-
Notifications
You must be signed in to change notification settings - Fork 588
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(client-workspaces-thin-client): add compatibility alias (#5555)
- Loading branch information
Showing
5 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
scripts/generate-clients/customizations/workspaces-thin-client.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
const root = path.join(__dirname, "..", "..", ".."); | ||
|
||
const indexTs = path.join(root, "clients", "client-workspaces-thin-client", "src", "index.ts"); | ||
|
||
/** | ||
* Exports aliases from the index of WorkSpacesThinClient. | ||
*/ | ||
module.exports = function () { | ||
const indexContents = fs.readFileSync(indexTs, "utf-8"); | ||
if (!indexContents.includes(`backwards compatible aliases`)) | ||
fs.writeFileSync( | ||
indexTs, | ||
indexContents + | ||
` | ||
import { WorkSpacesThinClient } from "./WorkSpacesThinClient"; | ||
/** | ||
* @deprecated use {WorkSpacesThinClient} (renamed) instead. | ||
* The aggregated client is called WorkSpacesThinClient, | ||
* and the barebones client is called WorkSpacesThinClientClient. | ||
* | ||
* Due to some code generation issues with the word "Client" in the service name, | ||
* we are maintaining a few backwards compatible aliases here. | ||
*/ | ||
export const WorkSpacesThin = WorkSpacesThinClient; | ||
export type { WorkSpacesThinClientPaginationConfiguration as WorkSpacesThinPaginationConfiguration } from "./pagination/Interfaces"; | ||
` | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters