Code Monkey home page Code Monkey logo

payrexx-nodejs's People

Contributors

weslleydesouza avatar xample avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

xample zwerit

payrexx-nodejs's Issues

wrong typing for the `fields` property of the `IGatewayCreate` type

Hi @WeslleyDeSouza

It's not a string, it's a key value on an object containing a value property:

fields?: Record<string, { value: string }>

I found it by reverse engineering their awesome docs…

current workaround is to force the typing

...
'fields': {
   'email': { value: '[email protected]' },
} as unknown as string,
...

Note: I initially wanted to hide the email from their form, if we provide the field at the gateway creation, the email is not mandatory anymore.

Types returned are not exported

Hello Weslley, after updating to the latest version 0.4.3 I realized there is public method returning non exported types

for instance

create(params:IGatewayCreate):Promise<Gateway>{

Where Gateway is not exported

class Gateway implements IGatewayResponse

solution: Every type returned by a public method, must be exported as well

export class Gateway implements IGatewayResponse {

Workaround: right now I can export the type using the following ugly workaround

type Awaited<T> = T extends PromiseLike<infer U> ? Awaited<U> : T;
type Gateway = Awaited<ReturnType<PayRexx['gateway']['create']>>

v0.3.0 broken import glitch

Hi, I get the following error
/node_modules/PayRexx/index.ts:1

import {SubscriptionsActions} from "./actions/payrexx.actions.subscriptions";
^^^^^^

This because ts will try to compile *.ts files within the payrexx package, the only *.ts files you should commit are *.d.ts files.

To fix the issue, you should not commit index.ts file, only it's corresponding index.d.ts (by the way a nice place is aside the index.js i.e. dist/index.d.ts).
image

then declare explicitly the typings in package.json. To do so, replace

"main": "index.ts",`

with

"main": "dist/index.js",
"types": "dist/index.d.ts",

https://medium.com/cameron-nokes/the-30-second-guide-to-publishing-a-typescript-package-to-npm-89d93ff7bccd

Axios dependency

Hi, I get this error when I "npm audit"

axios <0.21.1
Severity: high
Server-Side Request Forgery - https://npmjs.com/advisories/1594
No fix available
node_modules/payrexx/node_modules/axios
payrexx *
Depends on vulnerable versions of axios
node_modules/payrexx

Solution: Upgrade to 0.21.1 or later

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.