@purpleschool/gptbot 0.12.33 → 0.12.35

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.
@@ -0,0 +1,5 @@
1
+ export const ACCOUNT_MERGE_PRIVATE_CONTROLLER = 'private/account-merge' as const;
2
+
3
+ export const ACCOUNT_MERGE_PRIVATE_ROUTES = {
4
+ MERGE: '',
5
+ } as const;
@@ -1,4 +1,5 @@
1
1
  export * from './account-merge';
2
+ export * from './account-merge-private';
2
3
  export * from './ai-model';
3
4
  export * from './ai-vendor';
4
5
  export * from './auth';
@@ -25,6 +25,8 @@ export const TEAM_ACCOUNT_ROUTES = {
25
25
  ADMIN_GET_INVOICES: 'admin/invoices',
26
26
  ADMIN_GET_CURRENT_SUBSCRIPTIONS: (teamAccountId: string) =>
27
27
  `admin/subscriptions/current/${teamAccountId}`,
28
+ ADMIN_GET_CURRENT_PRODUCTS: (teamAccountId: string) =>
29
+ `admin/products/current/${teamAccountId}`,
28
30
  ADMIN_GET_PAYMENT_HISTORY: (teamAccountId: string) => `admin/payments/history/${teamAccountId}`,
29
31
  ADMIN_FIND_BY_UUID: (uuid: string) => `admin/find/${uuid}`,
30
32
  } as const;
package/api/routes.ts CHANGED
@@ -995,6 +995,9 @@ export const REST_API = {
995
995
  ACCOUNT_MERGE: {
996
996
  MERGE: `${ROOT}/${CONTROLLERS.ACCOUNT_MERGE_CONTROLLER}/${CONTROLLERS.ACCOUNT_MERGE_ROUTES.MERGE}`,
997
997
  },
998
+ ACCOUNT_MERGE_PRIVATE: {
999
+ MERGE: `${ROOT}/${CONTROLLERS.ACCOUNT_MERGE_PRIVATE_CONTROLLER}/${CONTROLLERS.ACCOUNT_MERGE_PRIVATE_ROUTES.MERGE}`,
1000
+ },
998
1001
  KEY_VALUE: {
999
1002
  FIND_ALL: `${ROOT}/${CONTROLLERS.KEY_VALUE_NAMESPACE_CONTROLLER}/${CONTROLLERS.KEY_VALUE_NAMESPACE_ROUTES.FIND_ALL}`,
1000
1003
  FIND_ALL_IN_NAMESPACE: (namespace: string) =>
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ACCOUNT_MERGE_PRIVATE_ROUTES = exports.ACCOUNT_MERGE_PRIVATE_CONTROLLER = void 0;
4
+ exports.ACCOUNT_MERGE_PRIVATE_CONTROLLER = 'private/account-merge';
5
+ exports.ACCOUNT_MERGE_PRIVATE_ROUTES = {
6
+ MERGE: '',
7
+ };
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./account-merge"), exports);
18
+ __exportStar(require("./account-merge-private"), exports);
18
19
  __exportStar(require("./ai-model"), exports);
19
20
  __exportStar(require("./ai-vendor"), exports);
20
21
  __exportStar(require("./auth"), exports);
@@ -26,6 +26,7 @@ exports.TEAM_ACCOUNT_ROUTES = {
26
26
  ADMIN_FIND_BY_NAME: 'admin/find',
27
27
  ADMIN_GET_INVOICES: 'admin/invoices',
28
28
  ADMIN_GET_CURRENT_SUBSCRIPTIONS: (teamAccountId) => `admin/subscriptions/current/${teamAccountId}`,
29
+ ADMIN_GET_CURRENT_PRODUCTS: (teamAccountId) => `admin/products/current/${teamAccountId}`,
29
30
  ADMIN_GET_PAYMENT_HISTORY: (teamAccountId) => `admin/payments/history/${teamAccountId}`,
30
31
  ADMIN_FIND_BY_UUID: (uuid) => `admin/find/${uuid}`,
31
32
  };
@@ -758,6 +758,9 @@ exports.REST_API = {
758
758
  ACCOUNT_MERGE: {
759
759
  MERGE: `${exports.ROOT}/${CONTROLLERS.ACCOUNT_MERGE_CONTROLLER}/${CONTROLLERS.ACCOUNT_MERGE_ROUTES.MERGE}`,
760
760
  },
761
+ ACCOUNT_MERGE_PRIVATE: {
762
+ MERGE: `${exports.ROOT}/${CONTROLLERS.ACCOUNT_MERGE_PRIVATE_CONTROLLER}/${CONTROLLERS.ACCOUNT_MERGE_PRIVATE_ROUTES.MERGE}`,
763
+ },
761
764
  KEY_VALUE: {
762
765
  FIND_ALL: `${exports.ROOT}/${CONTROLLERS.KEY_VALUE_NAMESPACE_CONTROLLER}/${CONTROLLERS.KEY_VALUE_NAMESPACE_ROUTES.FIND_ALL}`,
763
766
  FIND_ALL_IN_NAMESPACE: (namespace) => `${exports.ROOT}/${CONTROLLERS.KEY_VALUE_NAMESPACE_CONTROLLER}/${CONTROLLERS.KEY_VALUE_NAMESPACE_ROUTES.FIND_ALL_IN_NAMESPACE(namespace)}`,
@@ -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("./merge-account.command"), exports);
18
+ __exportStar(require("./merge-account-by-telegram-id.command"), exports);
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MergeAccountByTelegramIdCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var MergeAccountByTelegramIdCommand;
6
+ (function (MergeAccountByTelegramIdCommand) {
7
+ MergeAccountByTelegramIdCommand.RequestSchema = zod_1.z.object({
8
+ telegramId: zod_1.z.number(),
9
+ userId: zod_1.z.string().uuid(),
10
+ });
11
+ MergeAccountByTelegramIdCommand.ResponseSchema = zod_1.z.object({
12
+ data: zod_1.z.object({
13
+ accessToken: zod_1.z.string(),
14
+ }),
15
+ });
16
+ })(MergeAccountByTelegramIdCommand || (exports.MergeAccountByTelegramIdCommand = MergeAccountByTelegramIdCommand = {}));
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindCurrentTeamAccountProductsByTeamAccountIdCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var FindCurrentTeamAccountProductsByTeamAccountIdCommand;
7
+ (function (FindCurrentTeamAccountProductsByTeamAccountIdCommand) {
8
+ FindCurrentTeamAccountProductsByTeamAccountIdCommand.RequestParamSchema = zod_1.z.object({
9
+ teamAccountId: zod_1.z.string().uuid(),
10
+ });
11
+ FindCurrentTeamAccountProductsByTeamAccountIdCommand.ResponseSchema = zod_1.z.object({
12
+ data: zod_1.z.array(models_1.TeamToProductWithProductSchema),
13
+ });
14
+ })(FindCurrentTeamAccountProductsByTeamAccountIdCommand || (exports.FindCurrentTeamAccountProductsByTeamAccountIdCommand = FindCurrentTeamAccountProductsByTeamAccountIdCommand = {}));
@@ -41,3 +41,4 @@ __exportStar(require("./find-team-account-by-uuid.command"), exports);
41
41
  __exportStar(require("./create-team-account-invoice-payment.command"), exports);
42
42
  __exportStar(require("./get-invoice-for-payment.command"), exports);
43
43
  __exportStar(require("./get-team-account-payment-history.command"), exports);
44
+ __exportStar(require("./find-current-team-account-products-by-team-account-id.command"), exports);
@@ -1 +1,2 @@
1
1
  export * from './merge-account.command';
2
+ export * from './merge-account-by-telegram-id.command';
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace MergeAccountByTelegramIdCommand {
4
+ export const RequestSchema = z.object({
5
+ telegramId: z.number(),
6
+ userId: z.string().uuid(),
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
+ }
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { TeamToProductWithProductSchema } from '../../models';
3
+
4
+ export namespace FindCurrentTeamAccountProductsByTeamAccountIdCommand {
5
+ export const RequestParamSchema = z.object({
6
+ teamAccountId: z.string().uuid(),
7
+ });
8
+
9
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: z.array(TeamToProductWithProductSchema),
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -25,3 +25,4 @@ export * from './find-team-account-by-uuid.command';
25
25
  export * from './create-team-account-invoice-payment.command';
26
26
  export * from './get-invoice-for-payment.command';
27
27
  export * from './get-team-account-payment-history.command';
28
+ export * from './find-current-team-account-products-by-team-account-id.command';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.12.33",
3
+ "version": "0.12.35",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",