Move sticker creator API to chat service
This commit is contained in:
parent
a1e090d1f1
commit
31cbb89b0d
21 changed files with 124 additions and 587 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue