-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CMCI query parameters to SDK getResource #171
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 😋
Great addition to the SDK 🙏
/** | ||
* Query parameters to be used in the HTTP request | ||
*/ | ||
queryParams?: IResourceQueryParams; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of a query parameters object.
Maybe by V4 we could move criteria
and parameter
to that object 😋
if (options != null) { | ||
if (options.criteria != null && options.criteria.length > 0) { | ||
const addParentheses = options.criteria.charAt(0) !== '('; | ||
if (options && options.criteria) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not required to change this, but if you want to save some typing 😋
if (options && options.criteria) { | |
if (options?.criteria) { |
This may apply to other if conditions 🙏
delimiter = "&"; | ||
} | ||
|
||
if (options && options.queryParams && options.queryParams.nodiscard) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there could be some savings here too 😋
if (options && options.queryParams && options.queryParams.nodiscard) { | |
if (options?.queryParams?.nodiscard) { |
Signed-off-by: Andrew Twydell <[email protected]>
Signed-off-by: Andrew Twydell <[email protected]>
Signed-off-by: Andrew Twydell <[email protected]>
Signed-off-by: Andrew Twydell <[email protected]>
f17635b
to
96512f1
Compare
|
||
if (options && options.queryParams && options.queryParams.overrideWarningCount) { | ||
cmciResource += `${delimiter}${CicsCmciConstants.OVERRIDE_WARNING_COUNT}`; | ||
delimiter = "&"; |
Check warning
Code scanning / CodeQL
Useless assignment to local variable Warning
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #171 +/- ##
==========================================
+ Coverage 93.49% 93.62% +0.12%
==========================================
Files 74 74
Lines 738 753 +15
Branches 37 40 +3
==========================================
+ Hits 690 705 +15
Misses 48 48 ☔ View full report in Codecov by Sentry. |
Labeled as |
What It Does
Allows a user to specify query parameters to be added to the CMCI query URI (SUMMONLY, NODISCARD, OVERRIDEWARNINGCOUNT) by adding an optional addition to the supplied params.
This will allow the VSCE to retrieve a cache token from CMCI which will enable pagination on large result sets.
Review Checklist
I certify that I have: