@hautechai/sdk 0.3.32 → 0.3.33

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.
@@ -15,8 +15,6 @@ jobs:
15
15
 
16
16
  - name: Install pnpm
17
17
  uses: pnpm/action-setup@v4
18
- with:
19
- version: 9
20
18
 
21
19
  - name: Use Node LTS
22
20
  uses: actions/setup-node@v4
@@ -16,8 +16,7 @@ jobs:
16
16
 
17
17
  - name: Install pnpm
18
18
  uses: pnpm/action-setup@v4
19
- with:
20
- version: 9
19
+
21
20
 
22
21
  - name: Use Node LTS
23
22
  uses: actions/setup-node@v4
package/dist/sdk/index.js CHANGED
@@ -36,7 +36,10 @@ export const createSDK = (options) => {
36
36
  const operationsListener = new OperationsListener({
37
37
  ws: (options.useWebsocket ?? true)
38
38
  ? {
39
- endpoint: replaceProtocol(getBaseUrl(options), 'wss'),
39
+ endpoint: (() => {
40
+ const baseUrl = getBaseUrl(options);
41
+ return replaceProtocol(baseUrl, baseUrl.startsWith('https') ? 'wss' : 'ws');
42
+ })(),
40
43
  token: authToken,
41
44
  }
42
45
  : null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hautechai/sdk",
3
- "version": "0.3.32",
3
+ "version": "0.3.33",
4
4
  "license": "MIT",
5
5
  "keywords": [],
6
6
  "repository": {
@@ -1,6 +1,19 @@
1
1
  #!/bin/bash
2
2
 
3
- API_URL="https://api.hautech.ai"
3
+ # This script generates TypeScript code from the Hautech API
4
+ #
5
+ # Usage:
6
+ # ./scripts/generate.sh [API_URL]
7
+ # npm run generate [-- API_URL]
8
+ #
9
+ # Examples:
10
+ # ./scripts/generate.sh # Uses default API URL
11
+ # ./scripts/generate.sh https://custom-api.com # Uses custom API URL
12
+ # npm run generate # Uses default API URL
13
+ # npm run generate -- https://custom-api.com # Uses custom API URL
14
+ #
15
+ # Use the first argument as API_URL if provided, otherwise use the default
16
+ API_URL=${1:-"https://api.hautech.ai"}
4
17
 
5
18
  ./node_modules/.bin/openapi-generator-cli generate -i $API_URL/swagger.json -g typescript-axios -o ./src/autogenerated
6
19
  node ./scripts/generate-permissions.js $API_URL/v1/permissions/available ./src/autogenerated/permissions.ts