@thomas-labs/scrape-service-lib 1.1.53 → 1.1.55

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.
@@ -7,6 +7,7 @@ import { CollectionsService } from './services/CollectionsService';
7
7
  import { CollectionTemplatesService } from './services/CollectionTemplatesService';
8
8
  import { CollectionTestService } from './services/CollectionTestService';
9
9
  import { DefaultService } from './services/DefaultService';
10
+ import { NotificationsService } from './services/NotificationsService';
10
11
  import { ReportsService } from './services/ReportsService';
11
12
  import { StatsService } from './services/StatsService';
12
13
  import { StudyService } from './services/StudyService';
@@ -24,6 +25,7 @@ export declare class AppClient {
24
25
  readonly collectionTemplates: CollectionTemplatesService;
25
26
  readonly collectionTest: CollectionTestService;
26
27
  readonly default: DefaultService;
28
+ readonly notifications: NotificationsService;
27
29
  readonly reports: ReportsService;
28
30
  readonly stats: StatsService;
29
31
  readonly study: StudyService;
package/dist/AppClient.js CHANGED
@@ -9,6 +9,7 @@ const CollectionsService_1 = require("./services/CollectionsService");
9
9
  const CollectionTemplatesService_1 = require("./services/CollectionTemplatesService");
10
10
  const CollectionTestService_1 = require("./services/CollectionTestService");
11
11
  const DefaultService_1 = require("./services/DefaultService");
12
+ const NotificationsService_1 = require("./services/NotificationsService");
12
13
  const ReportsService_1 = require("./services/ReportsService");
13
14
  const StatsService_1 = require("./services/StatsService");
14
15
  const StudyService_1 = require("./services/StudyService");
@@ -21,7 +22,7 @@ class AppClient {
21
22
  constructor(config, HttpRequest = FetchHttpRequest_1.FetchHttpRequest) {
22
23
  this.request = new HttpRequest({
23
24
  BASE: config?.BASE ?? '/api',
24
- VERSION: config?.VERSION ?? '1.0.61',
25
+ VERSION: config?.VERSION ?? '1.0.63',
25
26
  WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
26
27
  CREDENTIALS: config?.CREDENTIALS ?? 'include',
27
28
  TOKEN: config?.TOKEN,
@@ -37,6 +38,7 @@ class AppClient {
37
38
  this.collectionTemplates = new CollectionTemplatesService_1.CollectionTemplatesService(this.request);
38
39
  this.collectionTest = new CollectionTestService_1.CollectionTestService(this.request);
39
40
  this.default = new DefaultService_1.DefaultService(this.request);
41
+ this.notifications = new NotificationsService_1.NotificationsService(this.request);
40
42
  this.reports = new ReportsService_1.ReportsService(this.request);
41
43
  this.stats = new StatsService_1.StatsService(this.request);
42
44
  this.study = new StudyService_1.StudyService(this.request);
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OpenAPI = void 0;
4
4
  exports.OpenAPI = {
5
5
  BASE: '/api',
6
- VERSION: '1.0.61',
6
+ VERSION: '1.0.63',
7
7
  WITH_CREDENTIALS: false,
8
8
  CREDENTIALS: 'include',
9
9
  TOKEN: undefined,
package/dist/index.d.ts CHANGED
@@ -8,10 +8,12 @@ export type { ActivateDto } from './models/ActivateDto';
8
8
  export { AiProviderDto } from './models/AiProviderDto';
9
9
  export { CollectionTestPartDto } from './models/CollectionTestPartDto';
10
10
  export { CollectionTestSessionStatusDto } from './models/CollectionTestSessionStatusDto';
11
+ export type { CreateAdminNotificationDto } from './models/CreateAdminNotificationDto';
11
12
  export type { CreateCollectionDto } from './models/CreateCollectionDto';
12
13
  export type { CreateCollectionJsonDto } from './models/CreateCollectionJsonDto';
13
14
  export type { CreateCollectionTemplateDto } from './models/CreateCollectionTemplateDto';
14
15
  export type { CreateCollectionTestSessionDto } from './models/CreateCollectionTestSessionDto';
16
+ export type { CreateNotificationBroadcastJobDto } from './models/CreateNotificationBroadcastJobDto';
15
17
  export type { CreateReportDto } from './models/CreateReportDto';
16
18
  export type { CreateTermImportRequestDto } from './models/CreateTermImportRequestDto';
17
19
  export type { EnrichTermsDto } from './models/EnrichTermsDto';
@@ -21,6 +23,8 @@ export { GradeTypeDto } from './models/GradeTypeDto';
21
23
  export type { ImportRootAiJsonDto } from './models/ImportRootAiJsonDto';
22
24
  export type { LoginDto } from './models/LoginDto';
23
25
  export type { LoginResDto } from './models/LoginResDto';
26
+ export type { MarkNotificationsReadDto } from './models/MarkNotificationsReadDto';
27
+ export { NotificationBroadcastJobStatusDto } from './models/NotificationBroadcastJobStatusDto';
24
28
  export { ProgressStageDto } from './models/ProgressStageDto';
25
29
  export type { Record_string_unknown_ } from './models/Record_string_unknown_';
26
30
  export type { RefreshTokenDto } from './models/RefreshTokenDto';
@@ -68,6 +72,7 @@ export { CollectionsService } from './services/CollectionsService';
68
72
  export { CollectionTemplatesService } from './services/CollectionTemplatesService';
69
73
  export { CollectionTestService } from './services/CollectionTestService';
70
74
  export { DefaultService } from './services/DefaultService';
75
+ export { NotificationsService } from './services/NotificationsService';
71
76
  export { ReportsService } from './services/ReportsService';
72
77
  export { StatsService } from './services/StatsService';
73
78
  export { StudyService } from './services/StudyService';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserService = exports.TermsService = exports.TelegramService = exports.TasksService = exports.TaskRequestsService = exports.StudyService = exports.StatsService = exports.ReportsService = exports.DefaultService = exports.CollectionTestService = exports.CollectionTemplatesService = exports.CollectionsService = exports.ClientService = exports.AuthService = exports.AiService = exports.TaskRequestTypeDto = exports.TaskRequestStatusDto = exports.TaskQueueTypeDto = exports.TaskQueueStatusDto = exports.StudySourceDto = exports.StudyNextActionDto = exports.StudyModeDto = exports.StudyActionDto = exports.RequestTermsImportDto = exports.ReportStatusDto = exports.ProgressStageDto = exports.GradeTypeDto = exports.GenerateImportPromptDto = exports.CollectionTestSessionStatusDto = exports.CollectionTestPartDto = exports.AiProviderDto = exports.OpenAPI = exports.CancelError = exports.CancelablePromise = exports.BaseHttpRequest = exports.ApiError = exports.AppClient = void 0;
3
+ exports.UserService = exports.TermsService = exports.TelegramService = exports.TasksService = exports.TaskRequestsService = exports.StudyService = exports.StatsService = exports.ReportsService = exports.NotificationsService = exports.DefaultService = exports.CollectionTestService = exports.CollectionTemplatesService = exports.CollectionsService = exports.ClientService = exports.AuthService = exports.AiService = exports.TaskRequestTypeDto = exports.TaskRequestStatusDto = exports.TaskQueueTypeDto = exports.TaskQueueStatusDto = exports.StudySourceDto = exports.StudyNextActionDto = exports.StudyModeDto = exports.StudyActionDto = exports.RequestTermsImportDto = exports.ReportStatusDto = exports.ProgressStageDto = exports.NotificationBroadcastJobStatusDto = exports.GradeTypeDto = exports.GenerateImportPromptDto = exports.CollectionTestSessionStatusDto = exports.CollectionTestPartDto = exports.AiProviderDto = exports.OpenAPI = exports.CancelError = exports.CancelablePromise = exports.BaseHttpRequest = exports.ApiError = exports.AppClient = void 0;
4
4
  /* generated using openapi-typescript-codegen -- do not edit */
5
5
  /* istanbul ignore file */
6
6
  /* tslint:disable */
@@ -26,6 +26,8 @@ var GenerateImportPromptDto_1 = require("./models/GenerateImportPromptDto");
26
26
  Object.defineProperty(exports, "GenerateImportPromptDto", { enumerable: true, get: function () { return GenerateImportPromptDto_1.GenerateImportPromptDto; } });
27
27
  var GradeTypeDto_1 = require("./models/GradeTypeDto");
28
28
  Object.defineProperty(exports, "GradeTypeDto", { enumerable: true, get: function () { return GradeTypeDto_1.GradeTypeDto; } });
29
+ var NotificationBroadcastJobStatusDto_1 = require("./models/NotificationBroadcastJobStatusDto");
30
+ Object.defineProperty(exports, "NotificationBroadcastJobStatusDto", { enumerable: true, get: function () { return NotificationBroadcastJobStatusDto_1.NotificationBroadcastJobStatusDto; } });
29
31
  var ProgressStageDto_1 = require("./models/ProgressStageDto");
30
32
  Object.defineProperty(exports, "ProgressStageDto", { enumerable: true, get: function () { return ProgressStageDto_1.ProgressStageDto; } });
31
33
  var ReportStatusDto_1 = require("./models/ReportStatusDto");
@@ -62,6 +64,8 @@ var CollectionTestService_1 = require("./services/CollectionTestService");
62
64
  Object.defineProperty(exports, "CollectionTestService", { enumerable: true, get: function () { return CollectionTestService_1.CollectionTestService; } });
63
65
  var DefaultService_1 = require("./services/DefaultService");
64
66
  Object.defineProperty(exports, "DefaultService", { enumerable: true, get: function () { return DefaultService_1.DefaultService; } });
67
+ var NotificationsService_1 = require("./services/NotificationsService");
68
+ Object.defineProperty(exports, "NotificationsService", { enumerable: true, get: function () { return NotificationsService_1.NotificationsService; } });
65
69
  var ReportsService_1 = require("./services/ReportsService");
66
70
  Object.defineProperty(exports, "ReportsService", { enumerable: true, get: function () { return ReportsService_1.ReportsService; } });
67
71
  var StatsService_1 = require("./services/StatsService");
@@ -0,0 +1,6 @@
1
+ export type CreateAdminNotificationDto = {
2
+ userId: string;
3
+ title: string;
4
+ message: string;
5
+ metadata?: any;
6
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export type CreateNotificationBroadcastJobDto = {
2
+ title: string;
3
+ message: string;
4
+ metadata?: any;
5
+ country?: string;
6
+ onlyActive?: boolean;
7
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export type MarkNotificationsReadDto = {
2
+ notificationIds?: Array<string>;
3
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export declare enum NotificationBroadcastJobStatusDto {
2
+ PENDING = "PENDING",
3
+ PROCESSING = "PROCESSING",
4
+ DONE = "DONE",
5
+ FAILED = "FAILED",
6
+ CANCELLED = "CANCELLED"
7
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationBroadcastJobStatusDto = void 0;
4
+ /* generated using openapi-typescript-codegen -- do not edit */
5
+ /* istanbul ignore file */
6
+ /* tslint:disable */
7
+ /* eslint-disable */
8
+ var NotificationBroadcastJobStatusDto;
9
+ (function (NotificationBroadcastJobStatusDto) {
10
+ NotificationBroadcastJobStatusDto["PENDING"] = "PENDING";
11
+ NotificationBroadcastJobStatusDto["PROCESSING"] = "PROCESSING";
12
+ NotificationBroadcastJobStatusDto["DONE"] = "DONE";
13
+ NotificationBroadcastJobStatusDto["FAILED"] = "FAILED";
14
+ NotificationBroadcastJobStatusDto["CANCELLED"] = "CANCELLED";
15
+ })(NotificationBroadcastJobStatusDto || (exports.NotificationBroadcastJobStatusDto = NotificationBroadcastJobStatusDto = {}));
@@ -0,0 +1,63 @@
1
+ import type { CreateAdminNotificationDto } from '../models/CreateAdminNotificationDto';
2
+ import type { CreateNotificationBroadcastJobDto } from '../models/CreateNotificationBroadcastJobDto';
3
+ import type { MarkNotificationsReadDto } from '../models/MarkNotificationsReadDto';
4
+ import type { NotificationBroadcastJobStatusDto } from '../models/NotificationBroadcastJobStatusDto';
5
+ import type { CancelablePromise } from '../core/CancelablePromise';
6
+ import type { BaseHttpRequest } from '../core/BaseHttpRequest';
7
+ export declare class NotificationsService {
8
+ readonly httpRequest: BaseHttpRequest;
9
+ constructor(httpRequest: BaseHttpRequest);
10
+ /**
11
+ * @returns any Ok
12
+ * @throws ApiError
13
+ */
14
+ unreadCount(): CancelablePromise<any>;
15
+ /**
16
+ * @param page
17
+ * @param limit
18
+ * @param isRead
19
+ * @param cursorId
20
+ * @param take
21
+ * @returns any Ok
22
+ * @throws ApiError
23
+ */
24
+ list(page?: number, limit?: number, isRead?: boolean, cursorId?: string, take?: number): CancelablePromise<any>;
25
+ /**
26
+ * @param requestBody
27
+ * @returns any Ok
28
+ * @throws ApiError
29
+ */
30
+ read(requestBody: MarkNotificationsReadDto): CancelablePromise<any>;
31
+ /**
32
+ * @param requestBody
33
+ * @returns any Ok
34
+ * @throws ApiError
35
+ */
36
+ adminCreate(requestBody: CreateAdminNotificationDto): CancelablePromise<any>;
37
+ /**
38
+ * @param requestBody
39
+ * @returns any Ok
40
+ * @throws ApiError
41
+ */
42
+ adminCreateBroadcast(requestBody: CreateNotificationBroadcastJobDto): CancelablePromise<any>;
43
+ /**
44
+ * @param page
45
+ * @param limit
46
+ * @param status
47
+ * @returns any Ok
48
+ * @throws ApiError
49
+ */
50
+ adminListBroadcastJobs(page?: number, limit?: number, status?: NotificationBroadcastJobStatusDto): CancelablePromise<any>;
51
+ /**
52
+ * @param jobId
53
+ * @returns any Ok
54
+ * @throws ApiError
55
+ */
56
+ adminBroadcastJobDetail(jobId: string): CancelablePromise<any>;
57
+ /**
58
+ * @param jobId
59
+ * @returns any Ok
60
+ * @throws ApiError
61
+ */
62
+ adminCancelBroadcastJob(jobId: string): CancelablePromise<any>;
63
+ }
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationsService = void 0;
4
+ class NotificationsService {
5
+ constructor(httpRequest) {
6
+ this.httpRequest = httpRequest;
7
+ }
8
+ /**
9
+ * @returns any Ok
10
+ * @throws ApiError
11
+ */
12
+ unreadCount() {
13
+ return this.httpRequest.request({
14
+ method: 'GET',
15
+ url: '/notifications/unread-count',
16
+ });
17
+ }
18
+ /**
19
+ * @param page
20
+ * @param limit
21
+ * @param isRead
22
+ * @param cursorId
23
+ * @param take
24
+ * @returns any Ok
25
+ * @throws ApiError
26
+ */
27
+ list(page, limit, isRead, cursorId, take) {
28
+ return this.httpRequest.request({
29
+ method: 'GET',
30
+ url: '/notifications',
31
+ query: {
32
+ 'page': page,
33
+ 'limit': limit,
34
+ 'isRead': isRead,
35
+ 'cursorId': cursorId,
36
+ 'take': take,
37
+ },
38
+ });
39
+ }
40
+ /**
41
+ * @param requestBody
42
+ * @returns any Ok
43
+ * @throws ApiError
44
+ */
45
+ read(requestBody) {
46
+ return this.httpRequest.request({
47
+ method: 'POST',
48
+ url: '/notifications/read',
49
+ body: requestBody,
50
+ mediaType: 'application/json',
51
+ });
52
+ }
53
+ /**
54
+ * @param requestBody
55
+ * @returns any Ok
56
+ * @throws ApiError
57
+ */
58
+ adminCreate(requestBody) {
59
+ return this.httpRequest.request({
60
+ method: 'POST',
61
+ url: '/notifications/admin',
62
+ body: requestBody,
63
+ mediaType: 'application/json',
64
+ });
65
+ }
66
+ /**
67
+ * @param requestBody
68
+ * @returns any Ok
69
+ * @throws ApiError
70
+ */
71
+ adminCreateBroadcast(requestBody) {
72
+ return this.httpRequest.request({
73
+ method: 'POST',
74
+ url: '/notifications/admin/broadcast',
75
+ body: requestBody,
76
+ mediaType: 'application/json',
77
+ });
78
+ }
79
+ /**
80
+ * @param page
81
+ * @param limit
82
+ * @param status
83
+ * @returns any Ok
84
+ * @throws ApiError
85
+ */
86
+ adminListBroadcastJobs(page, limit, status) {
87
+ return this.httpRequest.request({
88
+ method: 'GET',
89
+ url: '/notifications/admin/broadcast-jobs',
90
+ query: {
91
+ 'page': page,
92
+ 'limit': limit,
93
+ 'status': status,
94
+ },
95
+ });
96
+ }
97
+ /**
98
+ * @param jobId
99
+ * @returns any Ok
100
+ * @throws ApiError
101
+ */
102
+ adminBroadcastJobDetail(jobId) {
103
+ return this.httpRequest.request({
104
+ method: 'GET',
105
+ url: '/notifications/admin/broadcast-jobs/{jobId}',
106
+ path: {
107
+ 'jobId': jobId,
108
+ },
109
+ });
110
+ }
111
+ /**
112
+ * @param jobId
113
+ * @returns any Ok
114
+ * @throws ApiError
115
+ */
116
+ adminCancelBroadcastJob(jobId) {
117
+ return this.httpRequest.request({
118
+ method: 'POST',
119
+ url: '/notifications/admin/broadcast-jobs/{jobId}/cancel',
120
+ path: {
121
+ 'jobId': jobId,
122
+ },
123
+ });
124
+ }
125
+ }
126
+ exports.NotificationsService = NotificationsService;
@@ -15,4 +15,14 @@ export declare class UserService {
15
15
  * @throws ApiError
16
16
  */
17
17
  updateMe(requestBody: UpdateUserProfileDto): CancelablePromise<any>;
18
+ /**
19
+ * @param page
20
+ * @param limit
21
+ * @param search
22
+ * @param cursorId
23
+ * @param take
24
+ * @returns any Ok
25
+ * @throws ApiError
26
+ */
27
+ adminList(page?: number, limit?: number, search?: string, cursorId?: string, take?: number): CancelablePromise<any>;
18
28
  }
@@ -28,5 +28,27 @@ class UserService {
28
28
  mediaType: 'application/json',
29
29
  });
30
30
  }
31
+ /**
32
+ * @param page
33
+ * @param limit
34
+ * @param search
35
+ * @param cursorId
36
+ * @param take
37
+ * @returns any Ok
38
+ * @throws ApiError
39
+ */
40
+ adminList(page, limit, search, cursorId, take) {
41
+ return this.httpRequest.request({
42
+ method: 'GET',
43
+ url: '/user/admin/list',
44
+ query: {
45
+ 'page': page,
46
+ 'limit': limit,
47
+ 'search': search,
48
+ 'cursorId': cursorId,
49
+ 'take': take,
50
+ },
51
+ });
52
+ }
31
53
  }
32
54
  exports.UserService = UserService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thomas-labs/scrape-service-lib",
3
- "version": "1.1.53",
3
+ "version": "1.1.55",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",