@W-18741334: remove hard coded api names for download#200
@W-18741334: remove hard coded api names for download#200unandyala merged 6 commits intofeature/oasfrom
Conversation
unandyala
commented
Jun 11, 2025
- Removes hard-coded API names. Instead it uses the search query to search exchange and download the correct apis
- Ensures latest versions are downloaded from multiple version groups
joeluong-sfcc
left a comment
There was a problem hiding this comment.
LGTM besides these minor comments
| * SPDX-License-Identifier: BSD-3-Clause | ||
| * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
| */ | ||
| export const PRIMITIVE_DATA_TYPE_MAP = { |
There was a problem hiding this comment.
Interesting that this was never used anywhere, glad we're removing it
There was a problem hiding this comment.
I didn't find the usage anywhere
| downloadLatestApis(name, PRODUCTION_API_PATH).catch(console.error); | ||
| }); | ||
| // eslint-disable-next-line no-console | ||
|
|
There was a problem hiding this comment.
NIT
| // eslint-disable-next-line no-console | ||
|
|
||
| downloadLatestApis( | ||
| 'category:Visibility = "External" category:"SDK Type" = "Commerce" category:"SDK Type" = "Isomorphic"', |
There was a problem hiding this comment.
Is there a reason why we have SDK type as both Commerce and Isomorphic? If we just query for Isomorphic will it return all the same APIs?
wondering if we should remove Commerce SDK type so its not confusing
There was a problem hiding this comment.
just Isomorphic is enough. I remember Kay mentioning to use both. This is kind of ensuring we don't download non-commerce specs that are tagged as Isomorphic (as this is a generic term)
There was a problem hiding this comment.
Dumb question, but how does this query guarantee that we only pull in the oas specs and not the raml specs?
| rootPath: string | ||
| ): Promise<void> { | ||
| const matchedApis = await download.search(`"${name}"`); | ||
| const matchedApis = await download.search(searchQuery, undefined, true); |
There was a problem hiding this comment.
Can we add a small comment on why we're passing undefined to this search function? Might not be clear to someone who's unfamiliar with these changes
joeluong-sfcc
left a comment
There was a problem hiding this comment.
I don't see the small comment that I requested for
const matchedApis = await download.search(searchQuery, undefined, true);
but otherwise LGTM
vcua-mobify
left a comment
There was a problem hiding this comment.
Just had a question on how the query guarantees we only pull down the oas specs / not pull down the raml specs but otherwise it's LGTM
| // eslint-disable-next-line no-console | ||
|
|
||
| downloadLatestApis( | ||
| 'category:Visibility = "External" category:"SDK Type" = "Commerce" category:"SDK Type" = "Isomorphic"', |
There was a problem hiding this comment.
Dumb question, but how does this query guarantee that we only pull in the oas specs and not the raml specs?