Skip to content

Commit 6269d67

Browse files
committed
fix export
1 parent f469699 commit 6269d67

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

packages/client/fix-exports.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
// Path to the autogenerated file
5+
const filePath = path.join(__dirname, './src/models/data-contracts.ts');
6+
7+
// Read the file content
8+
fs.readFile(filePath, 'utf8', (err, data) => {
9+
if (err) {
10+
console.error('Error reading the file:', err);
11+
return;
12+
}
13+
14+
// Find the line with the type definition and add "export"
15+
const updatedContent = data.replace(/type UtilRequiredKeys/g, 'export type UtilRequiredKeys');
16+
17+
// Write the updated content back to the file
18+
fs.writeFile(filePath, updatedContent, 'utf8', (err) => {
19+
if (err) {
20+
console.error('Error writing the file:', err);
21+
return;
22+
}
23+
console.log('File updated successfully with export');
24+
});
25+
});

packages/client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
"build:types": "tsc -p ./tsconfig.json --outDir build --declaration true && api-extractor run",
3434
"clean": "rimraf ./build ./dist ./docs",
3535
"gen-api": "swagger-typescript-api -p https://api.relewise.com/public/swagger.json -o src/models --modular --no-client --enum-names-as-values",
36-
"gen-api-dev": "swagger-typescript-api -p swagger.json -o src/models --modular --no-client --enum-names-as-values",
37-
"publish": "npm run gen-api && npm run build && npm run build:types"
36+
"gen-api-dev": "swagger-typescript-api -p swagger.json -o src/models --modular --no-client --enum-names-as-values --custom-config ./swagger-custom-config.j",
37+
"publish": "npm run gen-api && node fix-exports.js && npm run build && npm run build:types"
3838
},
3939
"devDependencies": {
4040
"@microsoft/api-extractor": "^7.47.9",

packages/client/src/models/data-contracts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* ---------------------------------------------------------------
1010
*/
1111

12-
type UtilRequiredKeys<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
12+
export type UtilRequiredKeys<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
1313

1414
export type AbandonedCartTriggerConfiguration = AbandonedCartTriggerResultTriggerConfiguration & {
1515
cartName?: string | null;

0 commit comments

Comments
 (0)