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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 2 additions & 4 deletions .copywrite.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ schema_version = 1
project {
license = "Apache-2.0"
copyright_holder = "Spectro Cloud"

# (OPTIONAL) Represents the year that the project initially began
# Default: <the year the repo was first created>
copyright_year = 2025
copyright_year = "2026"

# (OPTIONAL) A list of globs that should not have copyright or license headers .
# Supports doublestar glob patterns for more flexibility in defining which
Expand All @@ -17,5 +14,6 @@ project {
header_ignore = [
"vendor/**",
"**autogen**",
"node_modules/**"
]
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.vscode

# Directories
api/hapi
api/hapi/**
node_modules
dist/

Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
api/
palette/
openapi/openapi.yaml
37 changes: 37 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Overview

This is a repository that contains the TypeScript SDK for the Palette API. You can use this SDK to interact with the Palette API in your TypeScript projects.

## Repository Structure

- `palette/`: Contains the generated TypeScript SDK code organized by API tags.
- `client/`: Contains the custom HTTP client implementation.
- `api/`: Contains scripts for OpenAPI spec processing and code generation.
- `openapi/`: Contains the generated OpenAPI YAML specification.
- `test/`: Contains integration tests for the SDK.

## Development

- Use `make help` to see available Makefile targets.
- Run `make generate` to regenerate the SDK from the OpenAPI spec.
- Run `npm test` to execute integration tests.
- Run `npm run build` to compile TypeScript to JavaScript.

## General Guidelines

- Comments should be complete sentences and end with a period.
- Review `package.json` to understand dependencies and their versions.
- Use the bulwark_scan_project tool to scan for compromised packages before installing dependencies.
- DO NOT UPDATE THE `package-lock.json` file manually. It is automatically updated by npm.
- DO NOT UPDATE DEPENDENCIES UNLESS EXPLICITLY REQUESTED.
- DO NOT CREATE MANUAL GIT TAGS. They are automatically created by CI/CD release workflow.

## Commit Messages and Pull Requests

- Follow the [Chris Beams](https://chris.beams.io/posts/git-commit/) style for commit messages.
- Use the angular commit message format. Such as: `fix: <description>`, `feat: <description>`, `refactor: <description>`, `test: <description>`, `docs: <description>`, `chore: <description>`.

- Every pull request should answer:
- What changed?
- Why?
- Breaking changes?
14 changes: 11 additions & 3 deletions api/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@
set -e

# Fetch the latest hapi spec
if [ -d "hapi" ]; then
(cd hapi && git pull origin master --ff)
else
if [ ! -d "hapi" ]; then
git clone [email protected]:spectrocloud/hapi.git || git clone https://github.com/spectrocloud/hapi
fi
(
cd hapi
# Fetch all tags from origin, forcing update of any moved tags
git fetch origin --tags --force
# Get the latest tag starting with 'v' sorted by version
LATEST_TAG=$(git tag -l 'v*' --sort=-v:refname | head -n 1)
if [ -z "$LATEST_TAG" ]; then
echo "Error: No tags starting with 'v' found"
exit 1
fi
echo "Checking out tag: $LATEST_TAG"
git checkout --force "$LATEST_TAG"
bash generate_hubble_spec.sh
go run api/main.go
cp gen/docs-spec/palette-apis-spec.json ..
Expand Down
Loading