-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: try_find_clients_endpoints #184
base: alpha
Are you sure you want to change the base?
Conversation
GermanVor
commented
Jan 27, 2025
выглядит так, как будто мы никогда однозначно не сможем угадывать ендпоинт клиентов через GET https://api.cloud.yandex.net/endpoints |
"strict": true, | ||
"skipLibCheck": true, | ||
"resolveJsonModule": true, | ||
"lib": ["es6", "DOM"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А зачем DOM?
@@ -169,7 +169,8 @@ | |||
"build:services": "ts-node scripts/build_services", | |||
"build:mono-service": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" tsc -p .", | |||
"build": "npm run build:mono-service && npm run build:services", | |||
"typecheck:clients": "tsc -p ./clients --noEmit" | |||
"typecheck:clients": "tsc -p ./clients --noEmit", | |||
"try_find_clients_endpoints": "ts-node scripts/try_find_clients_endpoints" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"try_find_clients_endpoints": "ts-node scripts/try_find_clients_endpoints" | |
"discover-endpoints": "ts-node scripts/discover-endpoints" |
?
}; | ||
|
||
const main = async () => { | ||
const resp = await fetch('https://api.cloud.yandex.net/endpoints', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Было бы круто еще endpoint принимать аргументом, чтобы другие инсталляции тыкать можно было.
type EndpointType = { id: string; address: string }; | ||
|
||
const buildEndpointsMap = (endpoints: EndpointType[]) => { | ||
return new Map(endpoints.map(({ id, address }) => [id.split('-').join(''), { address, id }])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Какой интересный способ сделать .replaceAll()
:)