@antelopejs/dms 0.25.6-next.1105.g9b73018 → 0.25.6
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/CHANGELOG.md +60 -0
- package/README.md +16 -16
- package/data/mockup-spec.schema.json +289 -5
- package/dist/implementations/dms-auth/account-emails.js +2 -2
- package/dist/implementations/dms-auth/account-emails.js.map +1 -1
- package/dist/implementations/dms-auth/index.js +1 -2
- package/dist/implementations/dms-auth/index.js.map +1 -1
- package/dist/implementations/dms-base/group-order.d.ts +18 -0
- package/dist/implementations/dms-base/group-order.js +66 -0
- package/dist/implementations/dms-base/group-order.js.map +1 -0
- package/dist/implementations/dms-base/search-route.js +8 -5
- package/dist/implementations/dms-base/search-route.js.map +1 -1
- package/dist/implementations/dms-builder/engine/cell-displays.js +4 -1
- package/dist/implementations/dms-builder/engine/cell-displays.js.map +1 -1
- package/dist/implementations/dms-builder/engine/mapped-displays.js +5 -1
- package/dist/implementations/dms-builder/engine/mapped-displays.js.map +1 -1
- package/dist/implementations/dms-builder/engine/resource-emit.js +4 -0
- package/dist/implementations/dms-builder/engine/resource-emit.js.map +1 -1
- package/dist/implementations/dms-builder/engine/theme-assets.js +5 -17
- package/dist/implementations/dms-builder/engine/theme-assets.js.map +1 -1
- package/dist/mcp/tools/mockup-apply-to-page.js +1 -1
- package/dist/mcp/tools/mockup-apply-to-page.js.map +1 -1
- package/dist/mcp/tools/mockup-patch-spec.js +1 -1
- package/dist/mcp/tools/mockup-patch-spec.js.map +1 -1
- package/dist/mcp/tools/mockup-write-spec.js +1 -1
- package/dist/mcp/tools/mockup-write-spec.js.map +1 -1
- package/dist/mockup/apply-notes.d.ts +1 -1
- package/dist/mockup/apply-notes.js +2 -1
- package/dist/mockup/apply-notes.js.map +1 -1
- package/dist/mockup/apply-plan.js +3 -0
- package/dist/mockup/apply-plan.js.map +1 -1
- package/dist/mockup/capture-routes.d.ts +18 -0
- package/dist/mockup/capture-routes.js +101 -0
- package/dist/mockup/capture-routes.js.map +1 -0
- package/dist/mockup/capture.d.ts +10 -0
- package/dist/mockup/capture.js +64 -0
- package/dist/mockup/capture.js.map +1 -0
- package/dist/mockup/compile.js +16 -8
- package/dist/mockup/compile.js.map +1 -1
- package/dist/mockup/controller-blocks.js +62 -10
- package/dist/mockup/controller-blocks.js.map +1 -1
- package/dist/mockup/display-values.js +1 -1
- package/dist/mockup/display-values.js.map +1 -1
- package/dist/mockup/files.d.ts +2 -1
- package/dist/mockup/files.js +3 -2
- package/dist/mockup/files.js.map +1 -1
- package/dist/mockup/fixtures.d.ts +3 -1
- package/dist/mockup/fixtures.js +25 -2
- package/dist/mockup/fixtures.js.map +1 -1
- package/dist/mockup/form-fields.js +10 -1
- package/dist/mockup/form-fields.js.map +1 -1
- package/dist/mockup/header-action.d.ts +47 -0
- package/dist/mockup/header-action.js +46 -0
- package/dist/mockup/header-action.js.map +1 -0
- package/dist/mockup/history-routes.js +8 -1
- package/dist/mockup/history-routes.js.map +1 -1
- package/dist/mockup/json-schema-header.d.ts +2 -0
- package/dist/mockup/json-schema-header.js +69 -0
- package/dist/mockup/json-schema-header.js.map +1 -0
- package/dist/mockup/json-schema-layout.d.ts +2 -0
- package/dist/mockup/json-schema-layout.js +61 -0
- package/dist/mockup/json-schema-layout.js.map +1 -0
- package/dist/mockup/json-schema.js +5 -16
- package/dist/mockup/json-schema.js.map +1 -1
- package/dist/mockup/model.d.ts +204 -18
- package/dist/mockup/model.js +46 -12
- package/dist/mockup/model.js.map +1 -1
- package/dist/mockup/page-links.d.ts +2 -1
- package/dist/mockup/page-links.js +14 -3
- package/dist/mockup/page-links.js.map +1 -1
- package/dist/mockup/refusals.d.ts +1 -0
- package/dist/mockup/refusals.js +1 -0
- package/dist/mockup/refusals.js.map +1 -1
- package/dist/mockup/routes.js +11 -1
- package/dist/mockup/routes.js.map +1 -1
- package/dist/mockup/sample-rows.js +4 -0
- package/dist/mockup/sample-rows.js.map +1 -1
- package/dist/mockup/store.d.ts +1 -0
- package/dist/mockup/store.js +9 -19
- package/dist/mockup/store.js.map +1 -1
- package/dist/mockup/summary-fields.d.ts +20 -0
- package/dist/mockup/summary-fields.js +22 -0
- package/dist/mockup/summary-fields.js.map +1 -0
- package/dist/mockup/table-columns.js +9 -3
- package/dist/mockup/table-columns.js.map +1 -1
- package/dist/mockup/table-options.d.ts +4 -1
- package/dist/mockup/table-options.js +40 -2
- package/dist/mockup/table-options.js.map +1 -1
- package/dist/mockup/table-param-filters.d.ts +52 -0
- package/dist/mockup/table-param-filters.js +83 -0
- package/dist/mockup/table-param-filters.js.map +1 -0
- package/dist/mockup/table-row-actions.d.ts +2 -0
- package/dist/mockup/table-row-actions.js +85 -0
- package/dist/mockup/table-row-actions.js.map +1 -0
- package/dist/mockup/unknown-keys.d.ts +3 -0
- package/dist/mockup/unknown-keys.js +45 -0
- package/dist/mockup/unknown-keys.js.map +1 -0
- package/dist/mockup/validate.d.ts +7 -1
- package/dist/mockup/validate.js +76 -3
- package/dist/mockup/validate.js.map +1 -1
- package/dist/pages/account.d.ts +1 -0
- package/dist/pages/account.js +1 -0
- package/dist/pages/account.js.map +1 -1
- package/dist/pages/settings/overview/account-summary.d.ts +2 -0
- package/dist/pages/settings/overview/account-summary.js +17 -8
- package/dist/pages/settings/overview/account-summary.js.map +1 -1
- package/dist/pages/settings/settings-index.js +2 -1
- package/dist/pages/settings/settings-index.js.map +1 -1
- package/dist/realtime/sse.js +2 -4
- package/dist/realtime/sse.js.map +1 -1
- package/dist/store/internal/frontend/dev-reload.js +7 -1
- package/dist/store/internal/frontend/dev-reload.js.map +1 -1
- package/dist/utils/account-notifications.js +1 -0
- package/dist/utils/account-notifications.js.map +1 -1
- package/dist/utils/email-change-mail.js +2 -2
- package/dist/utils/email-change-mail.js.map +1 -1
- package/dist/utils/email-plain-text.d.ts +1 -0
- package/dist/utils/email-plain-text.js +95 -0
- package/dist/utils/email-plain-text.js.map +1 -0
- package/dist/utils/export-jobs.js +2 -2
- package/dist/utils/export-jobs.js.map +1 -1
- package/dist/utils/html-email.d.ts +8 -0
- package/dist/utils/html-email.js +9 -0
- package/dist/utils/html-email.js.map +1 -0
- package/dist/utils/image-signatures.d.ts +3 -0
- package/dist/utils/image-signatures.js +22 -0
- package/dist/utils/image-signatures.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/sse-keepalive/index.d.ts +3 -0
- package/dist/utils/sse-keepalive/index.js +8 -0
- package/dist/utils/sse-keepalive/index.js.map +1 -0
- package/dist/validation/allowed-keys.d.ts +2 -0
- package/dist/validation/allowed-keys.js +16 -0
- package/dist/validation/allowed-keys.js.map +1 -0
- package/dist/validation/index.d.ts +1 -0
- package/dist/validation/index.js +1 -0
- package/dist/validation/index.js.map +1 -1
- package/frontend-vue/eslint-globals.generated.mjs +2 -2
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/2fa.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/backup.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot-validation.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/login.vue +4 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/recover.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/signup.vue +17 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/validate.vue +3 -0
- package/frontend-vue/layers/dms-auth/i18n/locales/auth-fr-FR.json +10 -10
- package/frontend-vue/layers/dms-core/app/build/composables/api-error.ts +8 -0
- package/frontend-vue/layers/dms-core/app/build/composables/field-errors.ts +485 -0
- package/frontend-vue/layers/dms-core/app/build/composables/useHydrated.ts +27 -0
- package/frontend-vue/layers/dms-core/app/composables/data-types/useDataType.ts +3 -2
- package/frontend-vue/layers/dms-core/app/composables/translation/useUniqueLocales.ts +23 -5
- package/frontend-vue/layers/dms-core/app/composables/useApiErrorPresenter.ts +1 -0
- package/frontend-vue/layers/dms-core/app/composables/useFieldErrors.ts +12 -443
- package/frontend-vue/layers/dms-core/app/entries/composables/useHydrated.ts +1 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +8 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +8 -0
- package/frontend-vue/layers/dms-core/shared/types/app-config.ts +2 -0
- package/frontend-vue/layers/dms-layout/app/app.config.ts +1 -0
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardHeader.vue +7 -4
- package/frontend-vue/layers/dms-layout/app/build/components/layout/EmptyLayoutBrand.vue +49 -0
- package/frontend-vue/layers/dms-layout/app/build/components/layout/LayoutFooter.vue +2 -0
- package/frontend-vue/layers/dms-layout/app/build/components/layout/PreviewPageHeader.vue +19 -3
- package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupMenu.ts +3 -8
- package/frontend-vue/layers/dms-layout/app/build/components/notification/NotificationPopover.vue +8 -2
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationInboxItem.vue +6 -9
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationMatrixCategory.vue +6 -2
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationMatrixSubject.vue +27 -22
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationPreferencesForm.vue +8 -10
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/notificationDisplay.ts +39 -3
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsShell.vue +38 -5
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/profile/useProfilePreferences.ts +1 -3
- package/frontend-vue/layers/dms-layout/app/build/utils/dev-reload-stream.ts +23 -4
- package/frontend-vue/layers/dms-layout/app/custom-layouts/EmptyLayout.vue +39 -31
- package/frontend-vue/layers/dms-layout/app/custom-layouts/PreviewLayout.vue +60 -4
- package/frontend-vue/layers/dms-layout/app/entries/components/pages/settings/shell/SettingsShell.ts +2 -0
- package/frontend-vue/layers/dms-layout/app/error.vue +1 -1
- package/frontend-vue/layers/dms-layout/app/middleware/module-routing.global.ts +7 -1
- package/frontend-vue/layers/dms-layout/app/plugins/dms-menu-sync.client.ts +14 -1
- package/frontend-vue/layers/dms-layout/app/utils/breadcrumb.ts +13 -0
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-en-GB.json +1 -1
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-fr-FR.json +5 -5
- package/frontend-vue/layers/dms-onboarding/app/build/components/onboarding/steps/StepPlatform.vue +3 -0
- package/frontend-vue/layers/dms-onboarding/app/components/onboarding/steps/StepRegister.vue +3 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/BlockPreviewSketch.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupHeaderActions.vue +1 -4
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspector.vue +2 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupIssues.vue +22 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +125 -178
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewArrows.vue +110 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewFrameImage.vue +75 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +113 -4
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewZoom.vue +67 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinLayer.vue +10 -4
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +8 -1
- package/frontend-vue/layers/dms-ui/app/build/components/table-view/ExpandedRowDetail.vue +26 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCapture.ts +247 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCaptureAssets.ts +181 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewNavigation.ts +8 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewRaster.ts +45 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockPreviewEmbed.ts +46 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +109 -35
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +4 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRoutePage.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts +3 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useOverviewCaptures.ts +136 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +68 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewLinks.ts +17 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/confirm/fetchedConfirmDialog.ts +6 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultDisplayComponents.ts +4 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts +38 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/registerFieldTypes.ts +69 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/useColumnValueRenderer.ts +20 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/form/keyValueRows.ts +36 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/form/useInstantForm.ts +4 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewGrouping.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewListing.ts +21 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewSorting.ts +8 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useGroupedRows.ts +32 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableFooter.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRows.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/displayOptions.ts +14 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/groupedRows.ts +68 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableQuery.ts +5 -0
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCard.vue +73 -48
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +18 -11
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupThumbnail.vue +34 -124
- package/frontend-vue/layers/dms-ui/app/build/mockups/manage.ts +7 -3
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewCapture.ts +96 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewChannel.ts +10 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +29 -118
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewRects.ts +61 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/dotGrid.ts +37 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/legalIdentifier.ts +279 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +34 -5
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCaptures.ts +130 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupFrame.ts +6 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupLinks.ts +35 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +44 -17
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +26 -14
- package/frontend-vue/layers/dms-ui/app/build/utils/previewHeader.ts +154 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageLayout.ts +149 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageQuery.ts +42 -0
- package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +56 -6
- package/frontend-vue/layers/dms-ui/app/components/confirm/ConfirmModal.vue +7 -7
- package/frontend-vue/layers/dms-ui/app/components/flow-canvas/FlowCanvas.vue +4 -7
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputIdentifier.vue +90 -0
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputPhone.vue +5 -0
- package/frontend-vue/layers/dms-ui/app/components/form/components/KeyValue.vue +2 -20
- package/frontend-vue/layers/dms-ui/app/components/key-value-list/KeyValueList.vue +51 -15
- package/frontend-vue/layers/dms-ui/app/composables/form/useForm.ts +3 -8
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/config.ts +10 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/previewCapture.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/previewCaptureAssets.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/usePreviewFrame.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/table-view/utils/displayOptions.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/mockups/manage.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/blockPreview.ts +3 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/legalIdentifier.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupCaptures.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/types/table/query.ts +5 -0
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +2 -0
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +12 -10
- package/frontend-vue/scripts/check-invariants.mjs +101 -0
- package/package.json +8 -8
- package/skills/dms/SKILL.md +4 -2
- package/skills/dms-module/SKILL.md +3 -0
|
@@ -72,6 +72,7 @@ function notifyNewLogin(user, device) {
|
|
|
72
72
|
const params = { ...delivery.params };
|
|
73
73
|
if (device.country) {
|
|
74
74
|
params.country = (0, sign_in_country_1.countryDisplayName)(device.country, user.language);
|
|
75
|
+
params.countryCode = device.country;
|
|
75
76
|
}
|
|
76
77
|
return (0, notification_emitter_1.emitNotification)(user._id, isRecognised ? templates.newLogin : templates.newLoginUnknownDevice, {
|
|
77
78
|
...delivery,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-notifications.js","sourceRoot":"","sources":["../../src/utils/account-notifications.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2EAGiD;AACjD,iEAKgC;AAChC,6DAA4E;AAC5E,uDAAuD;AAGvD,SAAS,gBAAgB,CACvB,SAAiB,EACjB,IAAY,EACZ,IAAkC;IAElC,OAAO;QACL,IAAI;QACJ,OAAO,EAAE,+BAAe;QACxB,SAAS;QACT,MAAM,EAAE,yCAAkB,CAAC,QAAQ;QACnC,IAAI;KACL,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG;IAChB,QAAQ,EAAE,gBAAgB,CAAC,WAAW,EAAE,cAAc,EAAE,SAAS,CAAC;IAClE,qBAAqB,EAAE,gBAAgB,CACrC,0BAA0B,EAC1B,cAAc,EACd,SAAS,CACV;IACD,eAAe,EAAE,gBAAgB,CAAC,kBAAkB,EAAE,UAAU,EAAE,SAAS,CAAC;IAC5E,gBAAgB,EAAE,gBAAgB,CAChC,oBAAoB,EACpB,sBAAsB,EACtB,SAAS,CACV;IACD,aAAa,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,UAAU,EAAE,SAAS,CAAC;IACxE,YAAY,EAAE,gBAAgB,CAC5B,eAAe,EACf,sBAAsB,EACtB,SAAS,CACV;IACD,sBAAsB,EAAE,gBAAgB,CACtC,0BAA0B,EAC1B,uBAAuB,EACvB,SAAS,CACV;IACD,cAAc,EAAE,gBAAgB,CAC9B,kBAAkB,EAClB,eAAe,EACf,SAAS,CACV;IACD,aAAa,EAAE,gBAAgB,CAC7B,iBAAiB,EACjB,sBAAsB,EACtB,OAAO,CACR;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,EAAE,EAAE,EAAE,CAAC;AAC7D,CAAC;
|
|
1
|
+
{"version":3,"file":"account-notifications.js","sourceRoot":"","sources":["../../src/utils/account-notifications.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2EAGiD;AACjD,iEAKgC;AAChC,6DAA4E;AAC5E,uDAAuD;AAGvD,SAAS,gBAAgB,CACvB,SAAiB,EACjB,IAAY,EACZ,IAAkC;IAElC,OAAO;QACL,IAAI;QACJ,OAAO,EAAE,+BAAe;QACxB,SAAS;QACT,MAAM,EAAE,yCAAkB,CAAC,QAAQ;QACnC,IAAI;KACL,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG;IAChB,QAAQ,EAAE,gBAAgB,CAAC,WAAW,EAAE,cAAc,EAAE,SAAS,CAAC;IAClE,qBAAqB,EAAE,gBAAgB,CACrC,0BAA0B,EAC1B,cAAc,EACd,SAAS,CACV;IACD,eAAe,EAAE,gBAAgB,CAAC,kBAAkB,EAAE,UAAU,EAAE,SAAS,CAAC;IAC5E,gBAAgB,EAAE,gBAAgB,CAChC,oBAAoB,EACpB,sBAAsB,EACtB,SAAS,CACV;IACD,aAAa,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,UAAU,EAAE,SAAS,CAAC;IACxE,YAAY,EAAE,gBAAgB,CAC5B,eAAe,EACf,sBAAsB,EACtB,SAAS,CACV;IACD,sBAAsB,EAAE,gBAAgB,CACtC,0BAA0B,EAC1B,uBAAuB,EACvB,SAAS,CACV;IACD,cAAc,EAAE,gBAAgB,CAC9B,kBAAkB,EAClB,eAAe,EACf,SAAS,CACV;IACD,aAAa,EAAE,gBAAgB,CAC7B,iBAAiB,EACjB,sBAAsB,EACtB,OAAO,CACR;IACD,gBAAgB,EAAE,gBAAgB,CAChC,oBAAoB,EACpB,qBAAqB,EACrB,OAAO,CACR;IACD,OAAO,EAAE;QACP,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,8BAAc;QACvB,SAAS,EAAE,SAAS;QACpB,MAAM,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M,EAAE,EAAE,IAAI,EAAE,EAAE,CACrD,CAAC;AACJ,CAAC;AAUD,6BACE,MAAc,EACd,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,EAAsB;IAE1D,OAAO,IAAA,uCAAgB,EAAC,MAAM,EAAE,SAAS,CAAC,aAAa,EAAE;QACvD,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE;QACzC,cAAc,EAAE,YAAY,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,aAAa;KACxE,CAAC,CAAC;AACL,CAAC;AAcD,gCACE,MAAc,EACd,EAAE,KAAK,EAAE,aAAa,EAAyB,EAC/C,OAAe;IAEf,OAAO,IAAA,uCAAgB,EAAC,MAAM,EAAE,SAAS,CAAC,gBAAgB,EAAE;QAC1D,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE;QACzC,cAAc,EAAE,sBAAsB,OAAO,EAAE;KAChD,CAAC,CAAC;AACL,CAAC;AAED,uBAA8B,MAAc,EAAE,IAAY;IACxD,OAAO,IAAA,uCAAgB,EACrB,MAAM,EACN,SAAS,CAAC,OAAO,EACjB,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAC9D,CAAC;AACJ,CAAC"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sendEmailChangeCode = sendEmailChangeCode;
|
|
4
4
|
exports.sendEmailChangeNotice = sendEmailChangeNotice;
|
|
5
|
-
const interface_email_1 = require("@antelopejs/interface-email");
|
|
6
5
|
const html_render_1 = require("@antelopejs/interface-dms/html-render");
|
|
7
6
|
const email_subjects_1 = require("./email-subjects");
|
|
7
|
+
const html_email_1 = require("./html-email");
|
|
8
8
|
const CodeTemplate = (0, html_render_1.RegisterHtmlTemplate)("EmailChangeVerification");
|
|
9
9
|
const NoticeTemplate = (0, html_render_1.RegisterHtmlTemplate)("EmailChangeNotice");
|
|
10
10
|
async function sendOrThrow(to, subject, html) {
|
|
11
|
-
const result = await (0,
|
|
11
|
+
const result = await (0, html_email_1.sendHtmlEmail)({ to, subject, html });
|
|
12
12
|
if (!result.success) {
|
|
13
13
|
throw new Error(`Failed to send email: ${result.error?.message}`);
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-change-mail.js","sourceRoot":"","sources":["../../src/utils/email-change-mail.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"email-change-mail.js","sourceRoot":"","sources":["../../src/utils/email-change-mail.ts"],"names":[],"mappings":";;;;AACA,uEAG+C;AAC/C,qDAAuD;AACvD,6CAA6C;AAe7C,MAAM,YAAY,GAAG,IAAA,kCAAoB,EACvC,yBAAyB,CAC1B,CAAC;AACF,MAAM,cAAc,GAClB,IAAA,kCAAoB,EAAwB,mBAAmB,CAAC,CAAC;AAEnE,KAAK,UAAU,WAAW,CAAC,EAAU,EAAE,OAAe,EAAE,IAAY;IAClE,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAa,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,yBAAyB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC;AAOM,KAAK,8BACV,IAAU,EACV,QAAgB,EAChB,IAAY,EACZ,cAAsB;IAEtB,MAAM,IAAI,GAAG,MAAM,IAAA,0BAAY,EAC7B,YAAY,EACZ;QACE,QAAQ,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK;QACjC,QAAQ;QACR,IAAI;QACJ,SAAS,EAAE,GAAG,cAAc,QAAQ;QACpC,cAAc;KACf,EACD,IAAI,CAAC,QAAQ,CACd,CAAC;IACF,MAAM,WAAW,CACf,QAAQ,EACR,IAAA,oCAAmB,EAAC,yBAAyB,EAAE,IAAI,CAAC,QAAQ,CAAC,EAC7D,IAAI,CACL,CAAC;AACJ,CAAC;AAGM,KAAK,gCACV,IAAU,EACV,QAAgB;IAEhB,MAAM,IAAI,GAAG,MAAM,IAAA,0BAAY,EAC7B,cAAc,EACd,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,EAC/C,IAAI,CAAC,QAAQ,CACd,CAAC;IACF,MAAM,WAAW,CACf,IAAI,CAAC,KAAK,EACV,IAAA,oCAAmB,EAAC,mBAAmB,EAAE,IAAI,CAAC,QAAQ,CAAC,EACvD,IAAI,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function emailPlainText(html: string): string;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.emailPlainText = emailPlainText;
|
|
4
|
+
const parse5_1 = require("parse5");
|
|
5
|
+
const LINE_BREAK = "\n";
|
|
6
|
+
const PARAGRAPH_BREAK = "\n\n";
|
|
7
|
+
const SPACE = " ";
|
|
8
|
+
const UNREAD_ELEMENTS = new Set([
|
|
9
|
+
"head",
|
|
10
|
+
"img",
|
|
11
|
+
"noscript",
|
|
12
|
+
"picture",
|
|
13
|
+
"script",
|
|
14
|
+
"style",
|
|
15
|
+
"svg",
|
|
16
|
+
"template",
|
|
17
|
+
"title",
|
|
18
|
+
]);
|
|
19
|
+
const BLOCK_ELEMENTS = new Set([
|
|
20
|
+
"address",
|
|
21
|
+
"article",
|
|
22
|
+
"aside",
|
|
23
|
+
"blockquote",
|
|
24
|
+
"dd",
|
|
25
|
+
"div",
|
|
26
|
+
"dl",
|
|
27
|
+
"dt",
|
|
28
|
+
"footer",
|
|
29
|
+
"h1",
|
|
30
|
+
"h2",
|
|
31
|
+
"h3",
|
|
32
|
+
"h4",
|
|
33
|
+
"h5",
|
|
34
|
+
"h6",
|
|
35
|
+
"header",
|
|
36
|
+
"hr",
|
|
37
|
+
"li",
|
|
38
|
+
"main",
|
|
39
|
+
"ol",
|
|
40
|
+
"p",
|
|
41
|
+
"pre",
|
|
42
|
+
"section",
|
|
43
|
+
"table",
|
|
44
|
+
"td",
|
|
45
|
+
"th",
|
|
46
|
+
"tr",
|
|
47
|
+
"ul",
|
|
48
|
+
]);
|
|
49
|
+
const HIDDEN_STYLE = /(?:^|;)\s*display\s*:\s*none/i;
|
|
50
|
+
const WEB_LINK = /^https?:\/\//i;
|
|
51
|
+
const WHITESPACE_RUN = /\s+/g;
|
|
52
|
+
const BLANK_LINES = /\n{3,}/g;
|
|
53
|
+
function attributeOf(element, name) {
|
|
54
|
+
return element.attrs.find((entry) => entry.name === name)?.value ?? "";
|
|
55
|
+
}
|
|
56
|
+
function isRead(element) {
|
|
57
|
+
return (!UNREAD_ELEMENTS.has(element.tagName) &&
|
|
58
|
+
!HIDDEN_STYLE.test(attributeOf(element, "style")));
|
|
59
|
+
}
|
|
60
|
+
function linkAddress(element, label) {
|
|
61
|
+
const address = attributeOf(element, "href").trim();
|
|
62
|
+
if (element.tagName !== "a" || !WEB_LINK.test(address))
|
|
63
|
+
return "";
|
|
64
|
+
const shown = label.trim();
|
|
65
|
+
if (shown === address)
|
|
66
|
+
return "";
|
|
67
|
+
return shown === "" ? address : `: ${address}`;
|
|
68
|
+
}
|
|
69
|
+
function asBlock(element, text) {
|
|
70
|
+
return BLOCK_ELEMENTS.has(element.tagName)
|
|
71
|
+
? `${PARAGRAPH_BREAK}${text}${PARAGRAPH_BREAK}`
|
|
72
|
+
: text;
|
|
73
|
+
}
|
|
74
|
+
function readNode(node) {
|
|
75
|
+
if (parse5_1.defaultTreeAdapter.isTextNode(node)) {
|
|
76
|
+
return node.value.replaceAll(WHITESPACE_RUN, SPACE);
|
|
77
|
+
}
|
|
78
|
+
if (!parse5_1.defaultTreeAdapter.isElementNode(node) || !isRead(node))
|
|
79
|
+
return "";
|
|
80
|
+
if (node.tagName === "br")
|
|
81
|
+
return LINE_BREAK;
|
|
82
|
+
const inner = node.childNodes.map((child) => readNode(child)).join("");
|
|
83
|
+
return asBlock(node, `${inner}${linkAddress(node, inner)}`);
|
|
84
|
+
}
|
|
85
|
+
function emailPlainText(html) {
|
|
86
|
+
return (0, parse5_1.parse)(html)
|
|
87
|
+
.childNodes.map((node) => readNode(node))
|
|
88
|
+
.join("")
|
|
89
|
+
.split(LINE_BREAK)
|
|
90
|
+
.map((line) => line.trim())
|
|
91
|
+
.join(LINE_BREAK)
|
|
92
|
+
.replaceAll(BLANK_LINES, PARAGRAPH_BREAK)
|
|
93
|
+
.trim();
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=email-plain-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-plain-text.js","sourceRoot":"","sources":["../../src/utils/email-plain-text.ts"],"names":[],"mappings":";;;AAAA,mCAIgB;AAKhB,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,KAAK,GAAG,GAAG,CAAC;AAGlB,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC9B,MAAM;IACN,KAAK;IACL,UAAU;IACV,SAAS;IACT,QAAQ;IACR,OAAO;IACP,KAAK;IACL,UAAU;IACV,OAAO;CACR,CAAC,CAAC;AAGH,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,SAAS;IACT,SAAS;IACT,OAAO;IACP,YAAY;IACZ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,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require("node:path"));
|
|
22
22
|
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
23
23
|
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
24
|
-
const interface_email_1 = require("@antelopejs/interface-email");
|
|
25
24
|
const interface_file_storage_1 = require("@antelopejs/interface-file-storage");
|
|
26
25
|
const db_1 = require("@antelopejs/interface-dms/db");
|
|
27
26
|
const db_2 = require("@antelopejs/interface-dms/auth/db");
|
|
@@ -32,6 +31,7 @@ const zod_1 = require("zod");
|
|
|
32
31
|
const config_1 = require("../config");
|
|
33
32
|
const exportJobs_model_1 = require("@antelopejs/interface-dms/db/internal/exportJobs.model");
|
|
34
33
|
const email_subjects_1 = require("./email-subjects");
|
|
34
|
+
const html_email_1 = require("./html-email");
|
|
35
35
|
const run_in_batches_1 = require("./run-in-batches");
|
|
36
36
|
const export_jobs_1 = require("@antelopejs/interface-dms/base/export-jobs");
|
|
37
37
|
const time_1 = require("@antelopejs/interface-dms/utils/internal/time");
|
|
@@ -136,7 +136,7 @@ const emailDeliverer = {
|
|
|
136
136
|
const user = await (0, interface_database_decorators_1.GetModel)(db_2.UserModel).get(exportRecord.userId);
|
|
137
137
|
(0, interface_api_util_1.assert)(user, 500, "Export recipient not found");
|
|
138
138
|
const html = await (0, html_render_1.GenerateHtml)(ExportReadyTemplate, exportReadyEmailData(user, exportRecord), user.language);
|
|
139
|
-
const sent = await (0,
|
|
139
|
+
const sent = await (0, html_email_1.sendHtmlEmail)({
|
|
140
140
|
to: user.email,
|
|
141
141
|
subject: (0, email_subjects_1.builtInEmailSubject)("exportReady", user.language),
|
|
142
142
|
html,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-jobs.js","sourceRoot":"","sources":["../../src/utils/export-jobs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAuC;AACvC,sDAAyB;AACzB,sDAAyB;AACzB,0DAA6B;AAC7B,uEAAwD;AAExD,6FAAqE;AACrE
|
|
1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,MAAM,EAAE,EAAE;YACrE,IAAI,MAAM,CAAC,UAAU;gBAAE,MAAM,uBAAuB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;QACH,IAAI,OAAO,CAAC,MAAM,GAAG,sBAAsB;YAAE,MAAM;QACnD,MAAM,IAAI,sBAAsB,CAAC;IACnC,CAAC;IACD,MAAM,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC;AACnC,CAAC;AAED,SAAS,uBAAuB,CAAC,OAAe;IAC9C,OAAO,OAAO,CAAC,OAAO,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAC;AACvE,CAAC;AAED,6BAAoC,IAAY,EAAE,SAAiB;IACjE,MAAM,SAAS,GAAG,uBAAuB,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IACpE,MAAM,QAAQ,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,GAAG,QAAQ,IAAI,SAAS,IAAI,SAAS,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendHtmlEmail = sendHtmlEmail;
|
|
4
|
+
const interface_email_1 = require("@antelopejs/interface-email");
|
|
5
|
+
const email_plain_text_1 = require("./email-plain-text");
|
|
6
|
+
function sendHtmlEmail(email) {
|
|
7
|
+
return (0, interface_email_1.Send)({ ...email, text: (0, email_plain_text_1.emailPlainText)(email.html) });
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=html-email.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-email.js","sourceRoot":"","sources":["../../src/utils/html-email.ts"],"names":[],"mappings":";;;AAAA,iEAAmD;AACnD,yDAAoD;AAapD,uBAA8B,KAAgB;IAC5C,OAAO,IAAA,sBAAI,EAAC,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,IAAA,iCAAc,EAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startsWith = startsWith;
|
|
4
|
+
exports.isPng = isPng;
|
|
5
|
+
exports.isWebp = isWebp;
|
|
6
|
+
const PNG_SIGNATURE = Buffer.from([
|
|
7
|
+
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a,
|
|
8
|
+
]);
|
|
9
|
+
const RIFF_SIGNATURE = Buffer.from("RIFF");
|
|
10
|
+
const WEBP_SIGNATURE = Buffer.from("WEBP");
|
|
11
|
+
const WEBP_SIGNATURE_OFFSET = 8;
|
|
12
|
+
function startsWith(bytes, signature, offset = 0) {
|
|
13
|
+
return bytes.subarray(offset, offset + signature.length).equals(signature);
|
|
14
|
+
}
|
|
15
|
+
function isPng(bytes) {
|
|
16
|
+
return startsWith(bytes, PNG_SIGNATURE);
|
|
17
|
+
}
|
|
18
|
+
function isWebp(bytes) {
|
|
19
|
+
return (startsWith(bytes, RIFF_SIGNATURE) &&
|
|
20
|
+
startsWith(bytes, WEBP_SIGNATURE, WEBP_SIGNATURE_OFFSET));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=image-signatures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-signatures.js","sourceRoot":"","sources":["../../src/utils/image-signatures.ts"],"names":[],"mappings":";;;;;AAAA,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC;IAChC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;CAC/C,CAAC,CAAC;AACH,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC3C,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC3C,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAGhC,oBACE,KAAa,EACb,SAAiB,EACjB,MAAM,GAAG,CAAC;IAEV,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAC7E,CAAC;AAGD,eAAsB,KAAa;IACjC,OAAO,UAAU,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;AAC1C,CAAC;AAGD,gBAAuB,KAAa;IAClC,OAAO,CACL,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC;QACjC,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,qBAAqB,CAAC,CACzD,CAAC;AACJ,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -14,8 +14,10 @@ export * from "./auth-constants";
|
|
|
14
14
|
export * from "./auth-key";
|
|
15
15
|
export * from "./client-ip";
|
|
16
16
|
export * from "./email-change-mail";
|
|
17
|
+
export * from "./email-plain-text";
|
|
17
18
|
export * from "./email-subjects";
|
|
18
19
|
export * from "./failed-sign-ins";
|
|
20
|
+
export * from "./html-email";
|
|
19
21
|
export * from "./jwt-claims";
|
|
20
22
|
export * from "./login-throttle";
|
|
21
23
|
export * from "./notification-emitter";
|
package/dist/utils/index.js
CHANGED
|
@@ -30,8 +30,10 @@ __exportStar(require("./auth-constants"), exports);
|
|
|
30
30
|
__exportStar(require("./auth-key"), exports);
|
|
31
31
|
__exportStar(require("./client-ip"), exports);
|
|
32
32
|
__exportStar(require("./email-change-mail"), exports);
|
|
33
|
+
__exportStar(require("./email-plain-text"), exports);
|
|
33
34
|
__exportStar(require("./email-subjects"), exports);
|
|
34
35
|
__exportStar(require("./failed-sign-ins"), exports);
|
|
36
|
+
__exportStar(require("./html-email"), exports);
|
|
35
37
|
__exportStar(require("./jwt-claims"), exports);
|
|
36
38
|
__exportStar(require("./login-throttle"), exports);
|
|
37
39
|
__exportStar(require("./notification-emitter"), exports);
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,gDAA8B;AAC9B,oDAAkC;AAClC,mDAAiC;AACjC,0DAAwC;AACxC,wFAAsE;AACtE,gFAA8D;AAC9D,wFAAsE;AACtE,qDAAmC;AACnC,0DAAwC;AACxC,uDAAqC;AACrC,oDAAkC;AAClC,mDAAiC;AACjC,6CAA2B;AAC3B,8CAA4B;AAC5B,sDAAoC;AACpC,mDAAiC;AACjC,oDAAkC;AAClC,+CAA6B;AAC7B,mDAAiC;AACjC,yDAAuC;AACvC,0DAAwC;AACxC,uDAAqC;AACrC,uDAAqC;AACrC,kDAAgC;AAChC,oDAAkC;AAClC,gDAA8B;AAC9B,+DAA6C;AAC7C,8CAA4B;AAC5B,8DAA4C;AAC5C,oDAAkC;AAClC,oDAAkC;AAClC,qDAAmC;AACnC,uDAAqC;AACrC,iDAA+B;AAC/B,kDAAgC;AAChC,+CAA6B;AAC7B,+CAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,gDAA8B;AAC9B,oDAAkC;AAClC,mDAAiC;AACjC,0DAAwC;AACxC,wFAAsE;AACtE,gFAA8D;AAC9D,wFAAsE;AACtE,qDAAmC;AACnC,0DAAwC;AACxC,uDAAqC;AACrC,oDAAkC;AAClC,mDAAiC;AACjC,6CAA2B;AAC3B,8CAA4B;AAC5B,sDAAoC;AACpC,qDAAmC;AACnC,mDAAiC;AACjC,oDAAkC;AAClC,+CAA6B;AAC7B,+CAA6B;AAC7B,mDAAiC;AACjC,yDAAuC;AACvC,0DAAwC;AACxC,uDAAqC;AACrC,uDAAqC;AACrC,kDAAgC;AAChC,oDAAkC;AAClC,gDAA8B;AAC9B,+DAA6C;AAC7C,8CAA4B;AAC5B,8DAA4C;AAC5C,oDAAkC;AAClC,oDAAkC;AAClC,qDAAmC;AACnC,uDAAqC;AACrC,iDAA+B;AAC/B,kDAAgC;AAChC,+CAA6B;AAC7B,+CAA6B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startKeepalive = void 0;
|
|
4
|
+
const SSE_KEEPALIVE_INTERVAL_MS = 20_000;
|
|
5
|
+
const KEEPALIVE_FRAME = ": keepalive\n\n";
|
|
6
|
+
const startKeepalive = (writer) => setInterval(() => writer.write(KEEPALIVE_FRAME), SSE_KEEPALIVE_INTERVAL_MS);
|
|
7
|
+
exports.startKeepalive = startKeepalive;
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/sse-keepalive/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,yBAAyB,GAAG,MAAM,CAAC;AACzC,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAOnC,MAAM,cAAc,GAAG,CAAC,MAE9B,EAAkB,EAAE,CACnB,WAAW,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,yBAAyB,CAAC,CAAC;AAHjE,QAAA,cAAc,GAAd,cAAc,CAGmD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.allowedKeysError = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const allowedKeysError = (issue) => {
|
|
6
|
+
if (issue.code !== "unrecognized_keys")
|
|
7
|
+
return undefined;
|
|
8
|
+
if (!(issue.inst instanceof zod_1.z.core.$ZodObject))
|
|
9
|
+
return undefined;
|
|
10
|
+
const written = issue.keys.map((key) => `"${key}"`).join(", ");
|
|
11
|
+
const allowed = Object.keys(issue.inst._zod.def.shape).join(", ");
|
|
12
|
+
const noun = issue.keys.length === 1 ? "key" : "keys";
|
|
13
|
+
return `Unrecognized ${noun}: ${written}; the keys are ${allowed}`;
|
|
14
|
+
};
|
|
15
|
+
exports.allowedKeysError = allowedKeysError;
|
|
16
|
+
//# sourceMappingURL=allowed-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowed-keys.js","sourceRoot":"","sources":["../../src/validation/allowed-keys.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAOjB,MAAM,gBAAgB,GAAwB,CAAC,KAAK,EAAE,EAAE;IAC7D,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAmB;QAAE,OAAO,SAAS,CAAC;IACzD,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,YAAY,OAAC,CAAC,IAAI,CAAC,UAAU,CAAC;QAAE,OAAO,SAAS,CAAC;IACjE,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClE,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;IACtD,OAAO,gBAAgB,IAAI,KAAK,OAAO,kBAAkB,OAAO,EAAE,CAAC;AACrE,CAAC,CAAC;AAPW,QAAA,gBAAgB,GAAhB,gBAAgB,CAO3B"}
|
package/dist/validation/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./account-deletion.schema"), exports);
|
|
18
|
+
__exportStar(require("./allowed-keys"), exports);
|
|
18
19
|
__exportStar(require("./auth.schema"), exports);
|
|
19
20
|
__exportStar(require("./file.schema"), exports);
|
|
20
21
|
__exportStar(require("./issue-message"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,gDAA8B;AAC9B,gDAA8B;AAC9B,kDAAgC;AAChC,yDAAuC;AACvC,4DAA0C;AAC1C,qEAAmD;AACnD,gEAA8C;AAC9C,uDAAqC;AACrC,oDAAkC;AAClC,iDAA+B;AAC/B,yEAAuD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,iDAA+B;AAC/B,gDAA8B;AAC9B,gDAA8B;AAC9B,kDAAgC;AAChC,yDAAuC;AACvC,4DAA0C;AAC1C,qEAAmD;AACnD,gEAA8C;AAC9C,uDAAqC;AACrC,oDAAkC;AAClC,iDAA+B;AAC/B,yEAAuD"}
|
|
@@ -168,10 +168,10 @@ computeResetState createActionValidator createFieldValueComparer
|
|
|
168
168
|
createTableViewDeleteShortcut createTableViewEscapeShortcut
|
|
169
169
|
createTableViewMetaRShortcut createTableViewShiftAShortcut
|
|
170
170
|
createTableViewShiftFShortcut createTableViewShiftNShortcut
|
|
171
|
-
createTrailingDeduper currentRegionalPreferences describeApiError
|
|
171
|
+
createTrailingDeduper crumbLabel currentRegionalPreferences describeApiError
|
|
172
172
|
describeFieldErrors detectDatetimeBuckets detectKeyboardPlatform
|
|
173
173
|
dispatchQuickActionTarget distributionMap downloadFile ensureApexLocale
|
|
174
|
-
evaluateRowActionRule extractRouteParams fieldErrorId
|
|
174
|
+
evaluateRowActionRule extractRouteParams fieldErrorId fieldErrorMessage
|
|
175
175
|
fieldValuesOfSubmitDefaults fillRouteParams findCascaderNode
|
|
176
176
|
findNavigableCategory findPageRoute firstAccessiblePagePath
|
|
177
177
|
flattenCascaderTree focusFirstFormError foldBreadcrumb formIssueMessage
|
|
@@ -7,6 +7,7 @@ import AuthFormAlert from "../../build/components/AuthFormAlert.vue";
|
|
|
7
7
|
import { useAuthFormError } from "../../build/composables/useAuthFormError";
|
|
8
8
|
import { AUTH_LINK_CLASS } from "../../build/utils/authStyles";
|
|
9
9
|
import { codeEntryError } from "#dms-core/app/composables/useFormValidation";
|
|
10
|
+
import { useHydrated } from "#dms-core/app/entries/composables/useHydrated";
|
|
10
11
|
|
|
11
12
|
type TwoFactorMethod = "totp" | "email";
|
|
12
13
|
|
|
@@ -16,6 +17,7 @@ const route = useDmsRoute();
|
|
|
16
17
|
const { processApiMessage } = useTranslation();
|
|
17
18
|
const { formError, showFormError, clearFormError, showError } =
|
|
18
19
|
useAuthFormError();
|
|
20
|
+
const hydrated = useHydrated();
|
|
19
21
|
|
|
20
22
|
const token = computed(() => route.query.token || "");
|
|
21
23
|
const availableMethods = computed(() =>
|
|
@@ -171,6 +173,7 @@ function switchMethod(method: TwoFactorMethod) {
|
|
|
171
173
|
/>
|
|
172
174
|
<UButton
|
|
173
175
|
:loading="isLoading"
|
|
176
|
+
:disabled="!hydrated"
|
|
174
177
|
:label="$t('page.2fa.verify')"
|
|
175
178
|
type="submit"
|
|
176
179
|
size="lg"
|
|
@@ -15,10 +15,12 @@ import {
|
|
|
15
15
|
useLiveFormErrors,
|
|
16
16
|
useLocalizedSchema,
|
|
17
17
|
} from "#dms-core/app/composables/useFormValidation";
|
|
18
|
+
import { useHydrated } from "#dms-core/app/entries/composables/useHydrated";
|
|
18
19
|
|
|
19
20
|
const route = useDmsRoute();
|
|
20
21
|
const { formError, clearFormError, showError } = useAuthFormError();
|
|
21
22
|
const form = useTemplateRef<AuthFormHandle>("form");
|
|
23
|
+
const hydrated = useHydrated();
|
|
22
24
|
|
|
23
25
|
const token = computed(() => route.query.token || "");
|
|
24
26
|
|
|
@@ -111,6 +113,7 @@ async function onSubmit(payload: FormSubmitEvent<Schema>) {
|
|
|
111
113
|
|
|
112
114
|
<UButton
|
|
113
115
|
:loading="isLoading"
|
|
116
|
+
:disabled="!hydrated"
|
|
114
117
|
:label="$t('page.2fa.verify')"
|
|
115
118
|
type="submit"
|
|
116
119
|
size="lg"
|
|
@@ -8,6 +8,7 @@ import AuthFormAlert from "../../build/components/AuthFormAlert.vue";
|
|
|
8
8
|
import AuthResendCode from "../../build/components/AuthResendCode.vue";
|
|
9
9
|
import { useAuthFormError } from "../../build/composables/useAuthFormError";
|
|
10
10
|
import { codeEntryError } from "#dms-core/app/composables/useFormValidation";
|
|
11
|
+
import { useHydrated } from "#dms-core/app/entries/composables/useHydrated";
|
|
11
12
|
|
|
12
13
|
const route = useDmsRoute();
|
|
13
14
|
const { processApiMessage } = useTranslation();
|
|
@@ -17,6 +18,7 @@ const dmsApp = useDmsApp();
|
|
|
17
18
|
const { $authFetch } = useAuthFetch();
|
|
18
19
|
const { formError, showFormError, clearFormError, showError } =
|
|
19
20
|
useAuthFormError();
|
|
21
|
+
const hydrated = useHydrated();
|
|
20
22
|
|
|
21
23
|
if (!route.query.email) {
|
|
22
24
|
throw createDmsError({
|
|
@@ -178,6 +180,7 @@ async function requestForgotPassword() {
|
|
|
178
180
|
|
|
179
181
|
<UButton
|
|
180
182
|
:loading="isLoading"
|
|
183
|
+
:disabled="!hydrated"
|
|
181
184
|
:label="$t('page.forgot.reset_button')"
|
|
182
185
|
type="submit"
|
|
183
186
|
size="lg"
|
|
@@ -14,11 +14,13 @@ import {
|
|
|
14
14
|
useLiveFormErrors,
|
|
15
15
|
useLocalizedSchema,
|
|
16
16
|
} from "#dms-core/app/composables/useFormValidation";
|
|
17
|
+
import { useHydrated } from "#dms-core/app/entries/composables/useHydrated";
|
|
17
18
|
|
|
18
19
|
const { $authFetch } = useAuthFetch();
|
|
19
20
|
const dmsApp = useDmsApp();
|
|
20
21
|
const { formError, clearFormError, showError } = useAuthFormError();
|
|
21
22
|
const form = useTemplateRef<AuthFormHandle>("form");
|
|
23
|
+
const hydrated = useHydrated();
|
|
22
24
|
|
|
23
25
|
const isLoading = ref(false);
|
|
24
26
|
|
|
@@ -90,6 +92,7 @@ async function onSubmit(event: FormSubmitEvent<Schema>) {
|
|
|
90
92
|
|
|
91
93
|
<UButton
|
|
92
94
|
:loading="isLoading"
|
|
95
|
+
:disabled="!hydrated"
|
|
93
96
|
:label="$t('page.forgot.send_code')"
|
|
94
97
|
type="submit"
|
|
95
98
|
size="lg"
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
import { ACCOUNTS_LIST_ROUTE } from "../../utils/accountsFlow";
|
|
19
19
|
import { noWorkspaceRoute } from "../../build/utils/noWorkspaceRoute";
|
|
20
20
|
import { isObject } from "#dms-core/app/utils/type-check";
|
|
21
|
+
import { useHydrated } from "#dms-core/app/entries/composables/useHydrated";
|
|
21
22
|
|
|
22
23
|
const route = useDmsRoute();
|
|
23
24
|
const homepage = useHomepage();
|
|
@@ -26,6 +27,7 @@ const { metaTitle } = useSystemState();
|
|
|
26
27
|
const { links: extraLinks } = useAuthLinks("login");
|
|
27
28
|
const { formError, clearFormError, showError } = useAuthFormError();
|
|
28
29
|
const form = useTemplateRef<AuthFormHandle>("form");
|
|
30
|
+
const hydrated = useHydrated();
|
|
29
31
|
|
|
30
32
|
useOAuthErrorToast();
|
|
31
33
|
|
|
@@ -181,7 +183,7 @@ async function onSubmit(payload: FormSubmitEvent<Schema>) {
|
|
|
181
183
|
/>
|
|
182
184
|
</UFormField>
|
|
183
185
|
|
|
184
|
-
<UFormField
|
|
186
|
+
<UFormField>
|
|
185
187
|
<UCheckbox
|
|
186
188
|
v-model="state.keep_login"
|
|
187
189
|
:label="$t('page.auth.keep_login')"
|
|
@@ -191,6 +193,7 @@ async function onSubmit(payload: FormSubmitEvent<Schema>) {
|
|
|
191
193
|
<div class="grid gap-2">
|
|
192
194
|
<UButton
|
|
193
195
|
:loading="isLoading"
|
|
196
|
+
:disabled="!hydrated"
|
|
194
197
|
:label="$t('button.login')"
|
|
195
198
|
type="submit"
|
|
196
199
|
size="lg"
|
|
@@ -15,12 +15,14 @@ import {
|
|
|
15
15
|
useLiveFormErrors,
|
|
16
16
|
useLocalizedSchema,
|
|
17
17
|
} from "#dms-core/app/composables/useFormValidation";
|
|
18
|
+
import { useHydrated } from "#dms-core/app/entries/composables/useHydrated";
|
|
18
19
|
|
|
19
20
|
const route = useDmsRoute();
|
|
20
21
|
const dmsApp = useDmsApp();
|
|
21
22
|
const { $authFetch } = useAuthFetch();
|
|
22
23
|
const { formError, clearFormError, showError } = useAuthFormError();
|
|
23
24
|
const form = useTemplateRef<AuthFormHandle>("form");
|
|
25
|
+
const hydrated = useHydrated();
|
|
24
26
|
|
|
25
27
|
if (!route.query.token || !route.query.email) {
|
|
26
28
|
throw createDmsError({
|
|
@@ -93,6 +95,7 @@ async function onSubmit(event: FormSubmitEvent<Schema>) {
|
|
|
93
95
|
<UButton
|
|
94
96
|
:label="$t('page.recover.submit')"
|
|
95
97
|
:loading="isLoading"
|
|
98
|
+
:disabled="!hydrated"
|
|
96
99
|
type="submit"
|
|
97
100
|
size="lg"
|
|
98
101
|
class="justify-center"
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
} from "#dms-core/app/composables/useFormValidation";
|
|
18
18
|
import { resolveApiErrorMessage } from "#dms-core/app/composables/resolveApiError";
|
|
19
19
|
import { isString } from "#dms-core/app/utils/type-check";
|
|
20
|
+
import { useHydrated } from "#dms-core/app/entries/composables/useHydrated";
|
|
20
21
|
|
|
21
22
|
const MIN_NAME_LENGTH = 2;
|
|
22
23
|
|
|
@@ -84,6 +85,7 @@ const homepage = useHomepage();
|
|
|
84
85
|
const dmsApp = useDmsApp();
|
|
85
86
|
const { formError, clearFormError, showError } = useAuthFormError();
|
|
86
87
|
const form = useTemplateRef<AuthFormHandle>("form");
|
|
88
|
+
const hydrated = useHydrated();
|
|
87
89
|
|
|
88
90
|
const route = useDmsRoute();
|
|
89
91
|
const queryToken = computed(() => route.query.token);
|
|
@@ -94,8 +96,19 @@ const hasInvitationToken = computed(
|
|
|
94
96
|
() => isString(queryToken.value) && queryToken.value !== "",
|
|
95
97
|
);
|
|
96
98
|
|
|
99
|
+
/**
|
|
100
|
+
* The registration consumed the invitation: the check reads nothing more.
|
|
101
|
+
* The sign-in that follows it moves the data to the new account's scope,
|
|
102
|
+
* which reads every open request again, and this one would answer that the
|
|
103
|
+
* invitation is used.
|
|
104
|
+
*/
|
|
105
|
+
const isRegistered = ref(false);
|
|
106
|
+
|
|
97
107
|
const invitationCheck = useApiData(
|
|
98
|
-
() =>
|
|
108
|
+
() =>
|
|
109
|
+
hasInvitationToken.value && !isRegistered.value
|
|
110
|
+
? "/api/auth/validate-invite-token"
|
|
111
|
+
: null,
|
|
99
112
|
{
|
|
100
113
|
method: "POST",
|
|
101
114
|
body: () => ({ token: queryToken.value, email: queryEmail.value }),
|
|
@@ -106,6 +119,7 @@ const closedOnSignup = ref<ClosedInvitation>();
|
|
|
106
119
|
const invitationState = computed<InvitationState>(() => {
|
|
107
120
|
if (!hasInvitationToken.value) return "invalid";
|
|
108
121
|
if (closedOnSignup.value) return closedOnSignup.value;
|
|
122
|
+
if (isRegistered.value) return "open";
|
|
109
123
|
const { status, error } = invitationCheck;
|
|
110
124
|
if (status.value === "idle" || status.value === "pending") return "checking";
|
|
111
125
|
return error.value ? (closedInvitationOf(error.value) ?? "open") : "open";
|
|
@@ -157,6 +171,7 @@ async function onSubmit(payload: FormSubmitEvent<Schema>) {
|
|
|
157
171
|
token: queryToken.value,
|
|
158
172
|
},
|
|
159
173
|
});
|
|
174
|
+
isRegistered.value = true;
|
|
160
175
|
|
|
161
176
|
await dmsApp.runWithContext(() =>
|
|
162
177
|
usePostLoginRedirect(
|
|
@@ -255,6 +270,7 @@ async function onSubmit(payload: FormSubmitEvent<Schema>) {
|
|
|
255
270
|
<UButton
|
|
256
271
|
:label="$t('page.signup.submit')"
|
|
257
272
|
:loading="isLoading"
|
|
273
|
+
:disabled="!hydrated"
|
|
258
274
|
type="submit"
|
|
259
275
|
size="lg"
|
|
260
276
|
class="justify-center"
|