Skip to content

Conversation

@kleinjm
Copy link
Contributor

@kleinjm kleinjm commented Aug 11, 2021

What

  • Generating the SDK after changes to the swagger.json file
  • Adds ability to query orders index with metadata

Why

Clients want the ability to query orders via metadata.

SDK Release Checklist

  • Have you added an integration test for the changes?
  • Have you built the package locally and made queries against it successfully?
  • Did you update the changelog?
  • Did you bump the package version?
  • For breaking changes, did you plan for the release of the new SDK versions and deploy the API to production?

@kleinjm kleinjm requested a review from pcothenet August 11, 2021 23:13
@kleinjm kleinjm removed the request for review from pcothenet August 13, 2021 16:01
strategy:
matrix:
node: ['10', '12', '14', '16']
max-parallel: 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this will slow down CI but reduce the amount of "collisions" we may see due to the same tests running on the same endpoints in parallel. Considering we don't run CI on these projects very frequently, I feel the stability is worth the extra 2 minutes until we change up the test suite to not hit the real API

package.json Outdated
"build": "babel src -d dist",
"prepack": "npm run build",
"test": "mocha"
"test": "mocha --timeout 10000"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

some specs run for longer than the default timeout so this gives us room for error

Copy link
Contributor

Choose a reason for hiding this comment

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

This is redundant with the .mocharc.yml setting, I would remove from here.


import superagent from 'superagent';
import querystring from 'querystring';
import querystring from 'query-string';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

there are 2 changes in this file that fix support for deep objects. This is the first and it swaps out these two very similar libraries because the original one did not encode the urls correctly

Copy link
Contributor

Choose a reason for hiding this comment

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

This answers my other question, thanks!

Comment on lines +63 to +64
if (param instanceof Object) {
return param;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

object query params will be encoded correctly by the library so they must be returned as is. Otherwise toString is called on them and we get "Object"

@kleinjm kleinjm requested a review from pcothenet August 17, 2021 19:25
Copy link
Contributor

@pcothenet pcothenet left a comment

Choose a reason for hiding this comment

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

Minor change for mocha settings. The rest looks great!


### Added

- Add support for querying Orders by `metadata`
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add the new parameter for ETH here too?

mocha.opts Outdated
@@ -0,0 +1 @@
--timeout 10000
Copy link
Contributor

@pcothenet pcothenet Aug 17, 2021

Choose a reason for hiding this comment

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

There is already a .mocharc.yml file in the repo (mocha.opts is deprecated). Let's move that there!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

something kept generating this file but I'll remove it and use the rc

package.json Outdated
"build": "babel src -d dist",
"prepack": "npm run build",
"test": "mocha"
"test": "mocha --timeout 10000"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is redundant with the .mocharc.yml setting, I would remove from here.


import superagent from 'superagent';
import querystring from 'querystring';
import querystring from 'query-string';
Copy link
Contributor

Choose a reason for hiding this comment

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

This answers my other question, thanks!

@kleinjm kleinjm requested a review from pcothenet August 17, 2021 23:50
@kleinjm kleinjm merged commit 7d423d3 into main Aug 18, 2021
@kleinjm kleinjm deleted the jklein/metadata_query branch August 18, 2021 17:16
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