-
Notifications
You must be signed in to change notification settings - Fork 51
Smoke Test SDK (@W-18482922@) #428
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
Changes from all commits
e2ac356
c3f08c8
a360348
a80b8e7
86c3b4c
386682c
18a47be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| /* | ||
| * Copyright (c) 2025, salesforce.com, inc. | ||
| * All rights reserved. | ||
| * 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 | ||
| */ | ||
|
|
||
| import path from "path"; | ||
| import fs from "fs-extra"; | ||
| import { PRODUCTION_API_PATH } from "./lib/config"; | ||
|
|
||
| /** | ||
| * Recursively removes all files ending in '-internal.yaml' from a directory and its subdirectories | ||
| * @param directoryPath - The path to the directory to process | ||
| */ | ||
| export function removeInternalOas(directoryPath: string): void { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curious, do we need to run this more than once? Or is this just a helper function for cleaning up the -internal files current state of the repo?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll have to run it everytime we pull down the APIs as the internal OAS file will always be a part of anypoint exchange asset (at least for now) |
||
| if (!fs.existsSync(directoryPath)) { | ||
| console.warn(`Directory does not exist: ${directoryPath}`); | ||
| return; | ||
| } | ||
|
|
||
| const items = fs.readdirSync(directoryPath); | ||
|
|
||
| items.forEach((item) => { | ||
| const fullPath = path.join(directoryPath, item); | ||
| const stat = fs.statSync(fullPath); | ||
|
|
||
| if (stat.isDirectory()) { | ||
| // Recursively process subdirectories | ||
| removeInternalOas(fullPath); | ||
| } else if (stat.isFile() && item.endsWith("-internal.yaml")) { | ||
| // Remove internal files | ||
| fs.removeSync(fullPath); | ||
| console.log(`Removed internal file: ${fullPath}`); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| // Run the function if this file is executed directly | ||
| if (require.main === module) { | ||
| console.log(`Removing internal OAS files from: ${PRODUCTION_API_PATH}`); | ||
| removeInternalOas(PRODUCTION_API_PATH); | ||
| console.log("Internal OAS files removal completed."); | ||
| } | ||
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.
Based on this, I assume we've decided to name shopper baskets V1 as
ShopperBasketsand notShopperBasketsV1?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.
Yes that's correct