@purpleschool/gptbot 0.7.88 → 0.7.90

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.
@@ -52,3 +52,4 @@ export * from './daily-streak';
52
52
  export * from './cabinet';
53
53
  export * from './webmaster';
54
54
  export * from './music';
55
+ export * from './webmaster-click';
@@ -0,0 +1,7 @@
1
+ export const WEBMASTER_CLICK_CONTROLLER_PRIVATE = 'private/webmaster-click' as const;
2
+ export const WEBMASTER_CLICK_CONTROLLER_PUBLIC = 'public/webmaster-click' as const;
3
+
4
+ export const WEBMASTER_CLICK_ROUTES = {
5
+ CREATE: '',
6
+ GET_OVERVIEW: 'overview',
7
+ } as const;
@@ -68,3 +68,4 @@ __exportStar(require("./daily-streak"), exports);
68
68
  __exportStar(require("./cabinet"), exports);
69
69
  __exportStar(require("./webmaster"), exports);
70
70
  __exportStar(require("./music"), exports);
71
+ __exportStar(require("./webmaster-click"), exports);
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WEBMASTER_CLICK_ROUTES = exports.WEBMASTER_CLICK_CONTROLLER_PUBLIC = exports.WEBMASTER_CLICK_CONTROLLER_PRIVATE = void 0;
4
+ exports.WEBMASTER_CLICK_CONTROLLER_PRIVATE = 'private/webmaster-click';
5
+ exports.WEBMASTER_CLICK_CONTROLLER_PUBLIC = 'public/webmaster-click';
6
+ exports.WEBMASTER_CLICK_ROUTES = {
7
+ CREATE: '',
8
+ GET_OVERVIEW: 'overview',
9
+ };
@@ -54,3 +54,4 @@ __exportStar(require("./user-to-product"), exports);
54
54
  __exportStar(require("./daily-streak"), exports);
55
55
  __exportStar(require("./cabinet"), exports);
56
56
  __exportStar(require("./webmaster"), exports);
57
+ __exportStar(require("./webmaster-click"), exports);
@@ -22,7 +22,7 @@ var PayCommand;
22
22
  OperationType: zod_1.z.string(),
23
23
  InvoiceId: zod_1.z.string().optional(),
24
24
  AccountId: zod_1.z.string(),
25
- Token: zod_1.z.string(),
25
+ Token: zod_1.z.string().nullable().optional().default(null),
26
26
  })
27
27
  .transform((data) => ({
28
28
  transactionId: data.TransactionId,
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateWebmasterClickCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var CreateWebmasterClickCommand;
7
+ (function (CreateWebmasterClickCommand) {
8
+ CreateWebmasterClickCommand.RequestSchema = zod_1.z.object({
9
+ webmasterAlias: zod_1.z.string(),
10
+ });
11
+ CreateWebmasterClickCommand.ResponseSchema = zod_1.z.object({
12
+ data: models_1.WebmasterClickSchema,
13
+ });
14
+ })(CreateWebmasterClickCommand || (exports.CreateWebmasterClickCommand = CreateWebmasterClickCommand = {}));
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetWebmasterClicksOverviewCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ var GetWebmasterClicksOverviewCommand;
7
+ (function (GetWebmasterClicksOverviewCommand) {
8
+ GetWebmasterClicksOverviewCommand.RequestSchema = zod_1.z.object({
9
+ startDate: zod_1.z.string().refine((v) => !isNaN(Date.parse(v)), {
10
+ message: 'from must be a valid date string',
11
+ }),
12
+ endDate: zod_1.z.string().refine((v) => !isNaN(Date.parse(v)), {
13
+ message: 'to must be a valid date string',
14
+ }),
15
+ groupBy: zod_1.z.nativeEnum(constants_1.GROUP_BY).default(constants_1.GROUP_BY.DAY),
16
+ });
17
+ GetWebmasterClicksOverviewCommand.WebmasterClickOverviewResponseSchema = zod_1.z.object({
18
+ alias: zod_1.z.string(),
19
+ stats: zod_1.z.array(zod_1.z.object({
20
+ startDate: zod_1.z.string(),
21
+ endDate: zod_1.z.string(),
22
+ clicks: zod_1.z.number(),
23
+ })),
24
+ });
25
+ GetWebmasterClicksOverviewCommand.ResponseSchema = zod_1.z.object({
26
+ data: zod_1.z.array(GetWebmasterClicksOverviewCommand.WebmasterClickOverviewResponseSchema),
27
+ });
28
+ })(GetWebmasterClicksOverviewCommand || (exports.GetWebmasterClicksOverviewCommand = GetWebmasterClicksOverviewCommand = {}));
@@ -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("./create-webmaster-click.command"), exports);
18
+ __exportStar(require("./get-webmaster-clicks-overview.command"), exports);
@@ -2123,7 +2123,7 @@ exports.ERRORS = {
2123
2123
  },
2124
2124
  WEBMASTER_OWNERSHIP_ERROR: {
2125
2125
  code: 'A435',
2126
- message: 'Кабинет вебмастер не принадлежит юзеру, сделавшему запрос',
2126
+ message: 'Кабинет вебмастера не принадлежит юзеру, сделавшему запрос',
2127
2127
  httpCode: 401,
2128
2128
  },
2129
2129
  WEBMASTER_BALANCE_CREATE_ERROR: {
@@ -2321,4 +2321,29 @@ exports.ERRORS = {
2321
2321
  message: 'Нельзя улучшить подписку, которая ожидает понижения',
2322
2322
  httpCode: 400,
2323
2323
  },
2324
+ WEBMASTER_CLICK_CREATE_ERROR: {
2325
+ code: 'A475',
2326
+ message: 'Ошибка при создании записи о переходе по ссылке вебмастера',
2327
+ httpCode: 500,
2328
+ },
2329
+ WEBMASTER_CLICK_GET_ERROR: {
2330
+ code: 'A476',
2331
+ message: 'Ошибка при получении записи о переходе по ссылке вебмастера',
2332
+ httpCode: 500,
2333
+ },
2334
+ WEBMASTER_CLICKS_GET_ERROR: {
2335
+ code: 'A477',
2336
+ message: 'Ошибка при получении записей о переходе по ссылке вебмастера',
2337
+ httpCode: 500,
2338
+ },
2339
+ WEBMASTER_CLICK_CONFLICT_ERROR: {
2340
+ code: 'A478',
2341
+ message: 'Запись о переходе этого юзера по ссылке вебмастера уже существует',
2342
+ httpCode: 409,
2343
+ },
2344
+ WEBMASTER_CLICK_GET_OVERVIEW_ERROR: {
2345
+ code: 'A479',
2346
+ message: 'Ошибка при получении сводки записей о переходе по ссылке вебмастера',
2347
+ httpCode: 409,
2348
+ },
2324
2349
  };
@@ -4,4 +4,5 @@ exports.VIDEO_EDITOR_MODEL_LIMITATION = void 0;
4
4
  var VIDEO_EDITOR_MODEL_LIMITATION;
5
5
  (function (VIDEO_EDITOR_MODEL_LIMITATION) {
6
6
  VIDEO_EDITOR_MODEL_LIMITATION["OUTPUT_VIDEO_LENGTH_CAPPED_TO_5_SECONDS"] = "OUTPUT_VIDEO_LENGTH_CAPPED_TO_5_SECONDS";
7
+ VIDEO_EDITOR_MODEL_LIMITATION["DOES_NOT_AFFECT_AUDIO"] = "DOES_NOT_AFFECT_AUDIO";
7
8
  })(VIDEO_EDITOR_MODEL_LIMITATION || (exports.VIDEO_EDITOR_MODEL_LIMITATION = VIDEO_EDITOR_MODEL_LIMITATION = {}));
@@ -69,3 +69,4 @@ __exportStar(require("./daily-streak"), exports);
69
69
  __exportStar(require("./webmaster.schema"), exports);
70
70
  __exportStar(require("./webmaster-balance.schema"), exports);
71
71
  __exportStar(require("./user-referrals.schema"), exports);
72
+ __exportStar(require("./webmaster-click.schema"), exports);
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.WebmasterClickSchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ exports.WebmasterClickSchema = zod_1.default.object({
9
+ uuid: zod_1.default.string().uuid(),
10
+ aliasUsed: zod_1.default.string(),
11
+ webmasterId: zod_1.default.string().uuid(),
12
+ unregisteredUserId: zod_1.default.string().uuid().nullable(),
13
+ createdAt: zod_1.default.date(),
14
+ updatedAt: zod_1.default.date(),
15
+ });
package/commands/index.ts CHANGED
@@ -38,3 +38,4 @@ export * from './user-to-product';
38
38
  export * from './daily-streak';
39
39
  export * from './cabinet';
40
40
  export * from './webmaster';
41
+ export * from './webmaster-click';
@@ -19,7 +19,7 @@ export namespace PayCommand {
19
19
  OperationType: z.string(),
20
20
  InvoiceId: z.string().optional(),
21
21
  AccountId: z.string(),
22
- Token: z.string(),
22
+ Token: z.string().nullable().optional().default(null),
23
23
  })
24
24
  .transform((data) => ({
25
25
  transactionId: data.TransactionId,
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { WebmasterClickSchema } from '../../models';
3
+
4
+ export namespace CreateWebmasterClickCommand {
5
+ export const RequestSchema = z.object({
6
+ webmasterAlias: z.string(),
7
+ });
8
+
9
+ export type Request = z.infer<typeof RequestSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: WebmasterClickSchema,
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ import { GROUP_BY } from '../../constants';
3
+
4
+ export namespace GetWebmasterClicksOverviewCommand {
5
+ export const RequestSchema = z.object({
6
+ startDate: z.string().refine((v) => !isNaN(Date.parse(v)), {
7
+ message: 'from must be a valid date string',
8
+ }),
9
+ endDate: z.string().refine((v) => !isNaN(Date.parse(v)), {
10
+ message: 'to must be a valid date string',
11
+ }),
12
+ groupBy: z.nativeEnum(GROUP_BY).default(GROUP_BY.DAY),
13
+ });
14
+
15
+ export type Request = z.infer<typeof RequestSchema>;
16
+
17
+ export const WebmasterClickOverviewResponseSchema = z.object({
18
+ alias: z.string(),
19
+ stats: z.array(
20
+ z.object({
21
+ startDate: z.string(),
22
+ endDate: z.string(),
23
+ clicks: z.number(),
24
+ }),
25
+ ),
26
+ });
27
+
28
+ export const ResponseSchema = z.object({
29
+ data: z.array(WebmasterClickOverviewResponseSchema),
30
+ });
31
+
32
+ export type Response = z.infer<typeof ResponseSchema>;
33
+ }
@@ -0,0 +1,2 @@
1
+ export * from './create-webmaster-click.command';
2
+ export * from './get-webmaster-clicks-overview.command';
@@ -2131,7 +2131,7 @@ export const ERRORS = {
2131
2131
  },
2132
2132
  WEBMASTER_OWNERSHIP_ERROR: {
2133
2133
  code: 'A435',
2134
- message: 'Кабинет вебмастер не принадлежит юзеру, сделавшему запрос',
2134
+ message: 'Кабинет вебмастера не принадлежит юзеру, сделавшему запрос',
2135
2135
  httpCode: 401,
2136
2136
  },
2137
2137
  WEBMASTER_BALANCE_CREATE_ERROR: {
@@ -2329,4 +2329,29 @@ export const ERRORS = {
2329
2329
  message: 'Нельзя улучшить подписку, которая ожидает понижения',
2330
2330
  httpCode: 400,
2331
2331
  },
2332
+ WEBMASTER_CLICK_CREATE_ERROR: {
2333
+ code: 'A475',
2334
+ message: 'Ошибка при создании записи о переходе по ссылке вебмастера',
2335
+ httpCode: 500,
2336
+ },
2337
+ WEBMASTER_CLICK_GET_ERROR: {
2338
+ code: 'A476',
2339
+ message: 'Ошибка при получении записи о переходе по ссылке вебмастера',
2340
+ httpCode: 500,
2341
+ },
2342
+ WEBMASTER_CLICKS_GET_ERROR: {
2343
+ code: 'A477',
2344
+ message: 'Ошибка при получении записей о переходе по ссылке вебмастера',
2345
+ httpCode: 500,
2346
+ },
2347
+ WEBMASTER_CLICK_CONFLICT_ERROR: {
2348
+ code: 'A478',
2349
+ message: 'Запись о переходе этого юзера по ссылке вебмастера уже существует',
2350
+ httpCode: 409,
2351
+ },
2352
+ WEBMASTER_CLICK_GET_OVERVIEW_ERROR: {
2353
+ code: 'A479',
2354
+ message: 'Ошибка при получении сводки записей о переходе по ссылке вебмастера',
2355
+ httpCode: 409,
2356
+ },
2332
2357
  };
@@ -1,3 +1,4 @@
1
1
  export enum VIDEO_EDITOR_MODEL_LIMITATION {
2
2
  OUTPUT_VIDEO_LENGTH_CAPPED_TO_5_SECONDS = 'OUTPUT_VIDEO_LENGTH_CAPPED_TO_5_SECONDS',
3
+ DOES_NOT_AFFECT_AUDIO = 'DOES_NOT_AFFECT_AUDIO',
3
4
  }
package/models/index.ts CHANGED
@@ -53,3 +53,4 @@ export * from './daily-streak';
53
53
  export * from './webmaster.schema';
54
54
  export * from './webmaster-balance.schema';
55
55
  export * from './user-referrals.schema';
56
+ export * from './webmaster-click.schema';
@@ -0,0 +1,11 @@
1
+ import z from 'zod';
2
+
3
+ export const WebmasterClickSchema = z.object({
4
+ uuid: z.string().uuid(),
5
+ aliasUsed: z.string(),
6
+ webmasterId: z.string().uuid(),
7
+ unregisteredUserId: z.string().uuid().nullable(),
8
+
9
+ createdAt: z.date(),
10
+ updatedAt: z.date(),
11
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.7.88",
3
+ "version": "0.7.90",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",