itlab-internal-services 2.15.7 → 2.16.0
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/README.md +1 -187
- package/dist/classes/document-merger.class.js +3 -5
- package/dist/classes/index.d.ts +1 -0
- package/dist/classes/index.js +3 -1
- package/dist/classes/report-category.class.d.ts +55 -0
- package/dist/classes/report-category.class.js +120 -0
- package/dist/decorators/{account.decorator.d.ts → authenticated-account.decorator.d.ts} +4 -4
- package/dist/decorators/{account.decorator.js → authenticated-account.decorator.js} +8 -10
- package/dist/decorators/index.d.ts +1 -1
- package/dist/decorators/index.js +1 -1
- package/dist/exceptions/authenticated-user-required.exception.d.ts +34 -0
- package/dist/exceptions/authenticated-user-required.exception.js +51 -0
- package/dist/exceptions/bad-body.exception.d.ts +19 -8
- package/dist/exceptions/bad-body.exception.js +26 -10
- package/dist/exceptions/bad-parameter.exception.d.ts +23 -8
- package/dist/exceptions/bad-parameter.exception.js +41 -19
- package/dist/exceptions/duplicate.exception.d.ts +20 -8
- package/dist/exceptions/duplicate.exception.js +27 -10
- package/dist/exceptions/index.d.ts +1 -0
- package/dist/exceptions/index.js +1 -0
- package/dist/functions/add-views-likes-virtuals.function.d.ts +15 -0
- package/dist/functions/add-views-likes-virtuals.function.js +43 -0
- package/dist/functions/create-internal-axios-client.function.js +2 -2
- package/dist/functions/index.d.ts +1 -0
- package/dist/functions/index.js +3 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/likeable.interface.d.ts +1 -1
- package/dist/likeable.interface.js +2 -2
- package/dist/models/account.model.d.ts +23 -0
- package/dist/models/account.model.js +59 -0
- package/dist/models/index.d.ts +3 -1
- package/dist/models/index.js +7 -3
- package/dist/{modules/search/models → models}/search-document.model.d.ts +1 -1
- package/dist/{modules/search/models → models}/search-document.model.js +1 -1
- package/dist/models/{account-entity.model.d.ts → user.model.d.ts} +8 -21
- package/dist/models/{account-entity.model.js → user.model.js} +11 -25
- package/dist/modules/authentication/authentication-module-options.interface.d.ts +2 -8
- package/dist/modules/authentication/authentication-options.parameter.d.ts +4 -0
- package/dist/modules/authentication/{inject-auth-options.decorator.js → authentication-options.parameter.js} +5 -2
- package/dist/modules/authentication/authentication.module.d.ts +23 -0
- package/dist/modules/authentication/authentication.module.js +24 -1
- package/dist/modules/authentication/guards/index.d.ts +2 -2
- package/dist/modules/authentication/guards/index.js +7 -7
- package/dist/modules/authentication/guards/jwt-auth.guard.d.ts +17 -0
- package/dist/modules/authentication/guards/jwt-auth.guard.js +73 -0
- package/dist/modules/authentication/guards/permissions.guard.d.ts +5 -27
- package/dist/modules/authentication/guards/permissions.guard.js +26 -59
- package/dist/modules/authentication/guards/public.guard.d.ts +7 -13
- package/dist/modules/authentication/guards/public.guard.js +10 -24
- package/dist/modules/authentication/guards/service-auth.guard.d.ts +22 -0
- package/dist/modules/authentication/guards/service-auth.guard.js +65 -0
- package/dist/modules/authentication/index.d.ts +3 -3
- package/dist/modules/authentication/index.js +3 -5
- package/dist/modules/cache/cache-response.interceptor.d.ts +2 -2
- package/dist/modules/cache/cache-response.interceptor.js +2 -2
- package/dist/modules/cache/index.d.ts +1 -0
- package/dist/modules/cache/index.js +1 -0
- package/dist/modules/comment/comment-module-options.interface.d.ts +38 -0
- package/dist/modules/comment/comment.controller.d.ts +24 -30
- package/dist/modules/comment/comment.controller.js +59 -61
- package/dist/modules/comment/comment.module-definition.d.ts +1 -42
- package/dist/modules/comment/comment.module-definition.js +1 -2
- package/dist/modules/comment/comment.module.d.ts +13 -13
- package/dist/modules/comment/comment.module.js +15 -42
- package/dist/modules/comment/comment.service.d.ts +27 -37
- package/dist/modules/comment/comment.service.js +50 -84
- package/dist/modules/comment/index.d.ts +2 -3
- package/dist/modules/comment/index.js +16 -7
- package/dist/modules/database/database.module.js +2 -5
- package/dist/modules/database/index.d.ts +2 -5
- package/dist/modules/database/index.js +17 -9
- package/dist/modules/index.d.ts +2 -6
- package/dist/modules/index.js +2 -6
- package/dist/modules/like/index.d.ts +2 -1
- package/dist/modules/like/index.js +16 -3
- package/dist/modules/like/like-module-options.interface.d.ts +21 -0
- package/dist/modules/like/like.controller.d.ts +45 -37
- package/dist/modules/like/like.controller.js +117 -102
- package/dist/modules/like/like.module-definition.d.ts +1 -17
- package/dist/modules/like/like.module-definition.js +1 -2
- package/dist/modules/like/like.module.d.ts +12 -12
- package/dist/modules/like/like.module.js +14 -37
- package/dist/modules/like/like.service.d.ts +31 -27
- package/dist/modules/like/like.service.js +42 -35
- package/dist/modules/merge/index.d.ts +3 -0
- package/dist/modules/merge/index.js +19 -0
- package/dist/modules/merge/merge-module-options.interface.d.ts +21 -0
- package/dist/modules/merge/merge.controller.d.ts +30 -0
- package/dist/modules/merge/merge.controller.js +76 -0
- package/dist/modules/merge/merge.module.d.ts +18 -0
- package/dist/modules/merge/merge.module.js +41 -0
- package/dist/modules/merge/merge.service.interface.d.ts +17 -0
- package/dist/modules/services/base-http.service.d.ts +83 -0
- package/dist/modules/services/base-http.service.js +124 -0
- package/dist/modules/services/base-urls.d.ts +22 -0
- package/dist/modules/services/base-urls.js +121 -0
- package/dist/modules/services/index.d.ts +4 -0
- package/dist/modules/services/index.js +20 -0
- package/dist/modules/services/providers/accounts.service.d.ts +52 -0
- package/dist/modules/services/providers/accounts.service.js +82 -0
- package/dist/modules/services/providers/books.service.d.ts +29 -0
- package/dist/modules/services/providers/books.service.js +53 -0
- package/dist/modules/services/providers/changelog.service.d.ts +18 -0
- package/dist/modules/services/providers/changelog.service.js +41 -0
- package/dist/modules/services/providers/comments/comments.service-definition.d.ts +1 -0
- package/dist/modules/services/providers/comments/comments.service-definition.js +4 -0
- package/dist/modules/services/providers/comments/comments.service.d.ts +60 -0
- package/dist/modules/services/providers/comments/comments.service.js +138 -0
- package/dist/modules/services/providers/comments/index.d.ts +1 -0
- package/dist/{factories → modules/services/providers/comments}/index.js +1 -1
- package/dist/modules/services/providers/content/content-types.d.ts +20 -0
- package/dist/modules/services/providers/content/content-types.js +7 -0
- package/dist/modules/services/providers/content/content.service-definition.d.ts +1 -0
- package/dist/modules/services/providers/content/content.service-definition.js +4 -0
- package/dist/modules/services/providers/content/content.service.d.ts +94 -0
- package/dist/modules/services/providers/content/content.service.js +214 -0
- package/dist/modules/services/providers/content/index.d.ts +1 -0
- package/dist/modules/{search/models → services/providers/content}/index.js +1 -1
- package/dist/modules/services/providers/demo-hive.service.d.ts +29 -0
- package/dist/modules/services/providers/demo-hive.service.js +53 -0
- package/dist/modules/services/providers/events.service.d.ts +29 -0
- package/dist/modules/services/providers/events.service.js +53 -0
- package/dist/modules/services/providers/hackschool.service.d.ts +49 -0
- package/dist/modules/services/providers/hackschool.service.js +77 -0
- package/dist/modules/services/providers/ideas.service.d.ts +18 -0
- package/dist/modules/services/providers/ideas.service.js +41 -0
- package/dist/modules/services/providers/index.d.ts +19 -0
- package/dist/modules/services/providers/index.js +35 -0
- package/dist/modules/services/providers/lunch-roulette.service.d.ts +18 -0
- package/dist/modules/services/providers/lunch-roulette.service.js +41 -0
- package/dist/modules/services/providers/mail/index.d.ts +3 -0
- package/dist/modules/services/providers/mail/index.js +19 -0
- package/dist/modules/services/providers/mail/mail-types.d.ts +30 -0
- package/dist/modules/services/providers/mail/mail-types.js +22 -0
- package/dist/modules/services/providers/mail/mail.service.d.ts +99 -0
- package/dist/modules/{mail → services/providers/mail}/mail.service.js +54 -91
- package/dist/modules/services/providers/newletter.service.d.ts +29 -0
- package/dist/modules/services/providers/newletter.service.js +53 -0
- package/dist/modules/services/providers/newsroom.service.d.ts +47 -0
- package/dist/modules/services/providers/newsroom.service.js +71 -0
- package/dist/modules/services/providers/notification/dtos/schedule-notification.dto.js +2 -0
- package/dist/modules/services/providers/notification/index.d.ts +2 -0
- package/dist/modules/services/providers/notification/index.js +18 -0
- package/dist/modules/services/providers/notification/notification.service-definition.d.ts +1 -0
- package/dist/modules/services/providers/notification/notification.service-definition.js +4 -0
- package/dist/modules/services/providers/notification/notification.service.d.ts +50 -0
- package/dist/modules/services/providers/notification/notification.service.js +130 -0
- package/dist/modules/services/providers/pass/dtos/create-guild-member-pass.dto.js +2 -0
- package/dist/modules/services/providers/pass/dtos/create-team-member-pass.dto.js +2 -0
- package/dist/modules/services/providers/pass/index.d.ts +2 -0
- package/dist/modules/services/providers/pass/index.js +18 -0
- package/dist/modules/services/providers/pass/pass-types.d.ts +18 -0
- package/dist/modules/services/providers/pass/pass-types.js +7 -0
- package/dist/modules/{pass → services/providers/pass}/pass.service.d.ts +15 -39
- package/dist/modules/{pass → services/providers/pass}/pass.service.js +46 -61
- package/dist/modules/services/providers/podcasts.service.d.ts +29 -0
- package/dist/modules/services/providers/podcasts.service.js +53 -0
- package/dist/modules/services/providers/search/dtos/index-search-document.dto.js +2 -0
- package/dist/modules/services/providers/search/index.d.ts +2 -0
- package/dist/modules/services/providers/search/index.js +18 -0
- package/dist/modules/services/providers/search/search.service-definition.d.ts +1 -0
- package/dist/modules/services/providers/search/search.service-definition.js +4 -0
- package/dist/modules/services/providers/search/search.service.d.ts +66 -0
- package/dist/modules/services/providers/search/search.service.js +171 -0
- package/dist/modules/services/providers/team.service.d.ts +29 -0
- package/dist/modules/services/providers/team.service.js +53 -0
- package/dist/modules/services/providers/tech-radar.service.d.ts +39 -0
- package/dist/modules/services/providers/tech-radar.service.js +65 -0
- package/dist/modules/services/services-module-options.interface.d.ts +4 -0
- package/dist/modules/services/services-module-options.interface.js +2 -0
- package/dist/modules/services/services-options.parameter.d.ts +1 -0
- package/dist/modules/services/services-options.parameter.js +8 -0
- package/dist/modules/services/services.module-definition.d.ts +16 -0
- package/dist/modules/services/services.module-definition.js +21 -0
- package/dist/modules/services/services.module.d.ts +17 -0
- package/dist/modules/services/services.module.js +63 -0
- package/dist/pipes/index.d.ts +2 -3
- package/dist/pipes/index.js +2 -3
- package/dist/pipes/params/hub-id.pipe.d.ts +22 -0
- package/dist/pipes/{hub-id.pipe.js → params/hub-id.pipe.js} +14 -17
- package/dist/pipes/params/hub-resource.pipe.d.ts +22 -0
- package/dist/pipes/{hub-resource.pipe.js → params/hub-resource.pipe.js} +19 -20
- package/dist/pipes/params/index.d.ts +3 -0
- package/dist/pipes/params/index.js +19 -0
- package/dist/pipes/params/mongo-id.pipe.d.ts +15 -0
- package/dist/pipes/params/mongo-id.pipe.js +52 -0
- package/dist/pipes/queries/index.d.ts +3 -0
- package/dist/pipes/queries/index.js +19 -0
- package/dist/pipes/queries/mongo-ids.pipe.d.ts +22 -0
- package/dist/pipes/queries/mongo-ids.pipe.js +60 -0
- package/dist/pipes/queries/optional-boolean.pipe.d.ts +29 -0
- package/dist/pipes/queries/optional-boolean.pipe.js +72 -0
- package/dist/pipes/queries/optional-include-drafts.pipe.d.ts +28 -0
- package/dist/pipes/queries/optional-include-drafts.pipe.js +38 -0
- package/dist/properties/index.d.ts +1 -0
- package/dist/properties/index.js +5 -0
- package/dist/swagger/index.d.ts +1 -0
- package/dist/swagger/index.js +5 -0
- package/dist/swagger/remove-public-route-auth.plugin.d.ts +9 -0
- package/dist/swagger/remove-public-route-auth.plugin.js +25 -0
- package/dist/swagger/swagger-options.interface.d.ts +14 -0
- package/dist/swagger/swagger-options.interface.js +2 -0
- package/dist/swagger/swagger.function.d.ts +11 -0
- package/dist/swagger/swagger.function.js +47 -0
- package/dist/transform/boolean.transform.js +3 -3
- package/dist/viewable.interface.js +1 -1
- package/package.json +2 -2
- package/dist/factories/index.d.ts +0 -1
- package/dist/factories/virtuals.factory.d.ts +0 -79
- package/dist/factories/virtuals.factory.js +0 -171
- package/dist/modules/authentication/guards/auth.guard.d.ts +0 -36
- package/dist/modules/authentication/guards/auth.guard.js +0 -107
- package/dist/modules/authentication/guards/internal.guard.d.ts +0 -33
- package/dist/modules/authentication/guards/internal.guard.js +0 -72
- package/dist/modules/authentication/inject-auth-options.decorator.d.ts +0 -1
- package/dist/modules/comment/comment.model.d.ts +0 -29
- package/dist/modules/comment/comment.model.js +0 -43
- package/dist/modules/content/content.module-definition.d.ts +0 -5
- package/dist/modules/content/content.module-definition.js +0 -8
- package/dist/modules/content/content.module.d.ts +0 -31
- package/dist/modules/content/content.module.js +0 -60
- package/dist/modules/content/content.service.d.ts +0 -50
- package/dist/modules/content/content.service.js +0 -145
- package/dist/modules/content/index.d.ts +0 -3
- package/dist/modules/content/index.js +0 -9
- package/dist/modules/database/model-service/dbs/hub-account.db.d.ts +0 -28
- package/dist/modules/database/model-service/dbs/hub-account.db.js +0 -44
- package/dist/modules/database/model-service/dbs/hub-books.db.d.ts +0 -23
- package/dist/modules/database/model-service/dbs/hub-books.db.js +0 -45
- package/dist/modules/database/model-service/dbs/hub-comments.db.d.ts +0 -29
- package/dist/modules/database/model-service/dbs/hub-comments.db.js +0 -68
- package/dist/modules/database/model-service/dbs/hub-content.db.d.ts +0 -24
- package/dist/modules/database/model-service/dbs/hub-content.db.js +0 -49
- package/dist/modules/database/model-service/dbs/hub-demo-hive.db.d.ts +0 -23
- package/dist/modules/database/model-service/dbs/hub-demo-hive.db.js +0 -45
- package/dist/modules/database/model-service/dbs/hub-events.db.d.ts +0 -24
- package/dist/modules/database/model-service/dbs/hub-events.db.js +0 -49
- package/dist/modules/database/model-service/dbs/hub-hackschool.db.d.ts +0 -60
- package/dist/modules/database/model-service/dbs/hub-hackschool.db.js +0 -106
- package/dist/modules/database/model-service/dbs/hub-newsroom.db.d.ts +0 -25
- package/dist/modules/database/model-service/dbs/hub-newsroom.db.js +0 -53
- package/dist/modules/database/model-service/dbs/hub-podcasts.db.d.ts +0 -23
- package/dist/modules/database/model-service/dbs/hub-podcasts.db.js +0 -45
- package/dist/modules/database/model-service/dbs/hub-team.db.d.ts +0 -22
- package/dist/modules/database/model-service/dbs/hub-team.db.js +0 -41
- package/dist/modules/database/model-service/dbs/hub-tech-radar.db.d.ts +0 -42
- package/dist/modules/database/model-service/dbs/hub-tech-radar.db.js +0 -81
- package/dist/modules/database/model-service/model.service.d.ts +0 -6407
- package/dist/modules/database/model-service/model.service.js +0 -136
- package/dist/modules/database/populate-service/populate.service.d.ts +0 -73
- package/dist/modules/database/populate-service/populate.service.js +0 -163
- package/dist/modules/database/service-mapper-service/service-mapper.service.d.ts +0 -32
- package/dist/modules/database/service-mapper-service/service-mapper.service.js +0 -73
- package/dist/modules/fetch/fetch.module.d.ts +0 -31
- package/dist/modules/fetch/fetch.module.js +0 -60
- package/dist/modules/fetch/fetch.service.d.ts +0 -153
- package/dist/modules/fetch/fetch.service.js +0 -274
- package/dist/modules/fetch/index.d.ts +0 -2
- package/dist/modules/fetch/index.js +0 -7
- package/dist/modules/mail/index.d.ts +0 -4
- package/dist/modules/mail/index.js +0 -23
- package/dist/modules/mail/mail.module.d.ts +0 -31
- package/dist/modules/mail/mail.module.js +0 -60
- package/dist/modules/mail/mail.service.d.ts +0 -136
- package/dist/modules/notification/index.d.ts +0 -3
- package/dist/modules/notification/index.js +0 -22
- package/dist/modules/notification/notification.module-definition.d.ts +0 -5
- package/dist/modules/notification/notification.module-definition.js +0 -8
- package/dist/modules/notification/notification.module.d.ts +0 -34
- package/dist/modules/notification/notification.module.js +0 -63
- package/dist/modules/notification/notification.service.d.ts +0 -42
- package/dist/modules/notification/notification.service.js +0 -100
- package/dist/modules/pass/index.d.ts +0 -3
- package/dist/modules/pass/index.js +0 -22
- package/dist/modules/pass/pass.module.d.ts +0 -32
- package/dist/modules/pass/pass.module.js +0 -61
- package/dist/modules/search/index.d.ts +0 -4
- package/dist/modules/search/index.js +0 -23
- package/dist/modules/search/models/index.d.ts +0 -1
- package/dist/modules/search/search.module-definition.d.ts +0 -5
- package/dist/modules/search/search.module-definition.js +0 -8
- package/dist/modules/search/search.module.d.ts +0 -33
- package/dist/modules/search/search.module.js +0 -62
- package/dist/modules/search/search.service.d.ts +0 -49
- package/dist/modules/search/search.service.js +0 -120
- package/dist/pipes/hub-id.pipe.d.ts +0 -22
- package/dist/pipes/hub-resource.pipe.d.ts +0 -22
- package/dist/pipes/mongo-id.pipe.d.ts +0 -14
- package/dist/pipes/mongo-id.pipe.js +0 -52
- package/dist/swagger.config.d.ts +0 -36
- package/dist/swagger.config.js +0 -76
- /package/dist/modules/{mail/dtos/auth-login-token-mail.dto.js → comment/comment-module-options.interface.js} +0 -0
- /package/dist/modules/{mail/dtos/auth-password-reset-mail.dto.js → like/like-module-options.interface.js} +0 -0
- /package/dist/modules/{mail/dtos/event-cancel-mail.dto.js → merge/merge-module-options.interface.js} +0 -0
- /package/dist/modules/{mail/dtos/event-invite-mail.dto.js → merge/merge.service.interface.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/auth-login-token-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/idea-status-updated-mail.dto.js → services/providers/mail/dtos/auth-login-token-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/auth-password-reset-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/idea-submitted-mail.dto.js → services/providers/mail/dtos/auth-password-reset-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/event-cancel-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/lunch-roulette-cancel-mail.dto.js → services/providers/mail/dtos/event-cancel-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/event-invite-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/lunch-roulette-matched-mail.dto.js → services/providers/mail/dtos/event-invite-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/idea-status-updated-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/lunch-roulette-submitted-mail.dto.js → services/providers/mail/dtos/idea-status-updated-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/idea-submitted-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/lunch-roulette-unmatched-mail.dto.js → services/providers/mail/dtos/idea-submitted-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/index.d.ts +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/index.js +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/lunch-roulette-cancel-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/newsletter-issue-mail.dto.js → services/providers/mail/dtos/lunch-roulette-cancel-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/lunch-roulette-matched-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/newsletter-subscribed-mail.dto.js → services/providers/mail/dtos/lunch-roulette-matched-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/lunch-roulette-submitted-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/newsletter-unsubscribed-mail.dto.js → services/providers/mail/dtos/lunch-roulette-submitted-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/lunch-roulette-unmatched-mail.dto.d.ts +0 -0
- /package/dist/modules/{mail/dtos/notification-mail.dto.js → services/providers/mail/dtos/lunch-roulette-unmatched-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/newsletter-issue-mail.dto.d.ts +0 -0
- /package/dist/modules/{notification/dtos/schedule-notification.dto.js → services/providers/mail/dtos/newsletter-issue-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/newsletter-subscribed-mail.dto.d.ts +0 -0
- /package/dist/modules/{pass/dtos/create-guild-member-pass.dto.js → services/providers/mail/dtos/newsletter-subscribed-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/newsletter-unsubscribed-mail.dto.d.ts +0 -0
- /package/dist/modules/{pass/dtos/create-team-member-pass.dto.js → services/providers/mail/dtos/newsletter-unsubscribed-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/dtos/notification-mail.dto.d.ts +0 -0
- /package/dist/modules/{search/dtos/index-search-document.dto.js → services/providers/mail/dtos/notification-mail.dto.js} +0 -0
- /package/dist/modules/{mail → services/providers/mail}/models/index.d.ts +0 -0
- /package/dist/modules/{mail → services/providers/mail}/models/index.js +0 -0
- /package/dist/modules/{mail → services/providers/mail}/models/mail-recipient.model.d.ts +0 -0
- /package/dist/modules/{mail → services/providers/mail}/models/mail-recipient.model.js +0 -0
- /package/dist/modules/{notification → services/providers/notification}/dtos/index.d.ts +0 -0
- /package/dist/modules/{notification → services/providers/notification}/dtos/index.js +0 -0
- /package/dist/modules/{notification → services/providers/notification}/dtos/schedule-notification.dto.d.ts +0 -0
- /package/dist/modules/{pass → services/providers/pass}/dtos/create-guild-member-pass.dto.d.ts +0 -0
- /package/dist/modules/{pass → services/providers/pass}/dtos/create-team-member-pass.dto.d.ts +0 -0
- /package/dist/modules/{pass → services/providers/pass}/dtos/index.d.ts +0 -0
- /package/dist/modules/{pass → services/providers/pass}/dtos/index.js +0 -0
- /package/dist/modules/{search → services/providers/search}/dtos/index-search-document.dto.d.ts +0 -0
- /package/dist/modules/{search → services/providers/search}/dtos/index.d.ts +0 -0
- /package/dist/modules/{search → services/providers/search}/dtos/index.js +0 -0
- /package/dist/{modules/content → properties}/content.property.d.ts +0 -0
- /package/dist/{modules/content → properties}/content.property.js +0 -0
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.InternalGuard = exports.INTERNAL_HEADER_KEY = void 0;
|
|
16
|
-
exports.InternalOnly = InternalOnly;
|
|
17
|
-
const common_1 = require("@nestjs/common");
|
|
18
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
19
|
-
const inject_auth_options_decorator_1 = require("../inject-auth-options.decorator");
|
|
20
|
-
/**
|
|
21
|
-
* INTERNAL_HEADER_KEY
|
|
22
|
-
*
|
|
23
|
-
* Custom HTTP header used to validate internal Kubernetes-based requests.
|
|
24
|
-
* This header must contain a pre-configured token for access to protected internal routes.
|
|
25
|
-
*/
|
|
26
|
-
exports.INTERNAL_HEADER_KEY = 'X-itlab-k8s-auth';
|
|
27
|
-
/**
|
|
28
|
-
* Guard that validates incoming requests against a shared internal token,
|
|
29
|
-
* typically used for internal service-to-service communication (e.g. from Kubernetes).
|
|
30
|
-
* Only requests with a matching token in the `X-itlab-k8s-auth` header are authorized.
|
|
31
|
-
*/
|
|
32
|
-
let InternalGuard = class InternalGuard {
|
|
33
|
-
constructor(authOptions) {
|
|
34
|
-
this.authOptions = authOptions;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Determines whether the request contains a valid internal auth token.
|
|
38
|
-
*
|
|
39
|
-
* @param {ExecutionContext} context - The current execution context of the request.
|
|
40
|
-
* @returns {boolean} Whether the request is authorized.
|
|
41
|
-
* @throws {UnauthorizedException} If the token is missing or invalid.
|
|
42
|
-
*/
|
|
43
|
-
canActivate(context) {
|
|
44
|
-
const request = context.switchToHttp().getRequest();
|
|
45
|
-
const tokenFromHeader = request.header(exports.INTERNAL_HEADER_KEY);
|
|
46
|
-
// Allow request only if the token matches the one provided via configuration.
|
|
47
|
-
const isTokenValid = tokenFromHeader && tokenFromHeader === this.authOptions.k8sToken;
|
|
48
|
-
if (!isTokenValid) {
|
|
49
|
-
throw new common_1.UnauthorizedException('Application unauthorized');
|
|
50
|
-
}
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
exports.InternalGuard = InternalGuard;
|
|
55
|
-
exports.InternalGuard = InternalGuard = __decorate([
|
|
56
|
-
(0, common_1.Injectable)(),
|
|
57
|
-
__param(0, (0, inject_auth_options_decorator_1.InjectAuthOptions)()),
|
|
58
|
-
__metadata("design:paramtypes", [Object])
|
|
59
|
-
], InternalGuard);
|
|
60
|
-
/**
|
|
61
|
-
* Decorator that secures a controller or route to only be accessible by internal services
|
|
62
|
-
* using the `InternalGuard`. Adds Swagger docs indicating the required custom header.
|
|
63
|
-
*
|
|
64
|
-
* @returns {MethodDecorator & ClassDecorator} Decorator to enforce internal-only access.
|
|
65
|
-
*/
|
|
66
|
-
function InternalOnly() {
|
|
67
|
-
return (0, common_1.applyDecorators)((0, common_1.UseGuards)(InternalGuard),
|
|
68
|
-
// Adds Swagger documentation for the custom basic auth header.
|
|
69
|
-
(0, swagger_1.ApiBasicAuth)(exports.INTERNAL_HEADER_KEY),
|
|
70
|
-
// Documents the 403 Forbidden response when access is denied.
|
|
71
|
-
(0, swagger_1.ApiForbiddenResponse)({ description: 'Application unauthorized' }));
|
|
72
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function InjectAuthOptions(): ParameterDecorator;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a single user-generated comment entry in the system.
|
|
3
|
-
*
|
|
4
|
-
* Encapsulates information about the author, creation time, and comment content,
|
|
5
|
-
* including support for rich text (HTML-formatted) body.
|
|
6
|
-
*/
|
|
7
|
-
export declare class Comment {
|
|
8
|
-
/**
|
|
9
|
-
* Identifier of the user who authored the comment.
|
|
10
|
-
* Used to associate the comment with a specific account.
|
|
11
|
-
*
|
|
12
|
-
* @example "000000000000000000000000"
|
|
13
|
-
*/
|
|
14
|
-
authorId: string;
|
|
15
|
-
/**
|
|
16
|
-
* UNIX timestamp of when the comment was created.
|
|
17
|
-
* Used for ordering and displaying relative or absolute creation time.
|
|
18
|
-
*
|
|
19
|
-
* @example 1625074800
|
|
20
|
-
*/
|
|
21
|
-
timestamp: number;
|
|
22
|
-
/**
|
|
23
|
-
* The content of the comment, formatted as rich HTML.
|
|
24
|
-
* Enables structured presentation (e.g., paragraphs, links).
|
|
25
|
-
*
|
|
26
|
-
* @example "<p>Hello World</p>"
|
|
27
|
-
*/
|
|
28
|
-
richtext: string;
|
|
29
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Comment = void 0;
|
|
13
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
-
/**
|
|
15
|
-
* Represents a single user-generated comment entry in the system.
|
|
16
|
-
*
|
|
17
|
-
* Encapsulates information about the author, creation time, and comment content,
|
|
18
|
-
* including support for rich text (HTML-formatted) body.
|
|
19
|
-
*/
|
|
20
|
-
class Comment {
|
|
21
|
-
}
|
|
22
|
-
exports.Comment = Comment;
|
|
23
|
-
__decorate([
|
|
24
|
-
(0, swagger_1.ApiProperty)({
|
|
25
|
-
description: 'ID of the comment author',
|
|
26
|
-
example: '000000000000000000000000',
|
|
27
|
-
}),
|
|
28
|
-
__metadata("design:type", String)
|
|
29
|
-
], Comment.prototype, "authorId", void 0);
|
|
30
|
-
__decorate([
|
|
31
|
-
(0, swagger_1.ApiProperty)({
|
|
32
|
-
description: 'Timestamp when the comment was created (UNIX format)',
|
|
33
|
-
example: 1625074800,
|
|
34
|
-
}),
|
|
35
|
-
__metadata("design:type", Number)
|
|
36
|
-
], Comment.prototype, "timestamp", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, swagger_1.ApiProperty)({
|
|
39
|
-
description: 'HTML-formatted comment content',
|
|
40
|
-
example: '<p>Hello World</p>',
|
|
41
|
-
}),
|
|
42
|
-
__metadata("design:type", String)
|
|
43
|
-
], Comment.prototype, "richtext", void 0);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CONTENT_MODULE_RESOURCE_TOKEN = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Token used to inject ContentModule options into services or controllers if needed.
|
|
6
|
-
* Symbol is used to avoid accidental naming collisions across modules.
|
|
7
|
-
*/
|
|
8
|
-
exports.CONTENT_MODULE_RESOURCE_TOKEN = Symbol('CONTENT_MODULE_RESOURCE_TOKEN');
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { DynamicModule } from '@nestjs/common';
|
|
2
|
-
import { HubResource } from '../../hub-resource.enum';
|
|
3
|
-
/**
|
|
4
|
-
* Dynamic module for providing ContentService configured for a specific Hub resource.
|
|
5
|
-
* Can be registered either globally (application-wide) or locally (module-scoped).
|
|
6
|
-
*/
|
|
7
|
-
export declare class ContentModule {
|
|
8
|
-
/**
|
|
9
|
-
* Internal utility to generate the module configuration.
|
|
10
|
-
*
|
|
11
|
-
* @param {boolean} isGlobal - Whether the module should be globally scoped.
|
|
12
|
-
* @param {HubResource} resource - The resource associated with the module.
|
|
13
|
-
* @returns {DynamicModule} - Configured dynamic module.
|
|
14
|
-
*/
|
|
15
|
-
private static createModule;
|
|
16
|
-
/**
|
|
17
|
-
* Registers the module globally, making ContentService accessible application-wide.
|
|
18
|
-
*
|
|
19
|
-
* @param {HubResource} resource - The resource associated with the module.
|
|
20
|
-
* @returns {DynamicModule} - Global dynamic module instance.
|
|
21
|
-
*/
|
|
22
|
-
static forRoot(resource: HubResource): DynamicModule;
|
|
23
|
-
/**
|
|
24
|
-
* Registers the module locally (non-global), restricting ContentService
|
|
25
|
-
* to the importing module's scope.
|
|
26
|
-
*
|
|
27
|
-
* @param {HubResource} resource - The resource associated with the module.
|
|
28
|
-
* @returns {DynamicModule} - Local dynamic module instance.
|
|
29
|
-
*/
|
|
30
|
-
static register(resource: HubResource): DynamicModule;
|
|
31
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var ContentModule_1;
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.ContentModule = void 0;
|
|
11
|
-
const common_1 = require("@nestjs/common");
|
|
12
|
-
const content_module_definition_1 = require("./content.module-definition");
|
|
13
|
-
const content_service_1 = require("./content.service");
|
|
14
|
-
/**
|
|
15
|
-
* Dynamic module for providing ContentService configured for a specific Hub resource.
|
|
16
|
-
* Can be registered either globally (application-wide) or locally (module-scoped).
|
|
17
|
-
*/
|
|
18
|
-
let ContentModule = ContentModule_1 = class ContentModule {
|
|
19
|
-
/**
|
|
20
|
-
* Internal utility to generate the module configuration.
|
|
21
|
-
*
|
|
22
|
-
* @param {boolean} isGlobal - Whether the module should be globally scoped.
|
|
23
|
-
* @param {HubResource} resource - The resource associated with the module.
|
|
24
|
-
* @returns {DynamicModule} - Configured dynamic module.
|
|
25
|
-
*/
|
|
26
|
-
static createModule(isGlobal, resource) {
|
|
27
|
-
return {
|
|
28
|
-
global: isGlobal,
|
|
29
|
-
module: ContentModule_1,
|
|
30
|
-
providers: [content_service_1.ContentService, { provide: content_module_definition_1.CONTENT_MODULE_RESOURCE_TOKEN, useValue: resource }],
|
|
31
|
-
exports: [content_service_1.ContentService],
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Registers the module globally, making ContentService accessible application-wide.
|
|
36
|
-
*
|
|
37
|
-
* @param {HubResource} resource - The resource associated with the module.
|
|
38
|
-
* @returns {DynamicModule} - Global dynamic module instance.
|
|
39
|
-
*/
|
|
40
|
-
static forRoot(resource) {
|
|
41
|
-
return this.createModule(true, resource);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Registers the module locally (non-global), restricting ContentService
|
|
45
|
-
* to the importing module's scope.
|
|
46
|
-
*
|
|
47
|
-
* @param {HubResource} resource - The resource associated with the module.
|
|
48
|
-
* @returns {DynamicModule} - Local dynamic module instance.
|
|
49
|
-
*/
|
|
50
|
-
static register(resource) {
|
|
51
|
-
return this.createModule(false, resource);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
exports.ContentModule = ContentModule;
|
|
55
|
-
exports.ContentModule = ContentModule = ContentModule_1 = __decorate([
|
|
56
|
-
(0, common_1.Module)({
|
|
57
|
-
providers: [content_service_1.ContentService],
|
|
58
|
-
exports: [content_service_1.ContentService],
|
|
59
|
-
})
|
|
60
|
-
], ContentModule);
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ConfigService } from '@nestjs/config';
|
|
2
|
-
import { LabContent, LabContentPopulated } from 'itlab-functions';
|
|
3
|
-
import { HubResource } from '../../hub-resource.enum';
|
|
4
|
-
import { AuthenticationModuleOptions } from '../authentication';
|
|
5
|
-
/**
|
|
6
|
-
* Service responsible for interacting with the Organisation Hub Content Service.
|
|
7
|
-
* Encapsulates logic for verifying, posting, retrieving, and deleting content.
|
|
8
|
-
* Uses a secured Axios client to communicate with internal endpoints.
|
|
9
|
-
*/
|
|
10
|
-
export declare class ContentService {
|
|
11
|
-
private readonly resource;
|
|
12
|
-
private readonly authOptions;
|
|
13
|
-
private readonly configService;
|
|
14
|
-
private readonly logger;
|
|
15
|
-
private readonly axiosInstance;
|
|
16
|
-
/**
|
|
17
|
-
* Initializes the ContentService with appropriate API client and settings.
|
|
18
|
-
*
|
|
19
|
-
* @param {HubResource} resource - Resource type injected via DI
|
|
20
|
-
* @param {AuthenticationModuleOptions} authOptions - Contains Kubernetes service account token
|
|
21
|
-
* @param {ConfigService} configService - Configuration service for environment checks
|
|
22
|
-
*/
|
|
23
|
-
constructor(resource: HubResource, authOptions: AuthenticationModuleOptions, configService: ConfigService);
|
|
24
|
-
/**
|
|
25
|
-
* Validates the structure and integrity of content using the backend.
|
|
26
|
-
*
|
|
27
|
-
* @param {LabContent} content - Content object to validate
|
|
28
|
-
* @returns {Promise<void>} Resolves if valid, rejects with HTTP error otherwise
|
|
29
|
-
*/
|
|
30
|
-
validateContent(content: LabContent): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* Submits new content for a specific resource.
|
|
33
|
-
*
|
|
34
|
-
* @param {string} resourceId - Unique identifier of the resource
|
|
35
|
-
* @param {LabContent} content - Content to be persisted
|
|
36
|
-
* @returns {Promise<void>}
|
|
37
|
-
*/
|
|
38
|
-
submitContent(resourceId: string, content: LabContent): Promise<void>;
|
|
39
|
-
/**
|
|
40
|
-
* Removes content associated with the given resource.
|
|
41
|
-
*
|
|
42
|
-
* @param {string} resourceId - Unique identifier of the resource
|
|
43
|
-
* @returns {Promise<void>}
|
|
44
|
-
*/
|
|
45
|
-
removeContent(resourceId: string): Promise<void>;
|
|
46
|
-
getContent(resourceId: string, type: 'json'): Promise<LabContent>;
|
|
47
|
-
getContent(resourceId: string, type: 'text'): Promise<string>;
|
|
48
|
-
getContent(resourceId: string, type: 'html'): Promise<LabContent>;
|
|
49
|
-
getContent(resourceId: string, type: 'populated'): Promise<LabContentPopulated>;
|
|
50
|
-
}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
var ContentService_1;
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.ContentService = void 0;
|
|
17
|
-
const common_1 = require("@nestjs/common");
|
|
18
|
-
const config_1 = require("@nestjs/config");
|
|
19
|
-
const create_internal_axios_client_function_1 = require("../../functions/create-internal-axios-client.function");
|
|
20
|
-
const hub_resource_enum_1 = require("../../hub-resource.enum");
|
|
21
|
-
const authentication_1 = require("../authentication");
|
|
22
|
-
const content_module_definition_1 = require("./content.module-definition");
|
|
23
|
-
/**
|
|
24
|
-
* Service responsible for interacting with the Organisation Hub Content Service.
|
|
25
|
-
* Encapsulates logic for verifying, posting, retrieving, and deleting content.
|
|
26
|
-
* Uses a secured Axios client to communicate with internal endpoints.
|
|
27
|
-
*/
|
|
28
|
-
let ContentService = ContentService_1 = class ContentService {
|
|
29
|
-
/**
|
|
30
|
-
* Initializes the ContentService with appropriate API client and settings.
|
|
31
|
-
*
|
|
32
|
-
* @param {HubResource} resource - Resource type injected via DI
|
|
33
|
-
* @param {AuthenticationModuleOptions} authOptions - Contains Kubernetes service account token
|
|
34
|
-
* @param {ConfigService} configService - Configuration service for environment checks
|
|
35
|
-
*/
|
|
36
|
-
constructor(resource, authOptions, configService) {
|
|
37
|
-
this.resource = resource;
|
|
38
|
-
this.authOptions = authOptions;
|
|
39
|
-
this.configService = configService;
|
|
40
|
-
this.logger = new common_1.Logger(ContentService_1.name);
|
|
41
|
-
const isProduction = this.configService.get('NODE_ENV') === 'production';
|
|
42
|
-
// Construct base URL conditionally based on environment.
|
|
43
|
-
const baseUrl = isProduction
|
|
44
|
-
? 'http://organisation-hub-content-service.organisation-hub-services.svc.cluster.local:3000/internal/'
|
|
45
|
-
: 'https://services.svi-itlab.com/content/internal/';
|
|
46
|
-
// Initialize axios instance with k8s token and appropriate URL.
|
|
47
|
-
this.axiosInstance = (0, create_internal_axios_client_function_1.createInternalAxiosClient)({
|
|
48
|
-
k8sToken: this.authOptions.k8sToken,
|
|
49
|
-
baseUrl: `${baseUrl}`,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Validates the structure and integrity of content using the backend.
|
|
54
|
-
*
|
|
55
|
-
* @param {LabContent} content - Content object to validate
|
|
56
|
-
* @returns {Promise<void>} Resolves if valid, rejects with HTTP error otherwise
|
|
57
|
-
*/
|
|
58
|
-
async validateContent(content) {
|
|
59
|
-
var _a, _b, _c;
|
|
60
|
-
this.logger.log('Validating content');
|
|
61
|
-
try {
|
|
62
|
-
await this.axiosInstance.post(`verify`, { content });
|
|
63
|
-
this.logger.log('Content validation successful');
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
const axiosError = error;
|
|
67
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
68
|
-
this.logger.error(`Content validation failed: ${(_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.data}`);
|
|
69
|
-
throw new common_1.HttpException((_b = axiosError.response) === null || _b === void 0 ? void 0 : _b.data, ((_c = axiosError.response) === null || _c === void 0 ? void 0 : _c.status) || 500);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Submits new content for a specific resource.
|
|
74
|
-
*
|
|
75
|
-
* @param {string} resourceId - Unique identifier of the resource
|
|
76
|
-
* @param {LabContent} content - Content to be persisted
|
|
77
|
-
* @returns {Promise<void>}
|
|
78
|
-
*/
|
|
79
|
-
async submitContent(resourceId, content) {
|
|
80
|
-
var _a, _b, _c;
|
|
81
|
-
this.logger.log(`Submitting content for ${this.resource} (${resourceId})`);
|
|
82
|
-
try {
|
|
83
|
-
await this.axiosInstance.post(`${this.resource}/${resourceId}`, { content });
|
|
84
|
-
this.logger.log(`Content successfully submitted for ${this.resource} (${resourceId})`);
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
const axiosError = error;
|
|
88
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
89
|
-
this.logger.error(`Content submission failed for ${this.resource} (${resourceId}): ${(_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.data}`);
|
|
90
|
-
throw new common_1.HttpException((_b = axiosError.response) === null || _b === void 0 ? void 0 : _b.data, ((_c = axiosError.response) === null || _c === void 0 ? void 0 : _c.status) || 500);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Removes content associated with the given resource.
|
|
95
|
-
*
|
|
96
|
-
* @param {string} resourceId - Unique identifier of the resource
|
|
97
|
-
* @returns {Promise<void>}
|
|
98
|
-
*/
|
|
99
|
-
async removeContent(resourceId) {
|
|
100
|
-
var _a;
|
|
101
|
-
this.logger.log(`Removing content for ${this.resource} (${resourceId})`);
|
|
102
|
-
try {
|
|
103
|
-
await this.axiosInstance.delete(`${this.resource}/${resourceId}`);
|
|
104
|
-
this.logger.log(`Content removed successfully for ${this.resource} (${resourceId})`);
|
|
105
|
-
}
|
|
106
|
-
catch (error) {
|
|
107
|
-
const axiosError = error;
|
|
108
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
109
|
-
this.logger.error(`Content removal failed for ${this.resource} (${resourceId}): ${(_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.data}`);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Retrieves content in the specified format from the backend service.
|
|
114
|
-
*
|
|
115
|
-
* @param {string} resourceId - Resource ID to fetch content for
|
|
116
|
-
* @param {'json'|'text'|'html'|'populated'} type - Format in which to retrieve content
|
|
117
|
-
* @returns {Promise<LabContent | string | LabContentPopulated>} - The retrieved content
|
|
118
|
-
*/
|
|
119
|
-
async getContent(resourceId, type) {
|
|
120
|
-
var _a;
|
|
121
|
-
this.logger.log(`Fetching ${type} content for ${this.resource} (${resourceId})`);
|
|
122
|
-
try {
|
|
123
|
-
const response = await this.axiosInstance.get(`${this.resource}/${resourceId}/${type}`);
|
|
124
|
-
this.logger.log(`Successfully retrieved ${type} content for ${this.resource} (${resourceId})`);
|
|
125
|
-
return response.data;
|
|
126
|
-
}
|
|
127
|
-
catch (error) {
|
|
128
|
-
const axiosError = error;
|
|
129
|
-
this.logger.error(
|
|
130
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
131
|
-
`Failed to fetch ${type} content for ${this.resource} (${resourceId}): ${(_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.data}`);
|
|
132
|
-
// Return sensible default based on content type
|
|
133
|
-
if (type === 'text')
|
|
134
|
-
return '';
|
|
135
|
-
return [];
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
exports.ContentService = ContentService;
|
|
140
|
-
exports.ContentService = ContentService = ContentService_1 = __decorate([
|
|
141
|
-
(0, common_1.Injectable)(),
|
|
142
|
-
__param(0, (0, common_1.Inject)(content_module_definition_1.CONTENT_MODULE_RESOURCE_TOKEN)),
|
|
143
|
-
__param(1, (0, authentication_1.InjectAuthOptions)()),
|
|
144
|
-
__metadata("design:paramtypes", [String, Object, config_1.ConfigService])
|
|
145
|
-
], ContentService);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContentService = exports.PropertyContent = exports.ContentModule = void 0;
|
|
4
|
-
var content_module_1 = require("./content.module");
|
|
5
|
-
Object.defineProperty(exports, "ContentModule", { enumerable: true, get: function () { return content_module_1.ContentModule; } });
|
|
6
|
-
var content_property_1 = require("./content.property");
|
|
7
|
-
Object.defineProperty(exports, "PropertyContent", { enumerable: true, get: function () { return content_property_1.PropertyContent; } });
|
|
8
|
-
var content_service_1 = require("./content.service");
|
|
9
|
-
Object.defineProperty(exports, "ContentService", { enumerable: true, get: function () { return content_service_1.ContentService; } });
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Document } from 'mongoose';
|
|
2
|
-
export type AccountInformation = {
|
|
3
|
-
id: string;
|
|
4
|
-
username: string;
|
|
5
|
-
email: string;
|
|
6
|
-
avatar?: string;
|
|
7
|
-
};
|
|
8
|
-
declare class AccountModel extends Document {
|
|
9
|
-
username: string;
|
|
10
|
-
email: string;
|
|
11
|
-
avatar?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare const AccountDB: {
|
|
14
|
-
name: string;
|
|
15
|
-
account: {
|
|
16
|
-
model: typeof AccountModel;
|
|
17
|
-
schema: import("mongoose").Schema<AccountModel, import("mongoose").Model<AccountModel, any, any, any, Document<unknown, any, AccountModel, any, {}> & AccountModel & Required<{
|
|
18
|
-
_id: unknown;
|
|
19
|
-
}> & {
|
|
20
|
-
__v: number;
|
|
21
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, AccountModel, Document<unknown, {}, import("mongoose").FlatRecord<AccountModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<AccountModel> & Required<{
|
|
22
|
-
_id: unknown;
|
|
23
|
-
}> & {
|
|
24
|
-
__v: number;
|
|
25
|
-
}>;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AccountDB = void 0;
|
|
13
|
-
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
-
const mongoose_2 = require("mongoose");
|
|
15
|
-
const functions_1 = require("../../../../functions");
|
|
16
|
-
const transform = (0, functions_1.createSchemaTransformer)((doc) => {
|
|
17
|
-
const { _id, email, username, avatar } = doc;
|
|
18
|
-
const account = { id: _id.toString(), email: email, username: username };
|
|
19
|
-
if (avatar)
|
|
20
|
-
account.avatar = `https://file.svi-itlab.com/avatar/${_id.toString()}.webp`;
|
|
21
|
-
return account;
|
|
22
|
-
});
|
|
23
|
-
let AccountModel = class AccountModel extends mongoose_2.Document {
|
|
24
|
-
};
|
|
25
|
-
__decorate([
|
|
26
|
-
(0, mongoose_1.Prop)(),
|
|
27
|
-
__metadata("design:type", String)
|
|
28
|
-
], AccountModel.prototype, "username", void 0);
|
|
29
|
-
__decorate([
|
|
30
|
-
(0, mongoose_1.Prop)(),
|
|
31
|
-
__metadata("design:type", String)
|
|
32
|
-
], AccountModel.prototype, "email", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
(0, mongoose_1.Prop)({ required: false }),
|
|
35
|
-
__metadata("design:type", Boolean)
|
|
36
|
-
], AccountModel.prototype, "avatar", void 0);
|
|
37
|
-
AccountModel = __decorate([
|
|
38
|
-
(0, mongoose_1.Schema)({ collection: 'accounts', toObject: transform, toJSON: transform })
|
|
39
|
-
], AccountModel);
|
|
40
|
-
const AccountSchema = mongoose_1.SchemaFactory.createForClass(AccountModel);
|
|
41
|
-
exports.AccountDB = {
|
|
42
|
-
name: 'hub-account',
|
|
43
|
-
account: { model: AccountModel, schema: AccountSchema },
|
|
44
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Document } from 'mongoose';
|
|
2
|
-
declare class BookModel extends Document {
|
|
3
|
-
title: string;
|
|
4
|
-
_hid: string;
|
|
5
|
-
draft: boolean;
|
|
6
|
-
submitterId: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const BooksDB: {
|
|
9
|
-
name: string;
|
|
10
|
-
book: {
|
|
11
|
-
model: typeof BookModel;
|
|
12
|
-
schema: import("mongoose").Schema<BookModel, import("mongoose").Model<BookModel, any, any, any, Document<unknown, any, BookModel, any, {}> & BookModel & Required<{
|
|
13
|
-
_id: unknown;
|
|
14
|
-
}> & {
|
|
15
|
-
__v: number;
|
|
16
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, BookModel, Document<unknown, {}, import("mongoose").FlatRecord<BookModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<BookModel> & Required<{
|
|
17
|
-
_id: unknown;
|
|
18
|
-
}> & {
|
|
19
|
-
__v: number;
|
|
20
|
-
}>;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export {};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.BooksDB = void 0;
|
|
13
|
-
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
-
const mongoose_2 = require("mongoose");
|
|
15
|
-
const functions_1 = require("../../../../functions");
|
|
16
|
-
const transform = (0, functions_1.createSchemaTransformer)((doc) => {
|
|
17
|
-
const { title, _hid } = doc;
|
|
18
|
-
return { title, url: `https://www.svi-itlab.com/books/${_hid}` };
|
|
19
|
-
});
|
|
20
|
-
let BookModel = class BookModel extends mongoose_2.Document {
|
|
21
|
-
};
|
|
22
|
-
__decorate([
|
|
23
|
-
(0, mongoose_1.Prop)(),
|
|
24
|
-
__metadata("design:type", String)
|
|
25
|
-
], BookModel.prototype, "title", void 0);
|
|
26
|
-
__decorate([
|
|
27
|
-
(0, mongoose_1.Prop)(),
|
|
28
|
-
__metadata("design:type", String)
|
|
29
|
-
], BookModel.prototype, "_hid", void 0);
|
|
30
|
-
__decorate([
|
|
31
|
-
(0, mongoose_1.Prop)(),
|
|
32
|
-
__metadata("design:type", Boolean)
|
|
33
|
-
], BookModel.prototype, "draft", void 0);
|
|
34
|
-
__decorate([
|
|
35
|
-
(0, mongoose_1.Prop)(),
|
|
36
|
-
__metadata("design:type", String)
|
|
37
|
-
], BookModel.prototype, "submitterId", void 0);
|
|
38
|
-
BookModel = __decorate([
|
|
39
|
-
(0, mongoose_1.Schema)({ collection: 'books', toObject: transform, toJSON: transform })
|
|
40
|
-
], BookModel);
|
|
41
|
-
const BookSchema = mongoose_1.SchemaFactory.createForClass(BookModel);
|
|
42
|
-
exports.BooksDB = {
|
|
43
|
-
name: 'hub-books',
|
|
44
|
-
book: { model: BookModel, schema: BookSchema },
|
|
45
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Document } from 'mongoose';
|
|
2
|
-
import { AccountDB } from './hub-account.db';
|
|
3
|
-
declare class CommentModel extends Document {
|
|
4
|
-
_resource: string;
|
|
5
|
-
_resourceId: string;
|
|
6
|
-
html: string;
|
|
7
|
-
timestamp: number;
|
|
8
|
-
authorId: string;
|
|
9
|
-
_replyTo?: string;
|
|
10
|
-
reactions?: Record<string, string[]>;
|
|
11
|
-
author: typeof AccountDB.account.model;
|
|
12
|
-
replies?: [];
|
|
13
|
-
}
|
|
14
|
-
export declare const CommentsDB: {
|
|
15
|
-
name: string;
|
|
16
|
-
comment: {
|
|
17
|
-
model: typeof CommentModel;
|
|
18
|
-
schema: import("mongoose").Schema<CommentModel, import("mongoose").Model<CommentModel, any, any, any, Document<unknown, any, CommentModel, any, {}> & CommentModel & Required<{
|
|
19
|
-
_id: unknown;
|
|
20
|
-
}> & {
|
|
21
|
-
__v: number;
|
|
22
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CommentModel, Document<unknown, {}, import("mongoose").FlatRecord<CommentModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<CommentModel> & Required<{
|
|
23
|
-
_id: unknown;
|
|
24
|
-
}> & {
|
|
25
|
-
__v: number;
|
|
26
|
-
}>;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export {};
|