@sync-in/server 1.7.0 → 1.8.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/CHANGELOG.md +173 -58
- package/environment/environment.dist.yaml +6 -3
- package/migrations/0003_giant_luckman.sql +6 -0
- package/migrations/meta/0003_snapshot.json +2463 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +19 -17
- package/server/app.bootstrap.js +5 -2
- package/server/app.bootstrap.js.map +1 -1
- package/server/app.constants.js +0 -4
- package/server/app.constants.js.map +1 -1
- package/server/app.service.js +7 -6
- package/server/app.service.js.map +1 -1
- package/server/applications/files/constants/only-office.js +12 -0
- package/server/applications/files/constants/only-office.js.map +1 -1
- package/server/applications/files/files.config.js +5 -0
- package/server/applications/files/files.config.js.map +1 -1
- package/server/applications/files/files.controller.js +12 -4
- package/server/applications/files/files.controller.js.map +1 -1
- package/server/applications/files/files.controller.spec.js +18 -4
- package/server/applications/files/files.controller.spec.js.map +1 -1
- package/server/applications/files/services/files-content-manager.service.js +6 -6
- package/server/applications/files/services/files-content-manager.service.js.map +1 -1
- package/server/applications/files/services/files-manager.service.js +4 -4
- package/server/applications/files/services/files-manager.service.js.map +1 -1
- package/server/applications/files/services/files-methods.service.js +4 -7
- package/server/applications/files/services/files-methods.service.js.map +1 -1
- package/server/applications/files/services/files-only-office-manager.service.js +2 -2
- package/server/applications/files/services/files-only-office-manager.service.js.map +1 -1
- package/server/applications/files/services/files-parser.service.js +6 -3
- package/server/applications/files/services/files-parser.service.js.map +1 -1
- package/server/applications/files/services/files-scheduler.service.js +51 -3
- package/server/applications/files/services/files-scheduler.service.js.map +1 -1
- package/server/applications/files/services/files-search-manager.service.js +4 -0
- package/server/applications/files/services/files-search-manager.service.js.map +1 -1
- package/server/applications/files/utils/doc-textify/adapters/pdf.js +6 -8
- package/server/applications/files/utils/doc-textify/adapters/pdf.js.map +1 -1
- package/server/applications/notifications/i18n/de.js +56 -0
- package/server/applications/notifications/i18n/de.js.map +1 -0
- package/server/applications/notifications/i18n/es.js +52 -0
- package/server/applications/notifications/i18n/es.js.map +1 -0
- package/server/applications/notifications/i18n/hi.js +52 -0
- package/server/applications/notifications/i18n/hi.js.map +1 -0
- package/server/applications/notifications/i18n/index.js +73 -8
- package/server/applications/notifications/i18n/index.js.map +1 -1
- package/server/applications/notifications/i18n/it.js +52 -0
- package/server/applications/notifications/i18n/it.js.map +1 -0
- package/server/applications/notifications/i18n/ja.js +52 -0
- package/server/applications/notifications/i18n/ja.js.map +1 -0
- package/server/applications/notifications/i18n/ko.js +52 -0
- package/server/applications/notifications/i18n/ko.js.map +1 -0
- package/server/applications/notifications/i18n/pl.js +52 -0
- package/server/applications/notifications/i18n/pl.js.map +1 -0
- package/server/applications/notifications/i18n/pt.js +52 -0
- package/server/applications/notifications/i18n/pt.js.map +1 -0
- package/server/applications/notifications/i18n/pt_br.js +52 -0
- package/server/applications/notifications/i18n/pt_br.js.map +1 -0
- package/server/applications/notifications/i18n/ru.js +52 -0
- package/server/applications/notifications/i18n/ru.js.map +1 -0
- package/server/applications/notifications/i18n/tr.js +52 -0
- package/server/applications/notifications/i18n/tr.js.map +1 -0
- package/server/applications/notifications/i18n/zh.js +52 -0
- package/server/applications/notifications/i18n/zh.js.map +1 -0
- package/server/applications/notifications/mails/models.js +6 -7
- package/server/applications/notifications/mails/models.js.map +1 -1
- package/server/applications/notifications/services/notifications-manager.service.js.map +1 -1
- package/server/applications/shares/dto/create-or-update-share.dto.js +11 -0
- package/server/applications/shares/dto/create-or-update-share.dto.js.map +1 -1
- package/server/applications/shares/interfaces/share-props.interface.js.map +1 -1
- package/server/applications/shares/schemas/share.interface.js.map +1 -1
- package/server/applications/shares/schemas/shares.schema.js +9 -0
- package/server/applications/shares/schemas/shares.schema.js.map +1 -1
- package/server/applications/shares/services/shares-manager.service.js +46 -17
- package/server/applications/shares/services/shares-manager.service.js.map +1 -1
- package/server/applications/shares/services/shares-queries.service.js +24 -5
- package/server/applications/shares/services/shares-queries.service.js.map +1 -1
- package/server/applications/spaces/constants/cache.js +4 -0
- package/server/applications/spaces/constants/cache.js.map +1 -1
- package/server/applications/spaces/dto/create-or-update-space.dto.js +5 -0
- package/server/applications/spaces/dto/create-or-update-space.dto.js.map +1 -1
- package/server/applications/spaces/guards/space.guard.js +3 -3
- package/server/applications/spaces/guards/space.guard.js.map +1 -1
- package/server/applications/spaces/models/space-props.model.js.map +1 -1
- package/server/applications/spaces/models/space.model.js.map +1 -1
- package/server/applications/spaces/schemas/space.interface.js.map +1 -1
- package/server/applications/spaces/schemas/spaces.schema.js +1 -0
- package/server/applications/spaces/schemas/spaces.schema.js.map +1 -1
- package/server/applications/spaces/services/spaces-browser.service.js.map +1 -1
- package/server/applications/spaces/services/spaces-manager.service.js +34 -31
- package/server/applications/spaces/services/spaces-manager.service.js.map +1 -1
- package/server/applications/spaces/services/spaces-queries.service.js +23 -7
- package/server/applications/spaces/services/spaces-queries.service.js.map +1 -1
- package/server/applications/spaces/services/spaces-scheduler.service.js +21 -20
- package/server/applications/spaces/services/spaces-scheduler.service.js.map +1 -1
- package/server/applications/spaces/spaces.controller.js +4 -2
- package/server/applications/spaces/spaces.controller.js.map +1 -1
- package/server/applications/spaces/utils/paths.js +14 -16
- package/server/applications/spaces/utils/paths.js.map +1 -1
- package/server/applications/sync/services/sync-manager.service.js +4 -3
- package/server/applications/sync/services/sync-manager.service.js.map +1 -1
- package/server/applications/sync/services/sync-paths-manager.service.js +1 -1
- package/server/applications/sync/services/sync-paths-manager.service.js.map +1 -1
- package/server/applications/sync/services/sync-paths-manager.service.spec.js +1 -1
- package/server/applications/sync/services/sync-paths-manager.service.spec.js.map +1 -1
- package/server/applications/sync/sync.controller.js +2 -1
- package/server/applications/sync/sync.controller.js.map +1 -1
- package/server/applications/users/constants/routes.js +5 -0
- package/server/applications/users/constants/routes.js.map +1 -1
- package/server/applications/users/constants/user.js +0 -16
- package/server/applications/users/constants/user.js.map +1 -1
- package/server/applications/users/dto/user-properties.dto.js +10 -0
- package/server/applications/users/dto/user-properties.dto.js.map +1 -1
- package/server/applications/users/models/user.model.js.map +1 -1
- package/server/applications/users/schemas/user.interface.js.map +1 -1
- package/server/applications/users/schemas/users.schema.js +3 -2
- package/server/applications/users/schemas/users.schema.js.map +1 -1
- package/server/applications/users/services/admin-users-manager.service.js +1 -0
- package/server/applications/users/services/admin-users-manager.service.js.map +1 -1
- package/server/applications/users/services/admin-users-manager.service.spec.js +2 -1
- package/server/applications/users/services/admin-users-manager.service.spec.js.map +1 -1
- package/server/applications/users/services/users-manager.service.js +7 -2
- package/server/applications/users/services/users-manager.service.js.map +1 -1
- package/server/applications/users/services/users-manager.service.spec.js +1 -0
- package/server/applications/users/services/users-manager.service.spec.js.map +1 -1
- package/server/applications/users/services/users-queries.service.js +18 -4
- package/server/applications/users/services/users-queries.service.js.map +1 -1
- package/server/applications/users/users.controller.js +15 -0
- package/server/applications/users/users.controller.js.map +1 -1
- package/server/applications/users/users.gateway.js +6 -0
- package/server/applications/users/users.gateway.js.map +1 -1
- package/server/applications/users/utils/test.js +2 -2
- package/server/applications/users/utils/test.js.map +1 -1
- package/server/applications/webdav/constants/routes.js +2 -2
- package/server/applications/webdav/constants/routes.js.map +1 -1
- package/server/applications/webdav/constants/webdav.js +2 -2
- package/server/applications/webdav/constants/webdav.js.map +1 -1
- package/server/applications/webdav/filters/webdav.filter.js +2 -2
- package/server/applications/webdav/filters/webdav.filter.js.map +1 -1
- package/server/applications/webdav/filters/webdav.filter.spec.js +2 -2
- package/server/applications/webdav/filters/webdav.filter.spec.js.map +1 -1
- package/server/applications/webdav/services/webdav-methods.service.js +3 -2
- package/server/applications/webdav/services/webdav-methods.service.js.map +1 -1
- package/server/applications/webdav/utils/webdav.js +1 -2
- package/server/applications/webdav/utils/webdav.js.map +1 -1
- package/server/authentication/auth.config.js +2 -2
- package/server/authentication/auth.config.js.map +1 -1
- package/server/authentication/guards/auth-basic.strategy.js +2 -2
- package/server/authentication/guards/auth-basic.strategy.js.map +1 -1
- package/server/common/i18n.js +52 -0
- package/server/common/i18n.js.map +1 -0
- package/server/common/image.js +63 -43
- package/server/common/image.js.map +1 -1
- package/server/common/interfaces.js.map +1 -1
- package/server/common/shared.js +5 -2
- package/server/common/shared.js.map +1 -1
- package/server/configuration/config.validation.js +3 -3
- package/server/configuration/config.validation.js.map +1 -1
- package/server/infrastructure/cache/adapters/mysql-cache.adapter.js +8 -6
- package/server/infrastructure/cache/adapters/mysql-cache.adapter.js.map +1 -1
- package/server/infrastructure/cache/adapters/redis-cache.adapter.js +22 -17
- package/server/infrastructure/cache/adapters/redis-cache.adapter.js.map +1 -1
- package/server/infrastructure/cache/cache.e2e-spec.js +1 -0
- package/server/infrastructure/cache/cache.e2e-spec.js.map +1 -1
- package/server/infrastructure/cache/cache.module.js +1 -14
- package/server/infrastructure/cache/cache.module.js.map +1 -1
- package/server/infrastructure/cache/services/cache.service.js.map +1 -1
- package/server/infrastructure/database/database.module.js +20 -1
- package/server/infrastructure/database/database.module.js.map +1 -1
- package/server/infrastructure/database/utils.js +48 -0
- package/server/infrastructure/database/utils.js.map +1 -1
- package/server/infrastructure/scheduler/scheduler.module.js +1 -1
- package/server/infrastructure/scheduler/scheduler.module.js.map +1 -1
- package/server/infrastructure/websocket/adapters/cluster.adapter.js +1 -3
- package/server/infrastructure/websocket/adapters/cluster.adapter.js.map +1 -1
- package/static/3rdpartylicenses.txt +137 -163
- package/static/chunk-2KLC4T2Z.js +1 -0
- package/static/chunk-2VMSXRCB.js +12 -0
- package/static/chunk-3GMLWAFZ.js +1 -0
- package/static/chunk-3OHSRRKH.js +4 -0
- package/static/chunk-3R4WKOHQ.js +1 -0
- package/static/{chunk-7ITZXYYJ.js → chunk-3R74L4UU.js} +1 -1
- package/static/chunk-3XVM35O2.js +1 -0
- package/static/chunk-3YVRP3VM.js +2 -0
- package/static/chunk-5NMSIIQB.js +1 -0
- package/static/chunk-5UKZLU5H.js +1 -0
- package/static/chunk-AF24EYXU.js +1 -0
- package/static/chunk-AKQVEHO6.js +2 -0
- package/static/chunk-BCVX464U.js +2 -0
- package/static/chunk-BQV4FRM6.js +1 -0
- package/static/{chunk-EVIE5F2U.js → chunk-CETH7UYS.js} +1 -1
- package/static/chunk-CHJ64RJM.js +1 -0
- package/static/chunk-DIT6W7VM.js +562 -0
- package/static/chunk-DKSEQTMX.js +1 -0
- package/static/chunk-DM4NXKEP.js +1 -0
- package/static/chunk-DPUVSXRB.js +1 -0
- package/static/chunk-DSWEWLXJ.js +1 -0
- package/static/chunk-FJE6BOFL.js +1 -0
- package/static/chunk-FZ3JPGYZ.js +1 -0
- package/static/chunk-IQSKQXC3.js +1 -0
- package/static/chunk-ITUFI2BJ.js +1 -0
- package/static/chunk-JPT5WEAT.js +1 -0
- package/static/chunk-LCTZJ537.js +1 -0
- package/static/chunk-LK2UCQJ6.js +1 -0
- package/static/chunk-LNTUR3GU.js +1 -0
- package/static/chunk-LP5TBXEN.js +7 -0
- package/static/{chunk-IPAC4VAF.js → chunk-LVSNIS5P.js} +1 -1
- package/static/{chunk-SIPE37PA.js → chunk-MTVSJTIW.js} +1 -1
- package/static/chunk-N3U6637P.js +1 -0
- package/static/chunk-NNV4OXSB.js +1 -0
- package/static/chunk-O6FYXVHI.js +1 -0
- package/static/chunk-OOGP4WSH.js +2 -0
- package/static/chunk-PB4AIT7O.js +1 -0
- package/static/chunk-PCWDQPOM.js +2 -0
- package/static/chunk-PNR6M34W.js +1 -0
- package/static/chunk-PVDHBQRM.js +1 -0
- package/static/chunk-Q5KM7LTX.js +1 -0
- package/static/chunk-QHC6ZPQ4.js +1 -0
- package/static/chunk-QMRBZHE4.js +1 -0
- package/static/chunk-QO6BTONN.js +1 -0
- package/static/chunk-QSJRY3TF.js +1 -0
- package/static/chunk-QUUIRSYT.js +1 -0
- package/static/chunk-RFH46UW3.js +1 -0
- package/static/{chunk-PTGDOWV3.js → chunk-RSXHRKM5.js} +1 -1
- package/static/chunk-RV3VZJPZ.js +1 -0
- package/static/{chunk-QNJFQVYI.js → chunk-S7HNXVRB.js} +1 -1
- package/static/chunk-SBZ572Q4.js +2 -0
- package/static/chunk-SJR5R3Y4.js +1 -0
- package/static/chunk-SLHTEGRU.js +1 -0
- package/static/{chunk-SH5EVL4E.js → chunk-SSFF27P2.js} +1 -1
- package/static/chunk-UNCPXHHT.js +1 -0
- package/static/chunk-URHTCJ7G.js +1 -0
- package/static/chunk-V3LHHZYN.js +1 -0
- package/static/{chunk-DJYJ66UF.js → chunk-VJTXJ43D.js} +1 -1
- package/static/chunk-VQQKMY2C.js +1 -0
- package/static/{chunk-IQOALFYU.js → chunk-WSSU2HXE.js} +1 -1
- package/static/chunk-XDZGW64M.js +3 -0
- package/static/chunk-XTRDKGKG.js +1 -0
- package/static/chunk-YLWTEC3X.js +1 -0
- package/static/chunk-Z5J5F5SX.js +1 -0
- package/static/chunk-ZIJQRARU.js +1 -0
- package/static/index.html +2 -2
- package/static/main-4H5BJY3J.js +9 -0
- package/static/scripts-WRDOQIU5.js +24 -0
- package/static/{styles-A5VYX3CE.css → styles-2C2UNCNB.css} +1 -1
- package/server/applications/spaces/interfaces/space-quota.interface.js +0 -10
- package/server/applications/spaces/interfaces/space-quota.interface.js.map +0 -1
- package/static/chunk-22EANI6R.js +0 -1
- package/static/chunk-3GFGJYMK.js +0 -1
- package/static/chunk-4YGJGZZZ.js +0 -1
- package/static/chunk-5K7HEX3C.js +0 -27
- package/static/chunk-5KLMS6A4.js +0 -1
- package/static/chunk-ATP3BFHV.js +0 -562
- package/static/chunk-BB4G55KE.js +0 -1
- package/static/chunk-EWKSX76T.js +0 -1
- package/static/chunk-FHLACA7V.js +0 -1
- package/static/chunk-GCATNU55.js +0 -1
- package/static/chunk-GYODPCIE.js +0 -1
- package/static/chunk-HZTFYLM5.js +0 -1
- package/static/chunk-JSUKJT6Z.js +0 -1
- package/static/chunk-JXZCNFW7.js +0 -1
- package/static/chunk-LTGFCQR7.js +0 -1
- package/static/chunk-LV3PYKWO.js +0 -1
- package/static/chunk-N2WFNW6M.js +0 -7
- package/static/chunk-ORMRCEGT.js +0 -1
- package/static/chunk-OUTBJSMW.js +0 -1
- package/static/chunk-RS2PX32L.js +0 -1
- package/static/chunk-RSSWH3S2.js +0 -1
- package/static/chunk-RTRJ3KFH.js +0 -1
- package/static/chunk-TKTCBDOG.js +0 -1
- package/static/chunk-V6K2N46L.js +0 -1
- package/static/chunk-XLCCZSQL.js +0 -4
- package/static/chunk-YPEH66GG.js +0 -1
- package/static/chunk-YPOIUQ57.js +0 -1
- package/static/chunk-ZKCFO2OA.js +0 -4
- package/static/main-MZ7HWZXO.js +0 -9
- package/static/scripts-VZVAP2P4.js +0 -30
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
|
|
3
|
+
* This file is part of Sync-in | The open source file sync and share solution
|
|
4
|
+
* See the LICENSE file for licensing details
|
|
5
|
+
*/ "use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
Object.defineProperty(exports, "pt", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return pt;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const pt = {
|
|
16
|
+
'If you no longer wish to receive notifications, change your preferences directly from your user space': 'Se já não deseja receber notificações, altere as suas preferências diretamente no seu espaço de utilizador',
|
|
17
|
+
'Access it from': 'Aceda a partir de',
|
|
18
|
+
Comment: 'Comentário',
|
|
19
|
+
commented: 'comentou',
|
|
20
|
+
'You receive this notification if you are the owner of the file or if you have also commented on this file': 'Recebe esta notificação se for o proprietário do ficheiro ou se também tiver comentado este ficheiro',
|
|
21
|
+
Space: 'Espaço',
|
|
22
|
+
'from the space': 'do espaço',
|
|
23
|
+
'to the space': 'para o espaço',
|
|
24
|
+
'Access your spaces from': 'Aceda aos seus espaços a partir de',
|
|
25
|
+
'Access this space from': 'Aceda a este espaço a partir de',
|
|
26
|
+
'You now have access to the space': 'Passou a ter acesso ao espaço',
|
|
27
|
+
'You no longer have access to the space': 'Deixou de ter acesso ao espaço',
|
|
28
|
+
'This space has been permanently deleted': 'Este espaço foi eliminado permanentemente',
|
|
29
|
+
anchored: 'ancorou',
|
|
30
|
+
unanchored: 'desancorou',
|
|
31
|
+
Share: 'Partilha',
|
|
32
|
+
'shared with you': 'partilhou consigo',
|
|
33
|
+
'no longer share with you': 'deixou de partilhar consigo',
|
|
34
|
+
'You now have access to the share': 'Passou a ter acesso à partilha',
|
|
35
|
+
'You no longer have access to the share': 'Deixou de ter acesso à partilha',
|
|
36
|
+
'You are no longer a member of the parent share, your child share has been deleted': 'Deixou de ser membro da partilha principal; a sua partilha filha foi eliminada',
|
|
37
|
+
'Access your shares from': 'Aceda às suas partilhas a partir de',
|
|
38
|
+
'Access password': 'Palavra-passe de acesso',
|
|
39
|
+
Sync: 'Sincronização',
|
|
40
|
+
'Access your syncs from': 'Aceda às suas sincronizações a partir de',
|
|
41
|
+
'You are no longer synchronizing': 'Deixou de sincronizar',
|
|
42
|
+
'Security notification': 'Notificação de segurança',
|
|
43
|
+
'Your account has been locked after several unsuccessful authentication attempts': 'A sua conta foi bloqueada após várias tentativas de autenticação sem sucesso',
|
|
44
|
+
'This security notification concerns your Sync-in account. Please contact an administrator to perform the analysis and unlock your account.': 'Esta notificação de segurança diz respeito à sua conta Sync-in. Contacte um administrador para proceder à análise e desbloquear a sua conta.',
|
|
45
|
+
'Two-factor authentication (2FA) on your account has been disabled': 'A autenticação de dois fatores (2FA) na sua conta foi desativada',
|
|
46
|
+
'Two-factor authentication (2FA) on your account has been enabled': 'A autenticação de dois fatores (2FA) na sua conta foi ativada',
|
|
47
|
+
'You received this notification because the security of your Sync-in account has changed. If you think this was a mistake, please review your security settings or contact your administrator.': 'Recebeu esta notificação porque a segurança da sua conta Sync-in foi alterada. Se acha que foi um engano, reveja as suas definições de segurança ou contacte o seu administrador.',
|
|
48
|
+
'Address IP': 'Endereço IP',
|
|
49
|
+
Browser: 'Navegador'
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=pt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../backend/src/applications/notifications/i18n/pt.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nexport const pt = {\n 'If you no longer wish to receive notifications, change your preferences directly from your user space':\n 'Se já não deseja receber notificações, altere as suas preferências diretamente no seu espaço de utilizador',\n 'Access it from': 'Aceda a partir de',\n Comment: 'Comentário',\n commented: 'comentou',\n 'You receive this notification if you are the owner of the file or if you have also commented on this file':\n 'Recebe esta notificação se for o proprietário do ficheiro ou se também tiver comentado este ficheiro',\n Space: 'Espaço',\n 'from the space': 'do espaço',\n 'to the space': 'para o espaço',\n 'Access your spaces from': 'Aceda aos seus espaços a partir de',\n 'Access this space from': 'Aceda a este espaço a partir de',\n 'You now have access to the space': 'Passou a ter acesso ao espaço',\n 'You no longer have access to the space': 'Deixou de ter acesso ao espaço',\n 'This space has been permanently deleted': 'Este espaço foi eliminado permanentemente',\n anchored: 'ancorou',\n unanchored: 'desancorou',\n Share: 'Partilha',\n 'shared with you': 'partilhou consigo',\n 'no longer share with you': 'deixou de partilhar consigo',\n 'You now have access to the share': 'Passou a ter acesso à partilha',\n 'You no longer have access to the share': 'Deixou de ter acesso à partilha',\n 'You are no longer a member of the parent share, your child share has been deleted':\n 'Deixou de ser membro da partilha principal; a sua partilha filha foi eliminada',\n 'Access your shares from': 'Aceda às suas partilhas a partir de',\n 'Access password': 'Palavra-passe de acesso',\n Sync: 'Sincronização',\n 'Access your syncs from': 'Aceda às suas sincronizações a partir de',\n 'You are no longer synchronizing': 'Deixou de sincronizar',\n 'Security notification': 'Notificação de segurança',\n 'Your account has been locked after several unsuccessful authentication attempts':\n 'A sua conta foi bloqueada após várias tentativas de autenticação sem sucesso',\n 'This security notification concerns your Sync-in account. Please contact an administrator to perform the analysis and unlock your account.':\n 'Esta notificação de segurança diz respeito à sua conta Sync-in. Contacte um administrador para proceder à análise e desbloquear a sua conta.',\n 'Two-factor authentication (2FA) on your account has been disabled': 'A autenticação de dois fatores (2FA) na sua conta foi desativada',\n 'Two-factor authentication (2FA) on your account has been enabled': 'A autenticação de dois fatores (2FA) na sua conta foi ativada',\n 'You received this notification because the security of your Sync-in account has changed. If you think this was a mistake, please review your security settings or contact your administrator.':\n 'Recebeu esta notificação porque a segurança da sua conta Sync-in foi alterada. Se acha que foi um engano, reveja as suas definições de segurança ou contacte o seu administrador.',\n 'Address IP': 'Endereço IP',\n Browser: 'Navegador'\n} as const\n"],"names":["pt","Comment","commented","Space","anchored","unanchored","Share","Sync","Browser"],"mappings":"AAAA;;;;CAIC;;;;+BAEYA;;;eAAAA;;;AAAN,MAAMA,KAAK;IAChB,yGACE;IACF,kBAAkB;IAClBC,SAAS;IACTC,WAAW;IACX,6GACE;IACFC,OAAO;IACP,kBAAkB;IAClB,gBAAgB;IAChB,2BAA2B;IAC3B,0BAA0B;IAC1B,oCAAoC;IACpC,0CAA0C;IAC1C,2CAA2C;IAC3CC,UAAU;IACVC,YAAY;IACZC,OAAO;IACP,mBAAmB;IACnB,4BAA4B;IAC5B,oCAAoC;IACpC,0CAA0C;IAC1C,qFACE;IACF,2BAA2B;IAC3B,mBAAmB;IACnBC,MAAM;IACN,0BAA0B;IAC1B,mCAAmC;IACnC,yBAAyB;IACzB,mFACE;IACF,8IACE;IACF,qEAAqE;IACrE,oEAAoE;IACpE,iMACE;IACF,cAAc;IACdC,SAAS;AACX"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
|
|
3
|
+
* This file is part of Sync-in | The open source file sync and share solution
|
|
4
|
+
* See the LICENSE file for licensing details
|
|
5
|
+
*/ "use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
Object.defineProperty(exports, "pt_BR", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return pt_BR;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const pt_BR = {
|
|
16
|
+
'If you no longer wish to receive notifications, change your preferences directly from your user space': 'Se você não deseja mais receber notificações, altere suas preferências diretamente no seu espaço do usuário.',
|
|
17
|
+
'Access it from': 'Acesse a partir de',
|
|
18
|
+
Comment: 'Comentário',
|
|
19
|
+
commented: 'comentou',
|
|
20
|
+
'You receive this notification if you are the owner of the file or if you have also commented on this file': 'Você recebe esta notificação se for o proprietário do arquivo ou se também comentou neste arquivo.',
|
|
21
|
+
Space: 'Espaço',
|
|
22
|
+
'from the space': 'do espaço',
|
|
23
|
+
'to the space': 'para o espaço',
|
|
24
|
+
'Access your spaces from': 'Acesse seus espaços a partir de',
|
|
25
|
+
'Access this space from': 'Acesse este espaço a partir de',
|
|
26
|
+
'You now have access to the space': 'Agora você tem acesso ao espaço',
|
|
27
|
+
'You no longer have access to the space': 'Você não tem mais acesso ao espaço',
|
|
28
|
+
'This space has been permanently deleted': 'Este espaço foi excluído permanentemente',
|
|
29
|
+
anchored: 'ancorou',
|
|
30
|
+
unanchored: 'desancorou',
|
|
31
|
+
Share: 'Compartilhamento',
|
|
32
|
+
'shared with you': 'compartilhou com você',
|
|
33
|
+
'no longer share with you': 'não compartilha mais com você',
|
|
34
|
+
'You now have access to the share': 'Agora você tem acesso ao compartilhamento',
|
|
35
|
+
'You no longer have access to the share': 'Você não tem mais acesso ao compartilhamento',
|
|
36
|
+
'You are no longer a member of the parent share, your child share has been deleted': 'Você não é mais membro do compartilhamento pai; seu compartilhamento filho foi excluído',
|
|
37
|
+
'Access your shares from': 'Acesse seus compartilhamentos a partir de',
|
|
38
|
+
'Access password': 'Senha de acesso',
|
|
39
|
+
Sync: 'Sincronização',
|
|
40
|
+
'Access your syncs from': 'Acesse suas sincronizações a partir de',
|
|
41
|
+
'You are no longer synchronizing': 'Você não está mais sincronizando',
|
|
42
|
+
'Security notification': 'Notificação de segurança',
|
|
43
|
+
'Your account has been locked after several unsuccessful authentication attempts': 'Sua conta foi bloqueada após várias tentativas de autenticação sem sucesso',
|
|
44
|
+
'This security notification concerns your Sync-in account. Please contact an administrator to perform the analysis and unlock your account.': 'Esta notificação de segurança diz respeito à sua conta Sync-in. Entre em contato com um administrador para realizar a análise e desbloquear sua conta.',
|
|
45
|
+
'Two-factor authentication (2FA) on your account has been disabled': 'A autenticação de dois fatores (2FA) na sua conta foi desativada',
|
|
46
|
+
'Two-factor authentication (2FA) on your account has been enabled': 'A autenticação de dois fatores (2FA) na sua conta foi ativada',
|
|
47
|
+
'You received this notification because the security of your Sync-in account has changed. If you think this was a mistake, please review your security settings or contact your administrator.': 'Você recebeu esta notificação porque a segurança da sua conta Sync-in foi alterada. Se você acha que isso foi um engano, revise suas configurações de segurança ou entre em contato com o seu administrador.',
|
|
48
|
+
'Address IP': 'Endereço IP',
|
|
49
|
+
Browser: 'Navegador'
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=pt_br.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../backend/src/applications/notifications/i18n/pt_br.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nexport const pt_BR = {\n 'If you no longer wish to receive notifications, change your preferences directly from your user space':\n 'Se você não deseja mais receber notificações, altere suas preferências diretamente no seu espaço do usuário.',\n 'Access it from': 'Acesse a partir de',\n Comment: 'Comentário',\n commented: 'comentou',\n 'You receive this notification if you are the owner of the file or if you have also commented on this file':\n 'Você recebe esta notificação se for o proprietário do arquivo ou se também comentou neste arquivo.',\n Space: 'Espaço',\n 'from the space': 'do espaço',\n 'to the space': 'para o espaço',\n 'Access your spaces from': 'Acesse seus espaços a partir de',\n 'Access this space from': 'Acesse este espaço a partir de',\n 'You now have access to the space': 'Agora você tem acesso ao espaço',\n 'You no longer have access to the space': 'Você não tem mais acesso ao espaço',\n 'This space has been permanently deleted': 'Este espaço foi excluído permanentemente',\n anchored: 'ancorou',\n unanchored: 'desancorou',\n Share: 'Compartilhamento',\n 'shared with you': 'compartilhou com você',\n 'no longer share with you': 'não compartilha mais com você',\n 'You now have access to the share': 'Agora você tem acesso ao compartilhamento',\n 'You no longer have access to the share': 'Você não tem mais acesso ao compartilhamento',\n 'You are no longer a member of the parent share, your child share has been deleted':\n 'Você não é mais membro do compartilhamento pai; seu compartilhamento filho foi excluído',\n 'Access your shares from': 'Acesse seus compartilhamentos a partir de',\n 'Access password': 'Senha de acesso',\n Sync: 'Sincronização',\n 'Access your syncs from': 'Acesse suas sincronizações a partir de',\n 'You are no longer synchronizing': 'Você não está mais sincronizando',\n 'Security notification': 'Notificação de segurança',\n 'Your account has been locked after several unsuccessful authentication attempts':\n 'Sua conta foi bloqueada após várias tentativas de autenticação sem sucesso',\n 'This security notification concerns your Sync-in account. Please contact an administrator to perform the analysis and unlock your account.':\n 'Esta notificação de segurança diz respeito à sua conta Sync-in. Entre em contato com um administrador para realizar a análise e desbloquear sua conta.',\n 'Two-factor authentication (2FA) on your account has been disabled': 'A autenticação de dois fatores (2FA) na sua conta foi desativada',\n 'Two-factor authentication (2FA) on your account has been enabled': 'A autenticação de dois fatores (2FA) na sua conta foi ativada',\n 'You received this notification because the security of your Sync-in account has changed. If you think this was a mistake, please review your security settings or contact your administrator.':\n 'Você recebeu esta notificação porque a segurança da sua conta Sync-in foi alterada. Se você acha que isso foi um engano, revise suas configurações de segurança ou entre em contato com o seu administrador.',\n 'Address IP': 'Endereço IP',\n Browser: 'Navegador'\n} as const\n"],"names":["pt_BR","Comment","commented","Space","anchored","unanchored","Share","Sync","Browser"],"mappings":"AAAA;;;;CAIC;;;;+BAEYA;;;eAAAA;;;AAAN,MAAMA,QAAQ;IACnB,yGACE;IACF,kBAAkB;IAClBC,SAAS;IACTC,WAAW;IACX,6GACE;IACFC,OAAO;IACP,kBAAkB;IAClB,gBAAgB;IAChB,2BAA2B;IAC3B,0BAA0B;IAC1B,oCAAoC;IACpC,0CAA0C;IAC1C,2CAA2C;IAC3CC,UAAU;IACVC,YAAY;IACZC,OAAO;IACP,mBAAmB;IACnB,4BAA4B;IAC5B,oCAAoC;IACpC,0CAA0C;IAC1C,qFACE;IACF,2BAA2B;IAC3B,mBAAmB;IACnBC,MAAM;IACN,0BAA0B;IAC1B,mCAAmC;IACnC,yBAAyB;IACzB,mFACE;IACF,8IACE;IACF,qEAAqE;IACrE,oEAAoE;IACpE,iMACE;IACF,cAAc;IACdC,SAAS;AACX"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
|
|
3
|
+
* This file is part of Sync-in | The open source file sync and share solution
|
|
4
|
+
* See the LICENSE file for licensing details
|
|
5
|
+
*/ "use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
Object.defineProperty(exports, "ru", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return ru;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const ru = {
|
|
16
|
+
'If you no longer wish to receive notifications, change your preferences directly from your user space': 'Если вы больше не хотите получать уведомления, измените настройки прямо в вашем пользовательском пространстве',
|
|
17
|
+
'Access it from': 'Доступно отсюда',
|
|
18
|
+
Comment: 'Комментарий',
|
|
19
|
+
commented: 'прокомментировал(а)',
|
|
20
|
+
'You receive this notification if you are the owner of the file or if you have also commented on this file': 'Вы получаете это уведомление, если являетесь владельцем файла или также оставляли комментарий к нему',
|
|
21
|
+
Space: 'Пространство',
|
|
22
|
+
'from the space': 'из пространства',
|
|
23
|
+
'to the space': 'в пространство',
|
|
24
|
+
'Access your spaces from': 'Доступ к вашим пространствам',
|
|
25
|
+
'Access this space from': 'Доступ к этому пространству',
|
|
26
|
+
'You now have access to the space': 'Теперь у вас есть доступ к пространству',
|
|
27
|
+
'You no longer have access to the space': 'У вас больше нет доступа к пространству',
|
|
28
|
+
'This space has been permanently deleted': 'Это пространство было безвозвратно удалено',
|
|
29
|
+
anchored: 'закрепил(а)',
|
|
30
|
+
unanchored: 'открепил(а)',
|
|
31
|
+
Share: 'Общий доступ',
|
|
32
|
+
'shared with you': 'поделился(лась) с вами',
|
|
33
|
+
'no longer share with you': 'больше не делится с вами',
|
|
34
|
+
'You now have access to the share': 'Теперь у вас есть доступ к общему ресурсу',
|
|
35
|
+
'You no longer have access to the share': 'У вас больше нет доступа к общему ресурсу',
|
|
36
|
+
'You are no longer a member of the parent share, your child share has been deleted': 'Вы больше не участник родительского общего ресурса, ваш дочерний ресурс был удалён',
|
|
37
|
+
'Access your shares from': 'Доступ к вашим общим ресурсам',
|
|
38
|
+
'Access password': 'Пароль доступа',
|
|
39
|
+
Sync: 'Синхронизация',
|
|
40
|
+
'Access your syncs from': 'Доступ к вашим синхронизациям',
|
|
41
|
+
'You are no longer synchronizing': 'Вы больше не синхронизируете',
|
|
42
|
+
'Security notification': 'Уведомление безопасности',
|
|
43
|
+
'Your account has been locked after several unsuccessful authentication attempts': 'Ваш аккаунт был заблокирован после нескольких неудачных попыток входа',
|
|
44
|
+
'This security notification concerns your Sync-in account. Please contact an administrator to perform the analysis and unlock your account.': 'Это уведомление касается вашего аккаунта в Sync-in. Пожалуйста, обратитесь к администратору для анализа и разблокировки аккаунта.',
|
|
45
|
+
'Two-factor authentication (2FA) on your account has been disabled': 'Двухфакторная аутентификация (2FA) для вашего аккаунта была отключена',
|
|
46
|
+
'Two-factor authentication (2FA) on your account has been enabled': 'Двухфакторная аутентификация (2FA) для вашего аккаунта была включена',
|
|
47
|
+
'You received this notification because the security of your Sync-in account has changed. If you think this was a mistake, please review your security settings or contact your administrator.': 'Вы получили это уведомление, потому что изменились настройки безопасности вашего аккаунта в Sync-in. Если вы считаете, что это ошибка, проверьте настройки безопасности или свяжитесь с администратором.',
|
|
48
|
+
'Address IP': 'IP-адрес',
|
|
49
|
+
Browser: 'Браузер'
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=ru.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../backend/src/applications/notifications/i18n/ru.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\nexport const ru = {\n 'If you no longer wish to receive notifications, change your preferences directly from your user space':\n 'Если вы больше не хотите получать уведомления, измените настройки прямо в вашем пользовательском пространстве',\n 'Access it from': 'Доступно отсюда',\n Comment: 'Комментарий',\n commented: 'прокомментировал(а)',\n 'You receive this notification if you are the owner of the file or if you have also commented on this file':\n 'Вы получаете это уведомление, если являетесь владельцем файла или также оставляли комментарий к нему',\n Space: 'Пространство',\n 'from the space': 'из пространства',\n 'to the space': 'в пространство',\n 'Access your spaces from': 'Доступ к вашим пространствам',\n 'Access this space from': 'Доступ к этому пространству',\n 'You now have access to the space': 'Теперь у вас есть доступ к пространству',\n 'You no longer have access to the space': 'У вас больше нет доступа к пространству',\n 'This space has been permanently deleted': 'Это пространство было безвозвратно удалено',\n anchored: 'закрепил(а)',\n unanchored: 'открепил(а)',\n Share: 'Общий доступ',\n 'shared with you': 'поделился(лась) с вами',\n 'no longer share with you': 'больше не делится с вами',\n 'You now have access to the share': 'Теперь у вас есть доступ к общему ресурсу',\n 'You no longer have access to the share': 'У вас больше нет доступа к общему ресурсу',\n 'You are no longer a member of the parent share, your child share has been deleted':\n 'Вы больше не участник родительского общего ресурса, ваш дочерний ресурс был удалён',\n 'Access your shares from': 'Доступ к вашим общим ресурсам',\n 'Access password': 'Пароль доступа',\n Sync: 'Синхронизация',\n 'Access your syncs from': 'Доступ к вашим синхронизациям',\n 'You are no longer synchronizing': 'Вы больше не синхронизируете',\n 'Security notification': 'Уведомление безопасности',\n 'Your account has been locked after several unsuccessful authentication attempts':\n 'Ваш аккаунт был заблокирован после нескольких неудачных попыток входа',\n 'This security notification concerns your Sync-in account. Please contact an administrator to perform the analysis and unlock your account.':\n 'Это уведомление касается вашего аккаунта в Sync-in. Пожалуйста, обратитесь к администратору для анализа и разблокировки аккаунта.',\n 'Two-factor authentication (2FA) on your account has been disabled': 'Двухфакторная аутентификация (2FA) для вашего аккаунта была отключена',\n 'Two-factor authentication (2FA) on your account has been enabled': 'Двухфакторная аутентификация (2FA) для вашего аккаунта была включена',\n 'You received this notification because the security of your Sync-in account has changed. If you think this was a mistake, please review your security settings or contact your administrator.':\n 'Вы получили это уведомление, потому что изменились настройки безопасности вашего аккаунта в Sync-in. Если вы считаете, что это ошибка, проверьте настройки безопасности или свяжитесь с администратором.',\n 'Address IP': 'IP-адрес',\n Browser: 'Браузер'\n} as const\n"],"names":["ru","Comment","commented","Space","anchored","unanchored","Share","Sync","Browser"],"mappings":"AAAA;;;;CAIC;;;;+BACYA;;;eAAAA;;;AAAN,MAAMA,KAAK;IAChB,yGACE;IACF,kBAAkB;IAClBC,SAAS;IACTC,WAAW;IACX,6GACE;IACFC,OAAO;IACP,kBAAkB;IAClB,gBAAgB;IAChB,2BAA2B;IAC3B,0BAA0B;IAC1B,oCAAoC;IACpC,0CAA0C;IAC1C,2CAA2C;IAC3CC,UAAU;IACVC,YAAY;IACZC,OAAO;IACP,mBAAmB;IACnB,4BAA4B;IAC5B,oCAAoC;IACpC,0CAA0C;IAC1C,qFACE;IACF,2BAA2B;IAC3B,mBAAmB;IACnBC,MAAM;IACN,0BAA0B;IAC1B,mCAAmC;IACnC,yBAAyB;IACzB,mFACE;IACF,8IACE;IACF,qEAAqE;IACrE,oEAAoE;IACpE,iMACE;IACF,cAAc;IACdC,SAAS;AACX"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
|
|
3
|
+
* This file is part of Sync-in | The open source file sync and share solution
|
|
4
|
+
* See the LICENSE file for licensing details
|
|
5
|
+
*/ "use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
Object.defineProperty(exports, "tr", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return tr;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const tr = {
|
|
16
|
+
'If you no longer wish to receive notifications, change your preferences directly from your user space': 'Artık bildirim almak istemiyorsanız, kullanıcı alanınızdan doğrudan tercihlerinizi değiştirin.',
|
|
17
|
+
'Access it from': 'Buradan erişin',
|
|
18
|
+
Comment: 'Yorum',
|
|
19
|
+
commented: 'yorum yaptı',
|
|
20
|
+
'You receive this notification if you are the owner of the file or if you have also commented on this file': 'Dosyanın sahibiyseniz veya bu dosyaya yorum yaptıysanız bu bildirimi alırsınız.',
|
|
21
|
+
Space: 'Alan',
|
|
22
|
+
'from the space': 'alandan',
|
|
23
|
+
'to the space': 'alana',
|
|
24
|
+
'Access your spaces from': 'Alanlarınıza buradan erişin',
|
|
25
|
+
'Access this space from': 'Bu alana buradan erişin',
|
|
26
|
+
'You now have access to the space': 'Artık bu alana erişiminiz var',
|
|
27
|
+
'You no longer have access to the space': 'Artık bu alana erişiminiz yok',
|
|
28
|
+
'This space has been permanently deleted': 'Bu alan kalıcı olarak silindi',
|
|
29
|
+
anchored: 'sabitledi',
|
|
30
|
+
unanchored: 'sabitlemeyi kaldırdı',
|
|
31
|
+
Share: 'Paylaşım',
|
|
32
|
+
'shared with you': 'sizinle paylaştı',
|
|
33
|
+
'no longer share with you': 'artık sizinle paylaşmıyor',
|
|
34
|
+
'You now have access to the share': 'Artık paylaşıma erişiminiz var',
|
|
35
|
+
'You no longer have access to the share': 'Artık paylaşıma erişiminiz yok',
|
|
36
|
+
'You are no longer a member of the parent share, your child share has been deleted': 'Üst paylaşıma artık üye olmadığınız için alt paylaşımınız silindi',
|
|
37
|
+
'Access your shares from': 'Paylaşımlarınıza buradan erişin',
|
|
38
|
+
'Access password': 'Erişim parolası',
|
|
39
|
+
Sync: 'Eşitleme',
|
|
40
|
+
'Access your syncs from': 'Eşitlemelerinize buradan erişin',
|
|
41
|
+
'You are no longer synchronizing': 'Artık eşitleme yapmıyorsunuz',
|
|
42
|
+
'Security notification': 'Güvenlik bildirimi',
|
|
43
|
+
'Your account has been locked after several unsuccessful authentication attempts': 'Birkaç başarısız kimlik doğrulama girişiminden sonra hesabınız kilitlendi',
|
|
44
|
+
'This security notification concerns your Sync-in account. Please contact an administrator to perform the analysis and unlock your account.': 'Bu güvenlik bildirimi, Sync-in hesabınızla ilgilidir. Analiz yapılması ve hesabınızın kilidinin açılması için lütfen bir yöneticiyle iletişime geçin.',
|
|
45
|
+
'Two-factor authentication (2FA) on your account has been disabled': 'Hesabınızda iki faktörlü kimlik doğrulama (2FA) devre dışı bırakıldı',
|
|
46
|
+
'Two-factor authentication (2FA) on your account has been enabled': 'Hesabınızda iki faktörlü kimlik doğrulama (2FA) etkinleştirildi',
|
|
47
|
+
'You received this notification because the security of your Sync-in account has changed. If you think this was a mistake, please review your security settings or contact your administrator.': 'Sync-in hesabınızın güvenliği değiştiği için bu bildirimi aldınız. Bunun bir hata olduğunu düşünüyorsanız güvenlik ayarlarınızı gözden geçirin veya yöneticinizle iletişime geçin.',
|
|
48
|
+
'Address IP': 'IP adresi',
|
|
49
|
+
Browser: 'Tarayıcı'
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=tr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../backend/src/applications/notifications/i18n/tr.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nexport const tr = {\n 'If you no longer wish to receive notifications, change your preferences directly from your user space':\n 'Artık bildirim almak istemiyorsanız, kullanıcı alanınızdan doğrudan tercihlerinizi değiştirin.',\n 'Access it from': 'Buradan erişin',\n Comment: 'Yorum',\n commented: 'yorum yaptı',\n 'You receive this notification if you are the owner of the file or if you have also commented on this file':\n 'Dosyanın sahibiyseniz veya bu dosyaya yorum yaptıysanız bu bildirimi alırsınız.',\n Space: 'Alan',\n 'from the space': 'alandan',\n 'to the space': 'alana',\n 'Access your spaces from': 'Alanlarınıza buradan erişin',\n 'Access this space from': 'Bu alana buradan erişin',\n 'You now have access to the space': 'Artık bu alana erişiminiz var',\n 'You no longer have access to the space': 'Artık bu alana erişiminiz yok',\n 'This space has been permanently deleted': 'Bu alan kalıcı olarak silindi',\n anchored: 'sabitledi',\n unanchored: 'sabitlemeyi kaldırdı',\n Share: 'Paylaşım',\n 'shared with you': 'sizinle paylaştı',\n 'no longer share with you': 'artık sizinle paylaşmıyor',\n 'You now have access to the share': 'Artık paylaşıma erişiminiz var',\n 'You no longer have access to the share': 'Artık paylaşıma erişiminiz yok',\n 'You are no longer a member of the parent share, your child share has been deleted':\n 'Üst paylaşıma artık üye olmadığınız için alt paylaşımınız silindi',\n 'Access your shares from': 'Paylaşımlarınıza buradan erişin',\n 'Access password': 'Erişim parolası',\n Sync: 'Eşitleme',\n 'Access your syncs from': 'Eşitlemelerinize buradan erişin',\n 'You are no longer synchronizing': 'Artık eşitleme yapmıyorsunuz',\n 'Security notification': 'Güvenlik bildirimi',\n 'Your account has been locked after several unsuccessful authentication attempts':\n 'Birkaç başarısız kimlik doğrulama girişiminden sonra hesabınız kilitlendi',\n 'This security notification concerns your Sync-in account. Please contact an administrator to perform the analysis and unlock your account.':\n 'Bu güvenlik bildirimi, Sync-in hesabınızla ilgilidir. Analiz yapılması ve hesabınızın kilidinin açılması için lütfen bir yöneticiyle iletişime geçin.',\n 'Two-factor authentication (2FA) on your account has been disabled': 'Hesabınızda iki faktörlü kimlik doğrulama (2FA) devre dışı bırakıldı',\n 'Two-factor authentication (2FA) on your account has been enabled': 'Hesabınızda iki faktörlü kimlik doğrulama (2FA) etkinleştirildi',\n 'You received this notification because the security of your Sync-in account has changed. If you think this was a mistake, please review your security settings or contact your administrator.':\n 'Sync-in hesabınızın güvenliği değiştiği için bu bildirimi aldınız. Bunun bir hata olduğunu düşünüyorsanız güvenlik ayarlarınızı gözden geçirin veya yöneticinizle iletişime geçin.',\n 'Address IP': 'IP adresi',\n Browser: 'Tarayıcı'\n} as const\n"],"names":["tr","Comment","commented","Space","anchored","unanchored","Share","Sync","Browser"],"mappings":"AAAA;;;;CAIC;;;;+BAEYA;;;eAAAA;;;AAAN,MAAMA,KAAK;IAChB,yGACE;IACF,kBAAkB;IAClBC,SAAS;IACTC,WAAW;IACX,6GACE;IACFC,OAAO;IACP,kBAAkB;IAClB,gBAAgB;IAChB,2BAA2B;IAC3B,0BAA0B;IAC1B,oCAAoC;IACpC,0CAA0C;IAC1C,2CAA2C;IAC3CC,UAAU;IACVC,YAAY;IACZC,OAAO;IACP,mBAAmB;IACnB,4BAA4B;IAC5B,oCAAoC;IACpC,0CAA0C;IAC1C,qFACE;IACF,2BAA2B;IAC3B,mBAAmB;IACnBC,MAAM;IACN,0BAA0B;IAC1B,mCAAmC;IACnC,yBAAyB;IACzB,mFACE;IACF,8IACE;IACF,qEAAqE;IACrE,oEAAoE;IACpE,iMACE;IACF,cAAc;IACdC,SAAS;AACX"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
|
|
3
|
+
* This file is part of Sync-in | The open source file sync and share solution
|
|
4
|
+
* See the LICENSE file for licensing details
|
|
5
|
+
*/ "use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
Object.defineProperty(exports, "zh", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return zh;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const zh = {
|
|
16
|
+
'If you no longer wish to receive notifications, change your preferences directly from your user space': '如果您不再希望接收通知,请在您的用户空间中直接更改偏好设置',
|
|
17
|
+
'Access it from': '通过以下入口访问',
|
|
18
|
+
Comment: '评论',
|
|
19
|
+
commented: '评论了',
|
|
20
|
+
'You receive this notification if you are the owner of the file or if you have also commented on this file': '如果您是该文件的所有者或也对该文件进行了评论,您会收到此通知',
|
|
21
|
+
Space: '空间',
|
|
22
|
+
'from the space': '来自该空间',
|
|
23
|
+
'to the space': '到该空间',
|
|
24
|
+
'Access your spaces from': '从以下位置访问您的空间',
|
|
25
|
+
'Access this space from': '从以下位置访问此空间',
|
|
26
|
+
'You now have access to the space': '您现在可以访问该空间',
|
|
27
|
+
'You no longer have access to the space': '您已不再能够访问该空间',
|
|
28
|
+
'This space has been permanently deleted': '该空间已被永久删除',
|
|
29
|
+
anchored: '已固定',
|
|
30
|
+
unanchored: '已取消固定',
|
|
31
|
+
Share: '共享',
|
|
32
|
+
'shared with you': '与您共享了',
|
|
33
|
+
'no longer share with you': '不再与您共享',
|
|
34
|
+
'You now have access to the share': '您现在可以访问该共享',
|
|
35
|
+
'You no longer have access to the share': '您已不再能够访问该共享',
|
|
36
|
+
'You are no longer a member of the parent share, your child share has been deleted': '您已不再是父级共享的成员,您的子共享已被删除',
|
|
37
|
+
'Access your shares from': '从以下位置访问您的共享',
|
|
38
|
+
'Access password': '访问密码',
|
|
39
|
+
Sync: '同步',
|
|
40
|
+
'Access your syncs from': '从以下位置访问您的同步',
|
|
41
|
+
'You are no longer synchronizing': '您已停止同步',
|
|
42
|
+
'Security notification': '安全通知',
|
|
43
|
+
'Your account has been locked after several unsuccessful authentication attempts': '在多次身份验证失败后,您的账户已被锁定',
|
|
44
|
+
'This security notification concerns your Sync-in account. Please contact an administrator to perform the analysis and unlock your account.': '此安全通知与您的 Sync-in 账户相关。请联系管理员进行分析并解锁您的账户。',
|
|
45
|
+
'Two-factor authentication (2FA) on your account has been disabled': '您账户的双重身份验证 (2FA) 已被禁用',
|
|
46
|
+
'Two-factor authentication (2FA) on your account has been enabled': '您账户的双重身份验证 (2FA) 已被启用',
|
|
47
|
+
'You received this notification because the security of your Sync-in account has changed. If you think this was a mistake, please review your security settings or contact your administrator.': '您收到此通知是因为您的 Sync-in 账户安全性发生了变化。如认为这是错误,请检查您的安全设置或联系管理员。',
|
|
48
|
+
'Address IP': 'IP 地址',
|
|
49
|
+
Browser: '浏览器'
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=zh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../backend/src/applications/notifications/i18n/zh.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nexport const zh = {\n 'If you no longer wish to receive notifications, change your preferences directly from your user space':\n '如果您不再希望接收通知,请在您的用户空间中直接更改偏好设置',\n 'Access it from': '通过以下入口访问',\n Comment: '评论',\n commented: '评论了',\n 'You receive this notification if you are the owner of the file or if you have also commented on this file':\n '如果您是该文件的所有者或也对该文件进行了评论,您会收到此通知',\n Space: '空间',\n 'from the space': '来自该空间',\n 'to the space': '到该空间',\n 'Access your spaces from': '从以下位置访问您的空间',\n 'Access this space from': '从以下位置访问此空间',\n 'You now have access to the space': '您现在可以访问该空间',\n 'You no longer have access to the space': '您已不再能够访问该空间',\n 'This space has been permanently deleted': '该空间已被永久删除',\n anchored: '已固定',\n unanchored: '已取消固定',\n Share: '共享',\n 'shared with you': '与您共享了',\n 'no longer share with you': '不再与您共享',\n 'You now have access to the share': '您现在可以访问该共享',\n 'You no longer have access to the share': '您已不再能够访问该共享',\n 'You are no longer a member of the parent share, your child share has been deleted': '您已不再是父级共享的成员,您的子共享已被删除',\n 'Access your shares from': '从以下位置访问您的共享',\n 'Access password': '访问密码',\n Sync: '同步',\n 'Access your syncs from': '从以下位置访问您的同步',\n 'You are no longer synchronizing': '您已停止同步',\n 'Security notification': '安全通知',\n 'Your account has been locked after several unsuccessful authentication attempts': '在多次身份验证失败后,您的账户已被锁定',\n 'This security notification concerns your Sync-in account. Please contact an administrator to perform the analysis and unlock your account.':\n '此安全通知与您的 Sync-in 账户相关。请联系管理员进行分析并解锁您的账户。',\n 'Two-factor authentication (2FA) on your account has been disabled': '您账户的双重身份验证 (2FA) 已被禁用',\n 'Two-factor authentication (2FA) on your account has been enabled': '您账户的双重身份验证 (2FA) 已被启用',\n 'You received this notification because the security of your Sync-in account has changed. If you think this was a mistake, please review your security settings or contact your administrator.':\n '您收到此通知是因为您的 Sync-in 账户安全性发生了变化。如认为这是错误,请检查您的安全设置或联系管理员。',\n 'Address IP': 'IP 地址',\n Browser: '浏览器'\n} as const\n"],"names":["zh","Comment","commented","Space","anchored","unanchored","Share","Sync","Browser"],"mappings":"AAAA;;;;CAIC;;;;+BAEYA;;;eAAAA;;;AAAN,MAAMA,KAAK;IAChB,yGACE;IACF,kBAAkB;IAClBC,SAAS;IACTC,WAAW;IACX,6GACE;IACFC,OAAO;IACP,kBAAkB;IAClB,gBAAgB;IAChB,2BAA2B;IAC3B,0BAA0B;IAC1B,oCAAoC;IACpC,0CAA0C;IAC1C,2CAA2C;IAC3CC,UAAU;IACVC,YAAY;IACZC,OAAO;IACP,mBAAmB;IACnB,4BAA4B;IAC5B,oCAAoC;IACpC,0CAA0C;IAC1C,qFAAqF;IACrF,2BAA2B;IAC3B,mBAAmB;IACnBC,MAAM;IACN,0BAA0B;IAC1B,mCAAmC;IACnC,yBAAyB;IACzB,mFAAmF;IACnF,8IACE;IACF,qEAAqE;IACrE,oEAAoE;IACpE,iMACE;IACF,cAAc;IACdC,SAAS;AACX"}
|
|
@@ -38,7 +38,6 @@ _export(exports, {
|
|
|
38
38
|
return syncMail;
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
|
-
const _appconstants = require("../../../app.constants");
|
|
42
41
|
const _constants = require("../../../common/constants");
|
|
43
42
|
const _shared = require("../../../common/shared");
|
|
44
43
|
const _files = require("../../files/utils/files");
|
|
@@ -54,7 +53,7 @@ function commentMail(language, notification, options) {
|
|
|
54
53
|
event: notification.event
|
|
55
54
|
});
|
|
56
55
|
const content = `${(0, _templates.mailAuthor)(options.author)}${(0, _templates.mailEventOnElement)(tr.event, notification.element)}${(0, _templates.mailItalicContent)(options.content)}`;
|
|
57
|
-
const footer = `<br>${tr.urlText} <a href="${(0, _urls.urlFromSpaceFile)(options.currentUrl, notification)}">${
|
|
56
|
+
const footer = `<br>${tr.urlText} <a href="${(0, _urls.urlFromSpaceFile)(options.currentUrl, notification)}">${_shared.SERVER_NAME}</a><br>${tr.footer}<br>${tr.defaultFooter}`;
|
|
58
57
|
return [
|
|
59
58
|
`${tr.title}: ${(0, _shared.capitalizeString)(notification.element)}`,
|
|
60
59
|
(0, _templates.mailTemplate)(content, footer)
|
|
@@ -69,7 +68,7 @@ function spaceMail(language, notification, options) {
|
|
|
69
68
|
});
|
|
70
69
|
const spaceUrl = (0, _urls.urlFromSpace)(options.currentUrl, options.action === _constants.ACTION.ADD ? notification.element : undefined);
|
|
71
70
|
const content = `${(0, _templates.mailEventOnElement)(tr.event, notification.element)}`;
|
|
72
|
-
const footer = `<br>${tr.urlText} <a href="${spaceUrl}">${
|
|
71
|
+
const footer = `<br>${tr.urlText} <a href="${spaceUrl}">${_shared.SERVER_NAME}</a><br>${tr.defaultFooter}`;
|
|
73
72
|
return [
|
|
74
73
|
`${tr.title}: ${(0, _shared.capitalizeString)(notification.element)}`,
|
|
75
74
|
(0, _templates.mailTemplate)(content, footer)
|
|
@@ -86,7 +85,7 @@ function spaceRootMail(language, notification, options) {
|
|
|
86
85
|
const spaceName = (0, _files.fileName)(notification.url);
|
|
87
86
|
const spaceRootUrl = options.action === _constants.ACTION.ADD ? (0, _urls.urlFromSpaceFile)(options.currentUrl, notification) : (0, _urls.urlFromSpace)(options.currentUrl, spaceName);
|
|
88
87
|
const content = `${(0, _templates.mailAuthor)(options.author)}${(0, _templates.mailEventOnElement)(tr.event, notification.element)} ${tr.originEvent} <b>${spaceName}</b>`;
|
|
89
|
-
const footer = `<br>${tr.urlText} <a href="${spaceRootUrl}">${
|
|
88
|
+
const footer = `<br>${tr.urlText} <a href="${spaceRootUrl}">${_shared.SERVER_NAME}</a><br>${tr.defaultFooter}`;
|
|
90
89
|
return [
|
|
91
90
|
`${tr.title}: ${(0, _shared.capitalizeString)(spaceName)}`,
|
|
92
91
|
(0, _templates.mailTemplate)(content, footer)
|
|
@@ -100,7 +99,7 @@ function shareMail(language, notification, options) {
|
|
|
100
99
|
event: notification.event
|
|
101
100
|
});
|
|
102
101
|
const content = `${options.author ? (0, _templates.mailAuthor)(options.author) : ''}${(0, _templates.mailEventOnElement)(tr.event, notification.element)}`;
|
|
103
|
-
const footer = `<br>${tr.urlText} <a href="${(0, _urls.urlFromSpaceFile)(options.currentUrl, notification)}">${
|
|
102
|
+
const footer = `<br>${tr.urlText} <a href="${(0, _urls.urlFromSpaceFile)(options.currentUrl, notification)}">${_shared.SERVER_NAME}</a><br>${tr.defaultFooter}`;
|
|
104
103
|
return [
|
|
105
104
|
`${tr.title}: ${(0, _shared.capitalizeString)(notification.element)}`,
|
|
106
105
|
(0, _templates.mailTemplate)(content, footer)
|
|
@@ -117,7 +116,7 @@ function linkMail(language, notification, options) {
|
|
|
117
116
|
if (options.linkPassword) {
|
|
118
117
|
content += `<br><br>${tr.passwordText}: <div style="border:1px solid #000; padding:8px; display:inline-block;">${options.linkPassword}</div>`;
|
|
119
118
|
}
|
|
120
|
-
const footer = `<br>${tr.urlText} <a href="${(0, _urls.urlFromLink)(options.currentUrl, options.linkUUID)}">${
|
|
119
|
+
const footer = `<br>${tr.urlText} <a href="${(0, _urls.urlFromLink)(options.currentUrl, options.linkUUID)}">${_shared.SERVER_NAME}</a>`;
|
|
121
120
|
return [
|
|
122
121
|
`${tr.title}: ${(0, _shared.capitalizeString)(notification.element)}`,
|
|
123
122
|
(0, _templates.mailTemplate)(content, footer)
|
|
@@ -132,7 +131,7 @@ function syncMail(language, notification, options) {
|
|
|
132
131
|
});
|
|
133
132
|
const syncUrl = (0, _urls.urlFromSync)(options.currentUrl);
|
|
134
133
|
const content = `${(0, _templates.mailEventOnElement)(tr.event, notification.element)}`;
|
|
135
|
-
const footer = `<br>${tr.urlText} <a href="${syncUrl}">${
|
|
134
|
+
const footer = `<br>${tr.urlText} <a href="${syncUrl}">${_shared.SERVER_NAME}</a><br>${tr.defaultFooter}`;
|
|
136
135
|
return [
|
|
137
136
|
`${tr.title}: ${(0, _shared.capitalizeString)(notification.element)}`,
|
|
138
137
|
(0, _templates.mailTemplate)(content, footer)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../backend/src/applications/notifications/mails/models.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport { SERVER_NAME } from '../../../app.constants'\nimport { ACTION } from '../../../common/constants'\nimport { capitalizeString } from '../../../common/shared'\nimport { fileName } from '../../files/utils/files'\nimport { UserModel } from '../../users/models/user.model'\nimport { translateObject } from '../i18n'\nimport { NotificationContent } from '../interfaces/notification-properties.interface'\nimport { defaultFooter, mailAuthor, mailEventOnElement, mailItalicContent, mailTemplate } from './templates'\nimport { urlFromLink, urlFromSpace, urlFromSpaceFile, urlFromSync } from './urls'\n\nexport function commentMail(\n language: string,\n notification: NotificationContent,\n options: {\n content: string\n currentUrl: string\n author: UserModel\n }\n): [string, string] {\n const tr = translateObject(language, {\n title: 'Comment',\n defaultFooter: defaultFooter,\n footer: 'You receive this notification if you are the owner of the file or if you have also commented on this file',\n urlText: 'Access it from',\n event: notification.event\n })\n\n const content = `${mailAuthor(options.author)}${mailEventOnElement(tr.event, notification.element)}${mailItalicContent(options.content)}`\n\n const footer = `<br>${tr.urlText} <a href=\"${urlFromSpaceFile(options.currentUrl, notification)}\">${SERVER_NAME}</a><br>${tr.footer}<br>${tr.defaultFooter}`\n\n return [`${tr.title}: ${capitalizeString(notification.element)}`, mailTemplate(content, footer)]\n}\n\nexport function spaceMail(\n language: string,\n notification: NotificationContent,\n options: {\n currentUrl: string\n action: ACTION\n }\n): [string, string] {\n const tr = translateObject(language, {\n title: 'Space',\n defaultFooter: defaultFooter,\n urlText: options.action === ACTION.ADD ? 'Access it from' : 'Access your spaces from',\n event: notification.event\n })\n\n const spaceUrl = urlFromSpace(options.currentUrl, options.action === ACTION.ADD ? notification.element : undefined)\n\n const content = `${mailEventOnElement(tr.event, notification.element)}`\n\n const footer = `<br>${tr.urlText} <a href=\"${spaceUrl}\">${SERVER_NAME}</a><br>${tr.defaultFooter}`\n\n return [`${tr.title}: ${capitalizeString(notification.element)}`, mailTemplate(content, footer)]\n}\n\nexport function spaceRootMail(\n language: string,\n notification: NotificationContent,\n options: {\n currentUrl: string\n author: UserModel\n action: ACTION\n }\n): [string, string] {\n const tr = translateObject(language, {\n title: 'Space',\n defaultFooter: defaultFooter,\n urlText: options.action === ACTION.ADD ? 'Access it from' : 'Access this space from',\n event: notification.event,\n originEvent: options.action === ACTION.ADD ? 'to the space' : 'from the space'\n })\n\n const spaceName = fileName(notification.url)\n const spaceRootUrl =\n options.action === ACTION.ADD ? urlFromSpaceFile(options.currentUrl, notification) : urlFromSpace(options.currentUrl, spaceName)\n\n const content = `${mailAuthor(options.author)}${mailEventOnElement(tr.event, notification.element)} ${tr.originEvent} <b>${spaceName}</b>`\n\n const footer = `<br>${tr.urlText} <a href=\"${spaceRootUrl}\">${SERVER_NAME}</a><br>${tr.defaultFooter}`\n\n return [`${tr.title}: ${capitalizeString(spaceName)}`, mailTemplate(content, footer)]\n}\n\nexport function shareMail(\n language: string,\n notification: NotificationContent,\n options: {\n currentUrl: string\n author: UserModel\n action: ACTION\n }\n): [string, string] {\n const tr = translateObject(language, {\n title: 'Share',\n defaultFooter: defaultFooter,\n urlText: options.action === ACTION.ADD ? 'Access it from' : 'Access your shares from',\n event: notification.event\n })\n\n const content = `${options.author ? mailAuthor(options.author) : ''}${mailEventOnElement(tr.event, notification.element)}`\n\n const footer = `<br>${tr.urlText} <a href=\"${urlFromSpaceFile(options.currentUrl, notification)}\">${SERVER_NAME}</a><br>${tr.defaultFooter}`\n\n return [`${tr.title}: ${capitalizeString(notification.element)}`, mailTemplate(content, footer)]\n}\n\nexport function linkMail(\n language: string,\n notification: NotificationContent,\n options: {\n currentUrl: string\n author: UserModel\n action: ACTION\n linkUUID: string\n linkPassword: string\n }\n): [string, string] {\n const tr = translateObject(language, {\n title: options.action === ACTION.ADD ? 'Share' : 'Space',\n passwordText: 'Access password',\n urlText: 'Access it from',\n event: notification.event\n })\n\n let content = `${options.author ? mailAuthor(options.author) : ''}${mailEventOnElement(tr.event, notification.element)}`\n\n if (options.linkPassword) {\n content += `<br><br>${tr.passwordText}: <div style=\"border:1px solid #000; padding:8px; display:inline-block;\">${options.linkPassword}</div>`\n }\n\n const footer = `<br>${tr.urlText} <a href=\"${urlFromLink(options.currentUrl, options.linkUUID)}\">${SERVER_NAME}</a>`\n\n return [`${tr.title}: ${capitalizeString(notification.element)}`, mailTemplate(content, footer)]\n}\n\nexport function syncMail(\n language: string,\n notification: NotificationContent,\n options: {\n currentUrl: string\n action: ACTION\n }\n): [string, string] {\n const tr = translateObject(language, {\n title: 'Sync',\n defaultFooter: defaultFooter,\n urlText: options.action === ACTION.ADD ? 'Access it from' : 'Access your syncs from',\n event: notification.event\n })\n\n const syncUrl = urlFromSync(options.currentUrl)\n\n const content = `${mailEventOnElement(tr.event, notification.element)}`\n\n const footer = `<br>${tr.urlText} <a href=\"${syncUrl}\">${SERVER_NAME}</a><br>${tr.defaultFooter}`\n\n return [`${tr.title}: ${capitalizeString(notification.element)}`, mailTemplate(content, footer)]\n}\n\nexport function auth2FaMail(language: string, notification: NotificationContent): [string, string] {\n const tr = translateObject(language, {\n title: 'Security notification',\n footer:\n 'You received this notification because the security of your Sync-in account has changed. If you think this was a mistake, please review your security settings or contact your administrator.',\n event: notification.event,\n addressIp: 'Address IP',\n browser: 'Browser'\n })\n\n const content = `${tr.event}<br><br>${tr.addressIp}: ${notification.url}<br>${tr.browser}: ${notification.element}`\n\n const footer = `<br>${tr.footer}<br>`\n\n return [tr.title, mailTemplate(content, footer)]\n}\n\nexport function authLocked(language: string, notification: NotificationContent): [string, string] {\n const tr = translateObject(language, {\n title: 'Security notification',\n footer:\n 'This security notification concerns your Sync-in account. Please contact an administrator to perform the analysis and unlock your account.',\n event: notification.event,\n addressIp: 'Address IP'\n })\n\n const content = `${tr.event}<br><br>${tr.addressIp}: ${notification.url}<br>`\n\n const footer = `<br>${tr.footer}<br>`\n\n return [tr.title, mailTemplate(content, footer)]\n}\n"],"names":["auth2FaMail","authLocked","commentMail","linkMail","shareMail","spaceMail","spaceRootMail","syncMail","language","notification","options","tr","translateObject","title","defaultFooter","footer","urlText","event","content","mailAuthor","author","mailEventOnElement","element","mailItalicContent","urlFromSpaceFile","currentUrl","SERVER_NAME","capitalizeString","mailTemplate","action","ACTION","ADD","spaceUrl","urlFromSpace","undefined","originEvent","spaceName","fileName","url","spaceRootUrl","passwordText","linkPassword","urlFromLink","linkUUID","syncUrl","urlFromSync","addressIp","browser"],"mappings":"AAAA;;;;CAIC;;;;;;;;;;;QAoKeA;eAAAA;;QAiBAC;eAAAA;;QAzKAC;eAAAA;;QAmGAC;eAAAA;;QAvBAC;eAAAA;;QApDAC;eAAAA;;QAwBAC;eAAAA;;QAgFAC;eAAAA;;;8BA1IY;2BACL;wBACU;uBACR;sBAEO;2BAE+D;sBACtB;AAElE,SAASL,YACdM,QA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U,GAAGP,GAAGM,KAAK,CAAC,QAAQ,EAAEN,GAAGmC,SAAS,CAAC,OAAO,EAAErC,aAAa6B,GAAG,CAAC,IAAI,EAAE3B,GAAGoC,OAAO,CAAC,OAAO,EAAEtC,aAAaa,OAAO,EAAE;IAE7H,MAAMP,SAAS,CAAC,IAAI,EAAEJ,GAAGI,MAAM,CAAC,IAAI,CAAC;IAErC,OAAO;QAACJ,GAAGE,KAAK;QAAEe,IAAAA,uBAAY,EAACV,SAASH;KAAQ;AAClD;AAEO,SAASd,WAAWO,QAAgB,EAAEC,YAAiC;IAC5E,MAAME,KAAKC,IAAAA,qBAAe,EAACJ,UAAU;QACnCK,OAAO;QACPE,QACE;QACFE,OAAOR,aAAaQ,KAAK;QACzB6B,WAAW;IACb;IAEA,MAAM5B,UAAU,GAAGP,GAAGM,KAAK,CAAC,QAAQ,EAAEN,GAAGmC,SAAS,CAAC,OAAO,EAAErC,aAAa6B,GAAG,CAAC,IAAI,CAAC;IAElF,MAAMvB,SAAS,CAAC,IAAI,EAAEJ,GAAGI,MAAM,CAAC,IAAI,CAAC;IAErC,OAAO;QAACJ,GAAGE,KAAK;QAAEe,IAAAA,uBAAY,EAACV,SAASH;KAAQ;AAClD"}
|
|
1
|
+
{"version":3,"sources":["../../../../../backend/src/applications/notifications/mails/models.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport { ACTION } from '../../../common/constants'\nimport { i18nLocale } from '../../../common/i18n'\nimport { capitalizeString, SERVER_NAME } from '../../../common/shared'\nimport { fileName } from '../../files/utils/files'\nimport { UserModel } from '../../users/models/user.model'\nimport { translateObject } from '../i18n'\nimport { NotificationContent } from '../interfaces/notification-properties.interface'\nimport { defaultFooter, mailAuthor, mailEventOnElement, mailItalicContent, mailTemplate } from './templates'\nimport { urlFromLink, urlFromSpace, urlFromSpaceFile, urlFromSync } from './urls'\n\nexport function commentMail(\n language: i18nLocale,\n notification: NotificationContent,\n options: {\n content: string\n currentUrl: string\n author: UserModel\n }\n): [string, string] {\n const tr = translateObject(language, {\n title: 'Comment',\n defaultFooter: defaultFooter,\n footer: 'You receive this notification if you are the owner of the file or if you have also commented on this file',\n urlText: 'Access it from',\n event: notification.event\n })\n\n const content = `${mailAuthor(options.author)}${mailEventOnElement(tr.event, notification.element)}${mailItalicContent(options.content)}`\n\n const footer = `<br>${tr.urlText} <a href=\"${urlFromSpaceFile(options.currentUrl, notification)}\">${SERVER_NAME}</a><br>${tr.footer}<br>${tr.defaultFooter}`\n\n return [`${tr.title}: ${capitalizeString(notification.element)}`, mailTemplate(content, footer)]\n}\n\nexport function spaceMail(\n language: i18nLocale,\n notification: NotificationContent,\n options: {\n currentUrl: string\n action: ACTION\n }\n): [string, string] {\n const tr = translateObject(language, {\n title: 'Space',\n defaultFooter: defaultFooter,\n urlText: options.action === ACTION.ADD ? 'Access it from' : 'Access your spaces from',\n event: notification.event\n })\n\n const spaceUrl = urlFromSpace(options.currentUrl, options.action === ACTION.ADD ? notification.element : undefined)\n\n const content = `${mailEventOnElement(tr.event, notification.element)}`\n\n const footer = `<br>${tr.urlText} <a href=\"${spaceUrl}\">${SERVER_NAME}</a><br>${tr.defaultFooter}`\n\n return [`${tr.title}: ${capitalizeString(notification.element)}`, mailTemplate(content, footer)]\n}\n\nexport function spaceRootMail(\n language: i18nLocale,\n notification: NotificationContent,\n options: {\n currentUrl: string\n author: UserModel\n action: ACTION\n }\n): [string, string] {\n const tr = translateObject(language, {\n title: 'Space',\n defaultFooter: defaultFooter,\n urlText: options.action === ACTION.ADD ? 'Access it from' : 'Access this space from',\n event: notification.event,\n originEvent: options.action === ACTION.ADD ? 'to the space' : 'from the space'\n })\n\n const spaceName = fileName(notification.url)\n const spaceRootUrl =\n options.action === ACTION.ADD ? urlFromSpaceFile(options.currentUrl, notification) : urlFromSpace(options.currentUrl, spaceName)\n\n const content = `${mailAuthor(options.author)}${mailEventOnElement(tr.event, notification.element)} ${tr.originEvent} <b>${spaceName}</b>`\n\n const footer = `<br>${tr.urlText} <a href=\"${spaceRootUrl}\">${SERVER_NAME}</a><br>${tr.defaultFooter}`\n\n return [`${tr.title}: ${capitalizeString(spaceName)}`, mailTemplate(content, footer)]\n}\n\nexport function shareMail(\n language: i18nLocale,\n notification: NotificationContent,\n options: {\n currentUrl: string\n author: UserModel\n action: ACTION\n }\n): [string, string] {\n const tr = translateObject(language, {\n title: 'Share',\n defaultFooter: defaultFooter,\n urlText: options.action === ACTION.ADD ? 'Access it from' : 'Access your shares from',\n event: notification.event\n })\n\n const content = `${options.author ? mailAuthor(options.author) : ''}${mailEventOnElement(tr.event, notification.element)}`\n\n const footer = `<br>${tr.urlText} <a href=\"${urlFromSpaceFile(options.currentUrl, notification)}\">${SERVER_NAME}</a><br>${tr.defaultFooter}`\n\n return [`${tr.title}: ${capitalizeString(notification.element)}`, mailTemplate(content, footer)]\n}\n\nexport function linkMail(\n language: i18nLocale,\n notification: NotificationContent,\n options: {\n currentUrl: string\n author: UserModel\n action: ACTION\n linkUUID: string\n linkPassword: string\n }\n): [string, string] {\n const tr = translateObject(language, {\n title: options.action === ACTION.ADD ? 'Share' : 'Space',\n passwordText: 'Access password',\n urlText: 'Access it from',\n event: notification.event\n })\n\n let content = `${options.author ? mailAuthor(options.author) : ''}${mailEventOnElement(tr.event, notification.element)}`\n\n if (options.linkPassword) {\n content += `<br><br>${tr.passwordText}: <div style=\"border:1px solid #000; padding:8px; display:inline-block;\">${options.linkPassword}</div>`\n }\n\n const footer = `<br>${tr.urlText} <a href=\"${urlFromLink(options.currentUrl, options.linkUUID)}\">${SERVER_NAME}</a>`\n\n return [`${tr.title}: ${capitalizeString(notification.element)}`, mailTemplate(content, footer)]\n}\n\nexport function syncMail(\n language: i18nLocale,\n notification: NotificationContent,\n options: {\n currentUrl: string\n action: ACTION\n }\n): [string, string] {\n const tr = translateObject(language, {\n title: 'Sync',\n defaultFooter: defaultFooter,\n urlText: options.action === ACTION.ADD ? 'Access it from' : 'Access your syncs from',\n event: notification.event\n })\n\n const syncUrl = urlFromSync(options.currentUrl)\n\n const content = `${mailEventOnElement(tr.event, notification.element)}`\n\n const footer = `<br>${tr.urlText} <a href=\"${syncUrl}\">${SERVER_NAME}</a><br>${tr.defaultFooter}`\n\n return [`${tr.title}: ${capitalizeString(notification.element)}`, mailTemplate(content, footer)]\n}\n\nexport function auth2FaMail(language: i18nLocale, notification: NotificationContent): [string, string] {\n const tr = translateObject(language, {\n title: 'Security notification',\n footer:\n 'You received this notification because the security of your Sync-in account has changed. If you think this was a mistake, please review your security settings or contact your administrator.',\n event: notification.event,\n addressIp: 'Address IP',\n browser: 'Browser'\n })\n\n const content = `${tr.event}<br><br>${tr.addressIp}: ${notification.url}<br>${tr.browser}: ${notification.element}`\n\n const footer = `<br>${tr.footer}<br>`\n\n return [tr.title, mailTemplate(content, footer)]\n}\n\nexport function authLocked(language: i18nLocale, notification: NotificationContent): [string, string] {\n const tr = translateObject(language, {\n title: 'Security notification',\n footer:\n 'This security notification concerns your Sync-in account. Please contact an administrator to perform the analysis and unlock your account.',\n event: notification.event,\n addressIp: 'Address IP'\n })\n\n const content = `${tr.event}<br><br>${tr.addressIp}: ${notification.url}<br>`\n\n const footer = `<br>${tr.footer}<br>`\n\n return [tr.title, mailTemplate(content, footer)]\n}\n"],"names":["auth2FaMail","authLocked","commentMail","linkMail","shareMail","spaceMail","spaceRootMail","syncMail","language","notification","options","tr","translateObject","title","defaultFooter","footer","urlText","event","content","mailAuthor","author","mailEventOnElement","element","mailItalicContent","urlFromSpaceFile","currentUrl","SERVER_NAME","capitalizeString","mailTemplate","action","ACTION","ADD","spaceUrl","urlFromSpace","undefined","originEvent","spaceName","fileName","url","spaceRootUrl","passwordText","linkPassword","urlFromLink","linkUUID","syncUrl","urlFromSync","addressIp","browser"],"mappings":"AAAA;;;;CAIC;;;;;;;;;;;QAoKeA;eAAAA;;QAiBAC;eAAAA;;Q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oB,EAAEC,YAAiC;IACjF,MAAME,KAAKC,IAAAA,qBAAe,EAACJ,UAAU;QACnCK,OAAO;QACPE,QACE;QACFE,OAAOR,aAAaQ,KAAK;QACzB6B,WAAW;QACXC,SAAS;IACX;IAEA,MAAM7B,UAAU,GAAGP,GAAGM,KAAK,CAAC,QAAQ,EAAEN,GAAGmC,SAAS,CAAC,OAAO,EAAErC,aAAa6B,GAAG,CAAC,IAAI,EAAE3B,GAAGoC,OAAO,CAAC,OAAO,EAAEtC,aAAaa,OAAO,EAAE;IAE7H,MAAMP,SAAS,CAAC,IAAI,EAAEJ,GAAGI,MAAM,CAAC,IAAI,CAAC;IAErC,OAAO;QAACJ,GAAGE,KAAK;QAAEe,IAAAA,uBAAY,EAACV,SAASH;KAAQ;AAClD;AAEO,SAASd,WAAWO,QAAoB,EAAEC,YAAiC;IAChF,MAAME,KAAKC,IAAAA,qBAAe,EAACJ,UAAU;QACnCK,OAAO;QACPE,QACE;QACFE,OAAOR,aAAaQ,KAAK;QACzB6B,WAAW;IACb;IAEA,MAAM5B,UAAU,GAAGP,GAAGM,KAAK,CAAC,QAAQ,EAAEN,GAAGmC,SAAS,CAAC,OAAO,EAAErC,aAAa6B,GAAG,CAAC,IAAI,CAAC;IAElF,MAAMvB,SAAS,CAAC,IAAI,EAAEJ,GAAGI,MAAM,CAAC,IAAI,CAAC;IAErC,OAAO;QAACJ,GAAGE,KAAK;QAAEe,IAAAA,uBAAY,EAACV,SAASH;KAAQ;AAClD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../backend/src/applications/notifications/services/notifications-manager.service.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport { Injectable, Logger } from '@nestjs/common'\nimport { MailProps } from '../../../infrastructure/mailer/interfaces/mail.interface'\nimport { Mailer } from '../../../infrastructure/mailer/mailer.service'\nimport { USER_NOTIFICATION } from '../../users/constants/user'\nimport { UserModel } from '../../users/models/user.model'\nimport { getAvatarBase64 } from '../../users/utils/avatar'\nimport { NOTIFICATION_APP } from '../constants/notifications'\nimport { NOTIFICATIONS_WS } from '../constants/websocket'\nimport type { NotificationContent, NotificationFromUser, NotificationOptions } from '../interfaces/notification-properties.interface'\nimport type { UserMailNotification } from '../interfaces/user-mail-notification'\nimport { auth2FaMail, authLocked, commentMail, linkMail, shareMail, spaceMail, spaceRootMail, syncMail } from '../mails/models'\nimport { WebSocketNotifications } from '../notifications.gateway'\nimport { NotificationsQueries } from './notifications-queries.service'\n\n@Injectable()\nexport class NotificationsManager {\n private readonly logger = new Logger(NotificationsManager.name)\n\n constructor(\n private readonly mailer: Mailer,\n private readonly notificationsQueries: NotificationsQueries,\n private readonly webSocketNotifications: WebSocketNotifications\n ) {}\n\n list(user: UserModel, onlyUnread: boolean = false): Promise<NotificationFromUser[]> {\n return this.notificationsQueries.list(user.id, onlyUnread)\n }\n\n async create(toUsers: UserMailNotification[] | number[], content: NotificationContent, options?: NotificationOptions): Promise<void> {\n // store it in db\n const isArrayOfUsers: boolean = typeof toUsers[0] === 'object'\n const toUserIds = isArrayOfUsers ? (toUsers as UserMailNotification[]).map((m) => m.id) : (toUsers as number[])\n this.storeNotification(toUserIds, content, options?.author?.id).catch((e: Error) => this.logger.error(`${this.create.name} - ${e}`))\n\n // send websocket notification\n this.webSocketNotifications.sendMessageToUsers(toUserIds, NOTIFICATIONS_WS.EVENTS.NOTIFICATION, 'check')\n\n // send emails\n if (this.mailer.available) {\n const usersNotifiedByEmail: UserMailNotification[] = isArrayOfUsers\n ? (toUsers as UserMailNotification[]).filter((u) => u.notification === USER_NOTIFICATION.APPLICATION_EMAIL)\n : await this.notificationsQueries.usersNotifiedByEmail(toUsers as number[])\n if (!usersNotifiedByEmail.length) {\n return\n }\n this.sendEmailNotification(usersNotifiedByEmail, content, options).catch((e: Error) => this.logger.error(`${this.create.name} - ${e}`))\n }\n }\n\n wasRead(user: UserModel, notificationId?: number): void {\n this.notificationsQueries.wasRead(user.id, notificationId).catch((e: Error) => this.logger.error(`${this.wasRead.name} - ${e}`))\n }\n\n async delete(user: UserModel, notificationId?: number): Promise<void> {\n return this.notificationsQueries.delete(user.id, notificationId)\n }\n\n async sendEmailNotification(toUsers: UserMailNotification[], content: NotificationContent, options?: NotificationOptions): Promise<void> {\n if (!this.mailer.available) {\n return\n }\n if (options?.author) {\n options.author.avatarBase64 = await getAvatarBase64(options.author.login)\n }\n this.mailer\n .sendMails(\n await Promise.all(\n toUsers.map(async (m) => {\n const [title, html] = this.genMail(m.language, content, options)\n return {\n to: m.email,\n subject: title,\n html: html\n } satisfies MailProps\n })\n )\n )\n .catch((e: Error) => this.logger.error(`${this.sendEmailNotification.name} - ${e}`))\n }\n\n private async storeNotification(toUserIds: number[], content: NotificationContent, authorId?: number): Promise<void> {\n // store it in db\n try {\n await this.notificationsQueries.create(authorId || null, toUserIds, content)\n } catch (e) {\n this.logger.error(`${this.create.name} - ${e}`)\n }\n }\n\n private genMail(language: string, content: NotificationContent, options?: NotificationOptions): [string, string] {\n switch (content.app) {\n case NOTIFICATION_APP.COMMENTS:\n return commentMail(language, content, { content: options.content, currentUrl: options.currentUrl, author: options.author })\n case NOTIFICATION_APP.SPACES:\n return spaceMail(language, content, { currentUrl: options.currentUrl, action: options.action })\n case NOTIFICATION_APP.SPACE_ROOTS:\n return spaceRootMail(language, content, { currentUrl: options.currentUrl, author: options.author, action: options.action })\n case NOTIFICATION_APP.SHARES:\n return shareMail(language, content, { currentUrl: options.currentUrl, author: options.author, action: options.action })\n case NOTIFICATION_APP.LINKS:\n return linkMail(language, content, {\n currentUrl: options.currentUrl,\n author: options.author,\n linkUUID: options.linkUUID,\n linkPassword: options.linkPassword,\n action: options.action\n })\n case NOTIFICATION_APP.SYNC:\n return syncMail(language, content, { currentUrl: options.currentUrl, action: options.action })\n case NOTIFICATION_APP.AUTH_2FA:\n return auth2FaMail(language, content)\n case NOTIFICATION_APP.AUTH_LOCKED:\n return authLocked(language, content)\n default:\n this.logger.error(`${this.genMail.name} - case not handled : ${content.app}`)\n }\n }\n}\n"],"names":["NotificationsManager","list","user","onlyUnread","notificationsQueries","id","create","toUsers","content","options","isArrayOfUsers","toUserIds","map","m","storeNotification","author","catch","e","logger","error","name","webSocketNotifications","sendMessageToUsers","NOTIFICATIONS_WS","EVENTS","NOTIFICATION","mailer","available","usersNotifiedByEmail","filter","u","notification","USER_NOTIFICATION","APPLICATION_EMAIL","length","sendEmailNotification","wasRead","notificationId","delete","avatarBase64","getAvatarBase64","login","sendMails","Promise","all","title","html","genMail","language","to","email","subject","authorId","app","NOTIFICATION_APP","COMMENTS","commentMail","currentUrl","SPACES","spaceMail","action","SPACE_ROOTS","spaceRootMail","SHARES","shareMail","LINKS","linkMail","linkUUID","linkPassword","SYNC","syncMail","AUTH_2FA","auth2FaMail","AUTH_LOCKED","authLocked","Logger"],"mappings":"AAAA;;;;CAIC;;;;+BAiBYA;;;eAAAA;;;wBAfsB;+BAEZ;sBACW;wBAEF;+BACC;2BACA;wBAG6E;sCACvE;6CACF;;;;;;;;;;AAG9B,IAAA,AAAMA,uBAAN,MAAMA;IASXC,KAAKC,IAAe,EAAEC,aAAsB,KAAK,EAAmC;QAClF,OAAO,IAAI,CAACC,oBAAoB,CAACH,IAAI,CAACC,KAAKG,EAAE,EAAEF;IACjD;IAEA,MAAMG,OAAOC,OAA0C,EAAEC,OAA4B,EAAEC,OAA6B,EAAiB;QACnI,iBAAiB;QACjB,MAAMC,iBAA0B,OAAOH,OAAO,CAAC,EAAE,KAAK;QACtD,MAAMI,YAAYD,iBAAiB,AAACH,QAAmCK,GAAG,CAAC,CAACC,IAAMA,EAAER,EAAE,IAAKE;QAC3F,IAAI,CAACO,iBAAiB,CAACH,WAAWH,SAASC,SAASM,QAAQV,IAAIW,KAAK,CAAC,CAACC,IAAa,IAAI,CAACC,MAAM,CAACC,KAAK,CAAC,GAAG,IAAI,C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E,qBAAqBoB,IAAI;IAM3D;AA+FL"}
|
|
1
|
+
{"version":3,"sources":["../../../../../backend/src/applications/notifications/services/notifications-manager.service.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport { Injectable, Logger } from '@nestjs/common'\nimport { i18nLocale } from '../../../common/i18n'\nimport { MailProps } from '../../../infrastructure/mailer/interfaces/mail.interface'\nimport { Mailer } from '../../../infrastructure/mailer/mailer.service'\nimport { USER_NOTIFICATION } from '../../users/constants/user'\nimport { UserModel } from '../../users/models/user.model'\nimport { getAvatarBase64 } from '../../users/utils/avatar'\nimport { NOTIFICATION_APP } from '../constants/notifications'\nimport { NOTIFICATIONS_WS } from '../constants/websocket'\nimport type { NotificationContent, NotificationFromUser, NotificationOptions } from '../interfaces/notification-properties.interface'\nimport type { UserMailNotification } from '../interfaces/user-mail-notification'\nimport { auth2FaMail, authLocked, commentMail, linkMail, shareMail, spaceMail, spaceRootMail, syncMail } from '../mails/models'\nimport { WebSocketNotifications } from '../notifications.gateway'\nimport { NotificationsQueries } from './notifications-queries.service'\n\n@Injectable()\nexport class NotificationsManager {\n private readonly logger = new Logger(NotificationsManager.name)\n\n constructor(\n private readonly mailer: Mailer,\n private readonly notificationsQueries: NotificationsQueries,\n private readonly webSocketNotifications: WebSocketNotifications\n ) {}\n\n list(user: UserModel, onlyUnread: boolean = false): Promise<NotificationFromUser[]> {\n return this.notificationsQueries.list(user.id, onlyUnread)\n }\n\n async create(toUsers: UserMailNotification[] | number[], content: NotificationContent, options?: NotificationOptions): Promise<void> {\n // store it in db\n const isArrayOfUsers: boolean = typeof toUsers[0] === 'object'\n const toUserIds = isArrayOfUsers ? (toUsers as UserMailNotification[]).map((m) => m.id) : (toUsers as number[])\n this.storeNotification(toUserIds, content, options?.author?.id).catch((e: Error) => this.logger.error(`${this.create.name} - ${e}`))\n\n // send websocket notification\n this.webSocketNotifications.sendMessageToUsers(toUserIds, NOTIFICATIONS_WS.EVENTS.NOTIFICATION, 'check')\n\n // send emails\n if (this.mailer.available) {\n const usersNotifiedByEmail: UserMailNotification[] = isArrayOfUsers\n ? (toUsers as UserMailNotification[]).filter((u) => u.notification === USER_NOTIFICATION.APPLICATION_EMAIL)\n : await this.notificationsQueries.usersNotifiedByEmail(toUsers as number[])\n if (!usersNotifiedByEmail.length) {\n return\n }\n this.sendEmailNotification(usersNotifiedByEmail, content, options).catch((e: Error) => this.logger.error(`${this.create.name} - ${e}`))\n }\n }\n\n wasRead(user: UserModel, notificationId?: number): void {\n this.notificationsQueries.wasRead(user.id, notificationId).catch((e: Error) => this.logger.error(`${this.wasRead.name} - ${e}`))\n }\n\n async delete(user: UserModel, notificationId?: number): Promise<void> {\n return this.notificationsQueries.delete(user.id, notificationId)\n }\n\n async sendEmailNotification(toUsers: UserMailNotification[], content: NotificationContent, options?: NotificationOptions): Promise<void> {\n if (!this.mailer.available) {\n return\n }\n if (options?.author) {\n options.author.avatarBase64 = await getAvatarBase64(options.author.login)\n }\n this.mailer\n .sendMails(\n await Promise.all(\n toUsers.map(async (m) => {\n const [title, html] = this.genMail(m.language as i18nLocale, content, options)\n return {\n to: m.email,\n subject: title,\n html: html\n } satisfies MailProps\n })\n )\n )\n .catch((e: Error) => this.logger.error(`${this.sendEmailNotification.name} - ${e}`))\n }\n\n private async storeNotification(toUserIds: number[], content: NotificationContent, authorId?: number): Promise<void> {\n // store it in db\n try {\n await this.notificationsQueries.create(authorId || null, toUserIds, content)\n } catch (e) {\n this.logger.error(`${this.create.name} - ${e}`)\n }\n }\n\n private genMail(language: i18nLocale, content: NotificationContent, options?: NotificationOptions): [string, string] {\n switch (content.app) {\n case NOTIFICATION_APP.COMMENTS:\n return commentMail(language, content, { content: options.content, currentUrl: options.currentUrl, author: options.author })\n case NOTIFICATION_APP.SPACES:\n return spaceMail(language, content, { currentUrl: options.currentUrl, action: options.action })\n case NOTIFICATION_APP.SPACE_ROOTS:\n return spaceRootMail(language, content, { currentUrl: options.currentUrl, author: options.author, action: options.action })\n case NOTIFICATION_APP.SHARES:\n return shareMail(language, content, { currentUrl: options.currentUrl, author: options.author, action: options.action })\n case NOTIFICATION_APP.LINKS:\n return linkMail(language, content, {\n currentUrl: options.currentUrl,\n author: options.author,\n linkUUID: options.linkUUID,\n linkPassword: options.linkPassword,\n action: options.action\n })\n case NOTIFICATION_APP.SYNC:\n return syncMail(language, content, { currentUrl: options.currentUrl, action: options.action })\n case NOTIFICATION_APP.AUTH_2FA:\n return auth2FaMail(language, content)\n case NOTIFICATION_APP.AUTH_LOCKED:\n return authLocked(language, content)\n default:\n this.logger.error(`${this.genMail.name} - case not handled : ${content.app}`)\n }\n }\n}\n"],"names":["NotificationsManager","list","user","onlyUnread","notificationsQueries","id","create","toUsers","content","options","isArrayOfUsers","toUserIds","map","m","storeNotification","author","catch","e","logger","error","name","webSocketNotifications","sendMessageToUsers","NOTIFICATIONS_WS","EVENTS","NOTIFICATION","mailer","available","usersNotifiedByEmail","filter","u","notification","USER_NOTIFICATION","APPLICATION_EMAIL","length","sendEmailNotification","wasRead","notificationId","delete","avatarBase64","getAvatarBase64","login","sendMails","Promise","all","title","html","genMail","language","to","email","subject","authorId","app","NOTIFICATION_APP","COMMENTS","commentMail","currentUrl","SPACES","spaceMail","action","SPACE_ROOTS","spaceRootMail","SHARES","shareMail","LINKS","linkMail","linkUUID","linkPassword","SYNC","syncMail","AUTH_2FA","auth2FaMail","AUTH_LOCKED","authLocked","Logger"],"mappings":"AAAA;;;;CAIC;;;;+BAkBYA;;;eAAAA;;;wBAhBsB;+BAGZ;sBACW;wBAEF;+BACC;2BACA;wBAG6E;sCACvE;6CACF;;;;;;;;;;AAG9B,IAAA,AAAMA,uBAAN,MAAMA;IASXC,KAAKC,IAAe,EAAEC,aAAsB,KAAK,EAAmC;QAClF,OAAO,IAAI,CAACC,oBAAoB,CAACH,IAAI,CAACC,KAAKG,EAAE,EAAEF;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mB,WAAW;gBAC/B,OAAOC,IAAAA,kBAAU,EAAC1B,UAAUxC;YAC9B;gBACE,IAAI,CAACU,MAAM,CAACC,KAAK,CAAC,GAAG,IAAI,CAAC4B,OAAO,CAAC3B,IAAI,CAAC,sBAAsB,EAAEZ,QAAQ6C,GAAG,EAAE;QAChF;IACF;IAlGA,YACE,AAAiB3B,MAAc,EAC/B,AAAiBtB,oBAA0C,EAC3D,AAAiBiB,sBAA8C,CAC/D;aAHiBK,SAAAA;aACAtB,uBAAAA;aACAiB,yBAAAA;aALFH,SAAS,IAAIyD,cAAM,CAAC3E,qBAAqBoB,IAAI;IAM3D;AA+FL"}
|
|
@@ -154,6 +154,7 @@ _ts_decorate([
|
|
|
154
154
|
let CreateOrUpdateShareDto = class CreateOrUpdateShareDto {
|
|
155
155
|
constructor(){
|
|
156
156
|
this.externalPath = null;
|
|
157
|
+
this.storageQuota = null;
|
|
157
158
|
this.// contains members (users, guests, links, groups, personal groups)
|
|
158
159
|
members = [];
|
|
159
160
|
this.// contains links
|
|
@@ -197,6 +198,16 @@ _ts_decorate([
|
|
|
197
198
|
(0, _classvalidator.IsBoolean)(),
|
|
198
199
|
_ts_metadata("design:type", Boolean)
|
|
199
200
|
], CreateOrUpdateShareDto.prototype, "enabled", void 0);
|
|
201
|
+
_ts_decorate([
|
|
202
|
+
(0, _classvalidator.IsOptional)(),
|
|
203
|
+
(0, _classvalidator.IsInt)(),
|
|
204
|
+
_ts_metadata("design:type", Number)
|
|
205
|
+
], CreateOrUpdateShareDto.prototype, "storageQuota", void 0);
|
|
206
|
+
_ts_decorate([
|
|
207
|
+
(0, _classvalidator.IsOptional)(),
|
|
208
|
+
(0, _classvalidator.IsBoolean)(),
|
|
209
|
+
_ts_metadata("design:type", Boolean)
|
|
210
|
+
], CreateOrUpdateShareDto.prototype, "storageIndexing", void 0);
|
|
200
211
|
_ts_decorate([
|
|
201
212
|
(0, _classvalidator.IsOptional)(),
|
|
202
213
|
(0, _classvalidator.ValidateNested)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../backend/src/applications/shares/dto/create-or-update-share.dto.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport { Transform, Type } from 'class-transformer'\nimport { IsArray, IsBoolean, IsEnum, IsInt, IsNotEmpty, IsOptional, IsString, ValidateIf, ValidateNested } from 'class-validator'\nimport { FileSpace } from '../../files/interfaces/file-space.interface'\nimport { sanitizeName, sanitizePath } from '../../files/utils/files'\nimport { CreateOrUpdateLinkDto } from '../../links/dto/create-or-update-link.dto'\nimport { MEMBER_TYPE, MEMBER_TYPE_REVERSE } from '../../users/constants/member'\nimport { SHARE_TYPE } from '../constants/shares'\n\nexport class ShareMemberDto {\n @IsNotEmpty()\n @IsInt()\n id: number\n\n @IsNotEmpty()\n @IsString()\n @Transform(({ value }) => MEMBER_TYPE_REVERSE[value])\n type: MEMBER_TYPE\n\n @IsOptional()\n @IsString()\n permissions?: string = ''\n\n @IsOptional()\n @IsInt()\n linkId?: number\n\n // used only to update the link\n @IsOptional()\n @ValidateNested()\n @Type(() => CreateOrUpdateLinkDto)\n linkSettings?: CreateOrUpdateLinkDto = null\n}\n\nexport class ShareFileSpaceRootDto {\n @IsOptional()\n @IsString()\n @Transform(({ value }) => (value ? sanitizeName(value.trim()) : ''))\n alias: string\n\n @IsOptional()\n @IsString()\n @Transform(({ value }) => (value ? sanitizeName(value.trim()) : ''))\n name: string\n}\n\nexport class ShareFileSpaceDto {\n @IsOptional()\n @IsString()\n @Transform(({ value }) => (value ? value.trim() : ''))\n alias: string\n\n @IsOptional()\n @IsString()\n @Transform(({ value }) => (value ? value.trim() : ''))\n name: string\n\n @IsOptional()\n @ValidateNested()\n @Type(() => ShareFileSpaceRootDto)\n root: ShareFileSpaceRootDto\n}\n\nexport class ShareParentDto {\n @IsNotEmpty()\n @IsString()\n @Transform(({ value }) => (value ? value.trim() : ''))\n alias: string\n}\n\nexport class ShareFileDto implements Omit<FileSpace, 'mime' | 'name' | 'inTrash' | 'isDir'> {\n @IsNotEmpty()\n @IsInt()\n id: number\n\n @ValidateIf((_, ownerId) => ownerId === null || typeof ownerId === 'number')\n ownerId: number\n\n @IsNotEmpty()\n @IsString()\n @Transform(({ value }) => sanitizePath(value))\n path: string\n\n @IsOptional()\n @IsString()\n permissions?: string\n\n @IsOptional()\n @ValidateNested()\n @Type(() => ShareFileSpaceDto)\n space: ShareFileSpaceDto\n}\n\nexport class CreateOrUpdateShareDto {\n @IsOptional()\n @IsInt()\n id?: number\n\n @IsNotEmpty()\n @IsString()\n @Transform(({ value }) => (value ? sanitizeName(value.trim()) : ''))\n name: string\n\n @IsOptional()\n @IsString()\n @Transform(({ value }) => (value ? sanitizeName(value.trim()) : ''))\n alias?: string\n\n @IsOptional()\n @IsEnum(SHARE_TYPE)\n type?: SHARE_TYPE\n\n @IsOptional()\n @IsString()\n description?: string\n\n @IsOptional()\n @IsString()\n externalPath?: string = null\n\n @IsOptional()\n @IsBoolean()\n enabled?: boolean\n\n @IsOptional()\n @ValidateNested()\n @Type(() => ShareParentDto)\n parent?: ShareParentDto\n\n @IsOptional()\n @ValidateIf((_, file) => !_.externalPath && file?.id)\n @ValidateNested()\n @Type(() => ShareFileDto)\n file?: ShareFileDto\n\n @IsOptional()\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => ShareMemberDto)\n // contains members (users, guests, links, groups, personal groups)\n members?: ShareMemberDto[] = []\n\n @IsOptional()\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => ShareMemberDto)\n // contains links\n links?: ShareMemberDto[] = []\n}\n"],"names":["CreateOrUpdateShareDto","ShareFileDto","ShareFileSpaceDto","ShareFileSpaceRootDto","ShareMemberDto","ShareParentDto","permissions","linkSettings","value","MEMBER_TYPE_REVERSE","CreateOrUpdateLinkDto","sanitizeName","trim","_","ownerId","sanitizePath","externalPath","members","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;
|
|
1
|
+
{"version":3,"sources":["../../../../../backend/src/applications/shares/dto/create-or-update-share.dto.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\n\nimport { Transform, Type } from 'class-transformer'\nimport { IsArray, IsBoolean, IsEnum, IsInt, IsNotEmpty, IsOptional, IsString, ValidateIf, ValidateNested } from 'class-validator'\nimport { FileSpace } from '../../files/interfaces/file-space.interface'\nimport { sanitizeName, sanitizePath } from '../../files/utils/files'\nimport { CreateOrUpdateLinkDto } from '../../links/dto/create-or-update-link.dto'\nimport { MEMBER_TYPE, MEMBER_TYPE_REVERSE } from '../../users/constants/member'\nimport { SHARE_TYPE } from '../constants/shares'\n\nexport class ShareMemberDto {\n @IsNotEmpty()\n @IsInt()\n id: number\n\n @IsNotEmpty()\n @IsString()\n @Transform(({ value }) => MEMBER_TYPE_REVERSE[value])\n type: MEMBER_TYPE\n\n @IsOptional()\n @IsString()\n permissions?: string = ''\n\n @IsOptional()\n @IsInt()\n linkId?: number\n\n // used only to update the link\n @IsOptional()\n @ValidateNested()\n @Type(() => CreateOrUpdateLinkDto)\n linkSettings?: CreateOrUpdateLinkDto = null\n}\n\nexport class ShareFileSpaceRootDto {\n @IsOptional()\n @IsString()\n @Transform(({ value }) => (value ? sanitizeName(value.trim()) : ''))\n alias: string\n\n @IsOptional()\n @IsString()\n @Transform(({ value }) => (value ? sanitizeName(value.trim()) : ''))\n name: string\n}\n\nexport class ShareFileSpaceDto {\n @IsOptional()\n @IsString()\n @Transform(({ value }) => (value ? value.trim() : ''))\n alias: string\n\n @IsOptional()\n @IsString()\n @Transform(({ value }) => (value ? value.trim() : ''))\n name: string\n\n @IsOptional()\n @ValidateNested()\n @Type(() => ShareFileSpaceRootDto)\n root: ShareFileSpaceRootDto\n}\n\nexport class ShareParentDto {\n @IsNotEmpty()\n @IsString()\n @Transform(({ value }) => (value ? value.trim() : ''))\n alias: string\n}\n\nexport class ShareFileDto implements Omit<FileSpace, 'mime' | 'name' | 'inTrash' | 'isDir'> {\n @IsNotEmpty()\n @IsInt()\n id: number\n\n @ValidateIf((_, ownerId) => ownerId === null || typeof ownerId === 'number')\n ownerId: number\n\n @IsNotEmpty()\n @IsString()\n @Transform(({ value }) => sanitizePath(value))\n path: string\n\n @IsOptional()\n @IsString()\n permissions?: string\n\n @IsOptional()\n @ValidateNested()\n @Type(() => ShareFileSpaceDto)\n space: ShareFileSpaceDto\n}\n\nexport class CreateOrUpdateShareDto {\n @IsOptional()\n @IsInt()\n id?: number\n\n @IsNotEmpty()\n @IsString()\n @Transform(({ value }) => (value ? sanitizeName(value.trim()) : ''))\n name: string\n\n @IsOptional()\n @IsString()\n @Transform(({ value }) => (value ? sanitizeName(value.trim()) : ''))\n alias?: string\n\n @IsOptional()\n @IsEnum(SHARE_TYPE)\n type?: SHARE_TYPE\n\n @IsOptional()\n @IsString()\n description?: string\n\n @IsOptional()\n @IsString()\n externalPath?: string = null\n\n @IsOptional()\n @IsBoolean()\n enabled?: boolean\n\n @IsOptional()\n @IsInt()\n storageQuota?: number = null\n\n @IsOptional()\n @IsBoolean()\n storageIndexing?: boolean\n\n @IsOptional()\n @ValidateNested()\n @Type(() => ShareParentDto)\n parent?: ShareParentDto\n\n @IsOptional()\n @ValidateIf((_, file) => !_.externalPath && file?.id)\n @ValidateNested()\n @Type(() => ShareFileDto)\n file?: ShareFileDto\n\n @IsOptional()\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => ShareMemberDto)\n // contains members (users, guests, links, groups, personal groups)\n members?: ShareMemberDto[] = []\n\n @IsOptional()\n @IsArray()\n @ValidateNested({ each: true })\n @Type(() => ShareMemberDto)\n // contains links\n links?: ShareMemberDto[] = []\n}\n"],"names":["CreateOrUpdateShareDto","ShareFileDto","ShareFileSpaceDto","ShareFileSpaceRootDto","ShareMemberDto","ShareParentDto","permissions","linkSettings","value","MEMBER_TYPE_REVERSE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AAmE;QACnEC,UAA6B,EAAE;aAM/B,iBAAiB;QACjBC,QAA2B,EAAE;;AAC/B;;;;;;;;;sCAxDc,EAAEX,KAAK,EAAE,GAAMA,QAAQG,IAAAA,mBAAY,EAACH,MAAMI,IAAI,MAAM;;;;;;sCAKpD,EAAEJ,KAAK,EAAE,GAAMA,QAAQG,IAAAA,mBAAY,EAACH,MAAMI,IAAI,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCA6BpDP;;;;;qCAICQ,GAAGO,OAAS,CAACP,EAAEG,YAAY,IAAII,MAAMC;;oCAEtCpB;;;;;;;QAKMqB,MAAM;;oCACZlB;;;;;;;QAMMkB,MAAM;;oCACZlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../backend/src/applications/shares/interfaces/share-props.interface.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\nimport type { FileSpace } from '../../files/interfaces/file-space.interface'\nimport type { Member } from '../../users/interfaces/member.interface'\nimport type { Share } from '../schemas/share.interface'\n\nexport class ShareProps\n implements
|
|
1
|
+
{"version":3,"sources":["../../../../../backend/src/applications/shares/interfaces/share-props.interface.ts"],"sourcesContent":["/*\n * Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>\n * This file is part of Sync-in | The open source file sync and share solution\n * See the LICENSE file for licensing details\n */\nimport type { FileSpace } from '../../files/interfaces/file-space.interface'\nimport type { Member } from '../../users/interfaces/member.interface'\nimport type { Share } from '../schemas/share.interface'\n\nexport class ShareProps\n implements\n Pick<\n Share,\n | 'id'\n | 'ownerId'\n | 'name'\n | 'alias'\n | 'enabled'\n | 'description'\n | 'externalPath'\n | 'createdAt'\n | 'modifiedAt'\n | 'disabledAt'\n | 'storageUsage'\n | 'storageQuota'\n | 'storageIndexing'\n >\n{\n id: number\n ownerId: number\n alias: string\n name: string\n description: string\n enabled: boolean\n externalPath: string\n storageUsage: number\n storageQuota: number\n storageIndexing: boolean\n createdAt: Date\n modifiedAt: Date\n disabledAt: Date\n parent: Pick<Share, 'id' | 'ownerId' | 'alias' | 'name'>\n file: FileSpace\n\n // Extra properties\n members: Member[] = []\n}\n"],"names":["ShareProps","members"],"mappings":"AAAA;;;;CAIC;;;;+BAKYA;;;eAAAA;;;AAAN,IAAA,AAAMA,aAAN,MAAMA;;QAmCX,mBAAmB;aACnBC,UAAoB,EAAE;;AACxB"}
|