Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/actions/vault-credentials/action.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

name: Vault Credentials

inputs:
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true


jobs:
run-ci:
# runs-on: ubuntu-latest
Expand All @@ -34,7 +33,7 @@ jobs:
uses: spectrocloud/palette-sdk-typescript/.github/actions/vault-credentials@main

- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6.0.1
with:
token: ${{ steps.import-secrets.outputs.VAULT_GITHUB_TOKEN }}

Expand All @@ -47,14 +46,33 @@ jobs:
- name: Setup Copywrite
uses: hashicorp/[email protected]

- name: Checkout HAPI Repository
uses: actions/[email protected]
with:
repository: spectrocloud/hapi
path: api/hapi
fetch-depth: "0"
token: ${{ steps.import-secrets.outputs.VAULT_GITHUB_TOKEN }}

- name: Install dependencies
run: make install-dependencies

- name: Install Go Swagger
run: |
dir=$(mktemp -d)
download_url=$(curl -s https://api.github.com/repos/go-swagger/go-swagger/releases/latest | \
jq -r '.assets[] | select(.name | contains("'"$(uname | tr '[:upper:]' '[:lower:]')"'_amd64")) | .browser_download_url')
curl -o $dir/swagger -L'#' "$download_url"
sudo install $dir/swagger /usr/local/bin

- name: Ensure Reviewable
run: make check-diff

- name: Generate
run: make generate

- name: Test
env:
# Expires 2026-12-31. Tenant is https://palette-ai-rsch.console.spectrocloud.com/
PALETTE_API_KEY: ${{ secrets.PALETTE_API_KEY }}
run: make test
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ yarn-error.log*
.env.test.local
.env.production.local

# Credentials
.netrc

# OS generated files
.DS_Store
.DS_Store?
Expand All @@ -37,4 +40,5 @@ yarn-error.log*
.Trashes
ehthumbs.db
Thumbs.db
.openapi-generator/
.openapi-generator/
tmp/
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ license:

clean: ## Clean generated files except httpClient folder
rm -rf palette/
rm rf api/hapi
rm -f api/palette-apis-spec-tagged.json
rm -rf dist/
@$(OK) "Clean complete"
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import {
type SpectroClustersMetadata,
} from "palette-sdk-typescript";


// Configure authentication
const config = {
headers: {
Expand All @@ -61,7 +60,7 @@ const config = {
},
// Configure custom base URL (optional)
// By default, the SDK uses https://api.spectrocloud.com
baseUrl: 'https://your-palette-host.com'
baseUrl: "https://your-palette-host.com",
};

// Get all clusters
Expand All @@ -80,6 +79,7 @@ If a project UID is not specified, then the Palette API will use the tenant scop
### Base URL Configuration

By default, the PaletteSDK targets `https://api.spectrocloud.com`. If you have a different Palette instance, such as a self-hosted Palette instance, you can configure the base URL.

```typescript
const config = {
headers: {
Expand All @@ -88,14 +88,15 @@ const config = {
ProjectUID: process.env.PROJECT_UID,
},
// Set custom base URL
baseUrl: 'https://your-palette-host.com'
baseUrl: "https://your-palette-host.com",
};

const response: SpectroClustersMetadata = await spectroClustersMetadataGet(
{},
config
);
```

The SDK will now use your custom URL(`https://your-palette-host.com`) for all API calls.

## Contributing
Expand Down Expand Up @@ -123,7 +124,7 @@ This project is licensed under the Apache License 2.0. See the [LICENSE](LICENSE

For issues and questions:

- **SDK Issues**: Open an issue on GitHub
- **SDK Issues**: Open an issue on GitHub.
- **API Documentation**: Visit the [Palette API Documentation](https://docs.spectrocloud.com/api/)
- **Palette Support**: Contact Spectro Cloud support

Expand Down
7 changes: 5 additions & 2 deletions api/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
set -e

# Fetch the latest hapi spec
rm -rf hapi && (git clone [email protected]:spectrocloud/hapi.git || git clone https://github.com/spectrocloud/hapi)
if [ -d "hapi" ]; then
(cd hapi && git pull origin master --ff)
else
git clone [email protected]:spectrocloud/hapi.git || git clone https://github.com/spectrocloud/hapi
fi
(
cd hapi
bash generate_hubble_spec.sh
go run api/main.go
cp gen/docs-spec/palette-apis-spec.json ..
rm -rf hapi
)
Loading