@monarkmarkets/api-client 1.0.5 → 1.1.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -5
- package/update-version.js +31 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monarkmarkets/api-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.92",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -17,13 +17,14 @@
|
|
|
17
17
|
"url": "git+https://github.com/Monark-Markets/ui-components.git"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"build": "tsc",
|
|
21
|
-
"
|
|
22
|
-
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"update-version": "node update-version.js",
|
|
22
|
+
"nswag": "npm run update-version && nswag openapi2tsclient /input:./swagger.json /output:./src/Client.ts"
|
|
23
|
+
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"typescript": "^5.7.3"
|
|
25
26
|
},
|
|
26
|
-
"dependencies": {
|
|
27
|
+
"dependencies": {
|
|
27
28
|
"nswag": "14.2.0"
|
|
28
29
|
}
|
|
29
30
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// update-version.js
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
|
|
5
|
+
// Read swagger.json
|
|
6
|
+
const swaggerContent = fs.readFileSync('./swagger.json', 'utf8');
|
|
7
|
+
const swaggerData = JSON.parse(swaggerContent);
|
|
8
|
+
|
|
9
|
+
// Get version from swagger.json
|
|
10
|
+
const swaggerVersion = swaggerData.info.version;
|
|
11
|
+
|
|
12
|
+
// Read package.json
|
|
13
|
+
const packageContent = fs.readFileSync('./package.json', 'utf8');
|
|
14
|
+
const packageData = JSON.parse(packageContent);
|
|
15
|
+
|
|
16
|
+
console.log(`Updating package version from ${packageData.version} to ${swaggerVersion}`);
|
|
17
|
+
|
|
18
|
+
// Update version in package.json
|
|
19
|
+
packageData.version = swaggerVersion;
|
|
20
|
+
|
|
21
|
+
// Write updated package.json
|
|
22
|
+
fs.writeFileSync('./package.json', JSON.stringify(packageData, null, 2));
|
|
23
|
+
|
|
24
|
+
// Update package-lock.json by running npm install
|
|
25
|
+
try {
|
|
26
|
+
console.log('Updating package-lock.json...');
|
|
27
|
+
execSync('npm install --package-lock-only');
|
|
28
|
+
console.log('Package-lock.json updated successfully');
|
|
29
|
+
} catch (error) {
|
|
30
|
+
console.error('Error updating package-lock.json:', error);
|
|
31
|
+
}
|