@purpleschool/gptbot 0.12.6 → 0.12.8

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.
Files changed (61) hide show
  1. package/api/controllers/http/auth.ts +1 -0
  2. package/api/controllers/http/index.ts +1 -0
  3. package/api/controllers/http/team-account.ts +1 -0
  4. package/api/controllers/http/tool-workspace.ts +9 -0
  5. package/api/routes.ts +2 -0
  6. package/build/api/controllers/http/auth.js +1 -0
  7. package/build/api/controllers/http/index.js +1 -0
  8. package/build/api/controllers/http/team-account.js +1 -0
  9. package/build/api/controllers/http/tool-workspace.js +11 -0
  10. package/build/api/routes.js +2 -0
  11. package/build/commands/auth/change-password.command.js +16 -0
  12. package/build/commands/auth/index.js +1 -0
  13. package/build/commands/team-account/get-invoice-for-payment.command.js +28 -0
  14. package/build/commands/team-account/index.js +1 -0
  15. package/build/commands/tools/index.js +1 -0
  16. package/build/commands/tools/marketplace-card/execute-marketplace-card.command.js +6 -0
  17. package/build/commands/tools/tool-workspace/delete-tool-workspace-by-uuid.command.js +11 -0
  18. package/build/commands/tools/tool-workspace/find-tool-workspace-by-uuid.command.js +14 -0
  19. package/build/commands/tools/tool-workspace/find-tool-workspaces.command.js +20 -0
  20. package/build/commands/tools/tool-workspace/index.js +20 -0
  21. package/build/commands/tools/tool-workspace/update-tool-workspace.command.js +20 -0
  22. package/build/commands/tools/video/video.command.js +7 -1
  23. package/build/constants/tool/enums/index.js +3 -0
  24. package/build/constants/tool/enums/tool-content-type.enum.js +5 -1
  25. package/build/constants/tool/enums/tool-type.enum.js +23 -0
  26. package/build/constants/tool/enums/tool-workspace-item-slot.enum.js +9 -0
  27. package/build/constants/tool/enums/tool-workspace-status.enum.js +8 -0
  28. package/build/models/index.js +1 -0
  29. package/build/models/invoice-for-payment.schema.js +24 -0
  30. package/build/models/tools/index.js +1 -0
  31. package/build/models/tools/tool-workspace/index.js +20 -0
  32. package/build/models/tools/tool-workspace/tool-workspace-contents.schema.js +10 -0
  33. package/build/models/tools/tool-workspace/tool-workspace-item.schema.js +16 -0
  34. package/build/models/tools/tool-workspace/tool-workspace-job.schema.js +17 -0
  35. package/build/models/tools/tool-workspace/tool-workspace.schema.js +16 -0
  36. package/commands/auth/change-password.command.ts +18 -0
  37. package/commands/auth/index.ts +1 -0
  38. package/commands/team-account/get-invoice-for-payment.command.ts +34 -0
  39. package/commands/team-account/index.ts +1 -0
  40. package/commands/tools/index.ts +1 -0
  41. package/commands/tools/marketplace-card/execute-marketplace-card.command.ts +6 -0
  42. package/commands/tools/tool-workspace/delete-tool-workspace-by-uuid.command.ts +11 -0
  43. package/commands/tools/tool-workspace/find-tool-workspace-by-uuid.command.ts +14 -0
  44. package/commands/tools/tool-workspace/find-tool-workspaces.command.ts +20 -0
  45. package/commands/tools/tool-workspace/index.ts +4 -0
  46. package/commands/tools/tool-workspace/update-tool-workspace.command.ts +22 -0
  47. package/commands/tools/video/video.command.ts +7 -1
  48. package/constants/tool/enums/index.ts +3 -0
  49. package/constants/tool/enums/tool-content-type.enum.ts +5 -1
  50. package/constants/tool/enums/tool-type.enum.ts +19 -0
  51. package/constants/tool/enums/tool-workspace-item-slot.enum.ts +5 -0
  52. package/constants/tool/enums/tool-workspace-status.enum.ts +4 -0
  53. package/models/index.ts +1 -0
  54. package/models/invoice-for-payment.schema.ts +23 -0
  55. package/models/tools/index.ts +1 -0
  56. package/models/tools/tool-workspace/index.ts +4 -0
  57. package/models/tools/tool-workspace/tool-workspace-contents.schema.ts +10 -0
  58. package/models/tools/tool-workspace/tool-workspace-item.schema.ts +16 -0
  59. package/models/tools/tool-workspace/tool-workspace-job.schema.ts +17 -0
  60. package/models/tools/tool-workspace/tool-workspace.schema.ts +16 -0
  61. package/package.json +1 -1
@@ -11,4 +11,5 @@ export const AUTH_ROUTES = {
11
11
  RESET_PASSWORD: 'reset-password',
12
12
  VERIFY_EMAIL: 'verify-email',
13
13
  VERIFY_EMAIL_RETRY: 'verify-email-retry',
14
+ CHANGE_PASSWORD: 'change-password',
14
15
  } as const;
@@ -61,3 +61,4 @@ export * from './interior-design';
61
61
  export * from './solving-edu-task';
62
62
  export * from './team-account';
63
63
  export * from './spell-corrector';
64
+ export * from './tool-workspace';
@@ -22,6 +22,7 @@ export const TEAM_ACCOUNT_ROUTES = {
22
22
  CREATE_MANUAL_PRODUCT: 'manual/product',
23
23
  CREATE_INVOICE_PAYMENT: 'invoice-payment',
24
24
  ADMIN_FIND_BY_NAME: 'admin/find',
25
+ ADMIN_GET_INVOICES: 'admin/invoices',
25
26
  ADMIN_GET_CURRENT_SUBSCRIPTIONS: (teamAccountId: string) =>
26
27
  `admin/subscriptions/current/${teamAccountId}`,
27
28
  ADMIN_GET_PAYMENT_HISTORY: (teamAccountId: string) => `admin/payments/history/${teamAccountId}`,
@@ -0,0 +1,9 @@
1
+ export const TOOL_WORKSPACE_CONTROLLER_PRIVATE = 'private/tools/workspaces' as const;
2
+ export const TOOL_WORKSPACE_CONTROLLER_PUBLIC = 'public/tools/workspaces' as const;
3
+
4
+ export const TOOL_WORKSPACE_ROUTES = {
5
+ GET_WORKSPACES: '',
6
+ GET_WORKSPACE: (uuid: string) => uuid,
7
+ UPDATE: (uuid: string) => uuid,
8
+ DELETE: (uuid: string) => uuid,
9
+ } as const;
package/api/routes.ts CHANGED
@@ -14,6 +14,7 @@ export const REST_API = {
14
14
  RESET_PASSWORD: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.RESET_PASSWORD}`,
15
15
  VERIFY_EMAIL: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.VERIFY_EMAIL}`,
16
16
  VERIFY_EMAIL_RETRY: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.VERIFY_EMAIL_RETRY}`,
17
+ CHANGE_PASSWORD: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.CHANGE_PASSWORD}`,
17
18
  },
18
19
  USERS: {
19
20
  GET: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET}`,
@@ -205,6 +206,7 @@ export const REST_API = {
205
206
  CREATE_MANUAL_PRODUCT: `${ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.CREATE_MANUAL_PRODUCT}`,
206
207
  CREATE_INVOICE_PAYMENT: `${ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.CREATE_INVOICE_PAYMENT}`,
207
208
  ADMIN_FIND_BY_NAME: `${ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.ADMIN_FIND_BY_NAME}`,
209
+ ADMIN_GET_INVOICES: `${ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.ADMIN_GET_INVOICES}`,
208
210
  ADMIN_GET_CURRENT_SUBSCRIPTIONS: (teamAccountId: string) =>
209
211
  `${ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.ADMIN_GET_CURRENT_SUBSCRIPTIONS(teamAccountId)}`,
210
212
  ADMIN_GET_PAYMENT_HISTORY: (teamAccountId: string) =>
@@ -13,4 +13,5 @@ exports.AUTH_ROUTES = {
13
13
  RESET_PASSWORD: 'reset-password',
14
14
  VERIFY_EMAIL: 'verify-email',
15
15
  VERIFY_EMAIL_RETRY: 'verify-email-retry',
16
+ CHANGE_PASSWORD: 'change-password',
16
17
  };
@@ -77,3 +77,4 @@ __exportStar(require("./interior-design"), exports);
77
77
  __exportStar(require("./solving-edu-task"), exports);
78
78
  __exportStar(require("./team-account"), exports);
79
79
  __exportStar(require("./spell-corrector"), exports);
80
+ __exportStar(require("./tool-workspace"), exports);
@@ -24,6 +24,7 @@ exports.TEAM_ACCOUNT_ROUTES = {
24
24
  CREATE_MANUAL_PRODUCT: 'manual/product',
25
25
  CREATE_INVOICE_PAYMENT: 'invoice-payment',
26
26
  ADMIN_FIND_BY_NAME: 'admin/find',
27
+ ADMIN_GET_INVOICES: 'admin/invoices',
27
28
  ADMIN_GET_CURRENT_SUBSCRIPTIONS: (teamAccountId) => `admin/subscriptions/current/${teamAccountId}`,
28
29
  ADMIN_GET_PAYMENT_HISTORY: (teamAccountId) => `admin/payments/history/${teamAccountId}`,
29
30
  };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TOOL_WORKSPACE_ROUTES = exports.TOOL_WORKSPACE_CONTROLLER_PUBLIC = exports.TOOL_WORKSPACE_CONTROLLER_PRIVATE = void 0;
4
+ exports.TOOL_WORKSPACE_CONTROLLER_PRIVATE = 'private/tools/workspaces';
5
+ exports.TOOL_WORKSPACE_CONTROLLER_PUBLIC = 'public/tools/workspaces';
6
+ exports.TOOL_WORKSPACE_ROUTES = {
7
+ GET_WORKSPACES: '',
8
+ GET_WORKSPACE: (uuid) => uuid,
9
+ UPDATE: (uuid) => uuid,
10
+ DELETE: (uuid) => uuid,
11
+ };
@@ -49,6 +49,7 @@ exports.REST_API = {
49
49
  RESET_PASSWORD: `${exports.ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.RESET_PASSWORD}`,
50
50
  VERIFY_EMAIL: `${exports.ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.VERIFY_EMAIL}`,
51
51
  VERIFY_EMAIL_RETRY: `${exports.ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.VERIFY_EMAIL_RETRY}`,
52
+ CHANGE_PASSWORD: `${exports.ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.CHANGE_PASSWORD}`,
52
53
  },
53
54
  USERS: {
54
55
  GET: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET}`,
@@ -204,6 +205,7 @@ exports.REST_API = {
204
205
  CREATE_MANUAL_PRODUCT: `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.CREATE_MANUAL_PRODUCT}`,
205
206
  CREATE_INVOICE_PAYMENT: `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.CREATE_INVOICE_PAYMENT}`,
206
207
  ADMIN_FIND_BY_NAME: `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.ADMIN_FIND_BY_NAME}`,
208
+ ADMIN_GET_INVOICES: `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.ADMIN_GET_INVOICES}`,
207
209
  ADMIN_GET_CURRENT_SUBSCRIPTIONS: (teamAccountId) => `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.ADMIN_GET_CURRENT_SUBSCRIPTIONS(teamAccountId)}`,
208
210
  ADMIN_GET_PAYMENT_HISTORY: (teamAccountId) => `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.ADMIN_GET_PAYMENT_HISTORY(teamAccountId)}`,
209
211
  },
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChangePasswordCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var ChangePasswordCommand;
6
+ (function (ChangePasswordCommand) {
7
+ ChangePasswordCommand.RequestSchema = zod_1.z.object({
8
+ currentPassword: zod_1.z.string(),
9
+ newPassword: zod_1.z.string(),
10
+ });
11
+ ChangePasswordCommand.ResponseSchema = zod_1.z.object({
12
+ data: zod_1.z.object({
13
+ accessToken: zod_1.z.string(),
14
+ }),
15
+ });
16
+ })(ChangePasswordCommand || (exports.ChangePasswordCommand = ChangePasswordCommand = {}));
@@ -23,3 +23,4 @@ __exportStar(require("./verify-email-retry.command"), exports);
23
23
  __exportStar(require("./verify-email.command"), exports);
24
24
  __exportStar(require("./vk-login.command"), exports);
25
25
  __exportStar(require("./yandex-login.command"), exports);
26
+ __exportStar(require("./change-password.command"), exports);
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetInvoiceForPaymentCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var GetInvoiceForPaymentCommand;
7
+ (function (GetInvoiceForPaymentCommand) {
8
+ GetInvoiceForPaymentCommand.RequestQuerySchema = zod_1.z
9
+ .object({
10
+ invoiceId: zod_1.z.string().uuid().optional(),
11
+ userId: zod_1.z.string().uuid().optional(),
12
+ teamAccountId: zod_1.z.string().uuid().optional(),
13
+ inn: zod_1.z.string().optional(),
14
+ invoiceNumber: zod_1.z.string().optional(),
15
+ })
16
+ .refine((value) => [
17
+ value.invoiceId,
18
+ value.userId,
19
+ value.teamAccountId,
20
+ value.inn,
21
+ value.invoiceNumber,
22
+ ].filter(Boolean).length === 1, {
23
+ message: 'Must provide exactly one filter',
24
+ });
25
+ GetInvoiceForPaymentCommand.ResponseSchema = zod_1.z.object({
26
+ data: zod_1.z.array(models_1.InvoiceForPaymentSchema),
27
+ });
28
+ })(GetInvoiceForPaymentCommand || (exports.GetInvoiceForPaymentCommand = GetInvoiceForPaymentCommand = {}));
@@ -38,4 +38,5 @@ __exportStar(require("./create-manual-team-subscription.command"), exports);
38
38
  __exportStar(require("./create-manual-team-product.command"), exports);
39
39
  __exportStar(require("./find-team-accounts-by-name.command"), exports);
40
40
  __exportStar(require("./create-team-account-invoice-payment.command"), exports);
41
+ __exportStar(require("./get-invoice-for-payment.command"), exports);
41
42
  __exportStar(require("./get-team-account-payment-history.command"), exports);
@@ -29,3 +29,4 @@ __exportStar(require("./marketplace-card"), exports);
29
29
  __exportStar(require("./interior-design"), exports);
30
30
  __exportStar(require("./solving-edu-task"), exports);
31
31
  __exportStar(require("./spell-corrector"), exports);
32
+ __exportStar(require("./tool-workspace"), exports);
@@ -2,11 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ExecuteMarketplaceCardCommand = void 0;
4
4
  const zod_1 = require("zod");
5
+ const constants_1 = require("../../../constants");
5
6
  const models_1 = require("../../../models");
6
7
  var ExecuteMarketplaceCardCommand;
7
8
  (function (ExecuteMarketplaceCardCommand) {
8
9
  ExecuteMarketplaceCardCommand.RequestSchema = zod_1.z
9
10
  .object({
11
+ workspaceId: zod_1.z.string().uuid().nullable().optional(),
12
+ workspaceItemId: zod_1.z.string().uuid().nullable().optional(),
13
+ workspaceToolType: zod_1.z.nativeEnum(constants_1.TOOL_CONTENT_TYPE).nullable().optional(),
14
+ workspaceSlot: zod_1.z.nativeEnum(constants_1.TOOL_WORKSPACE_ITEM_SLOT).optional(),
15
+ workspaceOrder: zod_1.z.number().int().min(0).optional(),
10
16
  title: zod_1.z.string(),
11
17
  subtitle: zod_1.z.string().nullable().optional(),
12
18
  advantages: zod_1.z.array(zod_1.z.string()),
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteToolWorkspaceByUUIDCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var DeleteToolWorkspaceByUUIDCommand;
6
+ (function (DeleteToolWorkspaceByUUIDCommand) {
7
+ DeleteToolWorkspaceByUUIDCommand.RequestParamsSchema = zod_1.z.object({
8
+ uuid: zod_1.z.string().uuid(),
9
+ });
10
+ DeleteToolWorkspaceByUUIDCommand.ResponseSchema = zod_1.z.void();
11
+ })(DeleteToolWorkspaceByUUIDCommand || (exports.DeleteToolWorkspaceByUUIDCommand = DeleteToolWorkspaceByUUIDCommand = {}));
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindToolWorkspaceByUUIDCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ var FindToolWorkspaceByUUIDCommand;
7
+ (function (FindToolWorkspaceByUUIDCommand) {
8
+ FindToolWorkspaceByUUIDCommand.RequestParamsSchema = zod_1.z.object({
9
+ uuid: zod_1.z.string().uuid(),
10
+ });
11
+ FindToolWorkspaceByUUIDCommand.ResponseSchema = zod_1.z.object({
12
+ data: models_1.ToolWorkspaceContentsSchema.nullable(),
13
+ });
14
+ })(FindToolWorkspaceByUUIDCommand || (exports.FindToolWorkspaceByUUIDCommand = FindToolWorkspaceByUUIDCommand = {}));
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindToolWorkspacesCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../../constants");
6
+ const models_1 = require("../../../models");
7
+ var FindToolWorkspacesCommand;
8
+ (function (FindToolWorkspacesCommand) {
9
+ FindToolWorkspacesCommand.RequestQuerySchema = zod_1.z.object({
10
+ toolType: zod_1.z.nativeEnum(constants_1.TOOL_CONTENT_TYPE).optional(),
11
+ title: zod_1.z.string().optional(),
12
+ limit: zod_1.z.coerce.number().min(1).optional(),
13
+ offset: zod_1.z.coerce.number().min(0).default(0).optional(),
14
+ });
15
+ FindToolWorkspacesCommand.ResponseSchema = zod_1.z.object({
16
+ data: zod_1.z.array(models_1.ToolWorkspaceSchema),
17
+ totalPages: zod_1.z.number(),
18
+ page: zod_1.z.number(),
19
+ });
20
+ })(FindToolWorkspacesCommand || (exports.FindToolWorkspacesCommand = FindToolWorkspacesCommand = {}));
@@ -0,0 +1,20 @@
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("./find-tool-workspace-by-uuid.command"), exports);
18
+ __exportStar(require("./find-tool-workspaces.command"), exports);
19
+ __exportStar(require("./update-tool-workspace.command"), exports);
20
+ __exportStar(require("./delete-tool-workspace-by-uuid.command"), exports);
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateToolWorkspaceCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../../constants");
6
+ const models_1 = require("../../../models");
7
+ var UpdateToolWorkspaceCommand;
8
+ (function (UpdateToolWorkspaceCommand) {
9
+ UpdateToolWorkspaceCommand.RequestSchema = zod_1.z.object({
10
+ title: zod_1.z.string().min(1).optional(),
11
+ coverUrl: zod_1.z.string().nullable().optional(),
12
+ status: zod_1.z.nativeEnum(constants_1.TOOL_WORKSPACE_STATUS).optional(),
13
+ });
14
+ UpdateToolWorkspaceCommand.RequestParamsSchema = zod_1.z.object({
15
+ uuid: zod_1.z.string().uuid(),
16
+ });
17
+ UpdateToolWorkspaceCommand.ResponseSchema = zod_1.z.object({
18
+ data: models_1.ToolWorkspaceSchema,
19
+ });
20
+ })(UpdateToolWorkspaceCommand || (exports.UpdateToolWorkspaceCommand = UpdateToolWorkspaceCommand = {}));
@@ -2,12 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VideoCommand = void 0;
4
4
  const zod_1 = require("zod");
5
+ const constants_1 = require("../../../constants");
5
6
  const models_1 = require("../../../models");
6
7
  var VideoCommand;
7
8
  (function (VideoCommand) {
8
9
  VideoCommand.RequestSchema = zod_1.z.object({
9
- modelId: zod_1.z.string().uuid(),
10
+ workspaceId: zod_1.z.string().uuid().nullable().optional(),
11
+ workspaceItemId: zod_1.z.string().uuid().nullable().optional(),
12
+ workspaceToolType: zod_1.z.nativeEnum(constants_1.TOOL_CONTENT_TYPE).nullable().optional(),
13
+ workspaceSlot: zod_1.z.nativeEnum(constants_1.TOOL_WORKSPACE_ITEM_SLOT).optional(),
14
+ workspaceOrder: zod_1.z.number().int().min(0).optional(),
10
15
  prompt: zod_1.z.string(),
16
+ modelId: zod_1.z.string().uuid(),
11
17
  params: models_1.VideoGenerationRequestParamsSchema,
12
18
  });
13
19
  VideoCommand.ResponseSchema = zod_1.z.object({
@@ -17,3 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./tool-content-type.enum"), exports);
18
18
  __exportStar(require("./tool-job-status.enum"), exports);
19
19
  __exportStar(require("./job-request-origin.enum"), exports);
20
+ __exportStar(require("./tool-type.enum"), exports);
21
+ __exportStar(require("./tool-workspace-item-slot.enum"), exports);
22
+ __exportStar(require("./tool-workspace-status.enum"), exports);
@@ -4,6 +4,7 @@ exports.TOOL_CONTENT_TYPE = void 0;
4
4
  var TOOL_CONTENT_TYPE;
5
5
  (function (TOOL_CONTENT_TYPE) {
6
6
  TOOL_CONTENT_TYPE["IMAGE_EDITOR"] = "IMAGE_EDITOR";
7
+ TOOL_CONTENT_TYPE["IMAGE_GENERATION"] = "IMAGE_GENERATION";
7
8
  TOOL_CONTENT_TYPE["TEXT_TO_SPEECH"] = "TEXT_TO_SPEECH";
8
9
  TOOL_CONTENT_TYPE["SPEECH_TO_TEXT"] = "SPEECH_TO_TEXT";
9
10
  TOOL_CONTENT_TYPE["REPHRASE"] = "REPHRASE";
@@ -12,6 +13,9 @@ var TOOL_CONTENT_TYPE;
12
13
  TOOL_CONTENT_TYPE["WRITER"] = "WRITER";
13
14
  TOOL_CONTENT_TYPE["VIDEO_EDITOR"] = "VIDEO_EDITOR";
14
15
  TOOL_CONTENT_TYPE["MUSIC"] = "MUSIC";
16
+ TOOL_CONTENT_TYPE["INTERIOR_DESIGN"] = "INTERIOR_DESIGN";
15
17
  TOOL_CONTENT_TYPE["NONE"] = "NONE";
16
- TOOL_CONTENT_TYPE["IMAGE_GENERATION"] = "IMAGE_GENERATION";
18
+ TOOL_CONTENT_TYPE["MARKETPLACE_CARD_GENERATION"] = "MARKETPLACE_CARD";
19
+ TOOL_CONTENT_TYPE["SOLVING_EDU_TASK"] = "SOLVING_EDU_TASK";
20
+ TOOL_CONTENT_TYPE["SPELL_CORRECTOR"] = "SPELL_CORRECTOR";
17
21
  })(TOOL_CONTENT_TYPE || (exports.TOOL_CONTENT_TYPE = TOOL_CONTENT_TYPE = {}));
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TOOL_TYPE = void 0;
4
+ var TOOL_TYPE;
5
+ (function (TOOL_TYPE) {
6
+ TOOL_TYPE["IMAGE"] = "IMAGE";
7
+ TOOL_TYPE["TEXT"] = "TEXT";
8
+ TOOL_TYPE["VIDEO"] = "VIDEO";
9
+ TOOL_TYPE["AUDIO"] = "AUDIO";
10
+ TOOL_TYPE["PRESENTATION"] = "PRESENTATION";
11
+ TOOL_TYPE["PRESENTATION_AI_ACTION"] = "PRESENTATION_AI_ACTION";
12
+ TOOL_TYPE["WRITER"] = "WRITER";
13
+ TOOL_TYPE["PARAPHRASE"] = "PARAPHRASE";
14
+ TOOL_TYPE["WRITER_ACTION"] = "WRITER_ACTION";
15
+ TOOL_TYPE["VIDEO_EDITOR"] = "VIDEO_EDITOR";
16
+ TOOL_TYPE["MUSIC"] = "MUSIC";
17
+ TOOL_TYPE["MUSIC_ACTION"] = "MUSIC_ACTION";
18
+ TOOL_TYPE["IMAGE_GENERATION"] = "IMAGE_GENERATION";
19
+ TOOL_TYPE["MARKETPLACE_CARD_GENERATION"] = "MARKETPLACE_CARD_GENERATION";
20
+ TOOL_TYPE["INTERIOR_DESIGN"] = "INTERIOR_DESIGN";
21
+ TOOL_TYPE["SPELL_CORRECTOR"] = "SPELL_CORRECTOR";
22
+ TOOL_TYPE["SOLVING_EDU_TASK"] = "SOLVING_EDU_TASK";
23
+ })(TOOL_TYPE || (exports.TOOL_TYPE = TOOL_TYPE = {}));
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TOOL_WORKSPACE_ITEM_SLOT = void 0;
4
+ var TOOL_WORKSPACE_ITEM_SLOT;
5
+ (function (TOOL_WORKSPACE_ITEM_SLOT) {
6
+ TOOL_WORKSPACE_ITEM_SLOT["CAPITAL"] = "\u0417\u0430\u0433\u043B\u0430\u0432\u043D\u0430\u044F";
7
+ TOOL_WORKSPACE_ITEM_SLOT["INTERNAL"] = "\u0412\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u044F\u044F";
8
+ TOOL_WORKSPACE_ITEM_SLOT["VIDEO"] = "\u0412\u0438\u0434\u0435\u043E";
9
+ })(TOOL_WORKSPACE_ITEM_SLOT || (exports.TOOL_WORKSPACE_ITEM_SLOT = TOOL_WORKSPACE_ITEM_SLOT = {}));
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TOOL_WORKSPACE_STATUS = void 0;
4
+ var TOOL_WORKSPACE_STATUS;
5
+ (function (TOOL_WORKSPACE_STATUS) {
6
+ TOOL_WORKSPACE_STATUS["ACTIVE"] = "active";
7
+ TOOL_WORKSPACE_STATUS["DELETED"] = "deleted";
8
+ })(TOOL_WORKSPACE_STATUS || (exports.TOOL_WORKSPACE_STATUS = TOOL_WORKSPACE_STATUS = {}));
@@ -38,6 +38,7 @@ __exportStar(require("./order.schema"), exports);
38
38
  __exportStar(require("./page.schema"), exports);
39
39
  __exportStar(require("./payment-history-item.schema"), exports);
40
40
  __exportStar(require("./payment.schema"), exports);
41
+ __exportStar(require("./invoice-for-payment.schema"), exports);
41
42
  __exportStar(require("./post.schema"), exports);
42
43
  __exportStar(require("./product.schema"), exports);
43
44
  __exportStar(require("./promocode.schema"), exports);
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvoiceForPaymentSchema = exports.InvoiceForPaymentPayloadSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.InvoiceForPaymentPayloadSchema = zod_1.z.object({
6
+ email: zod_1.z.string().email(),
7
+ name: zod_1.z.string(),
8
+ inn: zod_1.z.string(),
9
+ amount: zod_1.z.number(),
10
+ itemName: zod_1.z.string(),
11
+ });
12
+ exports.InvoiceForPaymentSchema = zod_1.z.object({
13
+ uuid: zod_1.z.string().uuid(),
14
+ userId: zod_1.z.string().uuid(),
15
+ teamAccountId: zod_1.z.string().uuid(),
16
+ invoiceNumber: zod_1.z.string(),
17
+ sum: zod_1.z.number(),
18
+ pdfUrl: zod_1.z.string(),
19
+ payload: exports.InvoiceForPaymentPayloadSchema,
20
+ orderId: zod_1.z.string().uuid().nullable(),
21
+ paymentId: zod_1.z.string().uuid().nullable(),
22
+ createdAt: zod_1.z.date(),
23
+ updatedAt: zod_1.z.date(),
24
+ });
@@ -30,3 +30,4 @@ __exportStar(require("./marketplace-card"), exports);
30
30
  __exportStar(require("./interior-design"), exports);
31
31
  __exportStar(require("./solving-edu-task"), exports);
32
32
  __exportStar(require("./spell-corrector"), exports);
33
+ __exportStar(require("./tool-workspace"), exports);
@@ -0,0 +1,20 @@
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("./tool-workspace.schema"), exports);
18
+ __exportStar(require("./tool-workspace-job.schema"), exports);
19
+ __exportStar(require("./tool-workspace-item.schema"), exports);
20
+ __exportStar(require("./tool-workspace-contents.schema"), exports);
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToolWorkspaceContentsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const tool_workspace_item_schema_1 = require("./tool-workspace-item.schema");
6
+ const tool_workspace_schema_1 = require("./tool-workspace.schema");
7
+ exports.ToolWorkspaceContentsSchema = zod_1.z.object({
8
+ workspace: tool_workspace_schema_1.ToolWorkspaceSchema,
9
+ items: zod_1.z.array(tool_workspace_item_schema_1.ToolWorkspaceItemSchema),
10
+ });
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToolWorkspaceItemSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../../constants");
6
+ const tool_workspace_job_schema_1 = require("./tool-workspace-job.schema");
7
+ exports.ToolWorkspaceItemSchema = zod_1.z.object({
8
+ uuid: zod_1.z.string().uuid(),
9
+ jobId: zod_1.z.string().uuid(),
10
+ jobType: zod_1.z.nativeEnum(constants_1.TOOL_TYPE),
11
+ slotTitle: zod_1.z.nativeEnum(constants_1.TOOL_WORKSPACE_ITEM_SLOT),
12
+ order: zod_1.z.number().int().min(0),
13
+ content: tool_workspace_job_schema_1.ToolWorkspaceJobSchema,
14
+ createdAt: zod_1.z.date(),
15
+ updatedAt: zod_1.z.date(),
16
+ });
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToolWorkspaceJobSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../../constants");
6
+ const marketplace_card_1 = require("../marketplace-card");
7
+ const video_1 = require("../video");
8
+ exports.ToolWorkspaceJobSchema = zod_1.z.discriminatedUnion('type', [
9
+ zod_1.z.object({
10
+ type: zod_1.z.literal(constants_1.TOOL_TYPE.MARKETPLACE_CARD_GENERATION),
11
+ job: marketplace_card_1.MarketplaceCardJobSchema,
12
+ }),
13
+ zod_1.z.object({
14
+ type: zod_1.z.literal(constants_1.TOOL_TYPE.VIDEO),
15
+ job: video_1.VideoJobSchema,
16
+ }),
17
+ ]);
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToolWorkspaceSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../../constants");
6
+ exports.ToolWorkspaceSchema = zod_1.z.object({
7
+ uuid: zod_1.z.string().uuid(),
8
+ toolType: zod_1.z.nativeEnum(constants_1.TOOL_CONTENT_TYPE),
9
+ title: zod_1.z.string(),
10
+ coverUrl: zod_1.z.string().nullable(),
11
+ status: zod_1.z.nativeEnum(constants_1.TOOL_WORKSPACE_STATUS),
12
+ userId: zod_1.z.string().uuid().nullable().optional(),
13
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
14
+ createdAt: zod_1.z.date(),
15
+ updatedAt: zod_1.z.date(),
16
+ });
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace ChangePasswordCommand {
4
+ export const RequestSchema = z.object({
5
+ currentPassword: z.string(),
6
+ newPassword: z.string(),
7
+ });
8
+
9
+ export type Request = z.infer<typeof RequestSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: z.object({
13
+ accessToken: z.string(),
14
+ }),
15
+ });
16
+
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }
@@ -7,3 +7,4 @@ export * from './verify-email-retry.command';
7
7
  export * from './verify-email.command';
8
8
  export * from './vk-login.command';
9
9
  export * from './yandex-login.command';
10
+ export * from './change-password.command';
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ import { InvoiceForPaymentSchema } from '../../models';
3
+
4
+ export namespace GetInvoiceForPaymentCommand {
5
+ export const RequestQuerySchema = z
6
+ .object({
7
+ invoiceId: z.string().uuid().optional(),
8
+ userId: z.string().uuid().optional(),
9
+ teamAccountId: z.string().uuid().optional(),
10
+ inn: z.string().optional(),
11
+ invoiceNumber: z.string().optional(),
12
+ })
13
+ .refine(
14
+ (value) =>
15
+ [
16
+ value.invoiceId,
17
+ value.userId,
18
+ value.teamAccountId,
19
+ value.inn,
20
+ value.invoiceNumber,
21
+ ].filter(Boolean).length === 1,
22
+ {
23
+ message: 'Must provide exactly one filter',
24
+ },
25
+ );
26
+
27
+ export type RequestQuery = z.infer<typeof RequestQuerySchema>;
28
+
29
+ export const ResponseSchema = z.object({
30
+ data: z.array(InvoiceForPaymentSchema),
31
+ });
32
+
33
+ export type Response = z.infer<typeof ResponseSchema>;
34
+ }
@@ -22,4 +22,5 @@ export * from './create-manual-team-subscription.command';
22
22
  export * from './create-manual-team-product.command';
23
23
  export * from './find-team-accounts-by-name.command';
24
24
  export * from './create-team-account-invoice-payment.command';
25
+ export * from './get-invoice-for-payment.command';
25
26
  export * from './get-team-account-payment-history.command';
@@ -13,3 +13,4 @@ export * from './marketplace-card';
13
13
  export * from './interior-design';
14
14
  export * from './solving-edu-task';
15
15
  export * from './spell-corrector';
16
+ export * from './tool-workspace';
@@ -1,9 +1,15 @@
1
1
  import { z } from 'zod';
2
+ import { TOOL_CONTENT_TYPE, TOOL_WORKSPACE_ITEM_SLOT } from '../../../constants';
2
3
  import { MarketplaceCardJobSchema } from '../../../models';
3
4
 
4
5
  export namespace ExecuteMarketplaceCardCommand {
5
6
  export const RequestSchema = z
6
7
  .object({
8
+ workspaceId: z.string().uuid().nullable().optional(),
9
+ workspaceItemId: z.string().uuid().nullable().optional(),
10
+ workspaceToolType: z.nativeEnum(TOOL_CONTENT_TYPE).nullable().optional(),
11
+ workspaceSlot: z.nativeEnum(TOOL_WORKSPACE_ITEM_SLOT).optional(),
12
+ workspaceOrder: z.number().int().min(0).optional(),
7
13
  title: z.string(),
8
14
  subtitle: z.string().nullable().optional(),
9
15
  advantages: z.array(z.string()),
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteToolWorkspaceByUUIDCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ });
7
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
8
+
9
+ export const ResponseSchema = z.void();
10
+ export type Response = z.infer<typeof ResponseSchema>;
11
+ }
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { ToolWorkspaceContentsSchema } from '../../../models';
3
+
4
+ export namespace FindToolWorkspaceByUUIDCommand {
5
+ export const RequestParamsSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
9
+
10
+ export const ResponseSchema = z.object({
11
+ data: ToolWorkspaceContentsSchema.nullable(),
12
+ });
13
+ export type Response = z.infer<typeof ResponseSchema>;
14
+ }
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { TOOL_CONTENT_TYPE } from '../../../constants';
3
+ import { ToolWorkspaceSchema } from '../../../models';
4
+
5
+ export namespace FindToolWorkspacesCommand {
6
+ export const RequestQuerySchema = z.object({
7
+ toolType: z.nativeEnum(TOOL_CONTENT_TYPE).optional(),
8
+ title: z.string().optional(),
9
+ limit: z.coerce.number().min(1).optional(),
10
+ offset: z.coerce.number().min(0).default(0).optional(),
11
+ });
12
+ export type RequestQuery = z.infer<typeof RequestQuerySchema>;
13
+
14
+ export const ResponseSchema = z.object({
15
+ data: z.array(ToolWorkspaceSchema),
16
+ totalPages: z.number(),
17
+ page: z.number(),
18
+ });
19
+ export type Response = z.infer<typeof ResponseSchema>;
20
+ }
@@ -0,0 +1,4 @@
1
+ export * from './find-tool-workspace-by-uuid.command';
2
+ export * from './find-tool-workspaces.command';
3
+ export * from './update-tool-workspace.command';
4
+ export * from './delete-tool-workspace-by-uuid.command';
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { TOOL_WORKSPACE_STATUS } from '../../../constants';
3
+ import { ToolWorkspaceSchema } from '../../../models';
4
+
5
+ export namespace UpdateToolWorkspaceCommand {
6
+ export const RequestSchema = z.object({
7
+ title: z.string().min(1).optional(),
8
+ coverUrl: z.string().nullable().optional(),
9
+ status: z.nativeEnum(TOOL_WORKSPACE_STATUS).optional(),
10
+ });
11
+ export type Request = z.infer<typeof RequestSchema>;
12
+
13
+ export const RequestParamsSchema = z.object({
14
+ uuid: z.string().uuid(),
15
+ });
16
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
17
+
18
+ export const ResponseSchema = z.object({
19
+ data: ToolWorkspaceSchema,
20
+ });
21
+ export type Response = z.infer<typeof ResponseSchema>;
22
+ }
@@ -1,9 +1,15 @@
1
1
  import { z } from 'zod';
2
+ import { TOOL_CONTENT_TYPE, TOOL_WORKSPACE_ITEM_SLOT } from '../../../constants';
2
3
  import { ToolJobSchema, VideoGenerationRequestParamsSchema } from '../../../models';
3
4
  export namespace VideoCommand {
4
5
  export const RequestSchema = z.object({
5
- modelId: z.string().uuid(),
6
+ workspaceId: z.string().uuid().nullable().optional(),
7
+ workspaceItemId: z.string().uuid().nullable().optional(),
8
+ workspaceToolType: z.nativeEnum(TOOL_CONTENT_TYPE).nullable().optional(),
9
+ workspaceSlot: z.nativeEnum(TOOL_WORKSPACE_ITEM_SLOT).optional(),
10
+ workspaceOrder: z.number().int().min(0).optional(),
6
11
  prompt: z.string(),
12
+ modelId: z.string().uuid(),
7
13
  params: VideoGenerationRequestParamsSchema,
8
14
  });
9
15
 
@@ -1,3 +1,6 @@
1
1
  export * from './tool-content-type.enum';
2
2
  export * from './tool-job-status.enum';
3
3
  export * from './job-request-origin.enum';
4
+ export * from './tool-type.enum';
5
+ export * from './tool-workspace-item-slot.enum';
6
+ export * from './tool-workspace-status.enum';
@@ -1,5 +1,6 @@
1
1
  export enum TOOL_CONTENT_TYPE {
2
2
  IMAGE_EDITOR = 'IMAGE_EDITOR',
3
+ IMAGE_GENERATION = 'IMAGE_GENERATION',
3
4
  TEXT_TO_SPEECH = 'TEXT_TO_SPEECH',
4
5
  SPEECH_TO_TEXT = 'SPEECH_TO_TEXT',
5
6
  REPHRASE = 'REPHRASE',
@@ -8,6 +9,9 @@ export enum TOOL_CONTENT_TYPE {
8
9
  WRITER = 'WRITER',
9
10
  VIDEO_EDITOR = 'VIDEO_EDITOR',
10
11
  MUSIC = 'MUSIC',
12
+ INTERIOR_DESIGN = 'INTERIOR_DESIGN',
11
13
  NONE = 'NONE',
12
- IMAGE_GENERATION = 'IMAGE_GENERATION',
14
+ MARKETPLACE_CARD_GENERATION = 'MARKETPLACE_CARD',
15
+ SOLVING_EDU_TASK = 'SOLVING_EDU_TASK',
16
+ SPELL_CORRECTOR = 'SPELL_CORRECTOR',
13
17
  }
@@ -0,0 +1,19 @@
1
+ export enum TOOL_TYPE {
2
+ IMAGE = 'IMAGE',
3
+ TEXT = 'TEXT',
4
+ VIDEO = 'VIDEO',
5
+ AUDIO = 'AUDIO',
6
+ PRESENTATION = 'PRESENTATION',
7
+ PRESENTATION_AI_ACTION = 'PRESENTATION_AI_ACTION',
8
+ WRITER = 'WRITER',
9
+ PARAPHRASE = 'PARAPHRASE',
10
+ WRITER_ACTION = 'WRITER_ACTION',
11
+ VIDEO_EDITOR = 'VIDEO_EDITOR',
12
+ MUSIC = 'MUSIC',
13
+ MUSIC_ACTION = 'MUSIC_ACTION',
14
+ IMAGE_GENERATION = 'IMAGE_GENERATION',
15
+ MARKETPLACE_CARD_GENERATION = 'MARKETPLACE_CARD_GENERATION',
16
+ INTERIOR_DESIGN = 'INTERIOR_DESIGN',
17
+ SPELL_CORRECTOR = 'SPELL_CORRECTOR',
18
+ SOLVING_EDU_TASK = 'SOLVING_EDU_TASK',
19
+ }
@@ -0,0 +1,5 @@
1
+ export enum TOOL_WORKSPACE_ITEM_SLOT {
2
+ CAPITAL = 'Заглавная',
3
+ INTERNAL = 'Внутренняя',
4
+ VIDEO = 'Видео',
5
+ }
@@ -0,0 +1,4 @@
1
+ export enum TOOL_WORKSPACE_STATUS {
2
+ ACTIVE = 'active',
3
+ DELETED = 'deleted',
4
+ }
package/models/index.ts CHANGED
@@ -22,6 +22,7 @@ export * from './order.schema';
22
22
  export * from './page.schema';
23
23
  export * from './payment-history-item.schema';
24
24
  export * from './payment.schema';
25
+ export * from './invoice-for-payment.schema';
25
26
  export * from './post.schema';
26
27
  export * from './product.schema';
27
28
  export * from './promocode.schema';
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+
3
+ export const InvoiceForPaymentPayloadSchema = z.object({
4
+ email: z.string().email(),
5
+ name: z.string(),
6
+ inn: z.string(),
7
+ amount: z.number(),
8
+ itemName: z.string(),
9
+ });
10
+
11
+ export const InvoiceForPaymentSchema = z.object({
12
+ uuid: z.string().uuid(),
13
+ userId: z.string().uuid(),
14
+ teamAccountId: z.string().uuid(),
15
+ invoiceNumber: z.string(),
16
+ sum: z.number(),
17
+ pdfUrl: z.string(),
18
+ payload: InvoiceForPaymentPayloadSchema,
19
+ orderId: z.string().uuid().nullable(),
20
+ paymentId: z.string().uuid().nullable(),
21
+ createdAt: z.date(),
22
+ updatedAt: z.date(),
23
+ });
@@ -14,3 +14,4 @@ export * from './marketplace-card';
14
14
  export * from './interior-design';
15
15
  export * from './solving-edu-task';
16
16
  export * from './spell-corrector';
17
+ export * from './tool-workspace';
@@ -0,0 +1,4 @@
1
+ export * from './tool-workspace.schema';
2
+ export * from './tool-workspace-job.schema';
3
+ export * from './tool-workspace-item.schema';
4
+ export * from './tool-workspace-contents.schema';
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ import { ToolWorkspaceItemSchema } from './tool-workspace-item.schema';
3
+ import { ToolWorkspaceSchema } from './tool-workspace.schema';
4
+
5
+ export const ToolWorkspaceContentsSchema = z.object({
6
+ workspace: ToolWorkspaceSchema,
7
+ items: z.array(ToolWorkspaceItemSchema),
8
+ });
9
+
10
+ export type ToolWorkspaceContents = z.infer<typeof ToolWorkspaceContentsSchema>;
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { TOOL_TYPE, TOOL_WORKSPACE_ITEM_SLOT } from '../../../constants';
3
+ import { ToolWorkspaceJobSchema } from './tool-workspace-job.schema';
4
+
5
+ export const ToolWorkspaceItemSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ jobId: z.string().uuid(),
8
+ jobType: z.nativeEnum(TOOL_TYPE),
9
+ slotTitle: z.nativeEnum(TOOL_WORKSPACE_ITEM_SLOT),
10
+ order: z.number().int().min(0),
11
+ content: ToolWorkspaceJobSchema,
12
+ createdAt: z.date(),
13
+ updatedAt: z.date(),
14
+ });
15
+
16
+ export type ToolWorkspaceItem = z.infer<typeof ToolWorkspaceItemSchema>;
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { TOOL_TYPE } from '../../../constants';
3
+ import { MarketplaceCardJobSchema } from '../marketplace-card';
4
+ import { VideoJobSchema } from '../video';
5
+
6
+ export const ToolWorkspaceJobSchema = z.discriminatedUnion('type', [
7
+ z.object({
8
+ type: z.literal(TOOL_TYPE.MARKETPLACE_CARD_GENERATION),
9
+ job: MarketplaceCardJobSchema,
10
+ }),
11
+ z.object({
12
+ type: z.literal(TOOL_TYPE.VIDEO),
13
+ job: VideoJobSchema,
14
+ }),
15
+ ]);
16
+
17
+ export type ToolWorkspaceJob = z.infer<typeof ToolWorkspaceJobSchema>;
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { TOOL_CONTENT_TYPE, TOOL_WORKSPACE_STATUS } from '../../../constants';
3
+
4
+ export const ToolWorkspaceSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ toolType: z.nativeEnum(TOOL_CONTENT_TYPE),
7
+ title: z.string(),
8
+ coverUrl: z.string().nullable(),
9
+ status: z.nativeEnum(TOOL_WORKSPACE_STATUS),
10
+ userId: z.string().uuid().nullable().optional(),
11
+ unregisteredUserId: z.string().uuid().nullable().optional(),
12
+ createdAt: z.date(),
13
+ updatedAt: z.date(),
14
+ });
15
+
16
+ export type ToolWorkspace = z.infer<typeof ToolWorkspaceSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.12.6",
3
+ "version": "0.12.8",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",