@thomas-labs/scrape-service-lib 1.1.17 → 1.1.19

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.
@@ -5,6 +5,7 @@ import { AuthService } from './services/AuthService';
5
5
  import { ClientService } from './services/ClientService';
6
6
  import { CollectionsService } from './services/CollectionsService';
7
7
  import { DefaultService } from './services/DefaultService';
8
+ import { ReportsService } from './services/ReportsService';
8
9
  import { StatsService } from './services/StatsService';
9
10
  import { StudyService } from './services/StudyService';
10
11
  import { TaskRequestsService } from './services/TaskRequestsService';
@@ -19,6 +20,7 @@ export declare class AppClient {
19
20
  readonly client: ClientService;
20
21
  readonly collections: CollectionsService;
21
22
  readonly default: DefaultService;
23
+ readonly reports: ReportsService;
22
24
  readonly stats: StatsService;
23
25
  readonly study: StudyService;
24
26
  readonly taskRequests: TaskRequestsService;
package/dist/AppClient.js CHANGED
@@ -7,6 +7,7 @@ const AuthService_1 = require("./services/AuthService");
7
7
  const ClientService_1 = require("./services/ClientService");
8
8
  const CollectionsService_1 = require("./services/CollectionsService");
9
9
  const DefaultService_1 = require("./services/DefaultService");
10
+ const ReportsService_1 = require("./services/ReportsService");
10
11
  const StatsService_1 = require("./services/StatsService");
11
12
  const StudyService_1 = require("./services/StudyService");
12
13
  const TaskRequestsService_1 = require("./services/TaskRequestsService");
@@ -18,7 +19,7 @@ class AppClient {
18
19
  constructor(config, HttpRequest = FetchHttpRequest_1.FetchHttpRequest) {
19
20
  this.request = new HttpRequest({
20
21
  BASE: config?.BASE ?? '/api',
21
- VERSION: config?.VERSION ?? '1.0.18',
22
+ VERSION: config?.VERSION ?? '1.0.20',
22
23
  WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
23
24
  CREDENTIALS: config?.CREDENTIALS ?? 'include',
24
25
  TOKEN: config?.TOKEN,
@@ -32,6 +33,7 @@ class AppClient {
32
33
  this.client = new ClientService_1.ClientService(this.request);
33
34
  this.collections = new CollectionsService_1.CollectionsService(this.request);
34
35
  this.default = new DefaultService_1.DefaultService(this.request);
36
+ this.reports = new ReportsService_1.ReportsService(this.request);
35
37
  this.stats = new StatsService_1.StatsService(this.request);
36
38
  this.study = new StudyService_1.StudyService(this.request);
37
39
  this.taskRequests = new TaskRequestsService_1.TaskRequestsService(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.18',
6
+ VERSION: '1.0.20',
7
7
  WITH_CREDENTIALS: false,
8
8
  CREDENTIALS: 'include',
9
9
  TOKEN: undefined,
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export type { ActivateDto } from './models/ActivateDto';
8
8
  export { AiProviderDto } from './models/AiProviderDto';
9
9
  export type { CreateCollectionDto } from './models/CreateCollectionDto';
10
10
  export type { CreateCollectionJsonDto } from './models/CreateCollectionJsonDto';
11
+ export type { CreateReportDto } from './models/CreateReportDto';
11
12
  export type { CreateTermImportRequestDto } from './models/CreateTermImportRequestDto';
12
13
  export type { EnrichTermsDto } from './models/EnrichTermsDto';
13
14
  export type { FirebaseLoginDto } from './models/FirebaseLoginDto';
@@ -18,6 +19,8 @@ export { ProgressStageDto } from './models/ProgressStageDto';
18
19
  export type { Record_string_unknown_ } from './models/Record_string_unknown_';
19
20
  export type { RefreshTokenDto } from './models/RefreshTokenDto';
20
21
  export type { RegisterDto } from './models/RegisterDto';
22
+ export type { ReplyReportDto } from './models/ReplyReportDto';
23
+ export { ReportStatusDto } from './models/ReportStatusDto';
21
24
  export { RequestTermsImportDto } from './models/RequestTermsImportDto';
22
25
  export type { StartCollectionDto } from './models/StartCollectionDto';
23
26
  export type { StopCollectionDto } from './models/StopCollectionDto';
@@ -48,8 +51,10 @@ export type { TelegramUpdate } from './models/TelegramUpdate';
48
51
  export type { TelegramUser } from './models/TelegramUser';
49
52
  export type { UpdateAiKeyDto } from './models/UpdateAiKeyDto';
50
53
  export type { UpdateCollectionDto } from './models/UpdateCollectionDto';
54
+ export type { UpdateReportStatusDto } from './models/UpdateReportStatusDto';
51
55
  export type { UpdateTaskRequestStatusDto } from './models/UpdateTaskRequestStatusDto';
52
56
  export type { UpdateTelegramBotConfigDto } from './models/UpdateTelegramBotConfigDto';
57
+ export type { UpdateUserProfileDto } from './models/UpdateUserProfileDto';
53
58
  export type { UpsertAiKeyDto } from './models/UpsertAiKeyDto';
54
59
  export type { UpsertTelegramBotConfigDto } from './models/UpsertTelegramBotConfigDto';
55
60
  export { AiService } from './services/AiService';
@@ -57,6 +62,7 @@ export { AuthService } from './services/AuthService';
57
62
  export { ClientService } from './services/ClientService';
58
63
  export { CollectionsService } from './services/CollectionsService';
59
64
  export { DefaultService } from './services/DefaultService';
65
+ export { ReportsService } from './services/ReportsService';
60
66
  export { StatsService } from './services/StatsService';
61
67
  export { StudyService } from './services/StudyService';
62
68
  export { TaskRequestsService } from './services/TaskRequestsService';
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.DefaultService = exports.CollectionsService = exports.ClientService = exports.AuthService = exports.AiService = exports.TelegramChat = exports.TaskRequestTypeDto = exports.TaskRequestStatusDto = exports.TaskQueueTypeDto = exports.TaskQueueStatusDto = exports.StudySourceDto = exports.StudyNextActionDto = exports.StudyModeDto = exports.StudyActionDto = exports.RequestTermsImportDto = exports.ProgressStageDto = exports.GradeTypeDto = 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.DefaultService = exports.CollectionsService = exports.ClientService = exports.AuthService = exports.AiService = exports.TelegramChat = 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.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 */
@@ -22,6 +22,8 @@ var GradeTypeDto_1 = require("./models/GradeTypeDto");
22
22
  Object.defineProperty(exports, "GradeTypeDto", { enumerable: true, get: function () { return GradeTypeDto_1.GradeTypeDto; } });
23
23
  var ProgressStageDto_1 = require("./models/ProgressStageDto");
24
24
  Object.defineProperty(exports, "ProgressStageDto", { enumerable: true, get: function () { return ProgressStageDto_1.ProgressStageDto; } });
25
+ var ReportStatusDto_1 = require("./models/ReportStatusDto");
26
+ Object.defineProperty(exports, "ReportStatusDto", { enumerable: true, get: function () { return ReportStatusDto_1.ReportStatusDto; } });
25
27
  var RequestTermsImportDto_1 = require("./models/RequestTermsImportDto");
26
28
  Object.defineProperty(exports, "RequestTermsImportDto", { enumerable: true, get: function () { return RequestTermsImportDto_1.RequestTermsImportDto; } });
27
29
  var StudyActionDto_1 = require("./models/StudyActionDto");
@@ -52,6 +54,8 @@ var CollectionsService_1 = require("./services/CollectionsService");
52
54
  Object.defineProperty(exports, "CollectionsService", { enumerable: true, get: function () { return CollectionsService_1.CollectionsService; } });
53
55
  var DefaultService_1 = require("./services/DefaultService");
54
56
  Object.defineProperty(exports, "DefaultService", { enumerable: true, get: function () { return DefaultService_1.DefaultService; } });
57
+ var ReportsService_1 = require("./services/ReportsService");
58
+ Object.defineProperty(exports, "ReportsService", { enumerable: true, get: function () { return ReportsService_1.ReportsService; } });
55
59
  var StatsService_1 = require("./services/StatsService");
56
60
  Object.defineProperty(exports, "StatsService", { enumerable: true, get: function () { return StatsService_1.StatsService; } });
57
61
  var StudyService_1 = require("./services/StudyService");
@@ -0,0 +1,5 @@
1
+ export type CreateReportDto = {
2
+ title: string;
3
+ message: string;
4
+ category?: string;
5
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export type ReplyReportDto = {
2
+ message: string;
3
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export declare enum ReportStatusDto {
2
+ OPEN = "OPEN",
3
+ IN_PROGRESS = "IN_PROGRESS",
4
+ WAITING_USER = "WAITING_USER",
5
+ WAITING_ADMIN = "WAITING_ADMIN",
6
+ RESOLVED = "RESOLVED",
7
+ CLOSED = "CLOSED"
8
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportStatusDto = void 0;
4
+ /* generated using openapi-typescript-codegen -- do not edit */
5
+ /* istanbul ignore file */
6
+ /* tslint:disable */
7
+ /* eslint-disable */
8
+ var ReportStatusDto;
9
+ (function (ReportStatusDto) {
10
+ ReportStatusDto["OPEN"] = "OPEN";
11
+ ReportStatusDto["IN_PROGRESS"] = "IN_PROGRESS";
12
+ ReportStatusDto["WAITING_USER"] = "WAITING_USER";
13
+ ReportStatusDto["WAITING_ADMIN"] = "WAITING_ADMIN";
14
+ ReportStatusDto["RESOLVED"] = "RESOLVED";
15
+ ReportStatusDto["CLOSED"] = "CLOSED";
16
+ })(ReportStatusDto || (exports.ReportStatusDto = ReportStatusDto = {}));
@@ -0,0 +1,5 @@
1
+ import type { ReportStatusDto } from './ReportStatusDto';
2
+ export type UpdateReportStatusDto = {
3
+ status: ReportStatusDto;
4
+ note?: string;
5
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export type UpdateUserProfileDto = {
2
+ name?: string;
3
+ phone?: string;
4
+ country?: string;
5
+ avatar?: string;
6
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,52 @@
1
+ import type { CreateReportDto } from '../models/CreateReportDto';
2
+ import type { ReplyReportDto } from '../models/ReplyReportDto';
3
+ import type { ReportStatusDto } from '../models/ReportStatusDto';
4
+ import type { UpdateReportStatusDto } from '../models/UpdateReportStatusDto';
5
+ import type { CancelablePromise } from '../core/CancelablePromise';
6
+ import type { BaseHttpRequest } from '../core/BaseHttpRequest';
7
+ export declare class ReportsService {
8
+ readonly httpRequest: BaseHttpRequest;
9
+ constructor(httpRequest: BaseHttpRequest);
10
+ /**
11
+ * @param requestBody
12
+ * @returns any Ok
13
+ * @throws ApiError
14
+ */
15
+ create(requestBody: CreateReportDto): CancelablePromise<any>;
16
+ /**
17
+ * @param page
18
+ * @param limit
19
+ * @param status
20
+ * @returns any Ok
21
+ * @throws ApiError
22
+ */
23
+ mine(page?: number, limit?: number, status?: ReportStatusDto): CancelablePromise<any>;
24
+ /**
25
+ * @param page
26
+ * @param limit
27
+ * @param status
28
+ * @returns any Ok
29
+ * @throws ApiError
30
+ */
31
+ admin(page?: number, limit?: number, status?: ReportStatusDto): CancelablePromise<any>;
32
+ /**
33
+ * @param reportId
34
+ * @returns any Ok
35
+ * @throws ApiError
36
+ */
37
+ detail(reportId: string): CancelablePromise<any>;
38
+ /**
39
+ * @param reportId
40
+ * @param requestBody
41
+ * @returns any Ok
42
+ * @throws ApiError
43
+ */
44
+ reply(reportId: string, requestBody: ReplyReportDto): CancelablePromise<any>;
45
+ /**
46
+ * @param reportId
47
+ * @param requestBody
48
+ * @returns any Ok
49
+ * @throws ApiError
50
+ */
51
+ status(reportId: string, requestBody: UpdateReportStatusDto): CancelablePromise<any>;
52
+ }
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportsService = void 0;
4
+ class ReportsService {
5
+ constructor(httpRequest) {
6
+ this.httpRequest = httpRequest;
7
+ }
8
+ /**
9
+ * @param requestBody
10
+ * @returns any Ok
11
+ * @throws ApiError
12
+ */
13
+ create(requestBody) {
14
+ return this.httpRequest.request({
15
+ method: 'POST',
16
+ url: '/reports',
17
+ body: requestBody,
18
+ mediaType: 'application/json',
19
+ });
20
+ }
21
+ /**
22
+ * @param page
23
+ * @param limit
24
+ * @param status
25
+ * @returns any Ok
26
+ * @throws ApiError
27
+ */
28
+ mine(page, limit, status) {
29
+ return this.httpRequest.request({
30
+ method: 'GET',
31
+ url: '/reports/mine',
32
+ query: {
33
+ 'page': page,
34
+ 'limit': limit,
35
+ 'status': status,
36
+ },
37
+ });
38
+ }
39
+ /**
40
+ * @param page
41
+ * @param limit
42
+ * @param status
43
+ * @returns any Ok
44
+ * @throws ApiError
45
+ */
46
+ admin(page, limit, status) {
47
+ return this.httpRequest.request({
48
+ method: 'GET',
49
+ url: '/reports/admin',
50
+ query: {
51
+ 'page': page,
52
+ 'limit': limit,
53
+ 'status': status,
54
+ },
55
+ });
56
+ }
57
+ /**
58
+ * @param reportId
59
+ * @returns any Ok
60
+ * @throws ApiError
61
+ */
62
+ detail(reportId) {
63
+ return this.httpRequest.request({
64
+ method: 'GET',
65
+ url: '/reports/{reportId}',
66
+ path: {
67
+ 'reportId': reportId,
68
+ },
69
+ });
70
+ }
71
+ /**
72
+ * @param reportId
73
+ * @param requestBody
74
+ * @returns any Ok
75
+ * @throws ApiError
76
+ */
77
+ reply(reportId, requestBody) {
78
+ return this.httpRequest.request({
79
+ method: 'POST',
80
+ url: '/reports/{reportId}/reply',
81
+ path: {
82
+ 'reportId': reportId,
83
+ },
84
+ body: requestBody,
85
+ mediaType: 'application/json',
86
+ });
87
+ }
88
+ /**
89
+ * @param reportId
90
+ * @param requestBody
91
+ * @returns any Ok
92
+ * @throws ApiError
93
+ */
94
+ status(reportId, requestBody) {
95
+ return this.httpRequest.request({
96
+ method: 'PATCH',
97
+ url: '/reports/{reportId}/status',
98
+ path: {
99
+ 'reportId': reportId,
100
+ },
101
+ body: requestBody,
102
+ mediaType: 'application/json',
103
+ });
104
+ }
105
+ }
106
+ exports.ReportsService = ReportsService;
@@ -74,4 +74,27 @@ export declare class StatsService {
74
74
  * @throws ApiError
75
75
  */
76
76
  terms(year?: number, month?: number, date?: string): CancelablePromise<any>;
77
+ /**
78
+ * @param year
79
+ * @returns any Ok
80
+ * @throws ApiError
81
+ */
82
+ adminUserGrowth(year?: number): CancelablePromise<any>;
83
+ /**
84
+ * @returns any Ok
85
+ * @throws ApiError
86
+ */
87
+ adminActiveUsers(): CancelablePromise<any>;
88
+ /**
89
+ * @param days
90
+ * @returns any Ok
91
+ * @throws ApiError
92
+ */
93
+ adminActivationFunnel(days?: number): CancelablePromise<any>;
94
+ /**
95
+ * @param days
96
+ * @returns any Ok
97
+ * @throws ApiError
98
+ */
99
+ adminReportTicketsDaily(days?: number): CancelablePromise<any>;
77
100
  }
@@ -141,5 +141,57 @@ class StatsService {
141
141
  },
142
142
  });
143
143
  }
144
+ /**
145
+ * @param year
146
+ * @returns any Ok
147
+ * @throws ApiError
148
+ */
149
+ adminUserGrowth(year) {
150
+ return this.httpRequest.request({
151
+ method: 'GET',
152
+ url: '/stats/admin/user-growth',
153
+ query: {
154
+ 'year': year,
155
+ },
156
+ });
157
+ }
158
+ /**
159
+ * @returns any Ok
160
+ * @throws ApiError
161
+ */
162
+ adminActiveUsers() {
163
+ return this.httpRequest.request({
164
+ method: 'GET',
165
+ url: '/stats/admin/active-users',
166
+ });
167
+ }
168
+ /**
169
+ * @param days
170
+ * @returns any Ok
171
+ * @throws ApiError
172
+ */
173
+ adminActivationFunnel(days) {
174
+ return this.httpRequest.request({
175
+ method: 'GET',
176
+ url: '/stats/admin/activation-funnel',
177
+ query: {
178
+ 'days': days,
179
+ },
180
+ });
181
+ }
182
+ /**
183
+ * @param days
184
+ * @returns any Ok
185
+ * @throws ApiError
186
+ */
187
+ adminReportTicketsDaily(days) {
188
+ return this.httpRequest.request({
189
+ method: 'GET',
190
+ url: '/stats/admin/report-tickets-daily',
191
+ query: {
192
+ 'days': days,
193
+ },
194
+ });
195
+ }
144
196
  }
145
197
  exports.StatsService = StatsService;
@@ -1,3 +1,4 @@
1
+ import type { UpdateUserProfileDto } from '../models/UpdateUserProfileDto';
1
2
  import type { CancelablePromise } from '../core/CancelablePromise';
2
3
  import type { BaseHttpRequest } from '../core/BaseHttpRequest';
3
4
  export declare class UserService {
@@ -8,4 +9,10 @@ export declare class UserService {
8
9
  * @throws ApiError
9
10
  */
10
11
  getMe(): CancelablePromise<any>;
12
+ /**
13
+ * @param requestBody
14
+ * @returns any Ok
15
+ * @throws ApiError
16
+ */
17
+ updateMe(requestBody: UpdateUserProfileDto): CancelablePromise<any>;
11
18
  }
@@ -15,5 +15,18 @@ class UserService {
15
15
  url: '/user/profile',
16
16
  });
17
17
  }
18
+ /**
19
+ * @param requestBody
20
+ * @returns any Ok
21
+ * @throws ApiError
22
+ */
23
+ updateMe(requestBody) {
24
+ return this.httpRequest.request({
25
+ method: 'PATCH',
26
+ url: '/user/profile',
27
+ body: requestBody,
28
+ mediaType: 'application/json',
29
+ });
30
+ }
18
31
  }
19
32
  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.17",
3
+ "version": "1.1.19",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",