Skip to content

Conversation

@michaelckelly
Copy link
Contributor

  • Add /sandbox/public_token/create endpoint

@michaelckelly michaelckelly requested a review from ntindall May 3, 2018 23:03
initialProducts: Array<string>,
options: Object,
cb: Callback<SandboxPublicTokenCreateResponse>
): Promise<SandboxPublicTokenCreateResponse>;
Copy link
Contributor

@ntindall ntindall May 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to define two flavors of this function, one for the CPS style, and one for the promisified variant

// sandboxCreatePublicToken(String, Array<sring>,Object, Function)
sandboxPublicTokenCreate(
  institutionId: string,
  initialProducts: Array<string>,
  options: Object,
  cb: Callback<SandboxPublicTokenCreateResponse>,
): void;

// sandboxCreatePublicToken(String, Array<sring>,Object)
sandboxPublicTokenCreate(
  institutionId: string,
  initialProducts: Array<string>,
  options?: Object,
): Promise<SandboxPublicTokenCreateResponse>;

when they are both defined, typescript will pick the one that compiles.

Copy link
Contributor Author

@michaelckelly michaelckelly May 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation and code @ntindall - should be ⚡️'d! :)

index.d.ts Outdated
// sandboxCreatePublicToken(String, Array<sring>,Object?, Function)
sandboxPublicTokenCreate(institutionId: string,
initialProducts: Array<string>,
options: Object,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we provide a typing for the options? we seem to be somewhat inconsistent about this... so maybe its "out of scope".

institution_id: institution_id,
initial_products: initial_products,
},
}, options, cb, true);
Copy link
Contributor

@ntindall ntindall May 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there actuallyoptions for this route?

I'm realizing the fact that _authenticatedRequest injects options onto the request in this way is somewhat confusing...

pretty sure I devised this scheme to support the variadic arguments behavior when you use the callback style... I wonder if anyone is benefitting from that...

ignore the above. this LGTM (confirmed that there are options on the route).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ntindall
Copy link
Contributor

ntindall commented May 4, 2018

looks good after we fix the typings @michaelckelly !

Copy link
Contributor

@ntindall ntindall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌱

@michaelckelly michaelckelly merged commit 333e203 into master May 7, 2018
@michaelckelly michaelckelly deleted the mk-sandbox-token branch May 7, 2018 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants