Skip to content

Commit

Permalink
chore(): Extracted form builder to npm package
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexXanderGrib committed Apr 14, 2021
1 parent 2432fa6 commit 1a5ced1
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 55 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
1. Есть поддержка TypeScript
2. Покрывает большую часть https://yoomoney.ru/docs/wallet
3. Документация прямо в коде
4. Всего 1 зависимость: `node-fetch`
4. Всего 2 зависимости: `node-fetch` и `redirect-form-builder` (для генерации html форм)
5. Есть API генерации frontend форм перенаправления для [Авторизации](https://yoomoney.ru/docs/wallet/using-api/authorization/basics) и [Оплаты](https://yoomoney.ru/docs/payment-buttons/using-api/forms)

## Работа с API
Expand Down
17 changes: 14 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
{
"name": "yoomoney-sdk",
"version": "1.0.1",
"version": "1.0.2",
"description": "YooMoney typed SDK",
"main": "dist/index.js",
"types": "./dist/index.d.ts",
"typings": "./dist/index.d.ts",
"type": "commonjs",
"scripts": {
"test": "jest",
"build": "tsc",
"build": "tsc --project tsconfig.json",
"prepack": "npm run build",
"prepublishOnly": "npm run generate-lock-files",
"generate-lock-files": "npm i && yarn install",
"glf": "npm run generate-lock-files"
},
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "git+https://github.com/AlexXanderGrib/yoomoney-sdk.git"
Expand Down Expand Up @@ -56,6 +60,7 @@
"typescript": "^4.2.4"
},
"dependencies": {
"node-fetch": "^2.6.1"
"node-fetch": "^2.6.1",
"redirect-form-builder": "^1.0.0"
}
}
2 changes: 1 addition & 1 deletion src/auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FormBuilder } from "redirect-form-builder";
import { fetch } from "./fetch";
import { FormBuilder } from "./form-builder";

type AuthScope =
| "account-info"
Expand Down
46 changes: 0 additions & 46 deletions src/form-builder.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/payment-form-builder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FormBuilder } from "redirect-form-builder";
import type { URL } from "url";
import { FormBuilder } from "./form-builder";

/* eslint-disable no-useless-constructor */
export type FormConfig = {
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3717,6 +3717,11 @@ read-pkg@^5.2.0:
parse-json "^5.0.0"
type-fest "^0.6.0"

redirect-form-builder@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/redirect-form-builder/-/redirect-form-builder-1.0.0.tgz"
integrity sha512-b4zgwTqWBHwSapqqlB8zmXhhW295eoV5515GdEyIz+JqVdtF9pYZtgnXp3539csQ3XEXXkeVqAfhkMYmXCYXVQ==

regex-not@^1.0.0, regex-not@^1.0.2:
version "1.0.2"
resolved "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz"
Expand Down

0 comments on commit 1a5ced1

Please sign in to comment.