@purpleschool/gptbot 0.10.2 → 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.
@@ -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',
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',
@@ -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
- email: zod_1.z.string().email(),
11
- role: zod_1.z.enum([constants_1.TEAM_ACCOUNT_MEMBER_ROLE.ADMIN, constants_1.TEAM_ACCOUNT_MEMBER_ROLE.MEMBER]).optional(),
12
- tokenLimit: zod_1.z.number().int().positive().optional(),
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 = {}));
@@ -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
- email: z.string().email(),
8
- role: z.enum([TEAM_ACCOUNT_MEMBER_ROLE.ADMIN, TEAM_ACCOUNT_MEMBER_ROLE.MEMBER]).optional(),
9
- tokenLimit: z.number().int().positive().optional(),
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",