itlab-internal-services 2.16.8 → 2.16.9
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/dist/classes/fetch-options/base-options.class.d.ts +9 -0
- package/dist/classes/fetch-options/comments-options.class.d.ts +3 -0
- package/dist/classes/fetch-options/comments-options.class.js +1 -1
- package/dist/classes/fetch-options/content-options.class.d.ts +3 -0
- package/dist/classes/fetch-options/content-options.class.js +1 -1
- package/dist/classes/fetch-options/drafted-options.class.d.ts +5 -1
- package/dist/classes/fetch-options/drafted-options.class.js +3 -2
- package/dist/classes/fetch-options/liked-by-options.class.d.ts +4 -0
- package/dist/classes/fetch-options/liked-by-options.class.js +1 -1
- package/dist/classes/fetch-options/timestamps-options.class.d.ts +4 -1
- package/dist/classes/fetch-options/timestamps-options.class.js +1 -1
- package/dist/classes/fetch-options/viewed-by-options.class.d.ts +5 -1
- package/dist/classes/fetch-options/viewed-by-options.class.js +1 -1
- package/dist/hub-resource.enum.d.ts +10 -10
- package/dist/hub-resource.enum.js +16 -16
- package/dist/modules/comments/comments.controller.js +1 -1
- package/dist/modules/comments/comments.service.d.ts +5 -5
- package/dist/modules/comments/comments.service.js +21 -13
- package/dist/modules/like/like.service.d.ts +1 -1
- package/dist/modules/like/like.service.js +7 -7
- package/dist/modules/merge/merge-module-options.interface.d.ts +2 -2
- package/dist/modules/merge/merge.controller.d.ts +3 -3
- package/dist/modules/merge/merge.service.interface.d.ts +1 -1
- package/dist/modules/services/base-http.service.d.ts +44 -40
- package/dist/modules/services/base-http.service.js +72 -47
- package/dist/modules/services/base-urls.d.ts +22 -19
- package/dist/modules/services/base-urls.js +38 -19
- package/dist/modules/services/providers/accounts/accounts.service.d.ts +99 -0
- package/dist/modules/services/providers/accounts/accounts.service.js +154 -0
- package/dist/modules/services/providers/accounts/fetch-account-options.dto.v1.type.d.ts +29 -0
- package/dist/modules/services/providers/accounts/index.d.ts +2 -0
- package/dist/modules/services/providers/accounts/index.js +18 -0
- package/dist/modules/services/providers/books/books.service.d.ts +49 -0
- package/dist/modules/services/providers/books/books.service.js +79 -0
- package/dist/modules/services/providers/books/fetch-book-options.dto.v1.type.d.ts +27 -0
- package/dist/modules/services/providers/books/index.d.ts +2 -0
- package/dist/modules/services/providers/{notification → books}/index.js +2 -2
- package/dist/modules/services/providers/changelog/changelog.service.d.ts +62 -0
- package/dist/modules/services/providers/changelog/changelog.service.js +79 -0
- package/dist/modules/services/providers/changelog/fetch-change-options.dto.v1.type.d.ts +15 -0
- package/dist/modules/services/providers/changelog/index.d.ts +2 -0
- package/dist/modules/services/providers/changelog/index.js +18 -0
- package/dist/modules/services/providers/conflicts/conflicts.service.d.ts +59 -0
- package/dist/modules/services/providers/conflicts/conflicts.service.js +79 -0
- package/dist/modules/services/providers/conflicts/fetch-conflict-options.dto.v1.type.d.ts +18 -0
- package/dist/modules/services/providers/conflicts/index.d.ts +2 -0
- package/dist/modules/services/providers/conflicts/index.js +18 -0
- package/dist/modules/services/providers/content/content-return-types.d.ts +3 -2
- package/dist/modules/services/providers/content/content-return-types.js +8 -2
- package/dist/modules/services/providers/content/content.service.d.ts +49 -7
- package/dist/modules/services/providers/content/content.service.js +61 -19
- package/dist/modules/services/providers/content/fetch-content-options.dto.v1.type.d.ts +15 -0
- package/dist/modules/services/providers/content/index.d.ts +1 -0
- package/dist/modules/services/providers/content/index.js +1 -0
- package/dist/modules/services/providers/demo-hive/demo-hive.service.d.ts +49 -0
- package/dist/modules/services/providers/demo-hive/demo-hive.service.js +79 -0
- package/dist/modules/services/providers/demo-hive/fetch-demo-options.dto.v1.type.d.ts +16 -0
- package/dist/modules/services/providers/demo-hive/index.d.ts +2 -0
- package/dist/modules/services/providers/demo-hive/index.js +18 -0
- package/dist/modules/services/providers/events/events.service.d.ts +49 -0
- package/dist/modules/services/providers/events/events.service.js +79 -0
- package/dist/modules/services/providers/events/fetch-event-options.dto.v1.type.d.ts +27 -0
- package/dist/modules/services/providers/events/index.d.ts +2 -0
- package/dist/modules/services/providers/events/index.js +18 -0
- package/dist/modules/services/providers/files/crop-image-options.dto.v1.type.d.ts +13 -0
- package/dist/modules/services/providers/files/fetch-file-options.dto.v1.type.d.ts +21 -0
- package/dist/modules/services/providers/files/fetch-folder-options.dto.v1.type.d.ts +15 -0
- package/dist/modules/services/providers/files/files.service.d.ts +106 -0
- package/dist/modules/services/providers/files/files.service.js +146 -0
- package/dist/modules/services/providers/files/index.d.ts +4 -0
- package/dist/modules/services/providers/files/index.js +20 -0
- package/dist/modules/services/providers/hackschool/fetch-course-options.dto.v1.type.d.ts +15 -0
- package/dist/modules/services/providers/hackschool/fetch-doc-options.dto.v1.type.d.ts +17 -0
- package/dist/modules/services/providers/hackschool/fetch-thread-options.dto.v1.type.d.ts +18 -0
- package/dist/modules/services/providers/hackschool/hackschool.service.d.ts +93 -0
- package/dist/modules/services/providers/hackschool/hackschool.service.js +135 -0
- package/dist/modules/services/providers/hackschool/index.d.ts +2 -0
- package/dist/modules/services/providers/hackschool/index.js +18 -0
- package/dist/modules/services/providers/ideas.service.js +1 -1
- package/dist/modules/services/providers/index.d.ts +15 -12
- package/dist/modules/services/providers/index.js +17 -12
- package/dist/modules/services/providers/lunch-roulette.service.js +1 -1
- package/dist/modules/services/providers/mail/dtos/{auth-login-token-mail.dto.d.ts → auth-login-token-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/{auth-password-reset-mail.dto.d.ts → auth-password-reset-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/{event-cancel-mail.dto.d.ts → event-cancel-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/{event-invite-mail.dto.d.ts → event-invite-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/{idea-status-updated-mail.dto.d.ts → idea-status-updated-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/{idea-submitted-mail.dto.d.ts → idea-submitted-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/idea-submitted-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/dtos/index.d.ts +14 -14
- package/dist/modules/services/providers/mail/dtos/index.js +14 -14
- package/dist/modules/services/providers/mail/dtos/{lunch-roulette-cancel-mail.dto.d.ts → lunch-roulette-cancel-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/lunch-roulette-cancel-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/dtos/{lunch-roulette-matched-mail.dto.d.ts → lunch-roulette-matched-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/lunch-roulette-matched-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/dtos/{lunch-roulette-submitted-mail.dto.d.ts → lunch-roulette-submitted-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/lunch-roulette-submitted-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/dtos/{lunch-roulette-unmatched-mail.dto.d.ts → lunch-roulette-unmatched-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/lunch-roulette-unmatched-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/dtos/{newsletter-issue-mail.dto.d.ts → newsletter-issue-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/newsletter-issue-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/dtos/{newsletter-subscribed-mail.dto.d.ts → newsletter-subscribed-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/newsletter-subscribed-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/dtos/{newsletter-unsubscribed-mail.dto.d.ts → newsletter-unsubscribed-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/newsletter-unsubscribed-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/dtos/{notification-mail.dto.d.ts → notification-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/notification-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/mail-types.d.ts +17 -16
- package/dist/modules/services/providers/mail/mail-types.js +31 -14
- package/dist/modules/services/providers/mail/mail.service.d.ts +30 -31
- package/dist/modules/services/providers/mail/mail.service.js +49 -50
- package/dist/modules/services/providers/mail/models/mail-recipient.model.d.ts +2 -0
- package/dist/modules/services/providers/mail/models/mail-recipient.model.js +3 -0
- package/dist/modules/services/providers/newsletter/fetch-issue-options.dto.v1.type.d.ts +16 -0
- package/dist/modules/services/providers/newsletter/fetch-issue-options.dto.v1.type.js +2 -0
- package/dist/modules/services/providers/newsletter/index.d.ts +2 -0
- package/dist/modules/services/providers/newsletter/index.js +18 -0
- package/dist/modules/services/providers/newsletter/newsletter.service.d.ts +49 -0
- package/dist/modules/services/providers/newsletter/newsletter.service.js +79 -0
- package/dist/modules/services/providers/newsroom/fetch-news-options.dto.v1.type.d.ts +20 -0
- package/dist/modules/services/providers/newsroom/fetch-news-options.dto.v1.type.js +2 -0
- package/dist/modules/services/providers/newsroom/index.d.ts +2 -0
- package/dist/modules/services/providers/newsroom/index.js +18 -0
- package/dist/modules/services/providers/newsroom/newsroom.service.d.ts +49 -0
- package/dist/modules/services/providers/newsroom/newsroom.service.js +79 -0
- package/dist/modules/services/providers/notifications/dtos/index.d.ts +1 -0
- package/dist/modules/services/providers/{notification → notifications}/dtos/index.js +1 -1
- package/dist/modules/services/providers/{notification/dtos/schedule-notification.dto.d.ts → notifications/dtos/schedule-notification.dto.v1.d.ts} +2 -10
- package/dist/modules/services/providers/notifications/dtos/schedule-notification.dto.v1.js +2 -0
- package/dist/modules/services/providers/notifications/fetch-notification-options.dto.v1.type.d.ts +19 -0
- package/dist/modules/services/providers/notifications/fetch-notification-options.dto.v1.type.js +2 -0
- package/dist/modules/services/providers/notifications/index.d.ts +3 -0
- package/dist/modules/services/providers/notifications/index.js +19 -0
- package/dist/modules/services/providers/notifications/notifications.service-definition.d.ts +1 -0
- package/dist/modules/services/providers/notifications/notifications.service-definition.js +4 -0
- package/dist/modules/services/providers/{notification/notification.service.d.ts → notifications/notifications.service.d.ts} +41 -5
- package/dist/modules/services/providers/{notification/notification.service.js → notifications/notifications.service.js} +52 -26
- package/dist/modules/services/providers/pass/dtos/{create-guild-member-pass.dto.d.ts → create-guild-member-pass.dto.v1.d.ts} +2 -2
- package/dist/modules/services/providers/pass/dtos/create-guild-member-pass.dto.v1.js +2 -0
- package/dist/modules/services/providers/pass/dtos/{create-team-member-pass.dto.d.ts → create-team-member-pass.dto.v1.d.ts} +2 -2
- package/dist/modules/services/providers/pass/dtos/create-team-member-pass.dto.v1.js +2 -0
- package/dist/modules/services/providers/pass/dtos/index.d.ts +2 -2
- package/dist/modules/services/providers/pass/dtos/index.js +2 -2
- package/dist/modules/services/providers/pass/pass-types.d.ts +3 -3
- package/dist/modules/services/providers/pass/pass.service.d.ts +14 -14
- package/dist/modules/services/providers/pass/pass.service.js +28 -28
- package/dist/modules/services/providers/podcasts/fetch-episode-options.dto.v1.type.d.ts +19 -0
- package/dist/modules/services/providers/podcasts/fetch-episode-options.dto.v1.type.js +2 -0
- package/dist/modules/services/providers/podcasts/index.d.ts +2 -0
- package/dist/modules/services/providers/podcasts/index.js +18 -0
- package/dist/modules/services/providers/podcasts/podcasts.service.d.ts +49 -0
- package/dist/modules/services/providers/podcasts/podcasts.service.js +79 -0
- package/dist/modules/services/providers/quick-links/fetch-link-options.dto.v1.type.d.ts +14 -0
- package/dist/modules/services/providers/quick-links/fetch-link-options.dto.v1.type.js +2 -0
- package/dist/modules/services/providers/quick-links/index.d.ts +2 -0
- package/dist/modules/services/providers/quick-links/index.js +18 -0
- package/dist/modules/services/providers/quick-links/quick-links.service.d.ts +61 -0
- package/dist/modules/services/providers/quick-links/quick-links.service.js +79 -0
- package/dist/modules/services/providers/search/dtos/{index-search-document.dto.d.ts → index-document.dto.v1.d.ts} +2 -2
- package/dist/modules/services/providers/search/dtos/index-document.dto.v1.js +2 -0
- package/dist/modules/services/providers/search/dtos/index.d.ts +1 -1
- package/dist/modules/services/providers/search/dtos/index.js +1 -1
- package/dist/modules/services/providers/search/search.service.d.ts +6 -6
- package/dist/modules/services/providers/search/search.service.js +14 -17
- package/dist/modules/services/providers/team/fetch-member-options.dto.v1.type.d.ts +11 -0
- package/dist/modules/services/providers/team/fetch-member-options.dto.v1.type.js +2 -0
- package/dist/modules/services/providers/team/index.d.ts +2 -0
- package/dist/modules/services/providers/team/index.js +18 -0
- package/dist/modules/services/providers/team/team.service.d.ts +49 -0
- package/dist/modules/services/providers/team/team.service.js +79 -0
- package/dist/modules/services/providers/tech-radar/fetch-blip-options.dto.v1.type.d.ts +19 -0
- package/dist/modules/services/providers/tech-radar/fetch-blip-options.dto.v1.type.js +2 -0
- package/dist/modules/services/providers/tech-radar/fetch-edition-options.dto.v1.type copy.d.ts +15 -0
- package/dist/modules/services/providers/tech-radar/fetch-edition-options.dto.v1.type copy.js +2 -0
- package/dist/modules/services/providers/tech-radar/index.d.ts +3 -0
- package/dist/modules/services/providers/tech-radar/index.js +19 -0
- package/dist/modules/services/providers/tech-radar/tech-radar.service.d.ts +71 -0
- package/dist/modules/services/providers/tech-radar/tech-radar.service.js +107 -0
- package/dist/modules/services/services.module.js +6 -3
- package/package.json +1 -1
- package/dist/modules/services/providers/accounts.service.d.ts +0 -67
- package/dist/modules/services/providers/accounts.service.js +0 -131
- package/dist/modules/services/providers/books.service.d.ts +0 -29
- package/dist/modules/services/providers/books.service.js +0 -55
- package/dist/modules/services/providers/changelog.service.d.ts +0 -18
- package/dist/modules/services/providers/changelog.service.js +0 -43
- package/dist/modules/services/providers/demo-hive.service.d.ts +0 -29
- package/dist/modules/services/providers/demo-hive.service.js +0 -55
- package/dist/modules/services/providers/events.service.d.ts +0 -29
- package/dist/modules/services/providers/events.service.js +0 -55
- package/dist/modules/services/providers/hackschool.service.d.ts +0 -49
- package/dist/modules/services/providers/hackschool.service.js +0 -79
- package/dist/modules/services/providers/newletter.service.d.ts +0 -29
- package/dist/modules/services/providers/newletter.service.js +0 -55
- package/dist/modules/services/providers/newsroom.service.d.ts +0 -47
- package/dist/modules/services/providers/newsroom.service.js +0 -73
- package/dist/modules/services/providers/notification/dtos/index.d.ts +0 -1
- package/dist/modules/services/providers/notification/index.d.ts +0 -2
- package/dist/modules/services/providers/notification/notification.service-definition.d.ts +0 -1
- package/dist/modules/services/providers/notification/notification.service-definition.js +0 -4
- package/dist/modules/services/providers/podcasts.service.d.ts +0 -29
- package/dist/modules/services/providers/podcasts.service.js +0 -55
- package/dist/modules/services/providers/team.service.d.ts +0 -29
- package/dist/modules/services/providers/team.service.js +0 -55
- package/dist/modules/services/providers/tech-radar.service.d.ts +0 -39
- package/dist/modules/services/providers/tech-radar.service.js +0 -67
- /package/dist/modules/services/providers/{mail/dtos/auth-login-token-mail.dto.js → accounts/fetch-account-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/auth-password-reset-mail.dto.js → books/fetch-book-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/event-cancel-mail.dto.js → changelog/fetch-change-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/event-invite-mail.dto.js → conflicts/fetch-conflict-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/idea-status-updated-mail.dto.js → content/fetch-content-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/idea-submitted-mail.dto.js → demo-hive/fetch-demo-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/lunch-roulette-cancel-mail.dto.js → events/fetch-event-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/lunch-roulette-matched-mail.dto.js → files/crop-image-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/lunch-roulette-submitted-mail.dto.js → files/fetch-file-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/lunch-roulette-unmatched-mail.dto.js → files/fetch-folder-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/newsletter-issue-mail.dto.js → hackschool/fetch-course-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/newsletter-subscribed-mail.dto.js → hackschool/fetch-doc-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/newsletter-unsubscribed-mail.dto.js → hackschool/fetch-thread-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/mail/dtos/{notification-mail.dto.js → auth-login-token-mail.dto.v1.js} +0 -0
- /package/dist/modules/services/providers/{notification/dtos/schedule-notification.dto.js → mail/dtos/auth-password-reset-mail.dto.v1.js} +0 -0
- /package/dist/modules/services/providers/{pass/dtos/create-guild-member-pass.dto.js → mail/dtos/event-cancel-mail.dto.v1.js} +0 -0
- /package/dist/modules/services/providers/{pass/dtos/create-team-member-pass.dto.js → mail/dtos/event-invite-mail.dto.v1.js} +0 -0
- /package/dist/modules/services/providers/{search/dtos/index-search-document.dto.js → mail/dtos/idea-status-updated-mail.dto.v1.js} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
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.ConflictsService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const config_1 = require("@nestjs/config");
|
|
18
|
+
const authentication_1 = require("../../../authentication");
|
|
19
|
+
const base_http_service_1 = require("../../base-http.service");
|
|
20
|
+
const base_urls_1 = require("../../base-urls");
|
|
21
|
+
/**
|
|
22
|
+
* ConflictsService
|
|
23
|
+
*
|
|
24
|
+
* Service client responsible for interacting with the Conflicts microservice.
|
|
25
|
+
* Extends `BaseHttpService` to inherit:
|
|
26
|
+
* - Environment-sensitive URL resolution (internal vs. external).
|
|
27
|
+
* - Secure inter-service authentication.
|
|
28
|
+
* - Structured logging for traceability of outbound requests.
|
|
29
|
+
*
|
|
30
|
+
* Why this pattern?
|
|
31
|
+
* - Ensures all outbound calls follow a unified configuration and logging structure.
|
|
32
|
+
* - Promotes strong typing and maintainable HTTP logic.
|
|
33
|
+
* - Makes service interactions predictable and debuggable across environments.
|
|
34
|
+
*/
|
|
35
|
+
let ConflictsService = class ConflictsService extends base_http_service_1.BaseHttpService {
|
|
36
|
+
/**
|
|
37
|
+
* Constructs an Conflicts service client instance.
|
|
38
|
+
*
|
|
39
|
+
* @param {AuthenticationModuleOptions} authenticationOptions - Injected authentication configuration.
|
|
40
|
+
* @param {ConfigService} configService - NestJS ConfigService for environment detection.
|
|
41
|
+
*/
|
|
42
|
+
constructor(authenticationOptions, configService) {
|
|
43
|
+
super('Conflicts', base_urls_1.BaseUrls.conflictsService, authenticationOptions, configService);
|
|
44
|
+
}
|
|
45
|
+
// ─────────────────────────────────────────────────────────────
|
|
46
|
+
// Conflict Resource Methods
|
|
47
|
+
// ─────────────────────────────────────────────────────────────
|
|
48
|
+
/**
|
|
49
|
+
* Retrieves a single conflict entry by its MongoDB identifier.
|
|
50
|
+
*
|
|
51
|
+
* This method gracefully handles downstream failures by logging
|
|
52
|
+
* and returning `undefined` instead of throwing.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} conflictId - Unique MongoDB identifier of the conflict.
|
|
55
|
+
* @param {FetchConflictOptionsDtoV1} [options] - Optional query parameters for filtering or projection.
|
|
56
|
+
* @returns {Promise<LabConflict | undefined>} Resolves to an Conflict or `undefined` on failure.
|
|
57
|
+
*/
|
|
58
|
+
async fetchConflictV1(conflictId, options) {
|
|
59
|
+
return this.fetchResource(`v1/internal/conflict/${conflictId}`, { params: options });
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Retrieves a collection of conflict entries.
|
|
63
|
+
*
|
|
64
|
+
* Useful for batch lookups or paginated listings.
|
|
65
|
+
* Returns an empty array if the downstream service call fails.
|
|
66
|
+
*
|
|
67
|
+
* @param {FetchConflictOptionsDtoV1} [options] - Optional filter options for narrowing results.
|
|
68
|
+
* @returns {Promise<LabConflict[]>} Resolves to a list of conflicts, or an empty array if none found.
|
|
69
|
+
*/
|
|
70
|
+
async fetchConflictCollectionV1(options) {
|
|
71
|
+
return this.fetchResourceCollection(`v1/internal/conflicts`, { params: options });
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
exports.ConflictsService = ConflictsService;
|
|
75
|
+
exports.ConflictsService = ConflictsService = __decorate([
|
|
76
|
+
(0, common_1.Injectable)(),
|
|
77
|
+
__param(0, (0, authentication_1.InjectAuthenticationOptions)()),
|
|
78
|
+
__metadata("design:paramtypes", [Object, config_1.ConfigService])
|
|
79
|
+
], ConflictsService);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseFetchOptions } from '../../../../classes';
|
|
2
|
+
/**
|
|
3
|
+
* FetchConflictOptionsDtoV1
|
|
4
|
+
*
|
|
5
|
+
* Data Transfer Object for querying conflict collections.
|
|
6
|
+
* Inherits timestamp filtering fields and extends them with
|
|
7
|
+
* conflict-specific query parameters.
|
|
8
|
+
*/
|
|
9
|
+
export type FetchConflictOptionsDtoV1 = BaseFetchOptions & {
|
|
10
|
+
resource?: string;
|
|
11
|
+
resources?: string[];
|
|
12
|
+
level?: number;
|
|
13
|
+
levels?: number[];
|
|
14
|
+
firstRecordedAtMin?: number;
|
|
15
|
+
firstRecordedAtMax?: number;
|
|
16
|
+
lastRecordedAtMin?: number;
|
|
17
|
+
lastRecordedAtMax?: number;
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./conflicts.service"), exports);
|
|
18
|
+
__exportStar(require("./fetch-conflict-options.dto.v1.type"), exports);
|
|
@@ -2,7 +2,7 @@ import { LabContent, LabContentPopulated } from 'itlab-functions';
|
|
|
2
2
|
/**
|
|
3
3
|
* Constant list of supported digital pass types.
|
|
4
4
|
*/
|
|
5
|
-
export declare const supportedContentReturnTypes: readonly ["json", "text", "html", "
|
|
5
|
+
export declare const supportedContentReturnTypes: readonly ["json", "text", "html", "htmlPopulated"];
|
|
6
6
|
/**
|
|
7
7
|
* Union type representing valid pass types.
|
|
8
8
|
*/
|
|
@@ -15,5 +15,6 @@ export type ContentReturnTypeMap = {
|
|
|
15
15
|
json: LabContent;
|
|
16
16
|
text: string;
|
|
17
17
|
html: LabContent;
|
|
18
|
-
|
|
18
|
+
htmlPopulated: LabContentPopulated;
|
|
19
19
|
};
|
|
20
|
+
export declare const ContentReturnTypeEndpointMap: Record<ContentReturnType, string>;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.supportedContentReturnTypes = void 0;
|
|
3
|
+
exports.ContentReturnTypeEndpointMap = exports.supportedContentReturnTypes = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Constant list of supported digital pass types.
|
|
6
6
|
*/
|
|
7
|
-
exports.supportedContentReturnTypes = ['json', 'text', 'html', '
|
|
7
|
+
exports.supportedContentReturnTypes = ['json', 'text', 'html', 'htmlPopulated'];
|
|
8
|
+
exports.ContentReturnTypeEndpointMap = {
|
|
9
|
+
json: 'v1/content/%resource%/%resourceId%/json',
|
|
10
|
+
text: 'v1/content/%resource%/%resourceId%/text',
|
|
11
|
+
html: 'v1/content/%resource%/%resourceId%/html',
|
|
12
|
+
htmlPopulated: 'v1/content/%resource%/%resourceId%/html/populated',
|
|
13
|
+
};
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import { DynamicModule } from '@nestjs/common';
|
|
2
2
|
import { ConfigService } from '@nestjs/config';
|
|
3
|
-
import { LabContent } from 'itlab-functions';
|
|
3
|
+
import { LabContent, LabContentPopulated } from 'itlab-functions';
|
|
4
4
|
import { HubResource } from '../../../../hub-resource.enum';
|
|
5
5
|
import { AuthenticationModuleOptions } from '../../../authentication';
|
|
6
6
|
import { CacheService } from '../../../cache';
|
|
7
7
|
import { BaseHttpService } from '../../base-http.service';
|
|
8
8
|
import { ServicesModuleOptions } from '../../services-module-options.interface';
|
|
9
9
|
import { ContentReturnType, ContentReturnTypeMap } from './content-return-types';
|
|
10
|
+
import { FetchContentOptionsDtoV1 } from './fetch-content-options.dto.v1.type';
|
|
10
11
|
/**
|
|
11
12
|
* Parameter decorator to inject the feature-specific ContentService.
|
|
12
13
|
*/
|
|
13
14
|
export declare function InjectFeatureContentService(): ParameterDecorator;
|
|
15
|
+
type ContentSchema = {
|
|
16
|
+
id: string;
|
|
17
|
+
_resource: string;
|
|
18
|
+
_resourceId: string;
|
|
19
|
+
json: LabContent;
|
|
20
|
+
htmlPopulated: LabContentPopulated;
|
|
21
|
+
};
|
|
14
22
|
/**
|
|
15
23
|
* Service responsible for all operations with the Organisation Hub Content Service.
|
|
16
24
|
*
|
|
@@ -43,6 +51,39 @@ export declare class ContentService extends BaseHttpService {
|
|
|
43
51
|
static forResource(resource: HubResource): DynamicModule;
|
|
44
52
|
private cacheKey;
|
|
45
53
|
private clearCache;
|
|
54
|
+
/**
|
|
55
|
+
* Retrieves a single content entry by its MongoDB identifier.
|
|
56
|
+
*
|
|
57
|
+
* This method gracefully handles downstream failures by logging
|
|
58
|
+
* and returning `undefined` instead of throwing.
|
|
59
|
+
*
|
|
60
|
+
* @param {string} contentId - Unique MongoDB identifier of the content.
|
|
61
|
+
* @param {FetchContentOptionsDtoV1} [options] - Optional query parameters for filtering or projection.
|
|
62
|
+
* @returns {Promise<ContentSchema | undefined>} Resolves to an Content or `undefined` on failure.
|
|
63
|
+
*/
|
|
64
|
+
fetchContentSchemaV1(contentId: string, options?: FetchContentOptionsDtoV1): Promise<ContentSchema | undefined>;
|
|
65
|
+
/**
|
|
66
|
+
* Retrieves a collection of content entries.
|
|
67
|
+
*
|
|
68
|
+
* Useful for batch lookups or paginated listings.
|
|
69
|
+
* Returns an empty array if the downstream service call fails.
|
|
70
|
+
*
|
|
71
|
+
* @param {FetchContentOptionsDtoV1} [options] - Optional filter options for narrowing results.
|
|
72
|
+
* @returns {Promise<ContentSchema[]>} Resolves to a list of contents, or an empty array if none found.
|
|
73
|
+
*/
|
|
74
|
+
fetchContentSchemaCollectionV1(options?: FetchContentOptionsDtoV1): Promise<ContentSchema[]>;
|
|
75
|
+
/**
|
|
76
|
+
* Retrieves a single content entry by its resource and resourceId identifiers.
|
|
77
|
+
*
|
|
78
|
+
* This method gracefully handles downstream failures by logging
|
|
79
|
+
* and returning `undefined` instead of throwing.
|
|
80
|
+
*
|
|
81
|
+
* @param {string} resource - Resource Type of the content.
|
|
82
|
+
* @param {string} resourceId - Unique MongoDB identifier of Resource of the content.
|
|
83
|
+
* @param {FetchContentOptionsDtoV1} [options] - Optional query parameters for filtering or projection.
|
|
84
|
+
* @returns {Promise<ContentSchema | undefined>} Resolves to an Content or `undefined` on failure.
|
|
85
|
+
*/
|
|
86
|
+
fetchContentSchemaOfResourceV1(resource: string, resourceId: string, options?: FetchContentOptionsDtoV1): Promise<ContentSchema>;
|
|
46
87
|
/**
|
|
47
88
|
* Validates the given content object using the backend service.
|
|
48
89
|
* Logs the process and throws an HTTP exception if validation fails.
|
|
@@ -51,7 +92,7 @@ export declare class ContentService extends BaseHttpService {
|
|
|
51
92
|
* @returns Resolves if validation is successful.
|
|
52
93
|
* @throws HttpException if the backend returns an error.
|
|
53
94
|
*/
|
|
54
|
-
|
|
95
|
+
validateContentV1(content: LabContent): Promise<void>;
|
|
55
96
|
/**
|
|
56
97
|
* Submits content for a given resource.
|
|
57
98
|
*
|
|
@@ -59,7 +100,7 @@ export declare class ContentService extends BaseHttpService {
|
|
|
59
100
|
* @param content Content object to submit.
|
|
60
101
|
* @throws HttpException if the backend returns an error.
|
|
61
102
|
*/
|
|
62
|
-
|
|
103
|
+
submitContentV1(resourceId: string, content: LabContent): Promise<void>;
|
|
63
104
|
/**
|
|
64
105
|
* Directly submits content without extra validation.
|
|
65
106
|
* Backend will handle validation internally.
|
|
@@ -68,14 +109,14 @@ export declare class ContentService extends BaseHttpService {
|
|
|
68
109
|
* @param content Content object to submit.
|
|
69
110
|
* @throws HttpException if the backend returns an error.
|
|
70
111
|
*/
|
|
71
|
-
|
|
112
|
+
validateAndSubmitContentV1(resourceId: string, content: LabContent): Promise<void>;
|
|
72
113
|
/**
|
|
73
114
|
* Removes content associated with a given resource.
|
|
74
115
|
* Logs errors but does not throw; always resolves to allow safe cleanup.
|
|
75
116
|
*
|
|
76
117
|
* @param resourceId Unique identifier of the resource.
|
|
77
118
|
*/
|
|
78
|
-
|
|
119
|
+
deleteContentV1(resourceId: string): void;
|
|
79
120
|
/**
|
|
80
121
|
* Retrieves content in a specified format from the backend.
|
|
81
122
|
* Provides default values if content retrieval fails.
|
|
@@ -84,7 +125,7 @@ export declare class ContentService extends BaseHttpService {
|
|
|
84
125
|
* @param returnType Format of content to retrieve ('json', 'text', 'html', 'populated').
|
|
85
126
|
* @returns Retrieved content in the requested format.
|
|
86
127
|
*/
|
|
87
|
-
|
|
128
|
+
fetchContentV1<ReturnType extends ContentReturnType>(resourceId: string, returnType: ReturnType): Promise<ContentReturnTypeMap[ReturnType]>;
|
|
88
129
|
/**
|
|
89
130
|
* Retrieves content from the cache if available; otherwise fetches from the backend.
|
|
90
131
|
*
|
|
@@ -92,5 +133,6 @@ export declare class ContentService extends BaseHttpService {
|
|
|
92
133
|
* @param returnType Format of content to retrieve.
|
|
93
134
|
* @returns Cached or freshly retrieved content.
|
|
94
135
|
*/
|
|
95
|
-
|
|
136
|
+
fetchCachedContentV1<ReturnType extends ContentReturnType>(resourceId: string, returnType: ReturnType): Promise<ContentReturnTypeMap[ReturnType]>;
|
|
96
137
|
}
|
|
138
|
+
export {};
|
|
@@ -52,7 +52,7 @@ let ContentService = ContentService_1 = class ContentService extends base_http_s
|
|
|
52
52
|
* @param cacheService Optional caching service for retrieving content efficiently.
|
|
53
53
|
*/
|
|
54
54
|
constructor(authenticationOptions, options, configService, cacheService) {
|
|
55
|
-
super('Content', base_urls_1.BaseUrls.
|
|
55
|
+
super('Content', base_urls_1.BaseUrls.contentService, authenticationOptions, configService);
|
|
56
56
|
this.options = options;
|
|
57
57
|
this.cacheService = cacheService;
|
|
58
58
|
this.cacheKey = (resourceId, returnType) => {
|
|
@@ -96,6 +96,48 @@ let ContentService = ContentService_1 = class ContentService extends base_http_s
|
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
+
// ─────────────────────────────────────────────────────────────
|
|
100
|
+
// Content Resource Methods
|
|
101
|
+
// ─────────────────────────────────────────────────────────────
|
|
102
|
+
/**
|
|
103
|
+
* Retrieves a single content entry by its MongoDB identifier.
|
|
104
|
+
*
|
|
105
|
+
* This method gracefully handles downstream failures by logging
|
|
106
|
+
* and returning `undefined` instead of throwing.
|
|
107
|
+
*
|
|
108
|
+
* @param {string} contentId - Unique MongoDB identifier of the content.
|
|
109
|
+
* @param {FetchContentOptionsDtoV1} [options] - Optional query parameters for filtering or projection.
|
|
110
|
+
* @returns {Promise<ContentSchema | undefined>} Resolves to an Content or `undefined` on failure.
|
|
111
|
+
*/
|
|
112
|
+
async fetchContentSchemaV1(contentId, options) {
|
|
113
|
+
return this.fetchResource(`v1/internal/content/${contentId}`, { params: options });
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Retrieves a collection of content entries.
|
|
117
|
+
*
|
|
118
|
+
* Useful for batch lookups or paginated listings.
|
|
119
|
+
* Returns an empty array if the downstream service call fails.
|
|
120
|
+
*
|
|
121
|
+
* @param {FetchContentOptionsDtoV1} [options] - Optional filter options for narrowing results.
|
|
122
|
+
* @returns {Promise<ContentSchema[]>} Resolves to a list of contents, or an empty array if none found.
|
|
123
|
+
*/
|
|
124
|
+
async fetchContentSchemaCollectionV1(options) {
|
|
125
|
+
return this.fetchResourceCollection(`v1/internal/contents`, { params: options });
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Retrieves a single content entry by its resource and resourceId identifiers.
|
|
129
|
+
*
|
|
130
|
+
* This method gracefully handles downstream failures by logging
|
|
131
|
+
* and returning `undefined` instead of throwing.
|
|
132
|
+
*
|
|
133
|
+
* @param {string} resource - Resource Type of the content.
|
|
134
|
+
* @param {string} resourceId - Unique MongoDB identifier of Resource of the content.
|
|
135
|
+
* @param {FetchContentOptionsDtoV1} [options] - Optional query parameters for filtering or projection.
|
|
136
|
+
* @returns {Promise<ContentSchema | undefined>} Resolves to an Content or `undefined` on failure.
|
|
137
|
+
*/
|
|
138
|
+
async fetchContentSchemaOfResourceV1(resource, resourceId, options) {
|
|
139
|
+
return this.fetchResource(`v1/internal/content/${resource}/${resourceId}`, { params: options });
|
|
140
|
+
}
|
|
99
141
|
/**
|
|
100
142
|
* Validates the given content object using the backend service.
|
|
101
143
|
* Logs the process and throws an HTTP exception if validation fails.
|
|
@@ -104,11 +146,10 @@ let ContentService = ContentService_1 = class ContentService extends base_http_s
|
|
|
104
146
|
* @returns Resolves if validation is successful.
|
|
105
147
|
* @throws HttpException if the backend returns an error.
|
|
106
148
|
*/
|
|
107
|
-
async
|
|
108
|
-
const endpoint = `internal/verify`;
|
|
149
|
+
async validateContentV1(content) {
|
|
109
150
|
this.logger.log('Validating content...');
|
|
110
151
|
try {
|
|
111
|
-
await this.
|
|
152
|
+
await this.httpClient.post(`v1/internal/content/validate`, { content });
|
|
112
153
|
this.logger.log('Content validation successful.');
|
|
113
154
|
}
|
|
114
155
|
catch (error) {
|
|
@@ -124,15 +165,14 @@ let ContentService = ContentService_1 = class ContentService extends base_http_s
|
|
|
124
165
|
* @param content Content object to submit.
|
|
125
166
|
* @throws HttpException if the backend returns an error.
|
|
126
167
|
*/
|
|
127
|
-
async
|
|
168
|
+
async submitContentV1(resourceId, content) {
|
|
128
169
|
if (!this.options.resource) {
|
|
129
170
|
this.logger.error('Cannot submit content: Resource type not provided.');
|
|
130
171
|
return;
|
|
131
172
|
}
|
|
132
|
-
const endpoint = `internal/${this.options.resource}/${resourceId}`;
|
|
133
173
|
this.logger.log(`Submitting content for ${this.options.resource} ${resourceId}...`);
|
|
134
174
|
try {
|
|
135
|
-
await this.
|
|
175
|
+
await this.httpClient.post(`v1/internal/content/${this.options.resource}/${resourceId}`, { content });
|
|
136
176
|
this.logger.log(`Content successfully submitted for ${this.options.resource} ${resourceId}.`);
|
|
137
177
|
this.clearCache(resourceId);
|
|
138
178
|
}
|
|
@@ -150,8 +190,8 @@ let ContentService = ContentService_1 = class ContentService extends base_http_s
|
|
|
150
190
|
* @param content Content object to submit.
|
|
151
191
|
* @throws HttpException if the backend returns an error.
|
|
152
192
|
*/
|
|
153
|
-
async
|
|
154
|
-
await this.
|
|
193
|
+
async validateAndSubmitContentV1(resourceId, content) {
|
|
194
|
+
await this.submitContentV1(resourceId, content);
|
|
155
195
|
}
|
|
156
196
|
/**
|
|
157
197
|
* Removes content associated with a given resource.
|
|
@@ -159,14 +199,14 @@ let ContentService = ContentService_1 = class ContentService extends base_http_s
|
|
|
159
199
|
*
|
|
160
200
|
* @param resourceId Unique identifier of the resource.
|
|
161
201
|
*/
|
|
162
|
-
|
|
202
|
+
deleteContentV1(resourceId) {
|
|
163
203
|
if (!this.options.resource) {
|
|
164
204
|
this.logger.error('Cannot remove document: Resource type not provided.');
|
|
165
205
|
return;
|
|
166
206
|
}
|
|
167
|
-
const endpoint = `internal/${this.options.resource}/${resourceId}`;
|
|
207
|
+
const endpoint = `v1/internal/content/${this.options.resource}/${resourceId}`;
|
|
168
208
|
this.logger.log(`Removing content for ${this.options.resource} ${resourceId}...`);
|
|
169
|
-
this.
|
|
209
|
+
this.httpClient
|
|
170
210
|
.delete(endpoint)
|
|
171
211
|
.then(() => {
|
|
172
212
|
this.logger.log(`Content removed successfully for ${this.options.resource} (${resourceId}).`);
|
|
@@ -185,16 +225,18 @@ let ContentService = ContentService_1 = class ContentService extends base_http_s
|
|
|
185
225
|
* @param returnType Format of content to retrieve ('json', 'text', 'html', 'populated').
|
|
186
226
|
* @returns Retrieved content in the requested format.
|
|
187
227
|
*/
|
|
188
|
-
async
|
|
228
|
+
async fetchContentV1(resourceId, returnType) {
|
|
189
229
|
const defaultReturnValue = (returnType === 'text' ? '' : []);
|
|
190
230
|
if (!this.options.resource) {
|
|
191
231
|
this.logger.error('Cannot fetch content: Resource type not provided.');
|
|
192
232
|
return defaultReturnValue;
|
|
193
233
|
}
|
|
194
|
-
const endpoint =
|
|
234
|
+
const endpoint = content_return_types_1.ContentReturnTypeEndpointMap[returnType]
|
|
235
|
+
.replace('%resource%', this.options.resource)
|
|
236
|
+
.replace('%resourceId%', resourceId);
|
|
195
237
|
this.logger.log(`Fetching ${returnType} content for ${this.options.resource} ${resourceId}...`);
|
|
196
238
|
try {
|
|
197
|
-
const { data } = await this.
|
|
239
|
+
const { data } = await this.httpClient.get(endpoint);
|
|
198
240
|
this.logger.log(`Successfully retrieved ${returnType} content for ${this.options.resource} ${resourceId}.`);
|
|
199
241
|
return data;
|
|
200
242
|
}
|
|
@@ -211,13 +253,13 @@ let ContentService = ContentService_1 = class ContentService extends base_http_s
|
|
|
211
253
|
* @param returnType Format of content to retrieve.
|
|
212
254
|
* @returns Cached or freshly retrieved content.
|
|
213
255
|
*/
|
|
214
|
-
async
|
|
215
|
-
const
|
|
256
|
+
async fetchCachedContentV1(resourceId, returnType) {
|
|
257
|
+
const fetchContentV1 = () => this.fetchContentV1(resourceId, returnType);
|
|
216
258
|
if (this.cacheService) {
|
|
217
259
|
const cacheKey = this.cacheKey(resourceId, returnType);
|
|
218
|
-
return this.cacheService.fetchOrStore(cacheKey,
|
|
260
|
+
return this.cacheService.fetchOrStore(cacheKey, fetchContentV1, 86400000); // 1 day or until updated
|
|
219
261
|
}
|
|
220
|
-
return
|
|
262
|
+
return fetchContentV1();
|
|
221
263
|
}
|
|
222
264
|
};
|
|
223
265
|
exports.ContentService = ContentService;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseFetchOptions } from '../../../../classes';
|
|
2
|
+
/**
|
|
3
|
+
* FetchContentOptionsDtoV1
|
|
4
|
+
*
|
|
5
|
+
* Data Transfer Object for querying content collections.
|
|
6
|
+
* Inherits timestamp filtering fields and extends them with
|
|
7
|
+
* content-specific query parameters.
|
|
8
|
+
*/
|
|
9
|
+
export type FetchContentOptionsDtoV1 = BaseFetchOptions & {
|
|
10
|
+
populateHtml?: boolean;
|
|
11
|
+
resource?: string;
|
|
12
|
+
resources?: string[];
|
|
13
|
+
resourceId?: string;
|
|
14
|
+
resourceIds?: string[];
|
|
15
|
+
};
|
|
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./content.service"), exports);
|
|
18
|
+
__exportStar(require("./fetch-content-options.dto.v1.type"), exports);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ConfigService } from '@nestjs/config';
|
|
2
|
+
import { LabDemo } from 'itlab-functions';
|
|
3
|
+
import { AuthenticationModuleOptions } from '../../../authentication';
|
|
4
|
+
import { BaseHttpService } from '../../base-http.service';
|
|
5
|
+
import { FetchDemoOptionsDtoV1 } from './fetch-demo-options.dto.v1.type';
|
|
6
|
+
/**
|
|
7
|
+
* DemoHiveService
|
|
8
|
+
*
|
|
9
|
+
* Service client responsible for interacting with the Demo Hive microservice.
|
|
10
|
+
* Extends `BaseHttpService` to inherit:
|
|
11
|
+
* - Environment-sensitive URL resolution (internal vs. external).
|
|
12
|
+
* - Secure inter-service authentication.
|
|
13
|
+
* - Structured logging for traceability of outbound requests.
|
|
14
|
+
*
|
|
15
|
+
* Why this pattern?
|
|
16
|
+
* - Ensures all outbound calls follow a unified configuration and logging structure.
|
|
17
|
+
* - Promotes strong typing and maintainable HTTP logic.
|
|
18
|
+
* - Makes service interactions predictable and debuggable across environments.
|
|
19
|
+
*/
|
|
20
|
+
export declare class DemoHiveService extends BaseHttpService {
|
|
21
|
+
/**
|
|
22
|
+
* Constructs an Demo Hive service client instance.
|
|
23
|
+
*
|
|
24
|
+
* @param {AuthenticationModuleOptions} authenticationOptions - Injected authentication configuration.
|
|
25
|
+
* @param {ConfigService} configService - NestJS ConfigService for environment detection.
|
|
26
|
+
*/
|
|
27
|
+
constructor(authenticationOptions: AuthenticationModuleOptions, configService: ConfigService);
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves a single demo entry by its MongoDB identifier.
|
|
30
|
+
*
|
|
31
|
+
* This method gracefully handles downstream failures by logging
|
|
32
|
+
* and returning `undefined` instead of throwing.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} demoId - Unique MongoDB identifier of the demo.
|
|
35
|
+
* @param {FetchDemoOptionsDtoV1} [options] - Optional query parameters for filtering or projection.
|
|
36
|
+
* @returns {Promise<LabDemo | undefined>} Resolves to an Demo or `undefined` on failure.
|
|
37
|
+
*/
|
|
38
|
+
fetchDemoV1(demoId: string, options?: FetchDemoOptionsDtoV1): Promise<LabDemo | undefined>;
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves a collection of demo entries.
|
|
41
|
+
*
|
|
42
|
+
* Useful for batch lookups or paginated listings.
|
|
43
|
+
* Returns an empty array if the downstream service call fails.
|
|
44
|
+
*
|
|
45
|
+
* @param {FetchDemoOptionsDtoV1} [options] - Optional filter options for narrowing results.
|
|
46
|
+
* @returns {Promise<LabDemo[]>} Resolves to a list of demos, or an empty array if none found.
|
|
47
|
+
*/
|
|
48
|
+
fetchDemoCollectionV1(options?: FetchDemoOptionsDtoV1): Promise<LabDemo[]>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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.DemoHiveService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const config_1 = require("@nestjs/config");
|
|
18
|
+
const authentication_1 = require("../../../authentication");
|
|
19
|
+
const base_http_service_1 = require("../../base-http.service");
|
|
20
|
+
const base_urls_1 = require("../../base-urls");
|
|
21
|
+
/**
|
|
22
|
+
* DemoHiveService
|
|
23
|
+
*
|
|
24
|
+
* Service client responsible for interacting with the Demo Hive microservice.
|
|
25
|
+
* Extends `BaseHttpService` to inherit:
|
|
26
|
+
* - Environment-sensitive URL resolution (internal vs. external).
|
|
27
|
+
* - Secure inter-service authentication.
|
|
28
|
+
* - Structured logging for traceability of outbound requests.
|
|
29
|
+
*
|
|
30
|
+
* Why this pattern?
|
|
31
|
+
* - Ensures all outbound calls follow a unified configuration and logging structure.
|
|
32
|
+
* - Promotes strong typing and maintainable HTTP logic.
|
|
33
|
+
* - Makes service interactions predictable and debuggable across environments.
|
|
34
|
+
*/
|
|
35
|
+
let DemoHiveService = class DemoHiveService extends base_http_service_1.BaseHttpService {
|
|
36
|
+
/**
|
|
37
|
+
* Constructs an Demo Hive service client instance.
|
|
38
|
+
*
|
|
39
|
+
* @param {AuthenticationModuleOptions} authenticationOptions - Injected authentication configuration.
|
|
40
|
+
* @param {ConfigService} configService - NestJS ConfigService for environment detection.
|
|
41
|
+
*/
|
|
42
|
+
constructor(authenticationOptions, configService) {
|
|
43
|
+
super('DemoHive', base_urls_1.BaseUrls.demoHiveService, authenticationOptions, configService);
|
|
44
|
+
}
|
|
45
|
+
// ─────────────────────────────────────────────────────────────
|
|
46
|
+
// Demo Resource Methods
|
|
47
|
+
// ─────────────────────────────────────────────────────────────
|
|
48
|
+
/**
|
|
49
|
+
* Retrieves a single demo entry by its MongoDB identifier.
|
|
50
|
+
*
|
|
51
|
+
* This method gracefully handles downstream failures by logging
|
|
52
|
+
* and returning `undefined` instead of throwing.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} demoId - Unique MongoDB identifier of the demo.
|
|
55
|
+
* @param {FetchDemoOptionsDtoV1} [options] - Optional query parameters for filtering or projection.
|
|
56
|
+
* @returns {Promise<LabDemo | undefined>} Resolves to an Demo or `undefined` on failure.
|
|
57
|
+
*/
|
|
58
|
+
async fetchDemoV1(demoId, options) {
|
|
59
|
+
return this.fetchResource(`v1/internal/demo/${demoId}`, { params: options });
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Retrieves a collection of demo entries.
|
|
63
|
+
*
|
|
64
|
+
* Useful for batch lookups or paginated listings.
|
|
65
|
+
* Returns an empty array if the downstream service call fails.
|
|
66
|
+
*
|
|
67
|
+
* @param {FetchDemoOptionsDtoV1} [options] - Optional filter options for narrowing results.
|
|
68
|
+
* @returns {Promise<LabDemo[]>} Resolves to a list of demos, or an empty array if none found.
|
|
69
|
+
*/
|
|
70
|
+
async fetchDemoCollectionV1(options) {
|
|
71
|
+
return this.fetchResourceCollection(`v1/internal/demos`, { params: options });
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
exports.DemoHiveService = DemoHiveService;
|
|
75
|
+
exports.DemoHiveService = DemoHiveService = __decorate([
|
|
76
|
+
(0, common_1.Injectable)(),
|
|
77
|
+
__param(0, (0, authentication_1.InjectAuthenticationOptions)()),
|
|
78
|
+
__metadata("design:paramtypes", [Object, config_1.ConfigService])
|
|
79
|
+
], DemoHiveService);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseFetchOptions, CommentsFetchOptions, ContentFetchOptions, DraftedFetchOptions, LikedByFetchOptions, TimestampsFetchOptions, ViewedByFetchOptions } from '../../../../classes';
|
|
2
|
+
/**
|
|
3
|
+
* FetchDemoOptionsDtoV1
|
|
4
|
+
*
|
|
5
|
+
* Data Transfer Object for querying demo collections.
|
|
6
|
+
* Inherits timestamp filtering fields and extends them with
|
|
7
|
+
* demo-specific query parameters.
|
|
8
|
+
*/
|
|
9
|
+
export type FetchDemoOptionsDtoV1 = BaseFetchOptions & TimestampsFetchOptions & DraftedFetchOptions & ContentFetchOptions & ViewedByFetchOptions & LikedByFetchOptions & CommentsFetchOptions & {
|
|
10
|
+
includeContact?: boolean;
|
|
11
|
+
hasWebsite?: boolean;
|
|
12
|
+
contactId?: string;
|
|
13
|
+
contactIds?: string[];
|
|
14
|
+
timestampMin?: number;
|
|
15
|
+
timestampMax?: number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./demo-hive.service"), exports);
|
|
18
|
+
__exportStar(require("./fetch-demo-options.dto.v1.type"), exports);
|