Skip to content

Commit 0f8855d

Browse files
authored
fix: sync schema for shareLink command (#311)
* fix: sync schema for shareLink command * fix: mock test
1 parent 9aa310f commit 0f8855d

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

src/generated/schema.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
"gateway.connect",
8989
"account.global_name.update",
9090
"payment_sources.country_code",
91+
"sdk.social_layer_presence",
9192
"sdk.social_layer",
9293
"lobbies.write"
9394
]
@@ -215,15 +216,20 @@
215216
"properties": {
216217
"referrer_id": {"type": "string", "maxLength": 64},
217218
"custom_id": {"type": "string", "maxLength": 64},
218-
"message": {"type": "string", "maxLength": 1000}
219+
"message": {"type": "string", "maxLength": 1000},
220+
"link_id": {"type": "string", "maxLength": 64}
219221
},
220222
"required": ["message"],
221223
"additionalProperties": false
222224
},
223225
"response": {
224226
"type": "object",
225-
"properties": {"success": {"type": "boolean"}},
226-
"required": ["success"],
227+
"properties": {
228+
"success": {"type": "boolean"},
229+
"didCopyLink": {"type": "boolean"},
230+
"didSendMessage": {"type": "boolean"}
231+
},
232+
"required": ["success", "didCopyLink", "didSendMessage"],
227233
"additionalProperties": false
228234
}
229235
},

src/generated/schemas.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export const AuthenticateResponseSchema = z.object({
7474
'gateway.connect',
7575
'account.global_name.update',
7676
'payment_sources.country_code',
77+
'sdk.social_layer_presence',
7778
'sdk.social_layer',
7879
'lobbies.write',
7980
])
@@ -156,9 +157,14 @@ export const ShareLinkRequestSchema = z.object({
156157
referrer_id: z.string().max(64).optional(),
157158
custom_id: z.string().max(64).optional(),
158159
message: z.string().max(1000),
160+
link_id: z.string().max(64).optional(),
159161
});
160162
export type ShareLinkRequest = zInfer<typeof ShareLinkRequestSchema>;
161-
export const ShareLinkResponseSchema = z.object({success: z.boolean()});
163+
export const ShareLinkResponseSchema = z.object({
164+
success: z.boolean(),
165+
didCopyLink: z.boolean(),
166+
didSendMessage: z.boolean(),
167+
});
162168
export type ShareLinkResponse = zInfer<typeof ShareLinkResponseSchema>;
163169

164170
// GET_RELATIONSHIPS

src/mock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export const commandsMockDefault: IDiscordSDK['commands'] = {
134134
}),
135135
getChannelPermissions: () => Promise.resolve({permissions: bigInt(1234567890) as unknown as bigint}),
136136
openShareMomentDialog: () => Promise.resolve(null),
137-
shareLink: () => Promise.resolve({success: false}),
137+
shareLink: () => Promise.resolve({success: false, didSendMessage: false, didCopyLink: false}),
138138
initiateImageUpload: () =>
139139
Promise.resolve({
140140
image_url:

0 commit comments

Comments
 (0)