-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aleksey Legotkin
committed
Oct 18, 2023
1 parent
48d97b1
commit 5bd63c8
Showing
111 changed files
with
10,841 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules/ | ||
dist-sdk/ | ||
dist-demo/ | ||
dist-docs/ | ||
dist-coverage/ | ||
dist-specification/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
node: true, | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 5, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module.exports = { | ||
parserOptions: { | ||
project: './tsconfig.eslint.json', | ||
tsconfigRootDir: __dirname, | ||
}, | ||
extends: ['@vkontakte/eslint-config/typescript'], | ||
plugins: ['eslint-plugin-import'], | ||
rules: { | ||
'import/order': [ | ||
'error', | ||
{ | ||
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], | ||
'newlines-between': 'always', | ||
'alphabetize': { | ||
order: 'asc', | ||
}, | ||
'pathGroups': [ | ||
{ | ||
pattern: '#/**', | ||
group: 'internal', | ||
}, | ||
], | ||
}, | ||
], | ||
|
||
// Disabled because: no configurable options for .length > 0, arr[0] and similar constructions. | ||
'no-magic-numbers': 'off', | ||
'@typescript-eslint/no-magic-numbers': 'off', | ||
|
||
// Disabled because: errors on 'displayMode || '5min'' expression with nullable variable. | ||
'@typescript-eslint/no-unnecessary-condition': 'off', | ||
|
||
// Disabled: covered with stricter tsc settings | ||
'@typescript-eslint/typedef': 'off', | ||
|
||
'@typescript-eslint/prefer-string-starts-ends-with': 'off', | ||
|
||
'no-shadow': 'off', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module.exports = { | ||
overrides: [{ | ||
files: ['demo/**/*.ts', 'src/**/*.ts', '__tests__/**/*.ts'], | ||
extends: ['./.eslintrc-ts.js'] | ||
}], | ||
env: { | ||
browser: true, | ||
node: true, | ||
es6: true, | ||
jest: true | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
// Allows for the parsing of modern ECMAScript features | ||
sourceType: 'module', | ||
// Allows for the use of imports | ||
ecmaFeatures: { | ||
restParams: true, | ||
spread: true | ||
} | ||
}, | ||
globals: { | ||
process: true | ||
}, | ||
extends: ["plugin:storybook/recommended", "plugin:storybook/recommended"] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
node_modules | ||
npm-debug.log | ||
.idea/ | ||
.vscode/ | ||
yarn-error.log | ||
vscode | ||
dist-sdk/ | ||
dist-demo/ | ||
dist-specification/ | ||
dist-coverage/ | ||
.eslintcache | ||
coverage | ||
*.DS_Store | ||
allure-report/ | ||
allure-results/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## Merge Checklist | ||
<!-- | ||
Список шагов, которые необходимо проверить перед влитием этого MR. | ||
--> | ||
* [ ] Подлит свежий develop | ||
* [ ] Код проверен на тесте и он работает | ||
* [ ] Код покрыт тестами (если возможно) | ||
* [ ] В демку внесены изменения (если возможно) | ||
* [ ] Документация обновлена | ||
|
||
## Описание изменений | ||
<!-- | ||
Краткое описание выполненной работы, включая список изменений, исправлений или новых функций. Если задача была связана с устранением ошибок, укажите проблему, которая была исправлена. Если это новая функциональность, объясните ее суть и значение для проекта. | ||
--> | ||
|
||
## Обоснование изменений | ||
<!-- | ||
Здесь можно предоставить дополнительную информацию о необходимости и цели внесенных изменений. Объясните, почему эти изменения важны и как они улучшают проект. Укажите связанные проблемы, требования или запросы от пользователей, которые эти изменения решают. | ||
--> | ||
|
||
## Реализация | ||
<!-- | ||
Опишите, как вы реализовали изменения. Укажите используемые технологии, методы или алгоритмы. Если есть вспомогательные материалы, такие как диаграммы, схемы или ссылки на документацию, приведите их здесь. | ||
--> | ||
|
||
## Тестирование | ||
<!-- | ||
Укажите, как вы проверили внесенные изменения. Если были добавлены новые тесты, укажите их объем и описание. Если выполнялись ручное тестирование или автоматические тесты, укажите использованные подходы и результаты. | ||
После изменения UI нужно приложить скриншот из демки. | ||
Для этого скопируйте <img src="/uploads/hash/image.png" width="400"/> и замените hash на хэш изображения. | ||
--> | ||
|
||
## Примечания | ||
<!-- | ||
В этом разделе вы можете указать дополнительные примечания или инструкции для ревьюера. Если есть известные ограничения, проблемы или замечания, которые не были решены в этом MR, укажите их здесь. | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
command_exists () { | ||
command -v "$1" >/dev/null 2>&1 | ||
} | ||
|
||
# Windows 10, Git Bash and Yarn workaround | ||
if command_exists winpty && test -t 1; then | ||
exec < /dev/tty | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
. "$(dirname "$0")/common.sh" | ||
|
||
yarn lint-staged && yarn docs:prod && git add ./.wiki |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
. "$(dirname "$0")/common.sh" | ||
|
||
yarn tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
@vkid/sdk / [Modules](modules.md) | ||
|
||
<div align="center"> | ||
<h1 align="center"> | ||
<img width="150" class="figure" src="https://unpkg.com/@vkid/[email protected]/logo.svg"/> | ||
</h1> | ||
<p align="center"> | ||
<!-- Заменить @vkontakte/superappkit на @vkid/sdk --> | ||
<a href="LICENSE"> | ||
<img src="https://img.shields.io/npm/l/@vkid/sdk?maxAge=3600"> | ||
</a> | ||
<a href="https://npmjs.com/package/@vkontakte/superappkit"> | ||
<img src="https://img.shields.io/npm/v/@vkid/sdk/latest.svg?maxAge=3600"> | ||
</a> | ||
<a href="https://npmjs.com/package/@vkid/sdk"> | ||
<img alt="npm" src="https://img.shields.io/npm/dw/%40vkid%2Fsdk"> | ||
</a> | ||
<a href="https://npmjs.com/package/@vkid/sdk"> | ||
<img alt="npm bundle size" src="https://img.shields.io/bundlephobia/minzip/%40vkid%2Fsdk"> | ||
</a> | ||
</p> | ||
<p align="center"> | ||
VK ID SDK — это библиотека для безопасной и удобной авторизации пользователей в вашем сервисе через VK ID. | ||
</p> | ||
</div> | ||
|
||
## Демонстрация | ||
|
||
Чтобы изучить возможности VK ID SDK, перейдите на [демо-стенд](https://demo.vksak.com) | ||
|
||
## Установка | ||
|
||
**NPM:** | ||
|
||
```sh | ||
npm i @vkid/sdk | ||
``` | ||
|
||
**YARN:** | ||
|
||
```sh | ||
yarn add @vkid/sdk | ||
``` | ||
|
||
**PNPM:** | ||
|
||
```sh | ||
pnpm add @vkid/sdk | ||
``` | ||
|
||
**CDN:** | ||
|
||
```html | ||
<script src="https://unpkg.com/@vkid/sdk/dist/index-umd.js"></script> | ||
``` | ||
|
||
## Пример | ||
|
||
```javascript | ||
import * as VKID from '@vkid/sdk'; | ||
|
||
VKID.Config.set({ | ||
app: APP_ID | ||
}); | ||
|
||
const handleSuccess = (token) => { | ||
console.log(token); | ||
} | ||
|
||
const authButton = document.createElement('button'); | ||
authButton.onclick = () => { | ||
VKID.Auth.login() | ||
.then(handleSuccess) | ||
.catch(console.error); | ||
}; | ||
|
||
document.getElementById('container') | ||
.appendChild(authButton); | ||
``` | ||
|
||
> Обратите внимание: Для работы авторизации нужен APP_ID. Вы получите его, когда [создадите](https://id.vk.com/business/go/docs/vkid/latest/create-application) приложение в кабинете подключения VK ID. | ||
## Документация | ||
|
||
- [Что такое VK ID](https://id.vk.com/business/go/docs/vkid/latest/start-page) | ||
- [Создание приложения](https://id.vk.com/business/go/docs/vkid/latest/create-application) | ||
- [Требования к дизайну](https://id.vk.com/business/go/docs/vkid/latest/guidelines/design-rules) | ||
- [Спецификация](.wiki/README.md) | ||
|
||
## Contributing | ||
|
||
Проект VK ID SDK имеет открытый исходный код на GitHub, и вы можете присоединиться к его доработке — мы будем благодарны за внесение улучшений и исправление возможных ошибок. | ||
|
||
### Code of Conduct | ||
|
||
Если вы собираетесь вносить изменения в проект VK ID SDK, следуйте правилам [разработки](CODE_OF_CONDUCT.md). Они помогут понять, какие действия возможны, а какие недопустимы. | ||
|
||
### Contributing Guide | ||
|
||
В [руководстве](CONTRIBUTING.md) вы можете подробно ознакомиться с процессом разработки и узнать, как предлагать улучшения и исправления, а ещё — как добавлять и тестировать свои изменения в VK ID SDK. | ||
Также рекомендуем ознакомиться с общими [правилами оформления кода](CODE_STYLE.md) в проекте. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[@vkid/sdk - v0.0.1](../README.md) / [Modules](../modules.md) / [auth](../modules/auth.md) / Auth | ||
|
||
# Class: Auth | ||
|
||
[auth](../modules/auth.md).Auth | ||
|
||
## Table of contents | ||
|
||
### Constructors | ||
|
||
- [constructor](auth.Auth.md#constructor) | ||
|
||
### Properties | ||
|
||
- [\_\_config](auth.Auth.md#__config) | ||
|
||
### Methods | ||
|
||
- [login](auth.Auth.md#login) | ||
|
||
## Constructors | ||
|
||
### constructor | ||
|
||
• **new Auth**() | ||
|
||
## Properties | ||
|
||
### \_\_config | ||
|
||
▪ `Static` **\_\_config**: [`Config`](core_config.Config.md) | ||
|
||
## Methods | ||
|
||
### login | ||
|
||
▸ `Readonly` **login**(`params?`): `Promise`<[`AuthResponse`](../interfaces/auth.AuthResponse.md)\> | ||
|
||
#### Parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `params?` | [`AuthParams`](../interfaces/auth.AuthParams.md) | | ||
|
||
#### Returns | ||
|
||
`Promise`<[`AuthResponse`](../interfaces/auth.AuthResponse.md)\> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
[@vkid/sdk - v0.0.1](../README.md) / [Modules](../modules.md) / [core/config](../modules/core_config.md) / Config | ||
|
||
# Class: Config | ||
|
||
[core/config](../modules/core_config.md).Config | ||
|
||
## Table of contents | ||
|
||
### Constructors | ||
|
||
- [constructor](core_config.Config.md#constructor) | ||
|
||
### Methods | ||
|
||
- [get](core_config.Config.md#get) | ||
- [set](core_config.Config.md#set) | ||
|
||
## Constructors | ||
|
||
### constructor | ||
|
||
• **new Config**() | ||
|
||
## Methods | ||
|
||
### get | ||
|
||
▸ **get**(): [`ConfigData`](../interfaces/core_config.ConfigData.md) | ||
|
||
#### Returns | ||
|
||
[`ConfigData`](../interfaces/core_config.ConfigData.md) | ||
|
||
___ | ||
|
||
### set | ||
|
||
▸ **set**(`config`): [`Config`](core_config.Config.md) | ||
|
||
#### Parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `config` | `Partial`<[`ConfigData`](../interfaces/core_config.ConfigData.md)\> | | ||
|
||
#### Returns | ||
|
||
[`Config`](core_config.Config.md) |
Oops, something went wrong.