Skip to content

Commit 46b7984

Browse files
committed
fix: update invite command to the new command name
1 parent e8fc12e commit 46b7984

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

src/commands/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {initiateImageUpload} from './initiateImageUpload';
2222
import {getChannel} from './getChannel';
2323
import {getInstanceConnectedParticipants} from './getInstanceConnectedParticipants';
2424
import {getRelationships} from './getRelationships';
25-
import {ActivityInviteUser} from './activityInviteUser';
25+
import {inviteUserEmbedded} from './inviteUserEmbedded';
2626

2727
export {Commands, SetActivity};
2828

@@ -49,7 +49,7 @@ function commands(sendCommand: TSendCommand) {
4949
initiateImageUpload: initiateImageUpload(sendCommand),
5050
getInstanceConnectedParticipants: getInstanceConnectedParticipants(sendCommand),
5151
getRelationships: getRelationships(sendCommand),
52-
activityInviteUser: ActivityInviteUser(sendCommand),
52+
inviteUserEmbedded: inviteUserEmbedded(sendCommand),
5353
};
5454
}
5555

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import {schemaCommandFactory} from '../utils/commandFactory';
22
import {Command} from '../generated/schemas';
33

4-
export const ActivityInviteUser = schemaCommandFactory(Command.ACTIVITY_INVITE_USER);
4+
export const inviteUserEmbedded = schemaCommandFactory(Command.INVITE_USER_EMBEDDED);

src/generated/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@
347347
"additionalProperties": false
348348
}
349349
},
350-
"ACTIVITY_INVITE_USER": {
350+
"INVITE_USER_EMBEDDED": {
351351
"request": {
352352
"type": "object",
353353
"properties": {"user_id": {"type": "string"}, "content": {"type": "string", "minLength": 0, "maxLength": 1024}},

src/generated/schemas.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,12 @@ export const GetRelationshipsResponseSchema = z.object({
246246
});
247247
export type GetRelationshipsResponse = zInfer<typeof GetRelationshipsResponseSchema>;
248248

249-
// ACTIVITY_INVITE_USER
250-
export const ActivityInviteUserRequestSchema = z.object({
249+
// INVITE_USER_EMBEDDED
250+
export const InviteUserEmbeddedRequestSchema = z.object({
251251
user_id: z.string(),
252252
content: z.string().min(0).max(1024).optional(),
253253
});
254-
export type ActivityInviteUserRequest = zInfer<typeof ActivityInviteUserRequestSchema>;
254+
export type InviteUserEmbeddedRequest = zInfer<typeof InviteUserEmbeddedRequestSchema>;
255255

256256
/**
257257
* RPC Commands which support schemas.
@@ -264,7 +264,7 @@ export enum Command {
264264
SHARE_INTERACTION = 'SHARE_INTERACTION',
265265
SHARE_LINK = 'SHARE_LINK',
266266
GET_RELATIONSHIPS = 'GET_RELATIONSHIPS',
267-
ACTIVITY_INVITE_USER = 'ACTIVITY_INVITE_USER',
267+
INVITE_USER_EMBEDDED = 'INVITE_USER_EMBEDDED',
268268
}
269269

270270
const emptyResponseSchema = z.object({}).optional().nullable();
@@ -302,8 +302,8 @@ export const Schemas = {
302302
request: emptyRequestSchema,
303303
response: GetRelationshipsResponseSchema,
304304
},
305-
[Command.ACTIVITY_INVITE_USER]: {
306-
request: ActivityInviteUserRequestSchema,
305+
[Command.INVITE_USER_EMBEDDED]: {
306+
request: InviteUserEmbeddedRequestSchema,
307307
response: emptyResponseSchema,
308308
},
309309
} as const;

src/mock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,5 +181,5 @@ export const commandsMockDefault: IDiscordSDK['commands'] = {
181181
},
182182
],
183183
}),
184-
activityInviteUser: () => Promise.resolve(null),
184+
inviteUserEmbedded: () => Promise.resolve(null),
185185
};

src/schema/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export enum Commands {
3838
GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS = 'GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS',
3939
SHARE_LINK = 'SHARE_LINK',
4040
GET_RELATIONSHIPS = 'GET_RELATIONSHIPS',
41-
ACTIVITY_INVITE_USER = 'ACTIVITY_INVITE_USER',
41+
INVITE_USER_EMBEDDED = 'INVITE_USER_EMBEDDED',
4242
}
4343

4444
export const ReceiveFramePayload = zod

src/schema/responses.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ function parseResponseData({cmd, data}: zod.infer<typeof ResponseFrame>) {
184184
case Commands.GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS:
185185
case Commands.SHARE_LINK:
186186
case Commands.GET_RELATIONSHIPS:
187-
case Commands.ACTIVITY_INVITE_USER:
187+
case Commands.INVITE_USER_EMBEDDED:
188188
const {response} = Schemas[cmd];
189189
return response.parse(data);
190190
default:

0 commit comments

Comments
 (0)