node-strava / node-strava-v3

API wrapper for Strava's v3 API, in Node
MIT License
356 stars 109 forks source link

Type definition issue with pushSubscription. #88

Closed jreeter closed 4 years ago

jreeter commented 4 years ago

The type definition seems to export this interface:

export interface PushSubscriptionRoutes {
    list(args: any, done?: Callback): Promise<any>;
    create(args: any, done?: Callback): Promise<any>;
    delete(args: any, done?: Callback): Promise<any>;
}

However the pushSubscriptions.list implementation only takes a done arg:

pushSubscriptions.prototype.list = function (done) {
  var qs = this.client.getQS(['client_secret', 'client_id'], {
    client_secret: authenticator.getClientSecret(),
    client_id: authenticator.getClientId()
  })
  return this.client._requestHelper({
    headers: { Authorization: null },
    baseUrl: this.baseUrl,
    url: 'push_subscriptions?' + qs
  }, done)
}

The result is code that can't be compiled.

jreeter commented 4 years ago

PR for issue: https://github.com/UnbounDev/node-strava-v3/pull/89