Move sticker creator API to chat service

This commit is contained in:
Fedor Indutny 2024-05-15 15:26:37 -07:00 committed by GitHub
parent a1e090d1f1
commit 31cbb89b0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 124 additions and 587 deletions

View file

@ -439,38 +439,6 @@ export const artAddStickersRoute = _route('artAddStickers', {
},
});
/**
* Art Service Authentication
* @example
* ```ts
* artAuthRoute.toAppUrl({
* token: "123",
* pubKey: "abc",
* })
* // URL { "sgnl://art-auth?token=123&pub_key=abc" }
*/
export const artAuthRoute = _route('artAuth', {
patterns: [_pattern('sgnl:', 'art-auth', '{/}?', { search: ':params' })],
schema: z.object({
token: paramSchema, // opaque
pubKey: paramSchema, // base64url
}),
parse(result) {
const params = new URLSearchParams(result.search.groups.params);
return {
token: params.get('token'),
pubKey: params.get('pub_key'),
};
},
toAppUrl(args) {
const params = new URLSearchParams({
token: args.token,
pub_key: args.pubKey,
});
return new URL(`sgnl://art-auth?${params.toString()}`);
},
});
/**
* Show a conversation
* @example
@ -594,7 +562,6 @@ const _allSignalRoutes = [
captchaRoute,
linkCallRoute,
artAddStickersRoute,
artAuthRoute,
showConversationRoute,
startCallLobbyRoute,
showWindowRoute,