-
Notifications
You must be signed in to change notification settings - Fork 16
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
Conversation
GermanVor
commented
Jan 27, 2025
выглядит так, как будто мы никогда однозначно не сможем угадывать ендпоинт клиентов через GET https://api.cloud.yandex.net/endpoints |
tsconfig.json
Outdated
"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?
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.
чтобы fetch делать в node скрипте
package.json
Outdated
@@ -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" |
?
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.
}; | ||
|
||
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()
:)
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.
old school
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.
ES2021 нужен
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.
272ecd5
to
1049759
Compare
144fe84
to
984666c
Compare