@ketvietlab/ketsuite 0.1.1
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 +21 -0
- package/README.md +19 -0
- package/dist/index.d.ts +119 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +118 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/account/functions.d.ts +14 -0
- package/dist/modules/account/functions.d.ts.map +1 -0
- package/dist/modules/account/functions.js +1038 -0
- package/dist/modules/account/functions.js.map +1 -0
- package/dist/modules/account/index.d.ts +5 -0
- package/dist/modules/account/index.d.ts.map +1 -0
- package/dist/modules/account/index.js +31 -0
- package/dist/modules/account/index.js.map +1 -0
- package/dist/modules/account/models.d.ts +3 -0
- package/dist/modules/account/models.d.ts.map +1 -0
- package/dist/modules/account/models.js +151 -0
- package/dist/modules/account/models.js.map +1 -0
- package/dist/modules/account/relations.d.ts +3 -0
- package/dist/modules/account/relations.d.ts.map +1 -0
- package/dist/modules/account/relations.js +35 -0
- package/dist/modules/account/relations.js.map +1 -0
- package/dist/modules/account/setup.d.ts +4 -0
- package/dist/modules/account/setup.d.ts.map +1 -0
- package/dist/modules/account/setup.js +179 -0
- package/dist/modules/account/setup.js.map +1 -0
- package/dist/modules/account/tt99.d.ts +30 -0
- package/dist/modules/account/tt99.d.ts.map +1 -0
- package/dist/modules/account/tt99.js +1661 -0
- package/dist/modules/account/tt99.js.map +1 -0
- package/dist/modules/account_activity_backend/index.d.ts +5 -0
- package/dist/modules/account_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/account_activity_backend/index.js +27 -0
- package/dist/modules/account_activity_backend/index.js.map +1 -0
- package/dist/modules/account_backend/accounting-overview-screen.d.ts +18 -0
- package/dist/modules/account_backend/accounting-overview-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/accounting-overview-screen.js +104 -0
- package/dist/modules/account_backend/accounting-overview-screen.js.map +1 -0
- package/dist/modules/account_backend/accounts-screen.d.ts +13 -0
- package/dist/modules/account_backend/accounts-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/accounts-screen.js +49 -0
- package/dist/modules/account_backend/accounts-screen.js.map +1 -0
- package/dist/modules/account_backend/customer-invoices-screen.d.ts +14 -0
- package/dist/modules/account_backend/customer-invoices-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/customer-invoices-screen.js +63 -0
- package/dist/modules/account_backend/customer-invoices-screen.js.map +1 -0
- package/dist/modules/account_backend/general-ledger-screen.d.ts +13 -0
- package/dist/modules/account_backend/general-ledger-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/general-ledger-screen.js +56 -0
- package/dist/modules/account_backend/general-ledger-screen.js.map +1 -0
- package/dist/modules/account_backend/index.d.ts +3 -0
- package/dist/modules/account_backend/index.d.ts.map +1 -0
- package/dist/modules/account_backend/index.js +1516 -0
- package/dist/modules/account_backend/index.js.map +1 -0
- package/dist/modules/account_backend/journal-entries-screen.d.ts +14 -0
- package/dist/modules/account_backend/journal-entries-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/journal-entries-screen.js +45 -0
- package/dist/modules/account_backend/journal-entries-screen.js.map +1 -0
- package/dist/modules/account_backend/journals-screen.d.ts +14 -0
- package/dist/modules/account_backend/journals-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/journals-screen.js +53 -0
- package/dist/modules/account_backend/journals-screen.js.map +1 -0
- package/dist/modules/account_backend/move-detail-screen.d.ts +10 -0
- package/dist/modules/account_backend/move-detail-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/move-detail-screen.js +100 -0
- package/dist/modules/account_backend/move-detail-screen.js.map +1 -0
- package/dist/modules/account_backend/partner-ledger-screen.d.ts +14 -0
- package/dist/modules/account_backend/partner-ledger-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/partner-ledger-screen.js +69 -0
- package/dist/modules/account_backend/partner-ledger-screen.js.map +1 -0
- package/dist/modules/account_backend/payment-terms-screen.d.ts +14 -0
- package/dist/modules/account_backend/payment-terms-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/payment-terms-screen.js +40 -0
- package/dist/modules/account_backend/payment-terms-screen.js.map +1 -0
- package/dist/modules/account_backend/payments-screen.d.ts +14 -0
- package/dist/modules/account_backend/payments-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/payments-screen.js +54 -0
- package/dist/modules/account_backend/payments-screen.js.map +1 -0
- package/dist/modules/account_backend/screens.d.ts +7 -0
- package/dist/modules/account_backend/screens.d.ts.map +1 -0
- package/dist/modules/account_backend/screens.js +7 -0
- package/dist/modules/account_backend/screens.js.map +1 -0
- package/dist/modules/account_backend/taxes-screen.d.ts +15 -0
- package/dist/modules/account_backend/taxes-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/taxes-screen.js +73 -0
- package/dist/modules/account_backend/taxes-screen.js.map +1 -0
- package/dist/modules/account_backend/trial-balance-screen.d.ts +13 -0
- package/dist/modules/account_backend/trial-balance-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/trial-balance-screen.js +62 -0
- package/dist/modules/account_backend/trial-balance-screen.js.map +1 -0
- package/dist/modules/account_backend/vendor-bills-screen.d.ts +14 -0
- package/dist/modules/account_backend/vendor-bills-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/vendor-bills-screen.js +59 -0
- package/dist/modules/account_backend/vendor-bills-screen.js.map +1 -0
- package/dist/modules/account_mail_backend/index.d.ts +5 -0
- package/dist/modules/account_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/account_mail_backend/index.js +28 -0
- package/dist/modules/account_mail_backend/index.js.map +1 -0
- package/dist/modules/account_partner/functions.d.ts +3 -0
- package/dist/modules/account_partner/functions.d.ts.map +1 -0
- package/dist/modules/account_partner/functions.js +85 -0
- package/dist/modules/account_partner/functions.js.map +1 -0
- package/dist/modules/account_partner/index.d.ts +3 -0
- package/dist/modules/account_partner/index.d.ts.map +1 -0
- package/dist/modules/account_partner/index.js +48 -0
- package/dist/modules/account_partner/index.js.map +1 -0
- package/dist/modules/account_partner_backend/index.d.ts +4 -0
- package/dist/modules/account_partner_backend/index.d.ts.map +1 -0
- package/dist/modules/account_partner_backend/index.js +49 -0
- package/dist/modules/account_partner_backend/index.js.map +1 -0
- package/dist/modules/account_partner_backend/routes.d.ts +3 -0
- package/dist/modules/account_partner_backend/routes.d.ts.map +1 -0
- package/dist/modules/account_partner_backend/routes.js +69 -0
- package/dist/modules/account_partner_backend/routes.js.map +1 -0
- package/dist/modules/account_partner_backend/screens.d.ts +16 -0
- package/dist/modules/account_partner_backend/screens.d.ts.map +1 -0
- package/dist/modules/account_partner_backend/screens.js +26 -0
- package/dist/modules/account_partner_backend/screens.js.map +1 -0
- package/dist/modules/activity/functions.d.ts +3 -0
- package/dist/modules/activity/functions.d.ts.map +1 -0
- package/dist/modules/activity/functions.js +250 -0
- package/dist/modules/activity/functions.js.map +1 -0
- package/dist/modules/activity/index.d.ts +9 -0
- package/dist/modules/activity/index.d.ts.map +1 -0
- package/dist/modules/activity/index.js +33 -0
- package/dist/modules/activity/index.js.map +1 -0
- package/dist/modules/activity/models.d.ts +3 -0
- package/dist/modules/activity/models.d.ts.map +1 -0
- package/dist/modules/activity/models.js +81 -0
- package/dist/modules/activity/models.js.map +1 -0
- package/dist/modules/activity/operations.d.ts +39 -0
- package/dist/modules/activity/operations.d.ts.map +1 -0
- package/dist/modules/activity/operations.js +226 -0
- package/dist/modules/activity/operations.js.map +1 -0
- package/dist/modules/activity/relations.d.ts +3 -0
- package/dist/modules/activity/relations.d.ts.map +1 -0
- package/dist/modules/activity/relations.js +24 -0
- package/dist/modules/activity/relations.js.map +1 -0
- package/dist/modules/activity/target.d.ts +4 -0
- package/dist/modules/activity/target.d.ts.map +1 -0
- package/dist/modules/activity/target.js +149 -0
- package/dist/modules/activity/target.js.map +1 -0
- package/dist/modules/activity/types.d.ts +9 -0
- package/dist/modules/activity/types.d.ts.map +1 -0
- package/dist/modules/activity/types.js +5 -0
- package/dist/modules/activity/types.js.map +1 -0
- package/dist/modules/activity_backend/index.d.ts +5 -0
- package/dist/modules/activity_backend/index.d.ts.map +1 -0
- package/dist/modules/activity_backend/index.js +80 -0
- package/dist/modules/activity_backend/index.js.map +1 -0
- package/dist/modules/activity_backend/islands.d.ts +3 -0
- package/dist/modules/activity_backend/islands.d.ts.map +1 -0
- package/dist/modules/activity_backend/islands.js +20 -0
- package/dist/modules/activity_backend/islands.js.map +1 -0
- package/dist/modules/activity_backend/routes.d.ts +5 -0
- package/dist/modules/activity_backend/routes.d.ts.map +1 -0
- package/dist/modules/activity_backend/routes.js +53 -0
- package/dist/modules/activity_backend/routes.js.map +1 -0
- package/dist/modules/activity_backend/screens.d.ts +5 -0
- package/dist/modules/activity_backend/screens.d.ts.map +1 -0
- package/dist/modules/activity_backend/screens.js +52 -0
- package/dist/modules/activity_backend/screens.js.map +1 -0
- package/dist/modules/address/data/VN/NOTICE.md +15 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/divisions/0001.json +8002 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/divisions/0002.json +8002 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/divisions/0003.json +8002 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/divisions/0004.json +2842 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/manifest.json +77 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/policy.json +49 -0
- package/dist/modules/address/data/countries.json +11 -0
- package/dist/modules/address/data/index.json +14 -0
- package/dist/modules/address/format.d.ts +37 -0
- package/dist/modules/address/format.d.ts.map +1 -0
- package/dist/modules/address/format.js +146 -0
- package/dist/modules/address/format.js.map +1 -0
- package/dist/modules/address/functions.d.ts +3 -0
- package/dist/modules/address/functions.d.ts.map +1 -0
- package/dist/modules/address/functions.js +320 -0
- package/dist/modules/address/functions.js.map +1 -0
- package/dist/modules/address/index.d.ts +6 -0
- package/dist/modules/address/index.d.ts.map +1 -0
- package/dist/modules/address/index.js +20 -0
- package/dist/modules/address/index.js.map +1 -0
- package/dist/modules/address/loader.d.ts +74 -0
- package/dist/modules/address/loader.d.ts.map +1 -0
- package/dist/modules/address/loader.js +144 -0
- package/dist/modules/address/loader.js.map +1 -0
- package/dist/modules/address/messages.d.ts +51 -0
- package/dist/modules/address/messages.d.ts.map +1 -0
- package/dist/modules/address/messages.js +51 -0
- package/dist/modules/address/messages.js.map +1 -0
- package/dist/modules/address/models.d.ts +8 -0
- package/dist/modules/address/models.d.ts.map +1 -0
- package/dist/modules/address/models.js +98 -0
- package/dist/modules/address/models.js.map +1 -0
- package/dist/modules/address/relations.d.ts +3 -0
- package/dist/modules/address/relations.d.ts.map +1 -0
- package/dist/modules/address/relations.js +22 -0
- package/dist/modules/address/relations.js.map +1 -0
- package/dist/modules/address_backend/index.d.ts +4 -0
- package/dist/modules/address_backend/index.d.ts.map +1 -0
- package/dist/modules/address_backend/index.js +90 -0
- package/dist/modules/address_backend/index.js.map +1 -0
- package/dist/modules/address_backend/routes.d.ts +3 -0
- package/dist/modules/address_backend/routes.d.ts.map +1 -0
- package/dist/modules/address_backend/routes.js +87 -0
- package/dist/modules/address_backend/routes.js.map +1 -0
- package/dist/modules/address_backend/screens.d.ts +31 -0
- package/dist/modules/address_backend/screens.d.ts.map +1 -0
- package/dist/modules/address_backend/screens.js +147 -0
- package/dist/modules/address_backend/screens.js.map +1 -0
- package/dist/modules/attendance/functions.d.ts +3 -0
- package/dist/modules/attendance/functions.d.ts.map +1 -0
- package/dist/modules/attendance/functions.js +750 -0
- package/dist/modules/attendance/functions.js.map +1 -0
- package/dist/modules/attendance/index.d.ts +5 -0
- package/dist/modules/attendance/index.d.ts.map +1 -0
- package/dist/modules/attendance/index.js +20 -0
- package/dist/modules/attendance/index.js.map +1 -0
- package/dist/modules/attendance/messages.d.ts +41 -0
- package/dist/modules/attendance/messages.d.ts.map +1 -0
- package/dist/modules/attendance/messages.js +41 -0
- package/dist/modules/attendance/messages.js.map +1 -0
- package/dist/modules/attendance/models.d.ts +3 -0
- package/dist/modules/attendance/models.d.ts.map +1 -0
- package/dist/modules/attendance/models.js +158 -0
- package/dist/modules/attendance/models.js.map +1 -0
- package/dist/modules/attendance/relations.d.ts +3 -0
- package/dist/modules/attendance/relations.d.ts.map +1 -0
- package/dist/modules/attendance/relations.js +12 -0
- package/dist/modules/attendance/relations.js.map +1 -0
- package/dist/modules/attendance/types.d.ts +9 -0
- package/dist/modules/attendance/types.d.ts.map +1 -0
- package/dist/modules/attendance/types.js +5 -0
- package/dist/modules/attendance/types.js.map +1 -0
- package/dist/modules/attendance_backend/index.d.ts +4 -0
- package/dist/modules/attendance_backend/index.d.ts.map +1 -0
- package/dist/modules/attendance_backend/index.js +182 -0
- package/dist/modules/attendance_backend/index.js.map +1 -0
- package/dist/modules/attendance_backend/qr.d.ts +2 -0
- package/dist/modules/attendance_backend/qr.d.ts.map +1 -0
- package/dist/modules/attendance_backend/qr.js +120 -0
- package/dist/modules/attendance_backend/qr.js.map +1 -0
- package/dist/modules/attendance_backend/routes.d.ts +3 -0
- package/dist/modules/attendance_backend/routes.d.ts.map +1 -0
- package/dist/modules/attendance_backend/routes.js +131 -0
- package/dist/modules/attendance_backend/routes.js.map +1 -0
- package/dist/modules/attendance_backend/screens.d.ts +10 -0
- package/dist/modules/attendance_backend/screens.d.ts.map +1 -0
- package/dist/modules/attendance_backend/screens.js +227 -0
- package/dist/modules/attendance_backend/screens.js.map +1 -0
- package/dist/modules/backend/catalogue.d.ts +10 -0
- package/dist/modules/backend/catalogue.d.ts.map +1 -0
- package/dist/modules/backend/catalogue.js +615 -0
- package/dist/modules/backend/catalogue.js.map +1 -0
- package/dist/modules/backend/design/HANDOFF.md +356 -0
- package/dist/modules/backend/design/admin.css +4229 -0
- package/dist/modules/backend/design/client/relation-select-view.d.mts +5 -0
- package/dist/modules/backend/design/client/relation-select-view.d.mts.map +1 -0
- package/dist/modules/backend/design/client/relation-select-view.mjs +335 -0
- package/dist/modules/backend/design/client/relation-select-view.mjs.map +1 -0
- package/dist/modules/backend/design/client/relation-select.d.mts +5 -0
- package/dist/modules/backend/design/client/relation-select.d.mts.map +1 -0
- package/dist/modules/backend/design/client/relation-select.mjs +7 -0
- package/dist/modules/backend/design/client/relation-select.mjs.map +1 -0
- package/dist/modules/backend/design/fixtures/product-back.svg +11 -0
- package/dist/modules/backend/design/fixtures/product-front.svg +9 -0
- package/dist/modules/backend/design/screenshots/apps-desktop-dark.png +0 -0
- package/dist/modules/backend/design/screenshots/list-mobile-dark.png +0 -0
- package/dist/modules/backend/design/screenshots/product-list-favorites-desktop-en.png +0 -0
- package/dist/modules/backend/design/screenshots/product-list-filter-desktop-en.png +0 -0
- package/dist/modules/backend/design/screenshots/product-list-filter-mobile-en.png +0 -0
- package/dist/modules/backend/design/screenshots/product-list-grouped-desktop.png +0 -0
- package/dist/modules/backend/design/screenshots/product-list-grouped-mobile.png +0 -0
- package/dist/modules/backend/design/tokens.css +132 -0
- package/dist/modules/backend/forms.d.ts +7 -0
- package/dist/modules/backend/forms.d.ts.map +1 -0
- package/dist/modules/backend/forms.js +25 -0
- package/dist/modules/backend/forms.js.map +1 -0
- package/dist/modules/backend/index.d.ts +24 -0
- package/dist/modules/backend/index.d.ts.map +1 -0
- package/dist/modules/backend/index.js +61 -0
- package/dist/modules/backend/index.js.map +1 -0
- package/dist/modules/backend/islands.d.ts +3 -0
- package/dist/modules/backend/islands.d.ts.map +1 -0
- package/dist/modules/backend/islands.js +13 -0
- package/dist/modules/backend/islands.js.map +1 -0
- package/dist/modules/backend/joints.d.ts +13 -0
- package/dist/modules/backend/joints.d.ts.map +1 -0
- package/dist/modules/backend/joints.js +33 -0
- package/dist/modules/backend/joints.js.map +1 -0
- package/dist/modules/backend/menus.d.ts +3 -0
- package/dist/modules/backend/menus.d.ts.map +1 -0
- package/dist/modules/backend/menus.js +25 -0
- package/dist/modules/backend/menus.js.map +1 -0
- package/dist/modules/backend/messages.d.ts +11 -0
- package/dist/modules/backend/messages.d.ts.map +1 -0
- package/dist/modules/backend/messages.js +161 -0
- package/dist/modules/backend/messages.js.map +1 -0
- package/dist/modules/backend/paging.d.ts +22 -0
- package/dist/modules/backend/paging.d.ts.map +1 -0
- package/dist/modules/backend/paging.js +56 -0
- package/dist/modules/backend/paging.js.map +1 -0
- package/dist/modules/backend/relation-select.d.ts +63 -0
- package/dist/modules/backend/relation-select.d.ts.map +1 -0
- package/dist/modules/backend/relation-select.js +20 -0
- package/dist/modules/backend/relation-select.js.map +1 -0
- package/dist/modules/backend/routes.d.ts +10 -0
- package/dist/modules/backend/routes.d.ts.map +1 -0
- package/dist/modules/backend/routes.js +123 -0
- package/dist/modules/backend/routes.js.map +1 -0
- package/dist/modules/backend/saved-searches.d.ts +4 -0
- package/dist/modules/backend/saved-searches.d.ts.map +1 -0
- package/dist/modules/backend/saved-searches.js +138 -0
- package/dist/modules/backend/saved-searches.js.map +1 -0
- package/dist/modules/backend/screens.d.ts +37 -0
- package/dist/modules/backend/screens.d.ts.map +1 -0
- package/dist/modules/backend/screens.js +107 -0
- package/dist/modules/backend/screens.js.map +1 -0
- package/dist/modules/calendar/functions.d.ts +3 -0
- package/dist/modules/calendar/functions.d.ts.map +1 -0
- package/dist/modules/calendar/functions.js +259 -0
- package/dist/modules/calendar/functions.js.map +1 -0
- package/dist/modules/calendar/index.d.ts +9 -0
- package/dist/modules/calendar/index.d.ts.map +1 -0
- package/dist/modules/calendar/index.js +36 -0
- package/dist/modules/calendar/index.js.map +1 -0
- package/dist/modules/calendar/jobs.d.ts +3 -0
- package/dist/modules/calendar/jobs.d.ts.map +1 -0
- package/dist/modules/calendar/jobs.js +57 -0
- package/dist/modules/calendar/jobs.js.map +1 -0
- package/dist/modules/calendar/models.d.ts +3 -0
- package/dist/modules/calendar/models.d.ts.map +1 -0
- package/dist/modules/calendar/models.js +90 -0
- package/dist/modules/calendar/models.js.map +1 -0
- package/dist/modules/calendar/operations.d.ts +45 -0
- package/dist/modules/calendar/operations.d.ts.map +1 -0
- package/dist/modules/calendar/operations.js +280 -0
- package/dist/modules/calendar/operations.js.map +1 -0
- package/dist/modules/calendar/recurrence.d.ts +28 -0
- package/dist/modules/calendar/recurrence.d.ts.map +1 -0
- package/dist/modules/calendar/recurrence.js +175 -0
- package/dist/modules/calendar/recurrence.js.map +1 -0
- package/dist/modules/calendar/relations.d.ts +3 -0
- package/dist/modules/calendar/relations.d.ts.map +1 -0
- package/dist/modules/calendar/relations.js +22 -0
- package/dist/modules/calendar/relations.js.map +1 -0
- package/dist/modules/calendar/types.d.ts +10 -0
- package/dist/modules/calendar/types.d.ts.map +1 -0
- package/dist/modules/calendar/types.js +6 -0
- package/dist/modules/calendar/types.js.map +1 -0
- package/dist/modules/calendar_activity/index.d.ts +6 -0
- package/dist/modules/calendar_activity/index.d.ts.map +1 -0
- package/dist/modules/calendar_activity/index.js +250 -0
- package/dist/modules/calendar_activity/index.js.map +1 -0
- package/dist/modules/calendar_backend/index.d.ts +5 -0
- package/dist/modules/calendar_backend/index.d.ts.map +1 -0
- package/dist/modules/calendar_backend/index.js +47 -0
- package/dist/modules/calendar_backend/index.js.map +1 -0
- package/dist/modules/calendar_backend/islands.d.ts +3 -0
- package/dist/modules/calendar_backend/islands.d.ts.map +1 -0
- package/dist/modules/calendar_backend/islands.js +12 -0
- package/dist/modules/calendar_backend/islands.js.map +1 -0
- package/dist/modules/calendar_backend/routes.d.ts +3 -0
- package/dist/modules/calendar_backend/routes.d.ts.map +1 -0
- package/dist/modules/calendar_backend/routes.js +43 -0
- package/dist/modules/calendar_backend/routes.js.map +1 -0
- package/dist/modules/calendar_backend/screens.d.ts +5 -0
- package/dist/modules/calendar_backend/screens.d.ts.map +1 -0
- package/dist/modules/calendar_backend/screens.js +4 -0
- package/dist/modules/calendar_backend/screens.js.map +1 -0
- package/dist/modules/calendar_mail_transport/index.d.ts +6 -0
- package/dist/modules/calendar_mail_transport/index.d.ts.map +1 -0
- package/dist/modules/calendar_mail_transport/index.js +138 -0
- package/dist/modules/calendar_mail_transport/index.js.map +1 -0
- package/dist/modules/catalog/index.d.ts +3 -0
- package/dist/modules/catalog/index.d.ts.map +1 -0
- package/dist/modules/catalog/index.js +68 -0
- package/dist/modules/catalog/index.js.map +1 -0
- package/dist/modules/checkout/index.d.ts +3 -0
- package/dist/modules/checkout/index.d.ts.map +1 -0
- package/dist/modules/checkout/index.js +50 -0
- package/dist/modules/checkout/index.js.map +1 -0
- package/dist/modules/company/functions.d.ts +3 -0
- package/dist/modules/company/functions.d.ts.map +1 -0
- package/dist/modules/company/functions.js +337 -0
- package/dist/modules/company/functions.js.map +1 -0
- package/dist/modules/company/index.d.ts +3 -0
- package/dist/modules/company/index.d.ts.map +1 -0
- package/dist/modules/company/index.js +23 -0
- package/dist/modules/company/index.js.map +1 -0
- package/dist/modules/company/messages.d.ts +63 -0
- package/dist/modules/company/messages.d.ts.map +1 -0
- package/dist/modules/company/messages.js +63 -0
- package/dist/modules/company/messages.js.map +1 -0
- package/dist/modules/company/models.d.ts +19 -0
- package/dist/modules/company/models.d.ts.map +1 -0
- package/dist/modules/company/models.js +61 -0
- package/dist/modules/company/models.js.map +1 -0
- package/dist/modules/company/relations.d.ts +3 -0
- package/dist/modules/company/relations.d.ts.map +1 -0
- package/dist/modules/company/relations.js +14 -0
- package/dist/modules/company/relations.js.map +1 -0
- package/dist/modules/company_backend/index.d.ts +5 -0
- package/dist/modules/company_backend/index.d.ts.map +1 -0
- package/dist/modules/company_backend/index.js +136 -0
- package/dist/modules/company_backend/index.js.map +1 -0
- package/dist/modules/company_backend/menus.d.ts +3 -0
- package/dist/modules/company_backend/menus.d.ts.map +1 -0
- package/dist/modules/company_backend/menus.js +17 -0
- package/dist/modules/company_backend/menus.js.map +1 -0
- package/dist/modules/company_backend/routes.d.ts +3 -0
- package/dist/modules/company_backend/routes.d.ts.map +1 -0
- package/dist/modules/company_backend/routes.js +269 -0
- package/dist/modules/company_backend/routes.js.map +1 -0
- package/dist/modules/company_backend/screens.d.ts +62 -0
- package/dist/modules/company_backend/screens.d.ts.map +1 -0
- package/dist/modules/company_backend/screens.js +268 -0
- package/dist/modules/company_backend/screens.js.map +1 -0
- package/dist/modules/crm/functions.d.ts +5 -0
- package/dist/modules/crm/functions.d.ts.map +1 -0
- package/dist/modules/crm/functions.js +840 -0
- package/dist/modules/crm/functions.js.map +1 -0
- package/dist/modules/crm/index.d.ts +6 -0
- package/dist/modules/crm/index.d.ts.map +1 -0
- package/dist/modules/crm/index.js +22 -0
- package/dist/modules/crm/index.js.map +1 -0
- package/dist/modules/crm/jobs.d.ts +4 -0
- package/dist/modules/crm/jobs.d.ts.map +1 -0
- package/dist/modules/crm/jobs.js +3 -0
- package/dist/modules/crm/jobs.js.map +1 -0
- package/dist/modules/crm/messages.d.ts +37 -0
- package/dist/modules/crm/messages.d.ts.map +1 -0
- package/dist/modules/crm/messages.js +68 -0
- package/dist/modules/crm/messages.js.map +1 -0
- package/dist/modules/crm/models.d.ts +3 -0
- package/dist/modules/crm/models.d.ts.map +1 -0
- package/dist/modules/crm/models.js +215 -0
- package/dist/modules/crm/models.js.map +1 -0
- package/dist/modules/crm/operations.d.ts +121 -0
- package/dist/modules/crm/operations.d.ts.map +1 -0
- package/dist/modules/crm/operations.js +744 -0
- package/dist/modules/crm/operations.js.map +1 -0
- package/dist/modules/crm/search.d.ts +67 -0
- package/dist/modules/crm/search.d.ts.map +1 -0
- package/dist/modules/crm/search.js +89 -0
- package/dist/modules/crm/search.js.map +1 -0
- package/dist/modules/crm/types.d.ts +10 -0
- package/dist/modules/crm/types.d.ts.map +1 -0
- package/dist/modules/crm/types.js +6 -0
- package/dist/modules/crm/types.js.map +1 -0
- package/dist/modules/crm_backend/client/crm-kanban-view.d.mts +8 -0
- package/dist/modules/crm_backend/client/crm-kanban-view.d.mts.map +1 -0
- package/dist/modules/crm_backend/client/crm-kanban-view.mjs +129 -0
- package/dist/modules/crm_backend/client/crm-kanban-view.mjs.map +1 -0
- package/dist/modules/crm_backend/client/crm-kanban.d.mts +3 -0
- package/dist/modules/crm_backend/client/crm-kanban.d.mts.map +1 -0
- package/dist/modules/crm_backend/client/crm-kanban.mjs +7 -0
- package/dist/modules/crm_backend/client/crm-kanban.mjs.map +1 -0
- package/dist/modules/crm_backend/client/crm.css +69 -0
- package/dist/modules/crm_backend/index.d.ts +4 -0
- package/dist/modules/crm_backend/index.d.ts.map +1 -0
- package/dist/modules/crm_backend/index.js +54 -0
- package/dist/modules/crm_backend/index.js.map +1 -0
- package/dist/modules/crm_backend/islands.d.ts +9 -0
- package/dist/modules/crm_backend/islands.d.ts.map +1 -0
- package/dist/modules/crm_backend/islands.js +13 -0
- package/dist/modules/crm_backend/islands.js.map +1 -0
- package/dist/modules/crm_backend/list-search.d.ts +21 -0
- package/dist/modules/crm_backend/list-search.d.ts.map +1 -0
- package/dist/modules/crm_backend/list-search.js +220 -0
- package/dist/modules/crm_backend/list-search.js.map +1 -0
- package/dist/modules/crm_backend/messages.d.ts +183 -0
- package/dist/modules/crm_backend/messages.d.ts.map +1 -0
- package/dist/modules/crm_backend/messages.js +182 -0
- package/dist/modules/crm_backend/messages.js.map +1 -0
- package/dist/modules/crm_backend/routes.d.ts +3 -0
- package/dist/modules/crm_backend/routes.d.ts.map +1 -0
- package/dist/modules/crm_backend/routes.js +520 -0
- package/dist/modules/crm_backend/routes.js.map +1 -0
- package/dist/modules/crm_backend/screens.d.ts +32 -0
- package/dist/modules/crm_backend/screens.d.ts.map +1 -0
- package/dist/modules/crm_backend/screens.js +405 -0
- package/dist/modules/crm_backend/screens.js.map +1 -0
- package/dist/modules/crm_sale/index.d.ts +4 -0
- package/dist/modules/crm_sale/index.d.ts.map +1 -0
- package/dist/modules/crm_sale/index.js +18 -0
- package/dist/modules/crm_sale/index.js.map +1 -0
- package/dist/modules/crm_sale/messages.d.ts +10 -0
- package/dist/modules/crm_sale/messages.d.ts.map +1 -0
- package/dist/modules/crm_sale/messages.js +14 -0
- package/dist/modules/crm_sale/messages.js.map +1 -0
- package/dist/modules/crm_sale/models.d.ts +3 -0
- package/dist/modules/crm_sale/models.d.ts.map +1 -0
- package/dist/modules/crm_sale/models.js +16 -0
- package/dist/modules/crm_sale/models.js.map +1 -0
- package/dist/modules/crm_sale/sale-functions.d.ts +15 -0
- package/dist/modules/crm_sale/sale-functions.d.ts.map +1 -0
- package/dist/modules/crm_sale/sale-functions.js +139 -0
- package/dist/modules/crm_sale/sale-functions.js.map +1 -0
- package/dist/modules/crm_website/functions.d.ts +3 -0
- package/dist/modules/crm_website/functions.d.ts.map +1 -0
- package/dist/modules/crm_website/functions.js +65 -0
- package/dist/modules/crm_website/functions.js.map +1 -0
- package/dist/modules/crm_website/index.d.ts +3 -0
- package/dist/modules/crm_website/index.d.ts.map +1 -0
- package/dist/modules/crm_website/index.js +19 -0
- package/dist/modules/crm_website/index.js.map +1 -0
- package/dist/modules/crm_website/messages.d.ts +20 -0
- package/dist/modules/crm_website/messages.d.ts.map +1 -0
- package/dist/modules/crm_website/messages.js +34 -0
- package/dist/modules/crm_website/messages.js.map +1 -0
- package/dist/modules/crm_website/models.d.ts +3 -0
- package/dist/modules/crm_website/models.d.ts.map +1 -0
- package/dist/modules/crm_website/models.js +15 -0
- package/dist/modules/crm_website/models.js.map +1 -0
- package/dist/modules/crm_website/routes.d.ts +3 -0
- package/dist/modules/crm_website/routes.d.ts.map +1 -0
- package/dist/modules/crm_website/routes.js +71 -0
- package/dist/modules/crm_website/routes.js.map +1 -0
- package/dist/modules/crm_website/screens.d.ts +5 -0
- package/dist/modules/crm_website/screens.d.ts.map +1 -0
- package/dist/modules/crm_website/screens.js +15 -0
- package/dist/modules/crm_website/screens.js.map +1 -0
- package/dist/modules/hospitality_core/calendar.d.ts +9 -0
- package/dist/modules/hospitality_core/calendar.d.ts.map +1 -0
- package/dist/modules/hospitality_core/calendar.js +41 -0
- package/dist/modules/hospitality_core/calendar.js.map +1 -0
- package/dist/modules/hospitality_core/content.d.ts +13 -0
- package/dist/modules/hospitality_core/content.d.ts.map +1 -0
- package/dist/modules/hospitality_core/content.js +345 -0
- package/dist/modules/hospitality_core/content.js.map +1 -0
- package/dist/modules/hospitality_core/functions.d.ts +3 -0
- package/dist/modules/hospitality_core/functions.d.ts.map +1 -0
- package/dist/modules/hospitality_core/functions.js +1558 -0
- package/dist/modules/hospitality_core/functions.js.map +1 -0
- package/dist/modules/hospitality_core/housekeeping.d.ts +3 -0
- package/dist/modules/hospitality_core/housekeeping.d.ts.map +1 -0
- package/dist/modules/hospitality_core/housekeeping.js +352 -0
- package/dist/modules/hospitality_core/housekeeping.js.map +1 -0
- package/dist/modules/hospitality_core/index.d.ts +5 -0
- package/dist/modules/hospitality_core/index.d.ts.map +1 -0
- package/dist/modules/hospitality_core/index.js +41 -0
- package/dist/modules/hospitality_core/index.js.map +1 -0
- package/dist/modules/hospitality_core/inventory.d.ts +40 -0
- package/dist/modules/hospitality_core/inventory.d.ts.map +1 -0
- package/dist/modules/hospitality_core/inventory.js +627 -0
- package/dist/modules/hospitality_core/inventory.js.map +1 -0
- package/dist/modules/hospitality_core/menus.d.ts +3 -0
- package/dist/modules/hospitality_core/menus.d.ts.map +1 -0
- package/dist/modules/hospitality_core/menus.js +134 -0
- package/dist/modules/hospitality_core/menus.js.map +1 -0
- package/dist/modules/hospitality_core/messages.d.ts +3 -0
- package/dist/modules/hospitality_core/messages.d.ts.map +1 -0
- package/dist/modules/hospitality_core/messages.js +2011 -0
- package/dist/modules/hospitality_core/messages.js.map +1 -0
- package/dist/modules/hospitality_core/models.d.ts +10 -0
- package/dist/modules/hospitality_core/models.d.ts.map +1 -0
- package/dist/modules/hospitality_core/models.js +657 -0
- package/dist/modules/hospitality_core/models.js.map +1 -0
- package/dist/modules/hospitality_core/night-audit.d.ts +26 -0
- package/dist/modules/hospitality_core/night-audit.d.ts.map +1 -0
- package/dist/modules/hospitality_core/night-audit.js +381 -0
- package/dist/modules/hospitality_core/night-audit.js.map +1 -0
- package/dist/modules/hospitality_core/operations.d.ts +3 -0
- package/dist/modules/hospitality_core/operations.d.ts.map +1 -0
- package/dist/modules/hospitality_core/operations.js +1562 -0
- package/dist/modules/hospitality_core/operations.js.map +1 -0
- package/dist/modules/hospitality_core/relations.d.ts +3 -0
- package/dist/modules/hospitality_core/relations.d.ts.map +1 -0
- package/dist/modules/hospitality_core/relations.js +175 -0
- package/dist/modules/hospitality_core/relations.js.map +1 -0
- package/dist/modules/hospitality_core/routes.d.ts +3 -0
- package/dist/modules/hospitality_core/routes.d.ts.map +1 -0
- package/dist/modules/hospitality_core/routes.js +1556 -0
- package/dist/modules/hospitality_core/routes.js.map +1 -0
- package/dist/modules/hospitality_core/screens.d.ts +763 -0
- package/dist/modules/hospitality_core/screens.d.ts.map +1 -0
- package/dist/modules/hospitality_core/screens.js +4138 -0
- package/dist/modules/hospitality_core/screens.js.map +1 -0
- package/dist/modules/hospitality_core/services.d.ts +9 -0
- package/dist/modules/hospitality_core/services.d.ts.map +1 -0
- package/dist/modules/hospitality_core/services.js +586 -0
- package/dist/modules/hospitality_core/services.js.map +1 -0
- package/dist/modules/hospitality_core/stay-notices.d.ts +11 -0
- package/dist/modules/hospitality_core/stay-notices.d.ts.map +1 -0
- package/dist/modules/hospitality_core/stay-notices.js +338 -0
- package/dist/modules/hospitality_core/stay-notices.js.map +1 -0
- package/dist/modules/hospitality_core/types.d.ts +61 -0
- package/dist/modules/hospitality_core/types.d.ts.map +1 -0
- package/dist/modules/hospitality_core/types.js +65 -0
- package/dist/modules/hospitality_core/types.js.map +1 -0
- package/dist/modules/hr/functions.d.ts +3 -0
- package/dist/modules/hr/functions.d.ts.map +1 -0
- package/dist/modules/hr/functions.js +711 -0
- package/dist/modules/hr/functions.js.map +1 -0
- package/dist/modules/hr/index.d.ts +5 -0
- package/dist/modules/hr/index.d.ts.map +1 -0
- package/dist/modules/hr/index.js +20 -0
- package/dist/modules/hr/index.js.map +1 -0
- package/dist/modules/hr/messages.d.ts +45 -0
- package/dist/modules/hr/messages.d.ts.map +1 -0
- package/dist/modules/hr/messages.js +45 -0
- package/dist/modules/hr/messages.js.map +1 -0
- package/dist/modules/hr/models.d.ts +3 -0
- package/dist/modules/hr/models.d.ts.map +1 -0
- package/dist/modules/hr/models.js +166 -0
- package/dist/modules/hr/models.js.map +1 -0
- package/dist/modules/hr/relations.d.ts +3 -0
- package/dist/modules/hr/relations.d.ts.map +1 -0
- package/dist/modules/hr/relations.js +19 -0
- package/dist/modules/hr/relations.js.map +1 -0
- package/dist/modules/hr/types.d.ts +9 -0
- package/dist/modules/hr/types.d.ts.map +1 -0
- package/dist/modules/hr/types.js +5 -0
- package/dist/modules/hr/types.js.map +1 -0
- package/dist/modules/hr_backend/index.d.ts +4 -0
- package/dist/modules/hr_backend/index.d.ts.map +1 -0
- package/dist/modules/hr_backend/index.js +142 -0
- package/dist/modules/hr_backend/index.js.map +1 -0
- package/dist/modules/hr_backend/routes.d.ts +3 -0
- package/dist/modules/hr_backend/routes.d.ts.map +1 -0
- package/dist/modules/hr_backend/routes.js +83 -0
- package/dist/modules/hr_backend/routes.js.map +1 -0
- package/dist/modules/hr_backend/screens.d.ts +9 -0
- package/dist/modules/hr_backend/screens.d.ts.map +1 -0
- package/dist/modules/hr_backend/screens.js +144 -0
- package/dist/modules/hr_backend/screens.js.map +1 -0
- package/dist/modules/inventory/index.d.ts +3 -0
- package/dist/modules/inventory/index.d.ts.map +1 -0
- package/dist/modules/inventory/index.js +31 -0
- package/dist/modules/inventory/index.js.map +1 -0
- package/dist/modules/loyalty/admin-functions.d.ts +3 -0
- package/dist/modules/loyalty/admin-functions.d.ts.map +1 -0
- package/dist/modules/loyalty/admin-functions.js +692 -0
- package/dist/modules/loyalty/admin-functions.js.map +1 -0
- package/dist/modules/loyalty/engine.d.ts +31 -0
- package/dist/modules/loyalty/engine.d.ts.map +1 -0
- package/dist/modules/loyalty/engine.js +412 -0
- package/dist/modules/loyalty/engine.js.map +1 -0
- package/dist/modules/loyalty/index.d.ts +5 -0
- package/dist/modules/loyalty/index.d.ts.map +1 -0
- package/dist/modules/loyalty/index.js +24 -0
- package/dist/modules/loyalty/index.js.map +1 -0
- package/dist/modules/loyalty/jobs.d.ts +4 -0
- package/dist/modules/loyalty/jobs.d.ts.map +1 -0
- package/dist/modules/loyalty/jobs.js +103 -0
- package/dist/modules/loyalty/jobs.js.map +1 -0
- package/dist/modules/loyalty/ledger.d.ts +48 -0
- package/dist/modules/loyalty/ledger.d.ts.map +1 -0
- package/dist/modules/loyalty/ledger.js +164 -0
- package/dist/modules/loyalty/ledger.js.map +1 -0
- package/dist/modules/loyalty/membership-functions.d.ts +4 -0
- package/dist/modules/loyalty/membership-functions.d.ts.map +1 -0
- package/dist/modules/loyalty/membership-functions.js +163 -0
- package/dist/modules/loyalty/membership-functions.js.map +1 -0
- package/dist/modules/loyalty/messages.d.ts +119 -0
- package/dist/modules/loyalty/messages.d.ts.map +1 -0
- package/dist/modules/loyalty/messages.js +119 -0
- package/dist/modules/loyalty/messages.js.map +1 -0
- package/dist/modules/loyalty/models.d.ts +3 -0
- package/dist/modules/loyalty/models.d.ts.map +1 -0
- package/dist/modules/loyalty/models.js +259 -0
- package/dist/modules/loyalty/models.js.map +1 -0
- package/dist/modules/loyalty/order-functions.d.ts +3 -0
- package/dist/modules/loyalty/order-functions.d.ts.map +1 -0
- package/dist/modules/loyalty/order-functions.js +656 -0
- package/dist/modules/loyalty/order-functions.js.map +1 -0
- package/dist/modules/loyalty/relations.d.ts +3 -0
- package/dist/modules/loyalty/relations.d.ts.map +1 -0
- package/dist/modules/loyalty/relations.js +19 -0
- package/dist/modules/loyalty/relations.js.map +1 -0
- package/dist/modules/loyalty/types.d.ts +83 -0
- package/dist/modules/loyalty/types.d.ts.map +1 -0
- package/dist/modules/loyalty/types.js +23 -0
- package/dist/modules/loyalty/types.js.map +1 -0
- package/dist/modules/loyalty_backend/index.d.ts +3 -0
- package/dist/modules/loyalty_backend/index.d.ts.map +1 -0
- package/dist/modules/loyalty_backend/index.js +636 -0
- package/dist/modules/loyalty_backend/index.js.map +1 -0
- package/dist/modules/loyalty_backend/messages.d.ts +162 -0
- package/dist/modules/loyalty_backend/messages.d.ts.map +1 -0
- package/dist/modules/loyalty_backend/messages.js +318 -0
- package/dist/modules/loyalty_backend/messages.js.map +1 -0
- package/dist/modules/loyalty_backend/screens.d.ts +33 -0
- package/dist/modules/loyalty_backend/screens.d.ts.map +1 -0
- package/dist/modules/loyalty_backend/screens.js +562 -0
- package/dist/modules/loyalty_backend/screens.js.map +1 -0
- package/dist/modules/loyalty_pos/functions.d.ts +19 -0
- package/dist/modules/loyalty_pos/functions.d.ts.map +1 -0
- package/dist/modules/loyalty_pos/functions.js +274 -0
- package/dist/modules/loyalty_pos/functions.js.map +1 -0
- package/dist/modules/loyalty_pos/index.d.ts +3 -0
- package/dist/modules/loyalty_pos/index.d.ts.map +1 -0
- package/dist/modules/loyalty_pos/index.js +45 -0
- package/dist/modules/loyalty_pos/index.js.map +1 -0
- package/dist/modules/loyalty_sale/functions.d.ts +19 -0
- package/dist/modules/loyalty_sale/functions.d.ts.map +1 -0
- package/dist/modules/loyalty_sale/functions.js +275 -0
- package/dist/modules/loyalty_sale/functions.js.map +1 -0
- package/dist/modules/loyalty_sale/index.d.ts +3 -0
- package/dist/modules/loyalty_sale/index.d.ts.map +1 -0
- package/dist/modules/loyalty_sale/index.js +45 -0
- package/dist/modules/loyalty_sale/index.js.map +1 -0
- package/dist/modules/mail/functions.d.ts +3 -0
- package/dist/modules/mail/functions.d.ts.map +1 -0
- package/dist/modules/mail/functions.js +129 -0
- package/dist/modules/mail/functions.js.map +1 -0
- package/dist/modules/mail/index.d.ts +9 -0
- package/dist/modules/mail/index.d.ts.map +1 -0
- package/dist/modules/mail/index.js +22 -0
- package/dist/modules/mail/index.js.map +1 -0
- package/dist/modules/mail/messages.d.ts +13 -0
- package/dist/modules/mail/messages.d.ts.map +1 -0
- package/dist/modules/mail/messages.js +13 -0
- package/dist/modules/mail/messages.js.map +1 -0
- package/dist/modules/mail/models.d.ts +3 -0
- package/dist/modules/mail/models.d.ts.map +1 -0
- package/dist/modules/mail/models.js +124 -0
- package/dist/modules/mail/models.js.map +1 -0
- package/dist/modules/mail/operations.d.ts +60 -0
- package/dist/modules/mail/operations.d.ts.map +1 -0
- package/dist/modules/mail/operations.js +249 -0
- package/dist/modules/mail/operations.js.map +1 -0
- package/dist/modules/mail/relations.d.ts +3 -0
- package/dist/modules/mail/relations.d.ts.map +1 -0
- package/dist/modules/mail/relations.js +41 -0
- package/dist/modules/mail/relations.js.map +1 -0
- package/dist/modules/mail/target.d.ts +16 -0
- package/dist/modules/mail/target.d.ts.map +1 -0
- package/dist/modules/mail/target.js +245 -0
- package/dist/modules/mail/target.js.map +1 -0
- package/dist/modules/mail/types.d.ts +7 -0
- package/dist/modules/mail/types.d.ts.map +1 -0
- package/dist/modules/mail/types.js +4 -0
- package/dist/modules/mail/types.js.map +1 -0
- package/dist/modules/mail_backend/index.d.ts +5 -0
- package/dist/modules/mail_backend/index.d.ts.map +1 -0
- package/dist/modules/mail_backend/index.js +56 -0
- package/dist/modules/mail_backend/index.js.map +1 -0
- package/dist/modules/mail_backend/islands.d.ts +3 -0
- package/dist/modules/mail_backend/islands.d.ts.map +1 -0
- package/dist/modules/mail_backend/islands.js +20 -0
- package/dist/modules/mail_backend/islands.js.map +1 -0
- package/dist/modules/mail_backend/routes.d.ts +5 -0
- package/dist/modules/mail_backend/routes.d.ts.map +1 -0
- package/dist/modules/mail_backend/routes.js +37 -0
- package/dist/modules/mail_backend/routes.js.map +1 -0
- package/dist/modules/mail_backend/screens.d.ts +5 -0
- package/dist/modules/mail_backend/screens.d.ts.map +1 -0
- package/dist/modules/mail_backend/screens.js +11 -0
- package/dist/modules/mail_backend/screens.js.map +1 -0
- package/dist/modules/mail_inbound/functions.d.ts +27 -0
- package/dist/modules/mail_inbound/functions.d.ts.map +1 -0
- package/dist/modules/mail_inbound/functions.js +178 -0
- package/dist/modules/mail_inbound/functions.js.map +1 -0
- package/dist/modules/mail_inbound/index.d.ts +10 -0
- package/dist/modules/mail_inbound/index.d.ts.map +1 -0
- package/dist/modules/mail_inbound/index.js +38 -0
- package/dist/modules/mail_inbound/index.js.map +1 -0
- package/dist/modules/mail_inbound/jobs.d.ts +3 -0
- package/dist/modules/mail_inbound/jobs.d.ts.map +1 -0
- package/dist/modules/mail_inbound/jobs.js +29 -0
- package/dist/modules/mail_inbound/jobs.js.map +1 -0
- package/dist/modules/mail_inbound/models.d.ts +3 -0
- package/dist/modules/mail_inbound/models.d.ts.map +1 -0
- package/dist/modules/mail_inbound/models.js +68 -0
- package/dist/modules/mail_inbound/models.js.map +1 -0
- package/dist/modules/mail_inbound/operations.d.ts +17 -0
- package/dist/modules/mail_inbound/operations.d.ts.map +1 -0
- package/dist/modules/mail_inbound/operations.js +273 -0
- package/dist/modules/mail_inbound/operations.js.map +1 -0
- package/dist/modules/mail_inbound/relations.d.ts +3 -0
- package/dist/modules/mail_inbound/relations.d.ts.map +1 -0
- package/dist/modules/mail_inbound/relations.js +19 -0
- package/dist/modules/mail_inbound/relations.js.map +1 -0
- package/dist/modules/mail_inbound/routes.d.ts +4 -0
- package/dist/modules/mail_inbound/routes.d.ts.map +1 -0
- package/dist/modules/mail_inbound/routes.js +156 -0
- package/dist/modules/mail_inbound/routes.js.map +1 -0
- package/dist/modules/mail_inbound/types.d.ts +37 -0
- package/dist/modules/mail_inbound/types.d.ts.map +1 -0
- package/dist/modules/mail_inbound/types.js +3 -0
- package/dist/modules/mail_inbound/types.js.map +1 -0
- package/dist/modules/mail_inbound_backend/index.d.ts +5 -0
- package/dist/modules/mail_inbound_backend/index.d.ts.map +1 -0
- package/dist/modules/mail_inbound_backend/index.js +59 -0
- package/dist/modules/mail_inbound_backend/index.js.map +1 -0
- package/dist/modules/mail_inbound_backend/routes.d.ts +5 -0
- package/dist/modules/mail_inbound_backend/routes.d.ts.map +1 -0
- package/dist/modules/mail_inbound_backend/routes.js +31 -0
- package/dist/modules/mail_inbound_backend/routes.js.map +1 -0
- package/dist/modules/mail_inbound_backend/screens.d.ts +5 -0
- package/dist/modules/mail_inbound_backend/screens.d.ts.map +1 -0
- package/dist/modules/mail_inbound_backend/screens.js +25 -0
- package/dist/modules/mail_inbound_backend/screens.js.map +1 -0
- package/dist/modules/mail_transport/functions.d.ts +3 -0
- package/dist/modules/mail_transport/functions.d.ts.map +1 -0
- package/dist/modules/mail_transport/functions.js +280 -0
- package/dist/modules/mail_transport/functions.js.map +1 -0
- package/dist/modules/mail_transport/index.d.ts +11 -0
- package/dist/modules/mail_transport/index.d.ts.map +1 -0
- package/dist/modules/mail_transport/index.js +37 -0
- package/dist/modules/mail_transport/index.js.map +1 -0
- package/dist/modules/mail_transport/jobs.d.ts +3 -0
- package/dist/modules/mail_transport/jobs.d.ts.map +1 -0
- package/dist/modules/mail_transport/jobs.js +79 -0
- package/dist/modules/mail_transport/jobs.js.map +1 -0
- package/dist/modules/mail_transport/models.d.ts +3 -0
- package/dist/modules/mail_transport/models.d.ts.map +1 -0
- package/dist/modules/mail_transport/models.js +88 -0
- package/dist/modules/mail_transport/models.js.map +1 -0
- package/dist/modules/mail_transport/operations.d.ts +16 -0
- package/dist/modules/mail_transport/operations.d.ts.map +1 -0
- package/dist/modules/mail_transport/operations.js +122 -0
- package/dist/modules/mail_transport/operations.js.map +1 -0
- package/dist/modules/mail_transport/relations.d.ts +3 -0
- package/dist/modules/mail_transport/relations.d.ts.map +1 -0
- package/dist/modules/mail_transport/relations.js +19 -0
- package/dist/modules/mail_transport/relations.js.map +1 -0
- package/dist/modules/mail_transport/target.d.ts +8 -0
- package/dist/modules/mail_transport/target.d.ts.map +1 -0
- package/dist/modules/mail_transport/target.js +43 -0
- package/dist/modules/mail_transport/target.js.map +1 -0
- package/dist/modules/mail_transport/template.d.ts +4 -0
- package/dist/modules/mail_transport/template.d.ts.map +1 -0
- package/dist/modules/mail_transport/template.js +52 -0
- package/dist/modules/mail_transport/template.js.map +1 -0
- package/dist/modules/mail_transport/types.d.ts +9 -0
- package/dist/modules/mail_transport/types.d.ts.map +1 -0
- package/dist/modules/mail_transport/types.js +3 -0
- package/dist/modules/mail_transport/types.js.map +1 -0
- package/dist/modules/mail_transport_backend/index.d.ts +5 -0
- package/dist/modules/mail_transport_backend/index.d.ts.map +1 -0
- package/dist/modules/mail_transport_backend/index.js +69 -0
- package/dist/modules/mail_transport_backend/index.js.map +1 -0
- package/dist/modules/mail_transport_backend/routes.d.ts +5 -0
- package/dist/modules/mail_transport_backend/routes.d.ts.map +1 -0
- package/dist/modules/mail_transport_backend/routes.js +42 -0
- package/dist/modules/mail_transport_backend/routes.js.map +1 -0
- package/dist/modules/mail_transport_backend/screens.d.ts +5 -0
- package/dist/modules/mail_transport_backend/screens.d.ts.map +1 -0
- package/dist/modules/mail_transport_backend/screens.js +35 -0
- package/dist/modules/mail_transport_backend/screens.js.map +1 -0
- package/dist/modules/oauth/functions.d.ts +3 -0
- package/dist/modules/oauth/functions.d.ts.map +1 -0
- package/dist/modules/oauth/functions.js +817 -0
- package/dist/modules/oauth/functions.js.map +1 -0
- package/dist/modules/oauth/index.d.ts +4 -0
- package/dist/modules/oauth/index.d.ts.map +1 -0
- package/dist/modules/oauth/index.js +22 -0
- package/dist/modules/oauth/index.js.map +1 -0
- package/dist/modules/oauth/messages.d.ts +129 -0
- package/dist/modules/oauth/messages.d.ts.map +1 -0
- package/dist/modules/oauth/messages.js +129 -0
- package/dist/modules/oauth/messages.js.map +1 -0
- package/dist/modules/oauth/models.d.ts +4 -0
- package/dist/modules/oauth/models.d.ts.map +1 -0
- package/dist/modules/oauth/models.js +83 -0
- package/dist/modules/oauth/models.js.map +1 -0
- package/dist/modules/oauth/protocol.d.ts +54 -0
- package/dist/modules/oauth/protocol.d.ts.map +1 -0
- package/dist/modules/oauth/protocol.js +309 -0
- package/dist/modules/oauth/protocol.js.map +1 -0
- package/dist/modules/oauth/relations.d.ts +3 -0
- package/dist/modules/oauth/relations.d.ts.map +1 -0
- package/dist/modules/oauth/relations.js +18 -0
- package/dist/modules/oauth/relations.js.map +1 -0
- package/dist/modules/oauth/routes.d.ts +3 -0
- package/dist/modules/oauth/routes.d.ts.map +1 -0
- package/dist/modules/oauth/routes.js +185 -0
- package/dist/modules/oauth/routes.js.map +1 -0
- package/dist/modules/oauth_backend/index.d.ts +4 -0
- package/dist/modules/oauth_backend/index.d.ts.map +1 -0
- package/dist/modules/oauth_backend/index.js +23 -0
- package/dist/modules/oauth_backend/index.js.map +1 -0
- package/dist/modules/oauth_backend/menus.d.ts +3 -0
- package/dist/modules/oauth_backend/menus.d.ts.map +1 -0
- package/dist/modules/oauth_backend/menus.js +17 -0
- package/dist/modules/oauth_backend/menus.js.map +1 -0
- package/dist/modules/oauth_backend/messages.d.ts +169 -0
- package/dist/modules/oauth_backend/messages.d.ts.map +1 -0
- package/dist/modules/oauth_backend/messages.js +169 -0
- package/dist/modules/oauth_backend/messages.js.map +1 -0
- package/dist/modules/oauth_backend/routes.d.ts +3 -0
- package/dist/modules/oauth_backend/routes.d.ts.map +1 -0
- package/dist/modules/oauth_backend/routes.js +231 -0
- package/dist/modules/oauth_backend/routes.js.map +1 -0
- package/dist/modules/oauth_backend/screens.d.ts +66 -0
- package/dist/modules/oauth_backend/screens.d.ts.map +1 -0
- package/dist/modules/oauth_backend/screens.js +323 -0
- package/dist/modules/oauth_backend/screens.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/functions.d.ts +3 -0
- package/dist/modules/odoo_collaboration_import/functions.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/functions.js +128 -0
- package/dist/modules/odoo_collaboration_import/functions.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/index.d.ts +6 -0
- package/dist/modules/odoo_collaboration_import/index.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/index.js +31 -0
- package/dist/modules/odoo_collaboration_import/index.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/models.d.ts +3 -0
- package/dist/modules/odoo_collaboration_import/models.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/models.js +76 -0
- package/dist/modules/odoo_collaboration_import/models.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/operations.d.ts +14 -0
- package/dist/modules/odoo_collaboration_import/operations.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/operations.js +1139 -0
- package/dist/modules/odoo_collaboration_import/operations.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/relations.d.ts +3 -0
- package/dist/modules/odoo_collaboration_import/relations.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/relations.js +19 -0
- package/dist/modules/odoo_collaboration_import/relations.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/types.d.ts +58 -0
- package/dist/modules/odoo_collaboration_import/types.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/types.js +2 -0
- package/dist/modules/odoo_collaboration_import/types.js.map +1 -0
- package/dist/modules/partner/functions.d.ts +5 -0
- package/dist/modules/partner/functions.d.ts.map +1 -0
- package/dist/modules/partner/functions.js +563 -0
- package/dist/modules/partner/functions.js.map +1 -0
- package/dist/modules/partner/index.d.ts +5 -0
- package/dist/modules/partner/index.d.ts.map +1 -0
- package/dist/modules/partner/index.js +23 -0
- package/dist/modules/partner/index.js.map +1 -0
- package/dist/modules/partner/messages.d.ts +55 -0
- package/dist/modules/partner/messages.d.ts.map +1 -0
- package/dist/modules/partner/messages.js +55 -0
- package/dist/modules/partner/messages.js.map +1 -0
- package/dist/modules/partner/models.d.ts +23 -0
- package/dist/modules/partner/models.d.ts.map +1 -0
- package/dist/modules/partner/models.js +124 -0
- package/dist/modules/partner/models.js.map +1 -0
- package/dist/modules/partner/relations.d.ts +4 -0
- package/dist/modules/partner/relations.d.ts.map +1 -0
- package/dist/modules/partner/relations.js +35 -0
- package/dist/modules/partner/relations.js.map +1 -0
- package/dist/modules/partner/types.d.ts +17 -0
- package/dist/modules/partner/types.d.ts.map +1 -0
- package/dist/modules/partner/types.js +14 -0
- package/dist/modules/partner/types.js.map +1 -0
- package/dist/modules/partner/views.d.ts +4 -0
- package/dist/modules/partner/views.d.ts.map +1 -0
- package/dist/modules/partner/views.js +19 -0
- package/dist/modules/partner/views.js.map +1 -0
- package/dist/modules/partner_backend/client/address-view.d.mts +5 -0
- package/dist/modules/partner_backend/client/address-view.d.mts.map +1 -0
- package/dist/modules/partner_backend/client/address-view.mjs +193 -0
- package/dist/modules/partner_backend/client/address-view.mjs.map +1 -0
- package/dist/modules/partner_backend/client/address.css +12 -0
- package/dist/modules/partner_backend/client/address.d.mts +5 -0
- package/dist/modules/partner_backend/client/address.d.mts.map +1 -0
- package/dist/modules/partner_backend/client/address.mjs +7 -0
- package/dist/modules/partner_backend/client/address.mjs.map +1 -0
- package/dist/modules/partner_backend/index.d.ts +5 -0
- package/dist/modules/partner_backend/index.d.ts.map +1 -0
- package/dist/modules/partner_backend/index.js +178 -0
- package/dist/modules/partner_backend/index.js.map +1 -0
- package/dist/modules/partner_backend/islands.d.ts +3 -0
- package/dist/modules/partner_backend/islands.d.ts.map +1 -0
- package/dist/modules/partner_backend/islands.js +23 -0
- package/dist/modules/partner_backend/islands.js.map +1 -0
- package/dist/modules/partner_backend/menus.d.ts +3 -0
- package/dist/modules/partner_backend/menus.d.ts.map +1 -0
- package/dist/modules/partner_backend/menus.js +11 -0
- package/dist/modules/partner_backend/menus.js.map +1 -0
- package/dist/modules/partner_backend/relation-control.d.ts +22 -0
- package/dist/modules/partner_backend/relation-control.d.ts.map +1 -0
- package/dist/modules/partner_backend/relation-control.js +46 -0
- package/dist/modules/partner_backend/relation-control.js.map +1 -0
- package/dist/modules/partner_backend/routes.d.ts +3 -0
- package/dist/modules/partner_backend/routes.d.ts.map +1 -0
- package/dist/modules/partner_backend/routes.js +300 -0
- package/dist/modules/partner_backend/routes.js.map +1 -0
- package/dist/modules/partner_backend/screens.d.ts +53 -0
- package/dist/modules/partner_backend/screens.d.ts.map +1 -0
- package/dist/modules/partner_backend/screens.js +169 -0
- package/dist/modules/partner_backend/screens.js.map +1 -0
- package/dist/modules/pos/functions.d.ts +6 -0
- package/dist/modules/pos/functions.d.ts.map +1 -0
- package/dist/modules/pos/functions.js +953 -0
- package/dist/modules/pos/functions.js.map +1 -0
- package/dist/modules/pos/index.d.ts +4 -0
- package/dist/modules/pos/index.d.ts.map +1 -0
- package/dist/modules/pos/index.js +34 -0
- package/dist/modules/pos/index.js.map +1 -0
- package/dist/modules/pos/models.d.ts +3 -0
- package/dist/modules/pos/models.d.ts.map +1 -0
- package/dist/modules/pos/models.js +107 -0
- package/dist/modules/pos/models.js.map +1 -0
- package/dist/modules/pos/relations.d.ts +3 -0
- package/dist/modules/pos/relations.d.ts.map +1 -0
- package/dist/modules/pos/relations.js +37 -0
- package/dist/modules/pos/relations.js.map +1 -0
- package/dist/modules/pos_backend/index.d.ts +3 -0
- package/dist/modules/pos_backend/index.d.ts.map +1 -0
- package/dist/modules/pos_backend/index.js +654 -0
- package/dist/modules/pos_backend/index.js.map +1 -0
- package/dist/modules/pos_backend/screens.d.ts +15 -0
- package/dist/modules/pos_backend/screens.d.ts.map +1 -0
- package/dist/modules/pos_backend/screens.js +320 -0
- package/dist/modules/pos_backend/screens.js.map +1 -0
- package/dist/modules/pricing/functions.d.ts +6 -0
- package/dist/modules/pricing/functions.d.ts.map +1 -0
- package/dist/modules/pricing/functions.js +318 -0
- package/dist/modules/pricing/functions.js.map +1 -0
- package/dist/modules/pricing/index.d.ts +4 -0
- package/dist/modules/pricing/index.d.ts.map +1 -0
- package/dist/modules/pricing/index.js +30 -0
- package/dist/modules/pricing/index.js.map +1 -0
- package/dist/modules/pricing/models.d.ts +3 -0
- package/dist/modules/pricing/models.d.ts.map +1 -0
- package/dist/modules/pricing/models.js +34 -0
- package/dist/modules/pricing/models.js.map +1 -0
- package/dist/modules/pricing/relations.d.ts +3 -0
- package/dist/modules/pricing/relations.d.ts.map +1 -0
- package/dist/modules/pricing/relations.js +11 -0
- package/dist/modules/pricing/relations.js.map +1 -0
- package/dist/modules/pricing_backend/index.d.ts +3 -0
- package/dist/modules/pricing_backend/index.d.ts.map +1 -0
- package/dist/modules/pricing_backend/index.js +241 -0
- package/dist/modules/pricing_backend/index.js.map +1 -0
- package/dist/modules/pricing_backend/screens.d.ts +13 -0
- package/dist/modules/pricing_backend/screens.d.ts.map +1 -0
- package/dist/modules/pricing_backend/screens.js +182 -0
- package/dist/modules/pricing_backend/screens.js.map +1 -0
- package/dist/modules/product/functions.d.ts +3 -0
- package/dist/modules/product/functions.d.ts.map +1 -0
- package/dist/modules/product/functions.js +627 -0
- package/dist/modules/product/functions.js.map +1 -0
- package/dist/modules/product/index.d.ts +6 -0
- package/dist/modules/product/index.d.ts.map +1 -0
- package/dist/modules/product/index.js +24 -0
- package/dist/modules/product/index.js.map +1 -0
- package/dist/modules/product/messages.d.ts +3 -0
- package/dist/modules/product/messages.d.ts.map +1 -0
- package/dist/modules/product/messages.js +19 -0
- package/dist/modules/product/messages.js.map +1 -0
- package/dist/modules/product/models.d.ts +11 -0
- package/dist/modules/product/models.d.ts.map +1 -0
- package/dist/modules/product/models.js +116 -0
- package/dist/modules/product/models.js.map +1 -0
- package/dist/modules/product/relations.d.ts +8 -0
- package/dist/modules/product/relations.d.ts.map +1 -0
- package/dist/modules/product/relations.js +53 -0
- package/dist/modules/product/relations.js.map +1 -0
- package/dist/modules/product/search.d.ts +73 -0
- package/dist/modules/product/search.d.ts.map +1 -0
- package/dist/modules/product/search.js +66 -0
- package/dist/modules/product/search.js.map +1 -0
- package/dist/modules/product/types.d.ts +14 -0
- package/dist/modules/product/types.d.ts.map +1 -0
- package/dist/modules/product/types.js +2 -0
- package/dist/modules/product/types.js.map +1 -0
- package/dist/modules/product/views.d.ts +4 -0
- package/dist/modules/product/views.d.ts.map +1 -0
- package/dist/modules/product/views.js +7 -0
- package/dist/modules/product/views.js.map +1 -0
- package/dist/modules/product_activity_backend/index.d.ts +5 -0
- package/dist/modules/product_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/product_activity_backend/index.js +29 -0
- package/dist/modules/product_activity_backend/index.js.map +1 -0
- package/dist/modules/product_backend/attributes-screen.d.ts +7 -0
- package/dist/modules/product_backend/attributes-screen.d.ts.map +1 -0
- package/dist/modules/product_backend/attributes-screen.js +76 -0
- package/dist/modules/product_backend/attributes-screen.js.map +1 -0
- package/dist/modules/product_backend/client/editor-view.d.mts +5 -0
- package/dist/modules/product_backend/client/editor-view.d.mts.map +1 -0
- package/dist/modules/product_backend/client/editor-view.mjs +141 -0
- package/dist/modules/product_backend/client/editor-view.mjs.map +1 -0
- package/dist/modules/product_backend/client/product.d.mts +6 -0
- package/dist/modules/product_backend/client/product.d.mts.map +1 -0
- package/dist/modules/product_backend/client/product.mjs +8 -0
- package/dist/modules/product_backend/client/product.mjs.map +1 -0
- package/dist/modules/product_backend/create-screen.d.ts +12 -0
- package/dist/modules/product_backend/create-screen.d.ts.map +1 -0
- package/dist/modules/product_backend/create-screen.js +83 -0
- package/dist/modules/product_backend/create-screen.js.map +1 -0
- package/dist/modules/product_backend/index.d.ts +20 -0
- package/dist/modules/product_backend/index.d.ts.map +1 -0
- package/dist/modules/product_backend/index.js +287 -0
- package/dist/modules/product_backend/index.js.map +1 -0
- package/dist/modules/product_backend/islands.d.ts +3 -0
- package/dist/modules/product_backend/islands.d.ts.map +1 -0
- package/dist/modules/product_backend/islands.js +13 -0
- package/dist/modules/product_backend/islands.js.map +1 -0
- package/dist/modules/product_backend/menus.d.ts +3 -0
- package/dist/modules/product_backend/menus.d.ts.map +1 -0
- package/dist/modules/product_backend/menus.js +25 -0
- package/dist/modules/product_backend/menus.js.map +1 -0
- package/dist/modules/product_backend/routes.d.ts +14 -0
- package/dist/modules/product_backend/routes.d.ts.map +1 -0
- package/dist/modules/product_backend/routes.js +990 -0
- package/dist/modules/product_backend/routes.js.map +1 -0
- package/dist/modules/product_backend/screens.d.ts +68 -0
- package/dist/modules/product_backend/screens.d.ts.map +1 -0
- package/dist/modules/product_backend/screens.js +388 -0
- package/dist/modules/product_backend/screens.js.map +1 -0
- package/dist/modules/product_mail_backend/index.d.ts +5 -0
- package/dist/modules/product_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/product_mail_backend/index.js +30 -0
- package/dist/modules/product_mail_backend/index.js.map +1 -0
- package/dist/modules/product_media/functions.d.ts +3 -0
- package/dist/modules/product_media/functions.d.ts.map +1 -0
- package/dist/modules/product_media/functions.js +183 -0
- package/dist/modules/product_media/functions.js.map +1 -0
- package/dist/modules/product_media/index.d.ts +3 -0
- package/dist/modules/product_media/index.d.ts.map +1 -0
- package/dist/modules/product_media/index.js +29 -0
- package/dist/modules/product_media/index.js.map +1 -0
- package/dist/modules/product_media/models.d.ts +4 -0
- package/dist/modules/product_media/models.d.ts.map +1 -0
- package/dist/modules/product_media/models.js +24 -0
- package/dist/modules/product_media/models.js.map +1 -0
- package/dist/modules/product_media/relations.d.ts +3 -0
- package/dist/modules/product_media/relations.d.ts.map +1 -0
- package/dist/modules/product_media/relations.js +8 -0
- package/dist/modules/product_media/relations.js.map +1 -0
- package/dist/modules/product_variant_activity_backend/index.d.ts +5 -0
- package/dist/modules/product_variant_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/product_variant_activity_backend/index.js +29 -0
- package/dist/modules/product_variant_activity_backend/index.js.map +1 -0
- package/dist/modules/product_variant_mail_backend/index.d.ts +5 -0
- package/dist/modules/product_variant_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/product_variant_mail_backend/index.js +30 -0
- package/dist/modules/product_variant_mail_backend/index.js.map +1 -0
- package/dist/modules/purchase/functions.d.ts +6 -0
- package/dist/modules/purchase/functions.d.ts.map +1 -0
- package/dist/modules/purchase/functions.js +743 -0
- package/dist/modules/purchase/functions.js.map +1 -0
- package/dist/modules/purchase/index.d.ts +4 -0
- package/dist/modules/purchase/index.d.ts.map +1 -0
- package/dist/modules/purchase/index.js +35 -0
- package/dist/modules/purchase/index.js.map +1 -0
- package/dist/modules/purchase/models.d.ts +3 -0
- package/dist/modules/purchase/models.d.ts.map +1 -0
- package/dist/modules/purchase/models.js +68 -0
- package/dist/modules/purchase/models.js.map +1 -0
- package/dist/modules/purchase/relations.d.ts +3 -0
- package/dist/modules/purchase/relations.d.ts.map +1 -0
- package/dist/modules/purchase/relations.js +20 -0
- package/dist/modules/purchase/relations.js.map +1 -0
- package/dist/modules/purchase_backend/index.d.ts +3 -0
- package/dist/modules/purchase_backend/index.d.ts.map +1 -0
- package/dist/modules/purchase_backend/index.js +615 -0
- package/dist/modules/purchase_backend/index.js.map +1 -0
- package/dist/modules/purchase_backend/screens.d.ts +29 -0
- package/dist/modules/purchase_backend/screens.d.ts.map +1 -0
- package/dist/modules/purchase_backend/screens.js +324 -0
- package/dist/modules/purchase_backend/screens.js.map +1 -0
- package/dist/modules/sale/functions.d.ts +6 -0
- package/dist/modules/sale/functions.d.ts.map +1 -0
- package/dist/modules/sale/functions.js +611 -0
- package/dist/modules/sale/functions.js.map +1 -0
- package/dist/modules/sale/index.d.ts +4 -0
- package/dist/modules/sale/index.d.ts.map +1 -0
- package/dist/modules/sale/index.js +35 -0
- package/dist/modules/sale/index.js.map +1 -0
- package/dist/modules/sale/models.d.ts +3 -0
- package/dist/modules/sale/models.d.ts.map +1 -0
- package/dist/modules/sale/models.js +46 -0
- package/dist/modules/sale/models.js.map +1 -0
- package/dist/modules/sale/relations.d.ts +3 -0
- package/dist/modules/sale/relations.d.ts.map +1 -0
- package/dist/modules/sale/relations.js +16 -0
- package/dist/modules/sale/relations.js.map +1 -0
- package/dist/modules/sale_activity_backend/index.d.ts +5 -0
- package/dist/modules/sale_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/sale_activity_backend/index.js +29 -0
- package/dist/modules/sale_activity_backend/index.js.map +1 -0
- package/dist/modules/sale_backend/client/editor-view.d.mts +5 -0
- package/dist/modules/sale_backend/client/editor-view.d.mts.map +1 -0
- package/dist/modules/sale_backend/client/editor-view.mjs +132 -0
- package/dist/modules/sale_backend/client/editor-view.mjs.map +1 -0
- package/dist/modules/sale_backend/client/sale.d.mts +6 -0
- package/dist/modules/sale_backend/client/sale.d.mts.map +1 -0
- package/dist/modules/sale_backend/client/sale.mjs +8 -0
- package/dist/modules/sale_backend/client/sale.mjs.map +1 -0
- package/dist/modules/sale_backend/index.d.ts +3 -0
- package/dist/modules/sale_backend/index.d.ts.map +1 -0
- package/dist/modules/sale_backend/index.js +681 -0
- package/dist/modules/sale_backend/index.js.map +1 -0
- package/dist/modules/sale_backend/invoicing-policies-screen.d.ts +14 -0
- package/dist/modules/sale_backend/invoicing-policies-screen.d.ts.map +1 -0
- package/dist/modules/sale_backend/invoicing-policies-screen.js +36 -0
- package/dist/modules/sale_backend/invoicing-policies-screen.js.map +1 -0
- package/dist/modules/sale_backend/islands.d.ts +3 -0
- package/dist/modules/sale_backend/islands.d.ts.map +1 -0
- package/dist/modules/sale_backend/islands.js +13 -0
- package/dist/modules/sale_backend/islands.js.map +1 -0
- package/dist/modules/sale_backend/order-detail-screen.d.ts +18 -0
- package/dist/modules/sale_backend/order-detail-screen.d.ts.map +1 -0
- package/dist/modules/sale_backend/order-detail-screen.js +217 -0
- package/dist/modules/sale_backend/order-detail-screen.js.map +1 -0
- package/dist/modules/sale_backend/quotations-screen.d.ts +15 -0
- package/dist/modules/sale_backend/quotations-screen.d.ts.map +1 -0
- package/dist/modules/sale_backend/quotations-screen.js +64 -0
- package/dist/modules/sale_backend/quotations-screen.js.map +1 -0
- package/dist/modules/sale_backend/sales-orders-screen.d.ts +12 -0
- package/dist/modules/sale_backend/sales-orders-screen.d.ts.map +1 -0
- package/dist/modules/sale_backend/sales-orders-screen.js +65 -0
- package/dist/modules/sale_backend/sales-orders-screen.js.map +1 -0
- package/dist/modules/sale_backend/screens.d.ts +23 -0
- package/dist/modules/sale_backend/screens.d.ts.map +1 -0
- package/dist/modules/sale_backend/screens.js +275 -0
- package/dist/modules/sale_backend/screens.js.map +1 -0
- package/dist/modules/sale_mail_backend/index.d.ts +5 -0
- package/dist/modules/sale_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/sale_mail_backend/index.js +30 -0
- package/dist/modules/sale_mail_backend/index.js.map +1 -0
- package/dist/modules/stock/functions.d.ts +10 -0
- package/dist/modules/stock/functions.d.ts.map +1 -0
- package/dist/modules/stock/functions.js +1523 -0
- package/dist/modules/stock/functions.js.map +1 -0
- package/dist/modules/stock/index.d.ts +5 -0
- package/dist/modules/stock/index.d.ts.map +1 -0
- package/dist/modules/stock/index.js +35 -0
- package/dist/modules/stock/index.js.map +1 -0
- package/dist/modules/stock/models.d.ts +3 -0
- package/dist/modules/stock/models.d.ts.map +1 -0
- package/dist/modules/stock/models.js +185 -0
- package/dist/modules/stock/models.js.map +1 -0
- package/dist/modules/stock/relations.d.ts +3 -0
- package/dist/modules/stock/relations.d.ts.map +1 -0
- package/dist/modules/stock/relations.js +40 -0
- package/dist/modules/stock/relations.js.map +1 -0
- package/dist/modules/stock/routing.d.ts +7 -0
- package/dist/modules/stock/routing.d.ts.map +1 -0
- package/dist/modules/stock/routing.js +527 -0
- package/dist/modules/stock/routing.js.map +1 -0
- package/dist/modules/stock_activity_backend/index.d.ts +5 -0
- package/dist/modules/stock_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/stock_activity_backend/index.js +29 -0
- package/dist/modules/stock_activity_backend/index.js.map +1 -0
- package/dist/modules/stock_backend/client/editor-view.d.mts +5 -0
- package/dist/modules/stock_backend/client/editor-view.d.mts.map +1 -0
- package/dist/modules/stock_backend/client/editor-view.mjs +147 -0
- package/dist/modules/stock_backend/client/editor-view.mjs.map +1 -0
- package/dist/modules/stock_backend/client/stock.d.mts +6 -0
- package/dist/modules/stock_backend/client/stock.d.mts.map +1 -0
- package/dist/modules/stock_backend/client/stock.mjs +8 -0
- package/dist/modules/stock_backend/client/stock.mjs.map +1 -0
- package/dist/modules/stock_backend/forecast-screen.d.ts +28 -0
- package/dist/modules/stock_backend/forecast-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/forecast-screen.js +108 -0
- package/dist/modules/stock_backend/forecast-screen.js.map +1 -0
- package/dist/modules/stock_backend/index.d.ts +3 -0
- package/dist/modules/stock_backend/index.d.ts.map +1 -0
- package/dist/modules/stock_backend/index.js +880 -0
- package/dist/modules/stock_backend/index.js.map +1 -0
- package/dist/modules/stock_backend/inventory-screen.d.ts +27 -0
- package/dist/modules/stock_backend/inventory-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/inventory-screen.js +141 -0
- package/dist/modules/stock_backend/inventory-screen.js.map +1 -0
- package/dist/modules/stock_backend/islands.d.ts +3 -0
- package/dist/modules/stock_backend/islands.d.ts.map +1 -0
- package/dist/modules/stock_backend/islands.js +13 -0
- package/dist/modules/stock_backend/islands.js.map +1 -0
- package/dist/modules/stock_backend/locations-screen.d.ts +18 -0
- package/dist/modules/stock_backend/locations-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/locations-screen.js +92 -0
- package/dist/modules/stock_backend/locations-screen.js.map +1 -0
- package/dist/modules/stock_backend/lot-screen.d.ts +30 -0
- package/dist/modules/stock_backend/lot-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/lot-screen.js +86 -0
- package/dist/modules/stock_backend/lot-screen.js.map +1 -0
- package/dist/modules/stock_backend/lots-screen.d.ts +21 -0
- package/dist/modules/stock_backend/lots-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/lots-screen.js +79 -0
- package/dist/modules/stock_backend/lots-screen.js.map +1 -0
- package/dist/modules/stock_backend/picking-types-screen.d.ts +21 -0
- package/dist/modules/stock_backend/picking-types-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/picking-types-screen.js +110 -0
- package/dist/modules/stock_backend/picking-types-screen.js.map +1 -0
- package/dist/modules/stock_backend/replenishment-screen.d.ts +29 -0
- package/dist/modules/stock_backend/replenishment-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/replenishment-screen.js +131 -0
- package/dist/modules/stock_backend/replenishment-screen.js.map +1 -0
- package/dist/modules/stock_backend/routes.d.ts +3 -0
- package/dist/modules/stock_backend/routes.d.ts.map +1 -0
- package/dist/modules/stock_backend/routes.js +950 -0
- package/dist/modules/stock_backend/routes.js.map +1 -0
- package/dist/modules/stock_backend/screens.d.ts +14 -0
- package/dist/modules/stock_backend/screens.d.ts.map +1 -0
- package/dist/modules/stock_backend/screens.js +40 -0
- package/dist/modules/stock_backend/screens.js.map +1 -0
- package/dist/modules/stock_backend/stock-route-screen.d.ts +30 -0
- package/dist/modules/stock_backend/stock-route-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/stock-route-screen.js +129 -0
- package/dist/modules/stock_backend/stock-route-screen.js.map +1 -0
- package/dist/modules/stock_backend/stock-routes-screen.d.ts +17 -0
- package/dist/modules/stock_backend/stock-routes-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/stock-routes-screen.js +60 -0
- package/dist/modules/stock_backend/stock-routes-screen.js.map +1 -0
- package/dist/modules/stock_backend/transfer-screen.d.ts +26 -0
- package/dist/modules/stock_backend/transfer-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/transfer-screen.js +95 -0
- package/dist/modules/stock_backend/transfer-screen.js.map +1 -0
- package/dist/modules/stock_backend/transfers-screen.d.ts +21 -0
- package/dist/modules/stock_backend/transfers-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/transfers-screen.js +88 -0
- package/dist/modules/stock_backend/transfers-screen.js.map +1 -0
- package/dist/modules/stock_backend/warehouses-screen.d.ts +17 -0
- package/dist/modules/stock_backend/warehouses-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/warehouses-screen.js +96 -0
- package/dist/modules/stock_backend/warehouses-screen.js.map +1 -0
- package/dist/modules/stock_lot_activity_backend/index.d.ts +5 -0
- package/dist/modules/stock_lot_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/stock_lot_activity_backend/index.js +29 -0
- package/dist/modules/stock_lot_activity_backend/index.js.map +1 -0
- package/dist/modules/stock_lot_mail_backend/index.d.ts +5 -0
- package/dist/modules/stock_lot_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/stock_lot_mail_backend/index.js +30 -0
- package/dist/modules/stock_lot_mail_backend/index.js.map +1 -0
- package/dist/modules/stock_mail_backend/index.d.ts +5 -0
- package/dist/modules/stock_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/stock_mail_backend/index.js +30 -0
- package/dist/modules/stock_mail_backend/index.js.map +1 -0
- package/dist/modules/stock_mail_inbound/index.d.ts +6 -0
- package/dist/modules/stock_mail_inbound/index.d.ts.map +1 -0
- package/dist/modules/stock_mail_inbound/index.js +104 -0
- package/dist/modules/stock_mail_inbound/index.js.map +1 -0
- package/dist/modules/storage/functions.d.ts +3 -0
- package/dist/modules/storage/functions.d.ts.map +1 -0
- package/dist/modules/storage/functions.js +129 -0
- package/dist/modules/storage/functions.js.map +1 -0
- package/dist/modules/storage/index.d.ts +3 -0
- package/dist/modules/storage/index.d.ts.map +1 -0
- package/dist/modules/storage/index.js +31 -0
- package/dist/modules/storage/index.js.map +1 -0
- package/dist/modules/storage/jobs.d.ts +3 -0
- package/dist/modules/storage/jobs.d.ts.map +1 -0
- package/dist/modules/storage/jobs.js +37 -0
- package/dist/modules/storage/jobs.js.map +1 -0
- package/dist/modules/storage/models.d.ts +3 -0
- package/dist/modules/storage/models.d.ts.map +1 -0
- package/dist/modules/storage/models.js +23 -0
- package/dist/modules/storage/models.js.map +1 -0
- package/dist/modules/storage/routes.d.ts +27 -0
- package/dist/modules/storage/routes.d.ts.map +1 -0
- package/dist/modules/storage/routes.js +180 -0
- package/dist/modules/storage/routes.js.map +1 -0
- package/dist/modules/uom/convert.d.ts +52 -0
- package/dist/modules/uom/convert.d.ts.map +1 -0
- package/dist/modules/uom/convert.js +76 -0
- package/dist/modules/uom/convert.js.map +1 -0
- package/dist/modules/uom/functions.d.ts +5 -0
- package/dist/modules/uom/functions.d.ts.map +1 -0
- package/dist/modules/uom/functions.js +235 -0
- package/dist/modules/uom/functions.js.map +1 -0
- package/dist/modules/uom/index.d.ts +5 -0
- package/dist/modules/uom/index.d.ts.map +1 -0
- package/dist/modules/uom/index.js +19 -0
- package/dist/modules/uom/index.js.map +1 -0
- package/dist/modules/uom/messages.d.ts +3 -0
- package/dist/modules/uom/messages.d.ts.map +1 -0
- package/dist/modules/uom/messages.js +19 -0
- package/dist/modules/uom/messages.js.map +1 -0
- package/dist/modules/uom/models.d.ts +4 -0
- package/dist/modules/uom/models.d.ts.map +1 -0
- package/dist/modules/uom/models.js +34 -0
- package/dist/modules/uom/models.js.map +1 -0
- package/dist/modules/uom/relations.d.ts +3 -0
- package/dist/modules/uom/relations.d.ts.map +1 -0
- package/dist/modules/uom/relations.js +7 -0
- package/dist/modules/uom/relations.js.map +1 -0
- package/dist/modules/user/functions.d.ts +8 -0
- package/dist/modules/user/functions.d.ts.map +1 -0
- package/dist/modules/user/functions.js +1094 -0
- package/dist/modules/user/functions.js.map +1 -0
- package/dist/modules/user/index.d.ts +8 -0
- package/dist/modules/user/index.d.ts.map +1 -0
- package/dist/modules/user/index.js +34 -0
- package/dist/modules/user/index.js.map +1 -0
- package/dist/modules/user/login.d.ts +28 -0
- package/dist/modules/user/login.d.ts.map +1 -0
- package/dist/modules/user/login.js +46 -0
- package/dist/modules/user/login.js.map +1 -0
- package/dist/modules/user/messages.d.ts +115 -0
- package/dist/modules/user/messages.d.ts.map +1 -0
- package/dist/modules/user/messages.js +115 -0
- package/dist/modules/user/messages.js.map +1 -0
- package/dist/modules/user/models.d.ts +16 -0
- package/dist/modules/user/models.d.ts.map +1 -0
- package/dist/modules/user/models.js +168 -0
- package/dist/modules/user/models.js.map +1 -0
- package/dist/modules/user/password.d.ts +11 -0
- package/dist/modules/user/password.d.ts.map +1 -0
- package/dist/modules/user/password.js +74 -0
- package/dist/modules/user/password.js.map +1 -0
- package/dist/modules/user/relations.d.ts +3 -0
- package/dist/modules/user/relations.d.ts.map +1 -0
- package/dist/modules/user/relations.js +31 -0
- package/dist/modules/user/relations.js.map +1 -0
- package/dist/modules/user/roles.d.ts +12 -0
- package/dist/modules/user/roles.d.ts.map +1 -0
- package/dist/modules/user/roles.js +254 -0
- package/dist/modules/user/roles.js.map +1 -0
- package/dist/modules/user/routes.d.ts +3 -0
- package/dist/modules/user/routes.d.ts.map +1 -0
- package/dist/modules/user/routes.js +244 -0
- package/dist/modules/user/routes.js.map +1 -0
- package/dist/modules/user/session-context.d.ts +10 -0
- package/dist/modules/user/session-context.d.ts.map +1 -0
- package/dist/modules/user/session-context.js +31 -0
- package/dist/modules/user/session-context.js.map +1 -0
- package/dist/modules/user_backend/index.d.ts +5 -0
- package/dist/modules/user_backend/index.d.ts.map +1 -0
- package/dist/modules/user_backend/index.js +24 -0
- package/dist/modules/user_backend/index.js.map +1 -0
- package/dist/modules/user_backend/menus.d.ts +3 -0
- package/dist/modules/user_backend/menus.d.ts.map +1 -0
- package/dist/modules/user_backend/menus.js +24 -0
- package/dist/modules/user_backend/menus.js.map +1 -0
- package/dist/modules/user_backend/messages.d.ts +189 -0
- package/dist/modules/user_backend/messages.d.ts.map +1 -0
- package/dist/modules/user_backend/messages.js +189 -0
- package/dist/modules/user_backend/messages.js.map +1 -0
- package/dist/modules/user_backend/routes.d.ts +3 -0
- package/dist/modules/user_backend/routes.d.ts.map +1 -0
- package/dist/modules/user_backend/routes.js +474 -0
- package/dist/modules/user_backend/routes.js.map +1 -0
- package/dist/modules/user_backend/screens.d.ts +70 -0
- package/dist/modules/user_backend/screens.d.ts.map +1 -0
- package/dist/modules/user_backend/screens.js +308 -0
- package/dist/modules/user_backend/screens.js.map +1 -0
- package/dist/modules/website/access.d.ts +15 -0
- package/dist/modules/website/access.d.ts.map +1 -0
- package/dist/modules/website/access.js +39 -0
- package/dist/modules/website/access.js.map +1 -0
- package/dist/modules/website/cms.d.ts +3 -0
- package/dist/modules/website/cms.d.ts.map +1 -0
- package/dist/modules/website/cms.js +1142 -0
- package/dist/modules/website/cms.js.map +1 -0
- package/dist/modules/website/content-types.d.ts +4 -0
- package/dist/modules/website/content-types.d.ts.map +1 -0
- package/dist/modules/website/content-types.js +30 -0
- package/dist/modules/website/content-types.js.map +1 -0
- package/dist/modules/website/customer-password.d.ts +4 -0
- package/dist/modules/website/customer-password.d.ts.map +1 -0
- package/dist/modules/website/customer-password.js +51 -0
- package/dist/modules/website/customer-password.js.map +1 -0
- package/dist/modules/website/customer-routes.d.ts +3 -0
- package/dist/modules/website/customer-routes.d.ts.map +1 -0
- package/dist/modules/website/customer-routes.js +322 -0
- package/dist/modules/website/customer-routes.js.map +1 -0
- package/dist/modules/website/customer.d.ts +5 -0
- package/dist/modules/website/customer.d.ts.map +1 -0
- package/dist/modules/website/customer.js +442 -0
- package/dist/modules/website/customer.js.map +1 -0
- package/dist/modules/website/functions.d.ts +3 -0
- package/dist/modules/website/functions.d.ts.map +1 -0
- package/dist/modules/website/functions.js +96 -0
- package/dist/modules/website/functions.js.map +1 -0
- package/dist/modules/website/index.d.ts +4 -0
- package/dist/modules/website/index.d.ts.map +1 -0
- package/dist/modules/website/index.js +152 -0
- package/dist/modules/website/index.js.map +1 -0
- package/dist/modules/website/jobs.d.ts +3 -0
- package/dist/modules/website/jobs.d.ts.map +1 -0
- package/dist/modules/website/jobs.js +25 -0
- package/dist/modules/website/jobs.js.map +1 -0
- package/dist/modules/website/joints.d.ts +4 -0
- package/dist/modules/website/joints.d.ts.map +1 -0
- package/dist/modules/website/joints.js +7 -0
- package/dist/modules/website/joints.js.map +1 -0
- package/dist/modules/website/models.d.ts +8 -0
- package/dist/modules/website/models.d.ts.map +1 -0
- package/dist/modules/website/models.js +260 -0
- package/dist/modules/website/models.js.map +1 -0
- package/dist/modules/website/sections.d.ts +8 -0
- package/dist/modules/website/sections.d.ts.map +1 -0
- package/dist/modules/website/sections.js +16 -0
- package/dist/modules/website/sections.js.map +1 -0
- package/dist/modules/website/tokens.d.ts +2 -0
- package/dist/modules/website/tokens.d.ts.map +1 -0
- package/dist/modules/website/tokens.js +5 -0
- package/dist/modules/website/tokens.js.map +1 -0
- package/dist/modules/website/types.d.ts +6 -0
- package/dist/modules/website/types.d.ts.map +1 -0
- package/dist/modules/website/types.js +2 -0
- package/dist/modules/website/types.js.map +1 -0
- package/dist/modules/website/views.d.ts +4 -0
- package/dist/modules/website/views.d.ts.map +1 -0
- package/dist/modules/website/views.js +5 -0
- package/dist/modules/website/views.js.map +1 -0
- package/dist/modules/website_backend/index.d.ts +3 -0
- package/dist/modules/website_backend/index.d.ts.map +1 -0
- package/dist/modules/website_backend/index.js +290 -0
- package/dist/modules/website_backend/index.js.map +1 -0
- package/dist/modules/website_backend/menus.d.ts +3 -0
- package/dist/modules/website_backend/menus.d.ts.map +1 -0
- package/dist/modules/website_backend/menus.js +54 -0
- package/dist/modules/website_backend/menus.js.map +1 -0
- package/dist/modules/website_backend/routes.d.ts +3 -0
- package/dist/modules/website_backend/routes.d.ts.map +1 -0
- package/dist/modules/website_backend/routes.js +625 -0
- package/dist/modules/website_backend/routes.js.map +1 -0
- package/dist/modules/website_backend/screens.d.ts +114 -0
- package/dist/modules/website_backend/screens.d.ts.map +1 -0
- package/dist/modules/website_backend/screens.js +625 -0
- package/dist/modules/website_backend/screens.js.map +1 -0
- package/dist/modules/website_form/functions.d.ts +3 -0
- package/dist/modules/website_form/functions.d.ts.map +1 -0
- package/dist/modules/website_form/functions.js +305 -0
- package/dist/modules/website_form/functions.js.map +1 -0
- package/dist/modules/website_form/index.d.ts +3 -0
- package/dist/modules/website_form/index.d.ts.map +1 -0
- package/dist/modules/website_form/index.js +72 -0
- package/dist/modules/website_form/index.js.map +1 -0
- package/dist/modules/website_form/models.d.ts +3 -0
- package/dist/modules/website_form/models.d.ts.map +1 -0
- package/dist/modules/website_form/models.js +46 -0
- package/dist/modules/website_form/models.js.map +1 -0
- package/dist/modules/website_form/routes.d.ts +3 -0
- package/dist/modules/website_form/routes.d.ts.map +1 -0
- package/dist/modules/website_form/routes.js +74 -0
- package/dist/modules/website_form/routes.js.map +1 -0
- package/dist/modules/website_form/sections.d.ts +3 -0
- package/dist/modules/website_form/sections.d.ts.map +1 -0
- package/dist/modules/website_form/sections.js +7 -0
- package/dist/modules/website_form/sections.js.map +1 -0
- package/dist/modules/website_hospitality/content-types.d.ts +3 -0
- package/dist/modules/website_hospitality/content-types.d.ts.map +1 -0
- package/dist/modules/website_hospitality/content-types.js +9 -0
- package/dist/modules/website_hospitality/content-types.js.map +1 -0
- package/dist/modules/website_hospitality/functions.d.ts +3 -0
- package/dist/modules/website_hospitality/functions.d.ts.map +1 -0
- package/dist/modules/website_hospitality/functions.js +296 -0
- package/dist/modules/website_hospitality/functions.js.map +1 -0
- package/dist/modules/website_hospitality/index.d.ts +3 -0
- package/dist/modules/website_hospitality/index.d.ts.map +1 -0
- package/dist/modules/website_hospitality/index.js +67 -0
- package/dist/modules/website_hospitality/index.js.map +1 -0
- package/dist/modules/website_hospitality/models.d.ts +3 -0
- package/dist/modules/website_hospitality/models.d.ts.map +1 -0
- package/dist/modules/website_hospitality/models.js +49 -0
- package/dist/modules/website_hospitality/models.js.map +1 -0
- package/dist/modules/website_hospitality/routes.d.ts +3 -0
- package/dist/modules/website_hospitality/routes.d.ts.map +1 -0
- package/dist/modules/website_hospitality/routes.js +78 -0
- package/dist/modules/website_hospitality/routes.js.map +1 -0
- package/dist/modules/website_hospitality/sections.d.ts +3 -0
- package/dist/modules/website_hospitality/sections.d.ts.map +1 -0
- package/dist/modules/website_hospitality/sections.js +11 -0
- package/dist/modules/website_hospitality/sections.js.map +1 -0
- package/dist/modules/website_menu/functions.d.ts +3 -0
- package/dist/modules/website_menu/functions.d.ts.map +1 -0
- package/dist/modules/website_menu/functions.js +79 -0
- package/dist/modules/website_menu/functions.js.map +1 -0
- package/dist/modules/website_menu/index.d.ts +3 -0
- package/dist/modules/website_menu/index.d.ts.map +1 -0
- package/dist/modules/website_menu/index.js +31 -0
- package/dist/modules/website_menu/index.js.map +1 -0
- package/dist/modules/website_menu/models.d.ts +3 -0
- package/dist/modules/website_menu/models.d.ts.map +1 -0
- package/dist/modules/website_menu/models.js +15 -0
- package/dist/modules/website_menu/models.js.map +1 -0
- package/dist/modules/website_menu/sections.d.ts +3 -0
- package/dist/modules/website_menu/sections.d.ts.map +1 -0
- package/dist/modules/website_menu/sections.js +4 -0
- package/dist/modules/website_menu/sections.js.map +1 -0
- package/dist/modules/website_menu/views.d.ts +3 -0
- package/dist/modules/website_menu/views.d.ts.map +1 -0
- package/dist/modules/website_menu/views.js +4 -0
- package/dist/modules/website_menu/views.js.map +1 -0
- package/dist/modules/website_retail/content-types.d.ts +3 -0
- package/dist/modules/website_retail/content-types.d.ts.map +1 -0
- package/dist/modules/website_retail/content-types.js +10 -0
- package/dist/modules/website_retail/content-types.js.map +1 -0
- package/dist/modules/website_retail/functions.d.ts +3 -0
- package/dist/modules/website_retail/functions.d.ts.map +1 -0
- package/dist/modules/website_retail/functions.js +321 -0
- package/dist/modules/website_retail/functions.js.map +1 -0
- package/dist/modules/website_retail/index.d.ts +3 -0
- package/dist/modules/website_retail/index.d.ts.map +1 -0
- package/dist/modules/website_retail/index.js +63 -0
- package/dist/modules/website_retail/index.js.map +1 -0
- package/dist/modules/website_retail/models.d.ts +3 -0
- package/dist/modules/website_retail/models.d.ts.map +1 -0
- package/dist/modules/website_retail/models.js +50 -0
- package/dist/modules/website_retail/models.js.map +1 -0
- package/dist/modules/website_retail/sections.d.ts +3 -0
- package/dist/modules/website_retail/sections.d.ts.map +1 -0
- package/dist/modules/website_retail/sections.js +11 -0
- package/dist/modules/website_retail/sections.js.map +1 -0
- package/dist/modules/website_search/client/search.d.mts +6 -0
- package/dist/modules/website_search/client/search.d.mts.map +1 -0
- package/dist/modules/website_search/client/search.mjs +25 -0
- package/dist/modules/website_search/client/search.mjs.map +1 -0
- package/dist/modules/website_search/fills.d.ts +3 -0
- package/dist/modules/website_search/fills.d.ts.map +1 -0
- package/dist/modules/website_search/fills.js +5 -0
- package/dist/modules/website_search/fills.js.map +1 -0
- package/dist/modules/website_search/index.d.ts +3 -0
- package/dist/modules/website_search/index.d.ts.map +1 -0
- package/dist/modules/website_search/index.js +28 -0
- package/dist/modules/website_search/index.js.map +1 -0
- package/dist/modules/website_search/islands.d.ts +7 -0
- package/dist/modules/website_search/islands.d.ts.map +1 -0
- package/dist/modules/website_search/islands.js +23 -0
- package/dist/modules/website_search/islands.js.map +1 -0
- package/dist/modules/website_seo/extend.d.ts +7 -0
- package/dist/modules/website_seo/extend.d.ts.map +1 -0
- package/dist/modules/website_seo/extend.js +20 -0
- package/dist/modules/website_seo/extend.js.map +1 -0
- package/dist/modules/website_seo/fills.d.ts +3 -0
- package/dist/modules/website_seo/fills.d.ts.map +1 -0
- package/dist/modules/website_seo/fills.js +8 -0
- package/dist/modules/website_seo/fills.js.map +1 -0
- package/dist/modules/website_seo/index.d.ts +3 -0
- package/dist/modules/website_seo/index.d.ts.map +1 -0
- package/dist/modules/website_seo/index.js +30 -0
- package/dist/modules/website_seo/index.js.map +1 -0
- package/dist/modules/website_seo/views.d.ts +3 -0
- package/dist/modules/website_seo/views.d.ts.map +1 -0
- package/dist/modules/website_seo/views.js +5 -0
- package/dist/modules/website_seo/views.js.map +1 -0
- package/dist/themes/default/index.d.ts +3 -0
- package/dist/themes/default/index.d.ts.map +1 -0
- package/dist/themes/default/index.js +16 -0
- package/dist/themes/default/index.js.map +1 -0
- package/dist/themes/default/templates/layout.ktl +7 -0
- package/dist/themes/default/templates/product.detail.ktl +10 -0
- package/dist/themes/default/templates/product.related_row.ktl +1 -0
- package/dist/themes/hospitality/assets/theme.css +109 -0
- package/dist/themes/hospitality/index.d.ts +3 -0
- package/dist/themes/hospitality/index.d.ts.map +1 -0
- package/dist/themes/hospitality/index.js +26 -0
- package/dist/themes/hospitality/index.js.map +1 -0
- package/dist/themes/hospitality/templates/layout.ktl +17 -0
- package/dist/themes/hospitality/templates/menu.item.ktl +1 -0
- package/dist/themes/hospitality/templates/menu.primary.ktl +1 -0
- package/dist/themes/hospitality/templates/website.hero.ktl +6 -0
- package/dist/themes/hospitality/templates/website.page.ktl +1 -0
- package/dist/themes/hospitality/templates/website.rich_text.ktl +3 -0
- package/dist/themes/hospitality/templates/website_form.form.ktl +1 -0
- package/dist/themes/hospitality/templates/website_hospitality.booking.ktl +1 -0
- package/dist/themes/hospitality/templates/website_hospitality.stays.ktl +1 -0
- package/dist/themes/hospitality/tokens.d.ts +2 -0
- package/dist/themes/hospitality/tokens.d.ts.map +1 -0
- package/dist/themes/hospitality/tokens.js +9 -0
- package/dist/themes/hospitality/tokens.js.map +1 -0
- package/dist/themes/paper/index.d.ts +9 -0
- package/dist/themes/paper/index.d.ts.map +1 -0
- package/dist/themes/paper/index.js +30 -0
- package/dist/themes/paper/index.js.map +1 -0
- package/dist/themes/paper/templates/layout.ktl +14 -0
- package/dist/themes/paper/templates/menu.item.ktl +3 -0
- package/dist/themes/paper/templates/menu.primary.ktl +3 -0
- package/dist/themes/paper/templates/website.hero.ktl +6 -0
- package/dist/themes/paper/templates/website.page.ktl +2 -0
- package/dist/themes/paper/templates/website.rich_text.ktl +4 -0
- package/dist/themes/paper/tokens.d.ts +2 -0
- package/dist/themes/paper/tokens.d.ts.map +1 -0
- package/dist/themes/paper/tokens.js +11 -0
- package/dist/themes/paper/tokens.js.map +1 -0
- package/dist/themes/retail/assets/theme.css +114 -0
- package/dist/themes/retail/index.d.ts +3 -0
- package/dist/themes/retail/index.d.ts.map +1 -0
- package/dist/themes/retail/index.js +26 -0
- package/dist/themes/retail/index.js.map +1 -0
- package/dist/themes/retail/templates/layout.ktl +5 -0
- package/dist/themes/retail/templates/menu.item.ktl +1 -0
- package/dist/themes/retail/templates/menu.primary.ktl +1 -0
- package/dist/themes/retail/templates/website.hero.ktl +1 -0
- package/dist/themes/retail/templates/website.page.ktl +1 -0
- package/dist/themes/retail/templates/website.rich_text.ktl +1 -0
- package/dist/themes/retail/templates/website_form.form.ktl +1 -0
- package/dist/themes/retail/templates/website_retail.cart.ktl +1 -0
- package/dist/themes/retail/templates/website_retail.products.ktl +1 -0
- package/dist/themes/retail/tokens.d.ts +2 -0
- package/dist/themes/retail/tokens.d.ts.map +1 -0
- package/dist/themes/retail/tokens.js +9 -0
- package/dist/themes/retail/tokens.js.map +1 -0
- package/dist/ui/actions.d.ts +38 -0
- package/dist/ui/actions.d.ts.map +1 -0
- package/dist/ui/actions.js +20 -0
- package/dist/ui/actions.js.map +1 -0
- package/dist/ui/activity.d.ts +4 -0
- package/dist/ui/activity.d.ts.map +1 -0
- package/dist/ui/activity.js +73 -0
- package/dist/ui/activity.js.map +1 -0
- package/dist/ui/attachments.d.ts +18 -0
- package/dist/ui/attachments.d.ts.map +1 -0
- package/dist/ui/attachments.js +15 -0
- package/dist/ui/attachments.js.map +1 -0
- package/dist/ui/auth.d.ts +9 -0
- package/dist/ui/auth.d.ts.map +1 -0
- package/dist/ui/auth.js +44 -0
- package/dist/ui/auth.js.map +1 -0
- package/dist/ui/calendar.d.ts +4 -0
- package/dist/ui/calendar.d.ts.map +1 -0
- package/dist/ui/calendar.js +51 -0
- package/dist/ui/calendar.js.map +1 -0
- package/dist/ui/chrome.d.ts +66 -0
- package/dist/ui/chrome.d.ts.map +1 -0
- package/dist/ui/chrome.js +39 -0
- package/dist/ui/chrome.js.map +1 -0
- package/dist/ui/client/activity-view.d.mts +12 -0
- package/dist/ui/client/activity-view.d.mts.map +1 -0
- package/dist/ui/client/activity-view.mjs +393 -0
- package/dist/ui/client/activity-view.mjs.map +1 -0
- package/dist/ui/client/activity.css +269 -0
- package/dist/ui/client/activity.d.mts +11 -0
- package/dist/ui/client/activity.d.mts.map +1 -0
- package/dist/ui/client/activity.mjs +10 -0
- package/dist/ui/client/activity.mjs.map +1 -0
- package/dist/ui/client/calendar-view.d.mts +5 -0
- package/dist/ui/client/calendar-view.d.mts.map +1 -0
- package/dist/ui/client/calendar-view.mjs +266 -0
- package/dist/ui/client/calendar-view.mjs.map +1 -0
- package/dist/ui/client/calendar.css +170 -0
- package/dist/ui/client/calendar.d.mts +6 -0
- package/dist/ui/client/calendar.d.mts.map +1 -0
- package/dist/ui/client/calendar.mjs +6 -0
- package/dist/ui/client/calendar.mjs.map +1 -0
- package/dist/ui/client/mail-view.d.mts +9 -0
- package/dist/ui/client/mail-view.d.mts.map +1 -0
- package/dist/ui/client/mail-view.mjs +350 -0
- package/dist/ui/client/mail-view.mjs.map +1 -0
- package/dist/ui/client/mail.css +230 -0
- package/dist/ui/client/mail.d.mts +11 -0
- package/dist/ui/client/mail.d.mts.map +1 -0
- package/dist/ui/client/mail.mjs +10 -0
- package/dist/ui/client/mail.mjs.map +1 -0
- package/dist/ui/data.d.ts +25 -0
- package/dist/ui/data.d.ts.map +1 -0
- package/dist/ui/data.js +23 -0
- package/dist/ui/data.js.map +1 -0
- package/dist/ui/date-picker.d.ts +36 -0
- package/dist/ui/date-picker.d.ts.map +1 -0
- package/dist/ui/date-picker.js +40 -0
- package/dist/ui/date-picker.js.map +1 -0
- package/dist/ui/form.d.ts +67 -0
- package/dist/ui/form.d.ts.map +1 -0
- package/dist/ui/form.js +75 -0
- package/dist/ui/form.js.map +1 -0
- package/dist/ui/format.d.ts +4 -0
- package/dist/ui/format.d.ts.map +1 -0
- package/dist/ui/format.js +33 -0
- package/dist/ui/format.js.map +1 -0
- package/dist/ui/hooks.d.ts +5 -0
- package/dist/ui/hooks.d.ts.map +1 -0
- package/dist/ui/hooks.js +82 -0
- package/dist/ui/hooks.js.map +1 -0
- package/dist/ui/icons.d.ts +12 -0
- package/dist/ui/icons.d.ts.map +1 -0
- package/dist/ui/icons.js +76 -0
- package/dist/ui/icons.js.map +1 -0
- package/dist/ui/index.d.ts +39 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +39 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/layout.d.ts +80 -0
- package/dist/ui/layout.d.ts.map +1 -0
- package/dist/ui/layout.js +86 -0
- package/dist/ui/layout.js.map +1 -0
- package/dist/ui/mail.d.ts +5 -0
- package/dist/ui/mail.d.ts.map +1 -0
- package/dist/ui/mail.js +69 -0
- package/dist/ui/mail.js.map +1 -0
- package/dist/ui/media.d.ts +42 -0
- package/dist/ui/media.d.ts.map +1 -0
- package/dist/ui/media.js +48 -0
- package/dist/ui/media.js.map +1 -0
- package/dist/ui/modal.d.ts +9 -0
- package/dist/ui/modal.d.ts.map +1 -0
- package/dist/ui/modal.js +13 -0
- package/dist/ui/modal.js.map +1 -0
- package/dist/ui/nav.d.ts +34 -0
- package/dist/ui/nav.d.ts.map +1 -0
- package/dist/ui/nav.js +77 -0
- package/dist/ui/nav.js.map +1 -0
- package/dist/ui/navigation.d.ts +22 -0
- package/dist/ui/navigation.d.ts.map +1 -0
- package/dist/ui/navigation.js +9 -0
- package/dist/ui/navigation.js.map +1 -0
- package/dist/ui/primitives.d.ts +61 -0
- package/dist/ui/primitives.d.ts.map +1 -0
- package/dist/ui/primitives.js +74 -0
- package/dist/ui/primitives.js.map +1 -0
- package/dist/ui/record.d.ts +44 -0
- package/dist/ui/record.d.ts.map +1 -0
- package/dist/ui/record.js +39 -0
- package/dist/ui/record.js.map +1 -0
- package/dist/ui/schedule.d.ts +34 -0
- package/dist/ui/schedule.d.ts.map +1 -0
- package/dist/ui/schedule.js +39 -0
- package/dist/ui/schedule.js.map +1 -0
- package/dist/ui/state.d.ts +19 -0
- package/dist/ui/state.d.ts.map +1 -0
- package/dist/ui/state.js +34 -0
- package/dist/ui/state.js.map +1 -0
- package/dist/ui/surfaces.d.ts +38 -0
- package/dist/ui/surfaces.d.ts.map +1 -0
- package/dist/ui/surfaces.js +36 -0
- package/dist/ui/surfaces.js.map +1 -0
- package/dist/ui/table.d.ts +48 -0
- package/dist/ui/table.d.ts.map +1 -0
- package/dist/ui/table.js +53 -0
- package/dist/ui/table.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,1142 @@
|
|
|
1
|
+
import { createHash, randomBytes, randomUUID } from 'node:crypto';
|
|
2
|
+
import { asc, defineFn, deleteFrom, desc, eq, from, like, validateLayout } from '@ketvietlab/ketjs';
|
|
3
|
+
import { canAccessSite, canAdministerSite, canCreateEntry, canEditEntry, canManageStructure, canPublishEntry, } from './access.js';
|
|
4
|
+
import { ensureCustomerRealm } from './customer.js';
|
|
5
|
+
const SITE_ROLES = new Set(['administrator', 'editor', 'author', 'contributor']);
|
|
6
|
+
const MAX_JSON_BYTES = 512 * 1024;
|
|
7
|
+
const hasControlCharacter = (value) => [...value].some((character) => {
|
|
8
|
+
const code = character.charCodeAt(0);
|
|
9
|
+
return code <= 31 || code === 127;
|
|
10
|
+
});
|
|
11
|
+
const cleanHost = (value) => {
|
|
12
|
+
const raw = String(value ?? '')
|
|
13
|
+
.trim()
|
|
14
|
+
.toLowerCase()
|
|
15
|
+
.replace(/\.$/, '');
|
|
16
|
+
if (!raw || raw.length > 253 || raw.includes(':') || /[\s/@\\?#]/.test(raw) || hasControlCharacter(raw))
|
|
17
|
+
return null;
|
|
18
|
+
try {
|
|
19
|
+
const host = new URL(`http://${raw}`).hostname.replace(/\.$/, '');
|
|
20
|
+
if (host !== raw)
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const labels = raw.split('.');
|
|
27
|
+
if (labels.some((label) => !label || label.length > 63 || !/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(label)))
|
|
28
|
+
return null;
|
|
29
|
+
return raw;
|
|
30
|
+
};
|
|
31
|
+
const cleanPath = (value) => {
|
|
32
|
+
const raw = String(value ?? '').trim();
|
|
33
|
+
if (!raw.startsWith('/') ||
|
|
34
|
+
raw.length > 2048 ||
|
|
35
|
+
raw.startsWith('//') ||
|
|
36
|
+
raw.includes('\\') ||
|
|
37
|
+
/[?#]/.test(raw) ||
|
|
38
|
+
hasControlCharacter(raw))
|
|
39
|
+
return null;
|
|
40
|
+
const path = raw === '/' ? raw : raw.replace(/\/+$/, '');
|
|
41
|
+
try {
|
|
42
|
+
if (path.split('/').some((part) => ['.', '..'].includes(decodeURIComponent(part).toLowerCase())))
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return path;
|
|
49
|
+
};
|
|
50
|
+
const digest = (token) => createHash('sha256').update(token).digest('hex');
|
|
51
|
+
const invalid = (field, message) => ({ ok: false, errors: [{ field, message }] });
|
|
52
|
+
const page = (limit, offset, defaultLimit = 50) => ({
|
|
53
|
+
limit: Math.min(Math.max(Number.isInteger(limit) ? Number(limit) : defaultLimit, 1), 100),
|
|
54
|
+
offset: Math.min(Math.max(Number.isInteger(offset) ? Number(offset) : 0, 0), 100_000),
|
|
55
|
+
});
|
|
56
|
+
const jsonBytes = (value) => {
|
|
57
|
+
try {
|
|
58
|
+
return Buffer.byteLength(JSON.stringify(value), 'utf8');
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return Number.POSITIVE_INFINITY;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const validSlug = (value) => {
|
|
65
|
+
const slug = String(value ?? '');
|
|
66
|
+
return slug.length <= 160 && /^[\p{L}\p{N}]+(?:-[\p{L}\p{N}]+)*$/u.test(slug);
|
|
67
|
+
};
|
|
68
|
+
const forbidden = () => invalid('siteId', 'website.error.forbidden');
|
|
69
|
+
const siteById = async (ctx, id) => {
|
|
70
|
+
const Site = ctx.table('website.Site');
|
|
71
|
+
return ctx.db.one(from(Site).where(eq(Site.id, id)));
|
|
72
|
+
};
|
|
73
|
+
const entryById = async (ctx, id) => {
|
|
74
|
+
const Entry = ctx.table('website.Entry');
|
|
75
|
+
return ctx.db.one(from(Entry).where(eq(Entry.id, id)));
|
|
76
|
+
};
|
|
77
|
+
const validateFields = (schema, raw) => {
|
|
78
|
+
const value = raw && typeof raw === 'object' && !Array.isArray(raw) ? raw : {};
|
|
79
|
+
const errors = [];
|
|
80
|
+
for (const key of Object.keys(value))
|
|
81
|
+
if (!schema[key])
|
|
82
|
+
errors.push({ field: key, message: 'website.error.unknownField' });
|
|
83
|
+
for (const [key, spec] of Object.entries(schema)) {
|
|
84
|
+
const optional = spec.endsWith('?');
|
|
85
|
+
const base = optional ? spec.slice(0, -1) : spec;
|
|
86
|
+
const field = value[key];
|
|
87
|
+
if (field == null) {
|
|
88
|
+
if (!optional)
|
|
89
|
+
errors.push({ field: key, message: 'website.error.required' });
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const valid = base === 'int'
|
|
93
|
+
? Number.isInteger(field)
|
|
94
|
+
: base === 'float' || base === 'decimal'
|
|
95
|
+
? typeof field === 'number' || typeof field === 'string'
|
|
96
|
+
: base === 'bool'
|
|
97
|
+
? typeof field === 'boolean'
|
|
98
|
+
: base === 'json'
|
|
99
|
+
? typeof field === 'object'
|
|
100
|
+
: typeof field === 'string';
|
|
101
|
+
if (!valid)
|
|
102
|
+
errors.push({ field: key, message: 'website.error.invalidFieldType' });
|
|
103
|
+
}
|
|
104
|
+
return errors;
|
|
105
|
+
};
|
|
106
|
+
export const cmsFunctions = {
|
|
107
|
+
resolveSite: defineFn({
|
|
108
|
+
anonymous: true,
|
|
109
|
+
input: { host: 'text' },
|
|
110
|
+
output: { id: 'id', title: 'text', locale: 'text', theme: 'text', tokens: 'json?' },
|
|
111
|
+
effects: ['read:website.Site', 'read:website.SiteDomain'],
|
|
112
|
+
handler: async (ctx, args) => {
|
|
113
|
+
const host = cleanHost(args.host);
|
|
114
|
+
if (!host)
|
|
115
|
+
return null;
|
|
116
|
+
const Domain = ctx.table('website.SiteDomain');
|
|
117
|
+
const Site = ctx.table('website.Site');
|
|
118
|
+
const domain = await ctx.db.one(from(Domain).where(eq(Domain.host, host)));
|
|
119
|
+
const site = domain
|
|
120
|
+
? await ctx.db.one(from(Site).where(eq(Site.id, domain.siteId), eq(Site.active, true)))
|
|
121
|
+
: null;
|
|
122
|
+
if (!site && (await ctx.db.count(from(Site).where(eq(Site.active, true)))) === 0) {
|
|
123
|
+
const fallback = Object.entries(ctx.manifest.modules).find(([, module]) => module.kind === 'theme');
|
|
124
|
+
return fallback
|
|
125
|
+
? {
|
|
126
|
+
id: '__legacy__',
|
|
127
|
+
title: 'Website',
|
|
128
|
+
locale: 'vi',
|
|
129
|
+
theme: fallback[0],
|
|
130
|
+
tokens: { legacy: true },
|
|
131
|
+
}
|
|
132
|
+
: null;
|
|
133
|
+
}
|
|
134
|
+
return site
|
|
135
|
+
? {
|
|
136
|
+
id: site.id,
|
|
137
|
+
title: site.title,
|
|
138
|
+
locale: site.defaultLocale,
|
|
139
|
+
theme: site.theme,
|
|
140
|
+
tokens: site.tokens ?? null,
|
|
141
|
+
}
|
|
142
|
+
: null;
|
|
143
|
+
},
|
|
144
|
+
}),
|
|
145
|
+
listSites: defineFn({
|
|
146
|
+
input: { active: 'bool?' },
|
|
147
|
+
output: { id: 'id', name: 'text', title: 'text', defaultLocale: 'text', theme: 'text', active: 'bool' },
|
|
148
|
+
effects: ['read:website.Site', 'read:website.SiteMember'],
|
|
149
|
+
agent: true,
|
|
150
|
+
handler: async (ctx, args) => {
|
|
151
|
+
const Site = ctx.table('website.Site');
|
|
152
|
+
let query = from(Site).orderBy(asc(Site.name));
|
|
153
|
+
if (args.active != null)
|
|
154
|
+
query = query.where(eq(Site.active, args.active));
|
|
155
|
+
const sites = await ctx.db.all(query);
|
|
156
|
+
if (!ctx.actor)
|
|
157
|
+
return sites;
|
|
158
|
+
const memberships = await ctx.db.select('website.SiteMember', { userId: ctx.actor });
|
|
159
|
+
const allowed = new Set(memberships.map((row) => row.siteId));
|
|
160
|
+
return sites.filter((site) => allowed.has(site.id));
|
|
161
|
+
},
|
|
162
|
+
}),
|
|
163
|
+
saveSite: defineFn({
|
|
164
|
+
input: {
|
|
165
|
+
id: 'id',
|
|
166
|
+
name: 'text',
|
|
167
|
+
title: 'text',
|
|
168
|
+
defaultLocale: 'text',
|
|
169
|
+
theme: 'text',
|
|
170
|
+
tokens: 'json?',
|
|
171
|
+
siteGroup: 'text?',
|
|
172
|
+
active: 'bool?',
|
|
173
|
+
},
|
|
174
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
175
|
+
effects: [
|
|
176
|
+
'read:website.Site',
|
|
177
|
+
'read:website.SiteMember',
|
|
178
|
+
'write:website.Site',
|
|
179
|
+
'write:website.SiteMember',
|
|
180
|
+
'read:website.CustomerRealm',
|
|
181
|
+
'write:website.CustomerRealm',
|
|
182
|
+
'read:website.CustomerRealmSite',
|
|
183
|
+
'write:website.CustomerRealmSite',
|
|
184
|
+
],
|
|
185
|
+
idempotent: true,
|
|
186
|
+
agent: true,
|
|
187
|
+
handler: async (ctx, args) => {
|
|
188
|
+
const selected = ctx.manifest.modules[String(args.theme)];
|
|
189
|
+
if (selected?.kind !== 'theme')
|
|
190
|
+
return invalid('theme', 'website.error.invalidTheme');
|
|
191
|
+
const existing = await siteById(ctx, args.id);
|
|
192
|
+
if (existing && !(await canAdministerSite(ctx, args.id)))
|
|
193
|
+
return forbidden();
|
|
194
|
+
const name = String(args.name ?? '').trim();
|
|
195
|
+
const title = String(args.title ?? '').trim();
|
|
196
|
+
const locale = String(args.defaultLocale ?? '').trim();
|
|
197
|
+
if (!name || name.length > 120)
|
|
198
|
+
return invalid('name', 'website.error.invalidName');
|
|
199
|
+
if (!title || title.length > 200)
|
|
200
|
+
return invalid('title', 'website.error.invalidTitle');
|
|
201
|
+
if (!/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/.test(locale))
|
|
202
|
+
return invalid('defaultLocale', 'website.error.invalidLocale');
|
|
203
|
+
if (jsonBytes(args.tokens ?? {}) > 64 * 1024)
|
|
204
|
+
return invalid('tokens', 'website.error.payloadTooLarge');
|
|
205
|
+
const duplicate = (await ctx.db.select('website.Site')).find((site) => site.id !== args.id && String(site.name).toLowerCase() === name.toLowerCase());
|
|
206
|
+
if (duplicate)
|
|
207
|
+
return invalid('name', 'website.error.duplicateName');
|
|
208
|
+
const cs = ctx
|
|
209
|
+
.change('website.Site', { ...args, name, title, defaultLocale: locale }, existing)
|
|
210
|
+
.cast(['id', 'name', 'title', 'defaultLocale', 'theme', 'tokens', 'siteGroup', 'active'])
|
|
211
|
+
.required(['name', 'title', 'defaultLocale', 'theme'])
|
|
212
|
+
.put('active', args.active ?? existing?.active ?? true);
|
|
213
|
+
if (!cs.valid)
|
|
214
|
+
return { ok: false, errors: cs.errors };
|
|
215
|
+
await ctx.tx(async (tx) => {
|
|
216
|
+
await tx.db.commit(cs, existing ? { id: args.id } : undefined);
|
|
217
|
+
await ensureCustomerRealm(tx, String(args.id), title);
|
|
218
|
+
if (!existing && ctx.actor)
|
|
219
|
+
await tx.db.insertIfAbsent('website.SiteMember', {
|
|
220
|
+
id: randomUUID(),
|
|
221
|
+
siteId: args.id,
|
|
222
|
+
userId: ctx.actor,
|
|
223
|
+
role: 'administrator',
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
return { ok: true, id: args.id };
|
|
227
|
+
},
|
|
228
|
+
}),
|
|
229
|
+
saveDomain: defineFn({
|
|
230
|
+
input: { id: 'id', siteId: 'id', host: 'text', primary: 'bool?', redirectToPrimary: 'bool?' },
|
|
231
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
232
|
+
effects: [
|
|
233
|
+
'read:website.Site',
|
|
234
|
+
'read:website.SiteMember',
|
|
235
|
+
'read:website.SiteDomain',
|
|
236
|
+
'write:website.SiteDomain',
|
|
237
|
+
],
|
|
238
|
+
idempotent: true,
|
|
239
|
+
agent: true,
|
|
240
|
+
handler: async (ctx, args) => {
|
|
241
|
+
if (!(await siteById(ctx, args.siteId)))
|
|
242
|
+
return invalid('siteId', 'website.error.siteNotFound');
|
|
243
|
+
if (!(await canAdministerSite(ctx, args.siteId)))
|
|
244
|
+
return forbidden();
|
|
245
|
+
const host = cleanHost(args.host);
|
|
246
|
+
if (!host)
|
|
247
|
+
return invalid('host', 'website.error.invalidHost');
|
|
248
|
+
const existing = (await ctx.db.select('website.SiteDomain', { id: args.id }))[0];
|
|
249
|
+
if (existing && existing.siteId !== args.siteId)
|
|
250
|
+
return invalid('id', 'website.error.immutableOwnership');
|
|
251
|
+
const Domain = ctx.table('website.SiteDomain');
|
|
252
|
+
const duplicate = await ctx.db.one(from(Domain).where(eq(Domain.host, host)));
|
|
253
|
+
if (duplicate && duplicate.id !== args.id)
|
|
254
|
+
return invalid('host', 'website.error.duplicateHost');
|
|
255
|
+
const row = {
|
|
256
|
+
id: args.id,
|
|
257
|
+
siteId: args.siteId,
|
|
258
|
+
host,
|
|
259
|
+
primary: args.primary === true,
|
|
260
|
+
primaryKey: args.primary === true ? String(args.siteId) : null,
|
|
261
|
+
redirectToPrimary: args.redirectToPrimary !== false,
|
|
262
|
+
};
|
|
263
|
+
await ctx.tx(async (tx) => {
|
|
264
|
+
if (row.primary) {
|
|
265
|
+
const domains = await tx.db.select('website.SiteDomain', { siteId: args.siteId });
|
|
266
|
+
for (const domain of domains)
|
|
267
|
+
if (domain.id !== args.id && domain.primary === true)
|
|
268
|
+
await tx.db.update('website.SiteDomain', { id: domain.id }, { primary: false, primaryKey: null });
|
|
269
|
+
}
|
|
270
|
+
if (existing)
|
|
271
|
+
await tx.db.update('website.SiteDomain', { id: args.id }, row);
|
|
272
|
+
else
|
|
273
|
+
await tx.db.insert('website.SiteDomain', row);
|
|
274
|
+
});
|
|
275
|
+
return { ok: true, id: args.id };
|
|
276
|
+
},
|
|
277
|
+
}),
|
|
278
|
+
listDomains: defineFn({
|
|
279
|
+
input: { siteId: 'id', limit: 'int?', offset: 'int?' },
|
|
280
|
+
output: {
|
|
281
|
+
id: 'id',
|
|
282
|
+
siteId: 'id',
|
|
283
|
+
host: 'text',
|
|
284
|
+
primary: 'bool',
|
|
285
|
+
redirectToPrimary: 'bool',
|
|
286
|
+
},
|
|
287
|
+
effects: ['read:website.SiteMember', 'read:website.SiteDomain'],
|
|
288
|
+
agent: true,
|
|
289
|
+
handler: async (ctx, args) => {
|
|
290
|
+
if (!(await canAdministerSite(ctx, args.siteId)))
|
|
291
|
+
return [];
|
|
292
|
+
const paging = page(args.limit, args.offset, 100);
|
|
293
|
+
const Domain = ctx.table('website.SiteDomain');
|
|
294
|
+
return ctx.db.all(from(Domain)
|
|
295
|
+
.where(eq(Domain.siteId, args.siteId))
|
|
296
|
+
.orderBy(desc(Domain.primary), asc(Domain.host))
|
|
297
|
+
.limit(paging.limit)
|
|
298
|
+
.offset(paging.offset));
|
|
299
|
+
},
|
|
300
|
+
}),
|
|
301
|
+
saveSiteMember: defineFn({
|
|
302
|
+
input: { id: 'id', siteId: 'id', userId: 'id', role: 'text' },
|
|
303
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
304
|
+
effects: ['read:website.Site', 'read:website.SiteMember', 'write:website.SiteMember'],
|
|
305
|
+
idempotent: true,
|
|
306
|
+
agent: true,
|
|
307
|
+
handler: async (ctx, args) => {
|
|
308
|
+
if (!(await siteById(ctx, args.siteId)))
|
|
309
|
+
return invalid('siteId', 'website.error.siteNotFound');
|
|
310
|
+
if (!(await canAdministerSite(ctx, args.siteId)))
|
|
311
|
+
return forbidden();
|
|
312
|
+
if (!SITE_ROLES.has(String(args.role)))
|
|
313
|
+
return invalid('role', 'website.error.invalidRole');
|
|
314
|
+
const existing = (await ctx.db.select('website.SiteMember', { id: args.id }))[0];
|
|
315
|
+
if (existing && (existing.siteId !== args.siteId || existing.userId !== args.userId))
|
|
316
|
+
return invalid('id', 'website.error.immutableOwnership');
|
|
317
|
+
const row = { id: args.id, siteId: args.siteId, userId: args.userId, role: args.role };
|
|
318
|
+
if (existing)
|
|
319
|
+
await ctx.db.update('website.SiteMember', { id: args.id }, row);
|
|
320
|
+
else
|
|
321
|
+
await ctx.db.insert('website.SiteMember', row);
|
|
322
|
+
return { ok: true, id: args.id };
|
|
323
|
+
},
|
|
324
|
+
}),
|
|
325
|
+
listSiteMembers: defineFn({
|
|
326
|
+
input: { siteId: 'id', limit: 'int?', offset: 'int?' },
|
|
327
|
+
output: { id: 'id', siteId: 'id', userId: 'id', role: 'text' },
|
|
328
|
+
effects: ['read:website.SiteMember'],
|
|
329
|
+
agent: true,
|
|
330
|
+
handler: async (ctx, args) => {
|
|
331
|
+
if (!(await canAdministerSite(ctx, args.siteId)))
|
|
332
|
+
return [];
|
|
333
|
+
const paging = page(args.limit, args.offset, 100);
|
|
334
|
+
const Member = ctx.table('website.SiteMember');
|
|
335
|
+
return ctx.db.all(from(Member)
|
|
336
|
+
.where(eq(Member.siteId, args.siteId))
|
|
337
|
+
.orderBy(asc(Member.role), asc(Member.userId))
|
|
338
|
+
.limit(paging.limit)
|
|
339
|
+
.offset(paging.offset));
|
|
340
|
+
},
|
|
341
|
+
}),
|
|
342
|
+
removeSiteMember: defineFn({
|
|
343
|
+
input: { id: 'id' },
|
|
344
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
345
|
+
effects: ['read:website.SiteMember', 'write:website.SiteMember'],
|
|
346
|
+
idempotent: true,
|
|
347
|
+
handler: async (ctx, args) => {
|
|
348
|
+
const member = (await ctx.db.select('website.SiteMember', { id: args.id }))[0];
|
|
349
|
+
if (!member)
|
|
350
|
+
return { ok: true, id: args.id };
|
|
351
|
+
if (!(await canAdministerSite(ctx, member.siteId)))
|
|
352
|
+
return forbidden();
|
|
353
|
+
if (member.role === 'administrator') {
|
|
354
|
+
const members = await ctx.db.select('website.SiteMember', { siteId: member.siteId });
|
|
355
|
+
if (members.filter((row) => row.role === 'administrator').length <= 1)
|
|
356
|
+
return invalid('id', 'website.error.lastAdministrator');
|
|
357
|
+
}
|
|
358
|
+
const Member = ctx.table('website.SiteMember');
|
|
359
|
+
await ctx.db.del(deleteFrom(Member).where(eq(Member.id, args.id)));
|
|
360
|
+
return { ok: true, id: args.id };
|
|
361
|
+
},
|
|
362
|
+
}),
|
|
363
|
+
listEntries: defineFn({
|
|
364
|
+
input: { siteId: 'id', type: 'text?', status: 'text?', search: 'text?', limit: 'int?', offset: 'int?' },
|
|
365
|
+
output: {
|
|
366
|
+
id: 'id',
|
|
367
|
+
siteId: 'id',
|
|
368
|
+
type: 'text',
|
|
369
|
+
slug: 'text',
|
|
370
|
+
path: 'text',
|
|
371
|
+
title: 'text',
|
|
372
|
+
status: 'text',
|
|
373
|
+
updatedAt: 'datetime?',
|
|
374
|
+
},
|
|
375
|
+
effects: ['read:website.Entry', 'read:website.SiteMember'],
|
|
376
|
+
agent: true,
|
|
377
|
+
handler: async (ctx, args) => {
|
|
378
|
+
if (!(await canAccessSite(ctx, args.siteId)))
|
|
379
|
+
return [];
|
|
380
|
+
const Entry = ctx.table('website.Entry');
|
|
381
|
+
const paging = page(args.limit, args.offset);
|
|
382
|
+
let query = from(Entry)
|
|
383
|
+
.where(eq(Entry.siteId, args.siteId))
|
|
384
|
+
.orderBy(desc(Entry.updatedAt), asc(Entry.title));
|
|
385
|
+
if (args.type)
|
|
386
|
+
query = query.where(eq(Entry.type, args.type));
|
|
387
|
+
if (args.status)
|
|
388
|
+
query = query.where(eq(Entry.status, args.status));
|
|
389
|
+
if (args.search)
|
|
390
|
+
query = query.where(like(Entry.title, `%${String(args.search).trim().slice(0, 100)}%`));
|
|
391
|
+
query = query.limit(paging.limit).offset(paging.offset);
|
|
392
|
+
return ctx.db.all(query);
|
|
393
|
+
},
|
|
394
|
+
}),
|
|
395
|
+
countEntries: defineFn({
|
|
396
|
+
input: { siteId: 'id', type: 'text?', status: 'text?', search: 'text?' },
|
|
397
|
+
output: { count: 'int' },
|
|
398
|
+
effects: ['read:website.Entry', 'read:website.SiteMember'],
|
|
399
|
+
handler: async (ctx, args) => {
|
|
400
|
+
if (!(await canAccessSite(ctx, args.siteId)))
|
|
401
|
+
return { count: 0 };
|
|
402
|
+
const Entry = ctx.table('website.Entry');
|
|
403
|
+
let query = from(Entry).where(eq(Entry.siteId, args.siteId));
|
|
404
|
+
if (args.type)
|
|
405
|
+
query = query.where(eq(Entry.type, args.type));
|
|
406
|
+
if (args.status)
|
|
407
|
+
query = query.where(eq(Entry.status, args.status));
|
|
408
|
+
if (args.search)
|
|
409
|
+
query = query.where(like(Entry.title, `%${String(args.search).trim().slice(0, 100)}%`));
|
|
410
|
+
return { count: await ctx.db.count(query) };
|
|
411
|
+
},
|
|
412
|
+
}),
|
|
413
|
+
getEntry: defineFn({
|
|
414
|
+
input: { id: 'id' },
|
|
415
|
+
output: { entry: 'json', revision: 'json?' },
|
|
416
|
+
effects: ['read:website.Entry', 'read:website.EntryRevision', 'read:website.SiteMember'],
|
|
417
|
+
agent: true,
|
|
418
|
+
handler: async (ctx, args) => {
|
|
419
|
+
const entry = await entryById(ctx, args.id);
|
|
420
|
+
if (!entry || !(await canEditEntry(ctx, entry)))
|
|
421
|
+
return null;
|
|
422
|
+
const revision = entry.currentRevisionId
|
|
423
|
+
? ((await ctx.db.select('website.EntryRevision', { id: entry.currentRevisionId }))[0] ?? null)
|
|
424
|
+
: null;
|
|
425
|
+
return { entry, revision };
|
|
426
|
+
},
|
|
427
|
+
}),
|
|
428
|
+
getEntryByPath: defineFn({
|
|
429
|
+
anonymous: true,
|
|
430
|
+
input: { siteId: 'id', path: 'text' },
|
|
431
|
+
output: {
|
|
432
|
+
id: 'id',
|
|
433
|
+
siteId: 'id?',
|
|
434
|
+
type: 'text?',
|
|
435
|
+
path: 'text',
|
|
436
|
+
title: 'text',
|
|
437
|
+
excerpt: 'text?',
|
|
438
|
+
layout: 'json',
|
|
439
|
+
fields: 'json?',
|
|
440
|
+
published: 'bool?',
|
|
441
|
+
},
|
|
442
|
+
effects: ['read:website.Entry', 'read:website.EntryRevision', 'read:website.Page'],
|
|
443
|
+
agent: true,
|
|
444
|
+
handler: async (ctx, args) => {
|
|
445
|
+
const path = cleanPath(args.path);
|
|
446
|
+
if (!path)
|
|
447
|
+
return null;
|
|
448
|
+
if (args.siteId === '__legacy__') {
|
|
449
|
+
const Page = ctx.table('website.Page');
|
|
450
|
+
return ctx.db.one(from(Page).where(eq(Page.path, path), eq(Page.published, true)));
|
|
451
|
+
}
|
|
452
|
+
const Entry = ctx.table('website.Entry');
|
|
453
|
+
const entry = await ctx.db.one(from(Entry).where(eq(Entry.siteId, args.siteId), eq(Entry.path, path)));
|
|
454
|
+
if (entry?.publishedRevisionId && entry.status !== 'trash') {
|
|
455
|
+
const revision = (await ctx.db.select('website.EntryRevision', { id: entry.publishedRevisionId }))[0];
|
|
456
|
+
if (revision)
|
|
457
|
+
return {
|
|
458
|
+
id: entry.id,
|
|
459
|
+
siteId: entry.siteId,
|
|
460
|
+
type: entry.type,
|
|
461
|
+
path: entry.path,
|
|
462
|
+
title: revision.title,
|
|
463
|
+
excerpt: revision.excerpt ?? null,
|
|
464
|
+
layout: revision.layout,
|
|
465
|
+
fields: revision.fields,
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
return null;
|
|
469
|
+
},
|
|
470
|
+
}),
|
|
471
|
+
searchPublished: defineFn({
|
|
472
|
+
anonymous: true,
|
|
473
|
+
input: { siteId: 'id', q: 'text', limit: 'int?', offset: 'int?' },
|
|
474
|
+
output: {
|
|
475
|
+
id: 'id',
|
|
476
|
+
type: 'text',
|
|
477
|
+
path: 'text',
|
|
478
|
+
title: 'text',
|
|
479
|
+
excerpt: 'text?',
|
|
480
|
+
publishedAt: 'datetime?',
|
|
481
|
+
},
|
|
482
|
+
effects: ['read:website.Entry', 'read:website.EntryRevision'],
|
|
483
|
+
handler: async (ctx, args) => {
|
|
484
|
+
const term = String(args.q ?? '')
|
|
485
|
+
.trim()
|
|
486
|
+
.toLocaleLowerCase()
|
|
487
|
+
.slice(0, 100);
|
|
488
|
+
if (term.length < 2)
|
|
489
|
+
return [];
|
|
490
|
+
const paging = page(args.limit, args.offset, 20);
|
|
491
|
+
const Entry = ctx.table('website.Entry');
|
|
492
|
+
const entries = await ctx.db.all(from(Entry).where(eq(Entry.siteId, args.siteId)).orderBy(desc(Entry.publishedAt)).limit(500));
|
|
493
|
+
const matches = [];
|
|
494
|
+
for (const entry of entries) {
|
|
495
|
+
if (!entry.publishedRevisionId || entry.status === 'trash')
|
|
496
|
+
continue;
|
|
497
|
+
const revision = (await ctx.db.select('website.EntryRevision', { id: entry.publishedRevisionId }))[0];
|
|
498
|
+
if (!revision || revision.entryId !== entry.id)
|
|
499
|
+
continue;
|
|
500
|
+
const haystack = `${String(revision.title)}\n${String(revision.excerpt ?? '')}`.toLocaleLowerCase();
|
|
501
|
+
if (!haystack.includes(term))
|
|
502
|
+
continue;
|
|
503
|
+
matches.push({
|
|
504
|
+
id: entry.id,
|
|
505
|
+
type: entry.type,
|
|
506
|
+
path: entry.path,
|
|
507
|
+
title: revision.title,
|
|
508
|
+
excerpt: revision.excerpt ?? null,
|
|
509
|
+
publishedAt: entry.publishedAt ?? null,
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
return matches.slice(paging.offset, paging.offset + paging.limit);
|
|
513
|
+
},
|
|
514
|
+
}),
|
|
515
|
+
saveEntry: defineFn({
|
|
516
|
+
input: {
|
|
517
|
+
id: 'id',
|
|
518
|
+
siteId: 'id',
|
|
519
|
+
type: 'text',
|
|
520
|
+
slug: 'text',
|
|
521
|
+
path: 'text',
|
|
522
|
+
title: 'text',
|
|
523
|
+
excerpt: 'text?',
|
|
524
|
+
layout: 'json',
|
|
525
|
+
fields: 'json?',
|
|
526
|
+
kind: 'text?',
|
|
527
|
+
expectedRevisionId: 'id?',
|
|
528
|
+
},
|
|
529
|
+
output: { ok: 'bool', id: 'id?', revisionId: 'id?', version: 'int?', errors: 'json?' },
|
|
530
|
+
effects: [
|
|
531
|
+
'read:website.Site',
|
|
532
|
+
'read:website.Entry',
|
|
533
|
+
'read:website.EntryRevision',
|
|
534
|
+
'read:website.SiteMember',
|
|
535
|
+
'write:website.Entry',
|
|
536
|
+
'write:website.EntryRevision',
|
|
537
|
+
],
|
|
538
|
+
agent: true,
|
|
539
|
+
handler: async (ctx, args) => {
|
|
540
|
+
if (!(await siteById(ctx, args.siteId)))
|
|
541
|
+
return invalid('siteId', 'website.error.siteNotFound');
|
|
542
|
+
const existing = await entryById(ctx, args.id);
|
|
543
|
+
if (existing && (existing.siteId !== args.siteId || existing.type !== args.type))
|
|
544
|
+
return invalid('id', 'website.error.immutableOwnership');
|
|
545
|
+
if (existing ? !(await canEditEntry(ctx, existing)) : !(await canCreateEntry(ctx, args.siteId)))
|
|
546
|
+
return forbidden();
|
|
547
|
+
if (existing &&
|
|
548
|
+
args.expectedRevisionId != null &&
|
|
549
|
+
args.expectedRevisionId !== existing.currentRevisionId)
|
|
550
|
+
return invalid('expectedRevisionId', 'website.error.editConflict');
|
|
551
|
+
const type = ctx.manifest.contentTypes[String(args.type)];
|
|
552
|
+
if (!type)
|
|
553
|
+
return invalid('type', 'website.error.invalidContentType');
|
|
554
|
+
if (!Array.isArray(args.layout) ||
|
|
555
|
+
args.layout.length > 100 ||
|
|
556
|
+
jsonBytes(args.layout) + jsonBytes(args.fields ?? {}) > MAX_JSON_BYTES)
|
|
557
|
+
return invalid('layout', 'website.error.payloadTooLarge');
|
|
558
|
+
const layoutCheck = validateLayout(ctx.manifest, args.layout);
|
|
559
|
+
if (!layoutCheck.ok)
|
|
560
|
+
return { ok: false, errors: layoutCheck.errors };
|
|
561
|
+
const fieldErrors = validateFields(type.fields, args.fields);
|
|
562
|
+
if (fieldErrors.length)
|
|
563
|
+
return { ok: false, errors: fieldErrors };
|
|
564
|
+
const path = cleanPath(args.path);
|
|
565
|
+
if (!path)
|
|
566
|
+
return invalid('path', 'website.error.invalidPath');
|
|
567
|
+
const slug = String(args.slug)
|
|
568
|
+
.trim()
|
|
569
|
+
.replace(/^\/+|\/+$/g, '');
|
|
570
|
+
if (!validSlug(slug))
|
|
571
|
+
return invalid('slug', 'website.error.invalidSlug');
|
|
572
|
+
const title = String(args.title ?? '').trim();
|
|
573
|
+
const excerpt = args.excerpt == null ? null : String(args.excerpt).trim();
|
|
574
|
+
if (!title || title.length > 300)
|
|
575
|
+
return invalid('title', 'website.error.invalidTitle');
|
|
576
|
+
if (excerpt && excerpt.length > 2_000)
|
|
577
|
+
return invalid('excerpt', 'website.error.payloadTooLarge');
|
|
578
|
+
const Entry = ctx.table('website.Entry');
|
|
579
|
+
const pathOwner = await ctx.db.one(from(Entry).where(eq(Entry.siteId, args.siteId), eq(Entry.path, path)));
|
|
580
|
+
if (pathOwner && pathOwner.id !== args.id)
|
|
581
|
+
return invalid('path', 'website.error.duplicatePath');
|
|
582
|
+
const slugOwner = await ctx.db.one(from(Entry).where(eq(Entry.siteId, args.siteId), eq(Entry.type, args.type), eq(Entry.slug, slug)));
|
|
583
|
+
if (slugOwner && slugOwner.id !== args.id)
|
|
584
|
+
return invalid('slug', 'website.error.duplicateSlug');
|
|
585
|
+
const revisions = await ctx.db.select('website.EntryRevision', { entryId: args.id });
|
|
586
|
+
const version = revisions.reduce((max, row) => Math.max(max, Number(row.version)), 0) + 1;
|
|
587
|
+
const revisionId = randomUUID();
|
|
588
|
+
const saved = await ctx.tx(async (tx) => {
|
|
589
|
+
const entry = {
|
|
590
|
+
id: args.id,
|
|
591
|
+
siteId: args.siteId,
|
|
592
|
+
type: args.type,
|
|
593
|
+
slug,
|
|
594
|
+
path,
|
|
595
|
+
title,
|
|
596
|
+
excerpt,
|
|
597
|
+
status: existing?.status === 'trash' || !existing ? 'draft' : existing.status,
|
|
598
|
+
currentRevisionId: revisionId,
|
|
599
|
+
publishedRevisionId: existing?.publishedRevisionId ?? null,
|
|
600
|
+
scheduledRevisionId: existing?.scheduledRevisionId ?? null,
|
|
601
|
+
authorId: existing?.authorId ?? ctx.actor,
|
|
602
|
+
publishAt: existing?.publishAt ?? null,
|
|
603
|
+
publishedAt: existing?.publishedAt ?? null,
|
|
604
|
+
};
|
|
605
|
+
if (existing) {
|
|
606
|
+
const changed = await tx.db.compareAndSet('website.Entry', { id: args.id }, { currentRevisionId: existing.currentRevisionId }, entry);
|
|
607
|
+
if (!('dryRun' in changed) && !changed.matched)
|
|
608
|
+
return false;
|
|
609
|
+
}
|
|
610
|
+
else {
|
|
611
|
+
const inserted = await tx.db.insertIfAbsent('website.Entry', entry);
|
|
612
|
+
if (!('dryRun' in inserted) && !inserted.inserted)
|
|
613
|
+
return false;
|
|
614
|
+
}
|
|
615
|
+
await tx.db.insert('website.EntryRevision', {
|
|
616
|
+
id: revisionId,
|
|
617
|
+
entryId: args.id,
|
|
618
|
+
version,
|
|
619
|
+
kind: args.kind === 'autosave' ? 'autosave' : 'revision',
|
|
620
|
+
title,
|
|
621
|
+
excerpt,
|
|
622
|
+
layout: args.layout,
|
|
623
|
+
fields: args.fields ?? {},
|
|
624
|
+
authorId: ctx.actor,
|
|
625
|
+
createdAt: new Date().toISOString(),
|
|
626
|
+
});
|
|
627
|
+
return true;
|
|
628
|
+
});
|
|
629
|
+
if (!saved)
|
|
630
|
+
return invalid('expectedRevisionId', 'website.error.editConflict');
|
|
631
|
+
return { ok: true, id: args.id, revisionId, version };
|
|
632
|
+
},
|
|
633
|
+
}),
|
|
634
|
+
publishEntry: defineFn({
|
|
635
|
+
input: { id: 'id', publishAt: 'datetime?', expectedRevisionId: 'id?' },
|
|
636
|
+
output: { ok: 'bool', id: 'id?', status: 'text?', errors: 'json?' },
|
|
637
|
+
effects: [
|
|
638
|
+
'read:website.Entry',
|
|
639
|
+
'read:website.SiteMember',
|
|
640
|
+
'write:website.Entry',
|
|
641
|
+
'enqueue:website.publishScheduled',
|
|
642
|
+
],
|
|
643
|
+
idempotent: true,
|
|
644
|
+
agent: true,
|
|
645
|
+
handler: async (ctx, args) => {
|
|
646
|
+
const entry = await entryById(ctx, args.id);
|
|
647
|
+
if (!entry?.currentRevisionId)
|
|
648
|
+
return invalid('id', 'website.error.revisionNotFound');
|
|
649
|
+
if (!(await canPublishEntry(ctx, entry)))
|
|
650
|
+
return forbidden();
|
|
651
|
+
if (args.expectedRevisionId && args.expectedRevisionId !== entry.currentRevisionId)
|
|
652
|
+
return invalid('expectedRevisionId', 'website.error.editConflict');
|
|
653
|
+
const revisionId = String(entry.currentRevisionId);
|
|
654
|
+
const now = new Date();
|
|
655
|
+
const scheduled = args.publishAt ? new Date(String(args.publishAt)) : null;
|
|
656
|
+
if (scheduled && Number.isNaN(scheduled.getTime()))
|
|
657
|
+
return invalid('publishAt', 'website.error.invalidDatetime');
|
|
658
|
+
if (scheduled && scheduled > now) {
|
|
659
|
+
const changed = await ctx.db.compareAndSet('website.Entry', { id: args.id }, { currentRevisionId: revisionId }, {
|
|
660
|
+
status: 'scheduled',
|
|
661
|
+
scheduledRevisionId: revisionId,
|
|
662
|
+
publishAt: scheduled.toISOString(),
|
|
663
|
+
});
|
|
664
|
+
if (!('dryRun' in changed) && !changed.matched)
|
|
665
|
+
return invalid('expectedRevisionId', 'website.error.editConflict');
|
|
666
|
+
await ctx.jobs.enqueue('website.publishScheduled', { id: args.id, revisionId }, { runAt: scheduled, uniqueKey: `${String(args.id)}:${revisionId}` });
|
|
667
|
+
return { ok: true, id: args.id, status: 'scheduled' };
|
|
668
|
+
}
|
|
669
|
+
const changed = await ctx.db.compareAndSet('website.Entry', { id: args.id }, { currentRevisionId: revisionId }, {
|
|
670
|
+
status: 'published',
|
|
671
|
+
publishedRevisionId: revisionId,
|
|
672
|
+
scheduledRevisionId: null,
|
|
673
|
+
publishAt: null,
|
|
674
|
+
publishedAt: now.toISOString(),
|
|
675
|
+
});
|
|
676
|
+
if (!('dryRun' in changed) && !changed.matched)
|
|
677
|
+
return invalid('expectedRevisionId', 'website.error.editConflict');
|
|
678
|
+
return { ok: true, id: args.id, status: 'published' };
|
|
679
|
+
},
|
|
680
|
+
}),
|
|
681
|
+
listRevisions: defineFn({
|
|
682
|
+
input: { entryId: 'id', limit: 'int?', offset: 'int?' },
|
|
683
|
+
output: { id: 'id', entryId: 'id', version: 'int', kind: 'text', authorId: 'id?', createdAt: 'datetime' },
|
|
684
|
+
effects: ['read:website.Entry', 'read:website.EntryRevision', 'read:website.SiteMember'],
|
|
685
|
+
handler: async (ctx, args) => {
|
|
686
|
+
const entry = await entryById(ctx, args.entryId);
|
|
687
|
+
if (!entry || !(await canEditEntry(ctx, entry)))
|
|
688
|
+
return [];
|
|
689
|
+
const Revision = ctx.table('website.EntryRevision');
|
|
690
|
+
const paging = page(args.limit, args.offset);
|
|
691
|
+
return ctx.db.all(from(Revision)
|
|
692
|
+
.where(eq(Revision.entryId, args.entryId))
|
|
693
|
+
.orderBy(desc(Revision.version))
|
|
694
|
+
.limit(paging.limit)
|
|
695
|
+
.offset(paging.offset));
|
|
696
|
+
},
|
|
697
|
+
}),
|
|
698
|
+
restoreRevision: defineFn({
|
|
699
|
+
input: { entryId: 'id', revisionId: 'id' },
|
|
700
|
+
output: { ok: 'bool', id: 'id?', revisionId: 'id?', version: 'int?', errors: 'json?' },
|
|
701
|
+
effects: [
|
|
702
|
+
'read:website.Entry',
|
|
703
|
+
'read:website.EntryRevision',
|
|
704
|
+
'read:website.SiteMember',
|
|
705
|
+
'write:website.Entry',
|
|
706
|
+
'write:website.EntryRevision',
|
|
707
|
+
],
|
|
708
|
+
idempotent: true,
|
|
709
|
+
handler: async (ctx, args) => {
|
|
710
|
+
const entry = await entryById(ctx, args.entryId);
|
|
711
|
+
if (!entry || !(await canEditEntry(ctx, entry)))
|
|
712
|
+
return forbidden();
|
|
713
|
+
const revision = (await ctx.db.select('website.EntryRevision', { id: args.revisionId, entryId: args.entryId }))[0];
|
|
714
|
+
if (!revision)
|
|
715
|
+
return invalid('revisionId', 'website.error.revisionNotFound');
|
|
716
|
+
const revisions = await ctx.db.select('website.EntryRevision', { entryId: args.entryId });
|
|
717
|
+
const version = revisions.reduce((max, row) => Math.max(max, Number(row.version)), 0) + 1;
|
|
718
|
+
const revisionId = randomUUID();
|
|
719
|
+
const restored = await ctx.tx(async (tx) => {
|
|
720
|
+
const changed = await tx.db.compareAndSet('website.Entry', { id: args.entryId }, { currentRevisionId: entry.currentRevisionId }, {
|
|
721
|
+
currentRevisionId: revisionId,
|
|
722
|
+
title: revision.title,
|
|
723
|
+
excerpt: revision.excerpt ?? null,
|
|
724
|
+
status: entry.status === 'trash' ? 'draft' : entry.status,
|
|
725
|
+
});
|
|
726
|
+
if (!('dryRun' in changed) && !changed.matched)
|
|
727
|
+
return false;
|
|
728
|
+
await tx.db.insert('website.EntryRevision', {
|
|
729
|
+
id: revisionId,
|
|
730
|
+
entryId: args.entryId,
|
|
731
|
+
version,
|
|
732
|
+
kind: 'restore',
|
|
733
|
+
title: revision.title,
|
|
734
|
+
excerpt: revision.excerpt ?? null,
|
|
735
|
+
layout: revision.layout,
|
|
736
|
+
fields: revision.fields,
|
|
737
|
+
authorId: ctx.actor,
|
|
738
|
+
createdAt: new Date().toISOString(),
|
|
739
|
+
});
|
|
740
|
+
return true;
|
|
741
|
+
});
|
|
742
|
+
return restored
|
|
743
|
+
? { ok: true, id: args.entryId, revisionId, version }
|
|
744
|
+
: invalid('revisionId', 'website.error.editConflict');
|
|
745
|
+
},
|
|
746
|
+
}),
|
|
747
|
+
createPreviewToken: defineFn({
|
|
748
|
+
input: { entryId: 'id', ttlSeconds: 'int?', oneTime: 'bool?' },
|
|
749
|
+
output: { token: 'text', expiresAt: 'datetime' },
|
|
750
|
+
effects: ['read:website.Entry', 'read:website.SiteMember', 'write:website.PreviewToken'],
|
|
751
|
+
handler: async (ctx, args) => {
|
|
752
|
+
const entry = await entryById(ctx, args.entryId);
|
|
753
|
+
if (!entry?.currentRevisionId)
|
|
754
|
+
throw new Error('entry has no revision');
|
|
755
|
+
if (!(await canEditEntry(ctx, entry)))
|
|
756
|
+
throw new Error('website.error.forbidden');
|
|
757
|
+
const ttl = Math.min(Math.max(Number(args.ttlSeconds ?? 900), 60), 3600);
|
|
758
|
+
const token = randomBytes(24).toString('base64url');
|
|
759
|
+
const expiresAt = new Date(Date.now() + ttl * 1000).toISOString();
|
|
760
|
+
await ctx.db.insert('website.PreviewToken', {
|
|
761
|
+
id: randomUUID(),
|
|
762
|
+
entryId: args.entryId,
|
|
763
|
+
revisionId: entry.currentRevisionId,
|
|
764
|
+
digest: digest(token),
|
|
765
|
+
expiresAt,
|
|
766
|
+
createdBy: ctx.actor,
|
|
767
|
+
oneTime: args.oneTime === true,
|
|
768
|
+
usedAt: null,
|
|
769
|
+
revokedAt: null,
|
|
770
|
+
});
|
|
771
|
+
return { token, expiresAt };
|
|
772
|
+
},
|
|
773
|
+
}),
|
|
774
|
+
previewEntry: defineFn({
|
|
775
|
+
anonymous: true,
|
|
776
|
+
input: { token: 'text' },
|
|
777
|
+
output: { entry: 'json', revision: 'json' },
|
|
778
|
+
effects: [
|
|
779
|
+
'read:website.PreviewToken',
|
|
780
|
+
'write:website.PreviewToken',
|
|
781
|
+
'read:website.Entry',
|
|
782
|
+
'read:website.EntryRevision',
|
|
783
|
+
],
|
|
784
|
+
handler: async (ctx, args) => {
|
|
785
|
+
const Token = ctx.table('website.PreviewToken');
|
|
786
|
+
const token = await ctx.db.one(from(Token).where(eq(Token.digest, digest(String(args.token)))));
|
|
787
|
+
if (!token ||
|
|
788
|
+
token.revokedAt ||
|
|
789
|
+
(token.oneTime === true && token.usedAt) ||
|
|
790
|
+
new Date(String(token.expiresAt)) <= new Date())
|
|
791
|
+
return null;
|
|
792
|
+
const entry = await entryById(ctx, token.entryId);
|
|
793
|
+
const revision = (await ctx.db.select('website.EntryRevision', { id: token.revisionId }))[0];
|
|
794
|
+
if (!entry || !revision || revision.entryId !== entry.id)
|
|
795
|
+
return null;
|
|
796
|
+
if (token.oneTime === true) {
|
|
797
|
+
const used = await ctx.db.compareAndSet('website.PreviewToken', { id: token.id }, { usedAt: null, revokedAt: null }, { usedAt: new Date().toISOString() });
|
|
798
|
+
if (!('dryRun' in used) && !used.matched)
|
|
799
|
+
return null;
|
|
800
|
+
}
|
|
801
|
+
return { entry, revision };
|
|
802
|
+
},
|
|
803
|
+
}),
|
|
804
|
+
revokePreviewTokens: defineFn({
|
|
805
|
+
input: { entryId: 'id' },
|
|
806
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
807
|
+
effects: [
|
|
808
|
+
'read:website.Entry',
|
|
809
|
+
'read:website.SiteMember',
|
|
810
|
+
'read:website.PreviewToken',
|
|
811
|
+
'write:website.PreviewToken',
|
|
812
|
+
],
|
|
813
|
+
idempotent: true,
|
|
814
|
+
handler: async (ctx, args) => {
|
|
815
|
+
const entry = await entryById(ctx, args.entryId);
|
|
816
|
+
if (!entry || !(await canEditEntry(ctx, entry)))
|
|
817
|
+
return forbidden();
|
|
818
|
+
const tokens = await ctx.db.select('website.PreviewToken', { entryId: args.entryId });
|
|
819
|
+
const revokedAt = new Date().toISOString();
|
|
820
|
+
for (const token of tokens)
|
|
821
|
+
if (!token.revokedAt)
|
|
822
|
+
await ctx.db.update('website.PreviewToken', { id: token.id }, { revokedAt });
|
|
823
|
+
return { ok: true, id: args.entryId };
|
|
824
|
+
},
|
|
825
|
+
}),
|
|
826
|
+
listTaxonomyTerms: defineFn({
|
|
827
|
+
input: { siteId: 'id', taxonomy: 'text?', limit: 'int?', offset: 'int?' },
|
|
828
|
+
output: {
|
|
829
|
+
id: 'id',
|
|
830
|
+
siteId: 'id',
|
|
831
|
+
taxonomy: 'text',
|
|
832
|
+
slug: 'text',
|
|
833
|
+
name: 'text',
|
|
834
|
+
description: 'text?',
|
|
835
|
+
parentId: 'id?',
|
|
836
|
+
},
|
|
837
|
+
effects: ['read:website.TaxonomyTerm', 'read:website.SiteMember'],
|
|
838
|
+
agent: true,
|
|
839
|
+
handler: async (ctx, args) => {
|
|
840
|
+
if (!(await canAccessSite(ctx, args.siteId)))
|
|
841
|
+
return [];
|
|
842
|
+
const Term = ctx.table('website.TaxonomyTerm');
|
|
843
|
+
const paging = page(args.limit, args.offset, 100);
|
|
844
|
+
let query = from(Term).where(eq(Term.siteId, args.siteId)).orderBy(asc(Term.taxonomy), asc(Term.name));
|
|
845
|
+
if (args.taxonomy)
|
|
846
|
+
query = query.where(eq(Term.taxonomy, args.taxonomy));
|
|
847
|
+
return ctx.db.all(query.limit(paging.limit).offset(paging.offset));
|
|
848
|
+
},
|
|
849
|
+
}),
|
|
850
|
+
getTaxonomyTerm: defineFn({
|
|
851
|
+
input: { id: 'id' },
|
|
852
|
+
output: {
|
|
853
|
+
id: 'id',
|
|
854
|
+
siteId: 'id',
|
|
855
|
+
taxonomy: 'text',
|
|
856
|
+
slug: 'text',
|
|
857
|
+
name: 'text',
|
|
858
|
+
description: 'text?',
|
|
859
|
+
parentId: 'id?',
|
|
860
|
+
},
|
|
861
|
+
effects: ['read:website.TaxonomyTerm', 'read:website.SiteMember'],
|
|
862
|
+
handler: async (ctx, args) => {
|
|
863
|
+
const term = (await ctx.db.select('website.TaxonomyTerm', { id: args.id }))[0];
|
|
864
|
+
return term && (await canAccessSite(ctx, term.siteId)) ? term : null;
|
|
865
|
+
},
|
|
866
|
+
}),
|
|
867
|
+
saveTerm: defineFn({
|
|
868
|
+
input: {
|
|
869
|
+
id: 'id',
|
|
870
|
+
siteId: 'id',
|
|
871
|
+
taxonomy: 'text',
|
|
872
|
+
slug: 'text',
|
|
873
|
+
name: 'text',
|
|
874
|
+
description: 'text?',
|
|
875
|
+
parentId: 'id?',
|
|
876
|
+
},
|
|
877
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
878
|
+
effects: [
|
|
879
|
+
'read:website.Site',
|
|
880
|
+
'read:website.SiteMember',
|
|
881
|
+
'read:website.TaxonomyTerm',
|
|
882
|
+
'write:website.TaxonomyTerm',
|
|
883
|
+
],
|
|
884
|
+
idempotent: true,
|
|
885
|
+
agent: true,
|
|
886
|
+
handler: async (ctx, args) => {
|
|
887
|
+
if (!ctx.manifest.taxonomies[String(args.taxonomy)])
|
|
888
|
+
return invalid('taxonomy', 'website.error.invalidTaxonomy');
|
|
889
|
+
if (!(await siteById(ctx, args.siteId)))
|
|
890
|
+
return invalid('siteId', 'website.error.siteNotFound');
|
|
891
|
+
if (!(await canManageStructure(ctx, args.siteId)))
|
|
892
|
+
return forbidden();
|
|
893
|
+
if (args.parentId === args.id)
|
|
894
|
+
return invalid('parentId', 'website.error.taxonomyCycle');
|
|
895
|
+
const existing = (await ctx.db.select('website.TaxonomyTerm', { id: args.id }))[0];
|
|
896
|
+
if (existing && (existing.siteId !== args.siteId || existing.taxonomy !== args.taxonomy))
|
|
897
|
+
return invalid('id', 'website.error.immutableOwnership');
|
|
898
|
+
const slug = String(args.slug ?? '').trim();
|
|
899
|
+
const name = String(args.name ?? '').trim();
|
|
900
|
+
if (!validSlug(slug))
|
|
901
|
+
return invalid('slug', 'website.error.invalidSlug');
|
|
902
|
+
if (!name || name.length > 200)
|
|
903
|
+
return invalid('name', 'website.error.invalidName');
|
|
904
|
+
const Term = ctx.table('website.TaxonomyTerm');
|
|
905
|
+
const duplicate = await ctx.db.one(from(Term).where(eq(Term.siteId, args.siteId), eq(Term.taxonomy, args.taxonomy), eq(Term.slug, slug)));
|
|
906
|
+
if (duplicate && duplicate.id !== args.id)
|
|
907
|
+
return invalid('slug', 'website.error.duplicateSlug');
|
|
908
|
+
let parentId = args.parentId ?? null;
|
|
909
|
+
for (let depth = 0; parentId && depth <= 100; depth += 1) {
|
|
910
|
+
const parent = (await ctx.db.select('website.TaxonomyTerm', { id: parentId }))[0];
|
|
911
|
+
if (!parent || parent.siteId !== args.siteId || parent.taxonomy !== args.taxonomy)
|
|
912
|
+
return invalid('parentId', 'website.error.invalidParent');
|
|
913
|
+
if (parent.id === args.id || depth === 100)
|
|
914
|
+
return invalid('parentId', 'website.error.taxonomyCycle');
|
|
915
|
+
parentId = parent.parentId ?? null;
|
|
916
|
+
}
|
|
917
|
+
const row = {
|
|
918
|
+
id: args.id,
|
|
919
|
+
siteId: args.siteId,
|
|
920
|
+
taxonomy: args.taxonomy,
|
|
921
|
+
slug,
|
|
922
|
+
name,
|
|
923
|
+
description: args.description ?? null,
|
|
924
|
+
parentId: args.parentId ?? null,
|
|
925
|
+
};
|
|
926
|
+
if (existing)
|
|
927
|
+
await ctx.db.update('website.TaxonomyTerm', { id: args.id }, row);
|
|
928
|
+
else
|
|
929
|
+
await ctx.db.insert('website.TaxonomyTerm', row);
|
|
930
|
+
return { ok: true, id: args.id };
|
|
931
|
+
},
|
|
932
|
+
}),
|
|
933
|
+
deleteTerm: defineFn({
|
|
934
|
+
input: { id: 'id' },
|
|
935
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
936
|
+
effects: [
|
|
937
|
+
'read:website.TaxonomyTerm',
|
|
938
|
+
'read:website.EntryTerm',
|
|
939
|
+
'read:website.SiteMember',
|
|
940
|
+
'write:website.TaxonomyTerm',
|
|
941
|
+
],
|
|
942
|
+
idempotent: true,
|
|
943
|
+
handler: async (ctx, args) => {
|
|
944
|
+
const term = (await ctx.db.select('website.TaxonomyTerm', { id: args.id }))[0];
|
|
945
|
+
if (!term)
|
|
946
|
+
return { ok: true, id: args.id };
|
|
947
|
+
if (!(await canManageStructure(ctx, term.siteId)))
|
|
948
|
+
return forbidden();
|
|
949
|
+
const children = await ctx.db.select('website.TaxonomyTerm', { parentId: term.id });
|
|
950
|
+
const assignments = await ctx.db.select('website.EntryTerm', { termId: term.id });
|
|
951
|
+
if (children.length || assignments.length)
|
|
952
|
+
return invalid('id', 'website.error.termInUse');
|
|
953
|
+
const Term = ctx.table('website.TaxonomyTerm');
|
|
954
|
+
await ctx.db.del(deleteFrom(Term).where(eq(Term.id, args.id)));
|
|
955
|
+
return { ok: true, id: args.id };
|
|
956
|
+
},
|
|
957
|
+
}),
|
|
958
|
+
assignTerm: defineFn({
|
|
959
|
+
input: { id: 'id', entryId: 'id', termId: 'id' },
|
|
960
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
961
|
+
effects: [
|
|
962
|
+
'read:website.Entry',
|
|
963
|
+
'read:website.SiteMember',
|
|
964
|
+
'read:website.TaxonomyTerm',
|
|
965
|
+
'write:website.EntryTerm',
|
|
966
|
+
],
|
|
967
|
+
idempotent: true,
|
|
968
|
+
handler: async (ctx, args) => {
|
|
969
|
+
const entry = await entryById(ctx, args.entryId);
|
|
970
|
+
const term = (await ctx.db.select('website.TaxonomyTerm', { id: args.termId }))[0];
|
|
971
|
+
if (!entry || !(await canEditEntry(ctx, entry)))
|
|
972
|
+
return forbidden();
|
|
973
|
+
if (!term || entry.siteId !== term.siteId)
|
|
974
|
+
return invalid('termId', 'website.error.termSiteMismatch');
|
|
975
|
+
await ctx.db.insertIfAbsent('website.EntryTerm', args);
|
|
976
|
+
return { ok: true, id: args.id };
|
|
977
|
+
},
|
|
978
|
+
}),
|
|
979
|
+
saveMediaMetadata: defineFn({
|
|
980
|
+
input: {
|
|
981
|
+
id: 'id',
|
|
982
|
+
siteId: 'id',
|
|
983
|
+
attachmentId: 'id',
|
|
984
|
+
alt: 'text?',
|
|
985
|
+
caption: 'text?',
|
|
986
|
+
width: 'int?',
|
|
987
|
+
height: 'int?',
|
|
988
|
+
},
|
|
989
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
990
|
+
effects: [
|
|
991
|
+
'read:website.Site',
|
|
992
|
+
'read:website.SiteMember',
|
|
993
|
+
'read:website.MediaMetadata',
|
|
994
|
+
'write:website.MediaMetadata',
|
|
995
|
+
],
|
|
996
|
+
idempotent: true,
|
|
997
|
+
handler: async (ctx, args) => {
|
|
998
|
+
if (!(await siteById(ctx, args.siteId)))
|
|
999
|
+
return invalid('siteId', 'website.error.siteNotFound');
|
|
1000
|
+
if (!(await canManageStructure(ctx, args.siteId)))
|
|
1001
|
+
return forbidden();
|
|
1002
|
+
const existing = (await ctx.db.select('website.MediaMetadata', { id: args.id }))[0];
|
|
1003
|
+
if (existing && existing.siteId !== args.siteId)
|
|
1004
|
+
return invalid('id', 'website.error.immutableOwnership');
|
|
1005
|
+
if ((args.width != null && (Number(args.width) <= 0 || Number(args.width) > 100_000)) ||
|
|
1006
|
+
(args.height != null && (Number(args.height) <= 0 || Number(args.height) > 100_000)))
|
|
1007
|
+
return invalid('width', 'website.error.invalidDimensions');
|
|
1008
|
+
const row = {
|
|
1009
|
+
...args,
|
|
1010
|
+
alt: args.alt ?? null,
|
|
1011
|
+
caption: args.caption ?? null,
|
|
1012
|
+
width: args.width ?? null,
|
|
1013
|
+
height: args.height ?? null,
|
|
1014
|
+
};
|
|
1015
|
+
if (existing)
|
|
1016
|
+
await ctx.db.update('website.MediaMetadata', { id: args.id }, row);
|
|
1017
|
+
else
|
|
1018
|
+
await ctx.db.insert('website.MediaMetadata', row);
|
|
1019
|
+
return { ok: true, id: args.id };
|
|
1020
|
+
},
|
|
1021
|
+
}),
|
|
1022
|
+
getMediaMetadata: defineFn({
|
|
1023
|
+
input: { id: 'id' },
|
|
1024
|
+
output: {
|
|
1025
|
+
id: 'id',
|
|
1026
|
+
siteId: 'id',
|
|
1027
|
+
attachmentId: 'id',
|
|
1028
|
+
alt: 'text?',
|
|
1029
|
+
caption: 'text?',
|
|
1030
|
+
width: 'int?',
|
|
1031
|
+
height: 'int?',
|
|
1032
|
+
},
|
|
1033
|
+
effects: ['read:website.MediaMetadata', 'read:website.SiteMember'],
|
|
1034
|
+
handler: async (ctx, args) => {
|
|
1035
|
+
const media = (await ctx.db.select('website.MediaMetadata', { id: args.id }))[0];
|
|
1036
|
+
return media && (await canAccessSite(ctx, media.siteId)) ? media : null;
|
|
1037
|
+
},
|
|
1038
|
+
}),
|
|
1039
|
+
deleteMediaMetadata: defineFn({
|
|
1040
|
+
input: { id: 'id' },
|
|
1041
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
1042
|
+
effects: ['read:website.MediaMetadata', 'read:website.SiteMember', 'write:website.MediaMetadata'],
|
|
1043
|
+
idempotent: true,
|
|
1044
|
+
handler: async (ctx, args) => {
|
|
1045
|
+
const media = (await ctx.db.select('website.MediaMetadata', { id: args.id }))[0];
|
|
1046
|
+
if (!media)
|
|
1047
|
+
return { ok: true, id: args.id };
|
|
1048
|
+
if (!(await canManageStructure(ctx, media.siteId)))
|
|
1049
|
+
return forbidden();
|
|
1050
|
+
const Media = ctx.table('website.MediaMetadata');
|
|
1051
|
+
await ctx.db.del(deleteFrom(Media).where(eq(Media.id, args.id)));
|
|
1052
|
+
return { ok: true, id: args.id };
|
|
1053
|
+
},
|
|
1054
|
+
}),
|
|
1055
|
+
listMedia: defineFn({
|
|
1056
|
+
input: { siteId: 'id', limit: 'int?', offset: 'int?' },
|
|
1057
|
+
output: {
|
|
1058
|
+
id: 'id',
|
|
1059
|
+
siteId: 'id',
|
|
1060
|
+
attachmentId: 'id',
|
|
1061
|
+
alt: 'text?',
|
|
1062
|
+
caption: 'text?',
|
|
1063
|
+
width: 'int?',
|
|
1064
|
+
height: 'int?',
|
|
1065
|
+
},
|
|
1066
|
+
effects: ['read:website.MediaMetadata', 'read:website.SiteMember'],
|
|
1067
|
+
handler: async (ctx, args) => {
|
|
1068
|
+
if (!(await canAccessSite(ctx, args.siteId)))
|
|
1069
|
+
return [];
|
|
1070
|
+
const Media = ctx.table('website.MediaMetadata');
|
|
1071
|
+
const paging = page(args.limit, args.offset, 100);
|
|
1072
|
+
return ctx.db.all(from(Media)
|
|
1073
|
+
.where(eq(Media.siteId, args.siteId))
|
|
1074
|
+
.orderBy(asc(Media.attachmentId))
|
|
1075
|
+
.limit(paging.limit)
|
|
1076
|
+
.offset(paging.offset));
|
|
1077
|
+
},
|
|
1078
|
+
}),
|
|
1079
|
+
saveRedirect: defineFn({
|
|
1080
|
+
input: { id: 'id', siteId: 'id', fromPath: 'text', toPath: 'text', permanent: 'bool?', active: 'bool?' },
|
|
1081
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
1082
|
+
effects: [
|
|
1083
|
+
'read:website.Site',
|
|
1084
|
+
'read:website.SiteMember',
|
|
1085
|
+
'read:website.Redirect',
|
|
1086
|
+
'write:website.Redirect',
|
|
1087
|
+
],
|
|
1088
|
+
idempotent: true,
|
|
1089
|
+
handler: async (ctx, args) => {
|
|
1090
|
+
const fromPath = cleanPath(args.fromPath);
|
|
1091
|
+
const toPath = cleanPath(args.toPath);
|
|
1092
|
+
if (!fromPath || !toPath || fromPath === toPath)
|
|
1093
|
+
return invalid('fromPath', 'website.error.invalidRedirect');
|
|
1094
|
+
if (!(await siteById(ctx, args.siteId)))
|
|
1095
|
+
return invalid('siteId', 'website.error.siteNotFound');
|
|
1096
|
+
if (!(await canManageStructure(ctx, args.siteId)))
|
|
1097
|
+
return forbidden();
|
|
1098
|
+
const existing = (await ctx.db.select('website.Redirect', { id: args.id }))[0];
|
|
1099
|
+
if (existing && existing.siteId !== args.siteId)
|
|
1100
|
+
return invalid('id', 'website.error.immutableOwnership');
|
|
1101
|
+
const redirects = await ctx.db.select('website.Redirect', { siteId: args.siteId });
|
|
1102
|
+
let target = toPath;
|
|
1103
|
+
for (let depth = 0; depth <= 20; depth += 1) {
|
|
1104
|
+
if (target === fromPath || depth === 20)
|
|
1105
|
+
return invalid('toPath', 'website.error.redirectCycle');
|
|
1106
|
+
const next = redirects.find((redirect) => redirect.id !== args.id && redirect.active === true && redirect.fromPath === target);
|
|
1107
|
+
if (!next)
|
|
1108
|
+
break;
|
|
1109
|
+
target = next.toPath;
|
|
1110
|
+
}
|
|
1111
|
+
const row = {
|
|
1112
|
+
id: args.id,
|
|
1113
|
+
siteId: args.siteId,
|
|
1114
|
+
fromPath,
|
|
1115
|
+
toPath,
|
|
1116
|
+
permanent: args.permanent !== false,
|
|
1117
|
+
active: args.active !== false,
|
|
1118
|
+
};
|
|
1119
|
+
if (existing)
|
|
1120
|
+
await ctx.db.update('website.Redirect', { id: args.id }, row);
|
|
1121
|
+
else
|
|
1122
|
+
await ctx.db.insert('website.Redirect', row);
|
|
1123
|
+
return { ok: true, id: args.id };
|
|
1124
|
+
},
|
|
1125
|
+
}),
|
|
1126
|
+
listRedirects: defineFn({
|
|
1127
|
+
input: { siteId: 'id', active: 'bool?', limit: 'int?', offset: 'int?' },
|
|
1128
|
+
output: { id: 'id', siteId: 'id', fromPath: 'text', toPath: 'text', permanent: 'bool', active: 'bool' },
|
|
1129
|
+
effects: ['read:website.Redirect', 'read:website.SiteMember'],
|
|
1130
|
+
handler: async (ctx, args) => {
|
|
1131
|
+
if (!(await canAccessSite(ctx, args.siteId)))
|
|
1132
|
+
return [];
|
|
1133
|
+
const Redirect = ctx.table('website.Redirect');
|
|
1134
|
+
const paging = page(args.limit, args.offset, 100);
|
|
1135
|
+
let query = from(Redirect).where(eq(Redirect.siteId, args.siteId)).orderBy(asc(Redirect.fromPath));
|
|
1136
|
+
if (args.active != null)
|
|
1137
|
+
query = query.where(eq(Redirect.active, args.active));
|
|
1138
|
+
return ctx.db.all(query.limit(paging.limit).offset(paging.offset));
|
|
1139
|
+
},
|
|
1140
|
+
}),
|
|
1141
|
+
};
|
|
1142
|
+
//# sourceMappingURL=cms.js.map
|