Code Monkey home page Code Monkey logo

lago-nodejs-client's People

Contributors

ansmonjol avatar huzaifaali14 avatar jdenquin avatar lovrocolic avatar rsempe avatar vincent-pochet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lago-nodejs-client's Issues

[FEAT]: Typescript Support

As we are using this package in our typescript project, it would be nice to have types defined so that we don't have to check if the shape of the objects change with each release.

[BUG]: Getting undefined result when calling findBillableMetric

When calling get request methods of SDK like findBillableMetric or findPlan this line is executed , which returns the JSON Object {"billable_metric":{"lago_id":"fcb0e1b8-acd7-4c1a-9b39-2bd63ef6f6d8","name":"User Start","code":"star","description":"","aggregation_type":"count_agg","created_at":"2022-11-11T13:17:09Z","field_name":null,"group":{}}} where as the caller expects the response to be a Javascript object and when it tries to read property from the object res.billable_metric

.then(res => response = res.billable_metric);
it returns undefined.

[BUG]: Package.json exports for billing config incorrect

Describe the bug
The export for billing_configuration is pointing to a non existent file.

Additional context
I believe you meant to point to lib/model/customer_billing_configuration instead of lib/model/billing_configuration

TypeScript support

How about using TypeScript to write source code?

I think there is no reason not to use TypeScript in this era.

Type definitions can be generated without much effort using json2ts.

Below is the result of generating type definitions from json example in the lago api reference

export interface Charge {
  lago_id: string
  charge_model: string
}

export interface Charge {
  lago_id: string
  charge_model: string
}

export interface BillableMetric {
  lago_id: string
  name: string
  code: string
  aggregation_type: string
}

export interface ChargesUsage {
  units: string
  amount_cents: number
  amount_currency: string
  charge: Charge
  billable_metric: BillableMetric
  groups: Record<string, any>
}

export interface CustomerUsage {
  from_datetime: Date
  to_datetime: Date
  issuing_date: string
  amount_cents: number
  amount_currency: string
  total_amount_cents: number
  total_amount_currency: string
  vat_amount_cents: number
  vat_amount_currency: string
  from_date: string
  to_date: string
  charges_usage: ChargesUsage[]
}

export interface CustomerUsageResult {
  customer_usage: CustomerUsage
}

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.