@purpleschool/gptbot 0.10.1 → 0.10.3
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.
- package/api/controllers/http/team-account.ts +2 -1
- package/api/routes.ts +1 -0
- package/build/api/controllers/http/team-account.js +2 -1
- package/build/api/routes.js +1 -0
- package/build/commands/team-account/index.js +1 -0
- package/build/commands/team-account/invite-team-account-member.command.js +7 -5
- package/build/commands/team-account/revoke-team-account-invite.command.js +15 -0
- package/build/constants/email/subjects.js +1 -0
- package/commands/team-account/index.ts +1 -0
- package/commands/team-account/invite-team-account-member.command.ts +10 -5
- package/commands/team-account/revoke-team-account-invite.command.ts +17 -0
- package/constants/email/subjects.ts +1 -0
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ export const TEAM_ACCOUNT_ROUTES = {
|
|
|
5
5
|
UPDATE_ME: 'me',
|
|
6
6
|
UPDATE_MEMBER: 'members',
|
|
7
7
|
INVITE_MEMBER: 'invite',
|
|
8
|
+
REVOKE_INVITE: 'invite/revoke',
|
|
8
9
|
REMOVE_MEMBER: 'members/remove',
|
|
9
10
|
ACCEPT_INVITE: 'invite/accept',
|
|
10
11
|
GET_ME: 'me',
|
|
@@ -17,5 +18,5 @@ export const TEAM_ACCOUNT_ROUTES = {
|
|
|
17
18
|
GET_BALANCE: 'balance',
|
|
18
19
|
CREATE_MANUAL_SUBSCRIPTION: 'manual/subscription',
|
|
19
20
|
CREATE_MANUAL_PRODUCT: 'manual/product',
|
|
20
|
-
ADMIN_FIND_BY_NAME: 'admin',
|
|
21
|
+
ADMIN_FIND_BY_NAME: 'admin/find',
|
|
21
22
|
} as const;
|
package/api/routes.ts
CHANGED
|
@@ -188,6 +188,7 @@ export const REST_API = {
|
|
|
188
188
|
UPDATE_ME: `${ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.UPDATE_ME}`,
|
|
189
189
|
UPDATE_MEMBER: `${ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.UPDATE_MEMBER}`,
|
|
190
190
|
INVITE_MEMBER: `${ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.INVITE_MEMBER}`,
|
|
191
|
+
REVOKE_INVITE: `${ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.REVOKE_INVITE}`,
|
|
191
192
|
REMOVE_MEMBER: `${ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.REMOVE_MEMBER}`,
|
|
192
193
|
ACCEPT_INVITE: `${ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.ACCEPT_INVITE}`,
|
|
193
194
|
GET_ME: `${ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.GET_ME}`,
|
|
@@ -7,6 +7,7 @@ exports.TEAM_ACCOUNT_ROUTES = {
|
|
|
7
7
|
UPDATE_ME: 'me',
|
|
8
8
|
UPDATE_MEMBER: 'members',
|
|
9
9
|
INVITE_MEMBER: 'invite',
|
|
10
|
+
REVOKE_INVITE: 'invite/revoke',
|
|
10
11
|
REMOVE_MEMBER: 'members/remove',
|
|
11
12
|
ACCEPT_INVITE: 'invite/accept',
|
|
12
13
|
GET_ME: 'me',
|
|
@@ -19,5 +20,5 @@ exports.TEAM_ACCOUNT_ROUTES = {
|
|
|
19
20
|
GET_BALANCE: 'balance',
|
|
20
21
|
CREATE_MANUAL_SUBSCRIPTION: 'manual/subscription',
|
|
21
22
|
CREATE_MANUAL_PRODUCT: 'manual/product',
|
|
22
|
-
ADMIN_FIND_BY_NAME: 'admin',
|
|
23
|
+
ADMIN_FIND_BY_NAME: 'admin/find',
|
|
23
24
|
};
|
package/build/api/routes.js
CHANGED
|
@@ -187,6 +187,7 @@ exports.REST_API = {
|
|
|
187
187
|
UPDATE_ME: `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.UPDATE_ME}`,
|
|
188
188
|
UPDATE_MEMBER: `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.UPDATE_MEMBER}`,
|
|
189
189
|
INVITE_MEMBER: `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.INVITE_MEMBER}`,
|
|
190
|
+
REVOKE_INVITE: `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.REVOKE_INVITE}`,
|
|
190
191
|
REMOVE_MEMBER: `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.REMOVE_MEMBER}`,
|
|
191
192
|
ACCEPT_INVITE: `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.ACCEPT_INVITE}`,
|
|
192
193
|
GET_ME: `${exports.ROOT}/${CONTROLLERS.TEAM_ACCOUNT_CONTROLLER}/${CONTROLLERS.TEAM_ACCOUNT_ROUTES.GET_ME}`,
|
|
@@ -19,6 +19,7 @@ __exportStar(require("./update-team-account.command"), exports);
|
|
|
19
19
|
__exportStar(require("./invite-team-account-member.command"), exports);
|
|
20
20
|
__exportStar(require("./accept-team-account-invite.command"), exports);
|
|
21
21
|
__exportStar(require("./remove-team-account-member.command"), exports);
|
|
22
|
+
__exportStar(require("./revoke-team-account-invite.command"), exports);
|
|
22
23
|
__exportStar(require("./update-team-account-member.command"), exports);
|
|
23
24
|
__exportStar(require("./get-my-team-account.command"), exports);
|
|
24
25
|
__exportStar(require("./find-team-account-members.command"), exports);
|
|
@@ -3,15 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.InviteTeamAccountMemberCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const models_1 = require("../../models");
|
|
6
|
-
const constants_1 = require("../../constants");
|
|
7
6
|
var InviteTeamAccountMemberCommand;
|
|
8
7
|
(function (InviteTeamAccountMemberCommand) {
|
|
9
8
|
InviteTeamAccountMemberCommand.RequestSchema = zod_1.z.object({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
emails: zod_1.z
|
|
10
|
+
.array(zod_1.z.string().email())
|
|
11
|
+
.min(1)
|
|
12
|
+
.refine((emails) => new Set(emails.map((email) => email.toLowerCase())).size === emails.length, {
|
|
13
|
+
message: 'Emails must be unique (case-insensitive)',
|
|
14
|
+
}),
|
|
13
15
|
});
|
|
14
16
|
InviteTeamAccountMemberCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
-
data: models_1.TeamAccountInviteSchema,
|
|
17
|
+
data: zod_1.z.array(models_1.TeamAccountInviteSchema),
|
|
16
18
|
});
|
|
17
19
|
})(InviteTeamAccountMemberCommand || (exports.InviteTeamAccountMemberCommand = InviteTeamAccountMemberCommand = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RevokeTeamAccountInviteCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var RevokeTeamAccountInviteCommand;
|
|
6
|
+
(function (RevokeTeamAccountInviteCommand) {
|
|
7
|
+
RevokeTeamAccountInviteCommand.RequestSchema = zod_1.z.object({
|
|
8
|
+
email: zod_1.z.string().email(),
|
|
9
|
+
});
|
|
10
|
+
RevokeTeamAccountInviteCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.object({
|
|
12
|
+
revoked: zod_1.z.boolean(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
})(RevokeTeamAccountInviteCommand || (exports.RevokeTeamAccountInviteCommand = RevokeTeamAccountInviteCommand = {}));
|
|
@@ -4,6 +4,7 @@ exports.EMAIL_SUBJECTS = void 0;
|
|
|
4
4
|
exports.EMAIL_SUBJECTS = {
|
|
5
5
|
WELCOME: 'Добро пожаловать на сервис ruGPT!',
|
|
6
6
|
EMAIL_VERIFICATION: 'Подтверждение почты',
|
|
7
|
+
TEAM_ACCOUNT_INVITE: 'Приглашение в команду',
|
|
7
8
|
SUBSCRIPTION_PURCHASE: 'Спасибо за покупку подписки',
|
|
8
9
|
SUBSCRIPTION_CANCEL: 'Нам жаль, что вы от нас уходите(',
|
|
9
10
|
PRODUCT_PURCHASE: 'Спасибо за покупку тарифа',
|
|
@@ -3,6 +3,7 @@ export * from './update-team-account.command';
|
|
|
3
3
|
export * from './invite-team-account-member.command';
|
|
4
4
|
export * from './accept-team-account-invite.command';
|
|
5
5
|
export * from './remove-team-account-member.command';
|
|
6
|
+
export * from './revoke-team-account-invite.command';
|
|
6
7
|
export * from './update-team-account-member.command';
|
|
7
8
|
export * from './get-my-team-account.command';
|
|
8
9
|
export * from './find-team-account-members.command';
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { TeamAccountInviteSchema } from '../../models';
|
|
3
|
-
import { TEAM_ACCOUNT_MEMBER_ROLE } from '../../constants';
|
|
4
3
|
|
|
5
4
|
export namespace InviteTeamAccountMemberCommand {
|
|
6
5
|
export const RequestSchema = z.object({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
emails: z
|
|
7
|
+
.array(z.string().email())
|
|
8
|
+
.min(1)
|
|
9
|
+
.refine(
|
|
10
|
+
(emails) => new Set(emails.map((email) => email.toLowerCase())).size === emails.length,
|
|
11
|
+
{
|
|
12
|
+
message: 'Emails must be unique (case-insensitive)',
|
|
13
|
+
},
|
|
14
|
+
),
|
|
10
15
|
});
|
|
11
16
|
|
|
12
17
|
export type Request = z.infer<typeof RequestSchema>;
|
|
13
18
|
|
|
14
19
|
export const ResponseSchema = z.object({
|
|
15
|
-
data: TeamAccountInviteSchema,
|
|
20
|
+
data: z.array(TeamAccountInviteSchema),
|
|
16
21
|
});
|
|
17
22
|
|
|
18
23
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace RevokeTeamAccountInviteCommand {
|
|
4
|
+
export const RequestSchema = z.object({
|
|
5
|
+
email: z.string().email(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: z.object({
|
|
12
|
+
revoked: z.boolean(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export const EMAIL_SUBJECTS = {
|
|
2
2
|
WELCOME: 'Добро пожаловать на сервис ruGPT!',
|
|
3
3
|
EMAIL_VERIFICATION: 'Подтверждение почты',
|
|
4
|
+
TEAM_ACCOUNT_INVITE: 'Приглашение в команду',
|
|
4
5
|
SUBSCRIPTION_PURCHASE: 'Спасибо за покупку подписки',
|
|
5
6
|
SUBSCRIPTION_CANCEL: 'Нам жаль, что вы от нас уходите(',
|
|
6
7
|
PRODUCT_PURCHASE: 'Спасибо за покупку тарифа',
|