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
37 changes: 36 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,40 @@ jobs:
- name: Run type check
run: pnpm run typecheck

# No CI job used to run `pnpm run generate`, so when TypeScript 7 broke the
# openapi-ts codegen (2026-08-27) CI stayed green while the Generate SDK
# workflow failed 10 dispatches in a row and the published SDK silently froze
# at API 1.109.0. This job regenerates from the committed spec and fails on
# any drift.
codegen:
name: Codegen
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v5

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Regenerate client from the committed spec
run: pnpm run generate

- name: Fail on generated-client drift
run: |
if ! git diff --exit-code -- src/client; then
echo "::error::src/client is out of sync with public-openapi.json. Run 'pnpm run generate' and commit the result."
exit 1
fi

Comment thread
cursor[bot] marked this conversation as resolved.
test:
name: Test (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
Expand Down Expand Up @@ -182,14 +216,15 @@ jobs:
# Summary job that other jobs can depend on
ci-success:
name: CI Success
needs: [lint, typecheck, test, test-bun, test-deno, build]
needs: [lint, typecheck, codegen, test, test-bun, test-deno, build]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check all jobs passed
run: |
if [[ "${{ needs.lint.result }}" != "success" ]] || \
[[ "${{ needs.typecheck.result }}" != "success" ]] || \
[[ "${{ needs.codegen.result }}" != "success" ]] || \
[[ "${{ needs.test.result }}" != "success" ]] || \
[[ "${{ needs.test-bun.result }}" != "success" ]] || \
[[ "${{ needs.test-deno.result }}" != "success" ]] || \
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ coverage/
.direnv/
result


# Git worktrees
.worktrees/
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ coverage/
# Nix
flake.lock


# Git worktrees
.worktrees/
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ The SDK provides several services to interact with different parts of the Abby A
- `abby.opportunity`: CRM and opportunities management.
- `abby.asset`: Manage business assets.
- `abby.advance`: Manage advance payments.
- `abby.customerPortal`: Customer portal payments and billing themes.

### Basic Example

Expand Down Expand Up @@ -360,16 +361,15 @@ The client automatically includes your API key and SDK headers in all requests.

## Validation

The SDK includes built-in [Zod](https://zod.dev) validation for all API requests and responses, ensuring type safety at runtime.
The SDK includes built-in [Zod](https://zod.dev) validation for API requests, catching malformed payloads before they leave your process.

### Automatic Validation

All SDK methods automatically validate:
All SDK methods automatically validate **request data**: parameters, query strings, and request bodies are checked before sending.

- **Request data**: Parameters, query strings, and request bodies are validated before sending
- **Response data**: API responses are validated to ensure they match the expected schema
**Responses are not validated.** Response schemas are generated and exported (see below), but the SDK does not run them — a spec/API mismatch would otherwise turn a successful call into a thrown error. Types on responses remain compile-time only; parse with the exported `z*Dto` schemas yourself if you need a runtime guarantee.

If validation fails, a `ZodError` is thrown with detailed information about what went wrong:
If request validation fails, a `ZodError` is thrown with detailed information about what went wrong:

```typescript
import Abby from '@abby-inc/node';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"prettier": "^3.9.6",
"rollup": "^4.63.0",
"rollup-plugin-esbuild": "6.2.1",
"typescript": "^7.0.2",
"typescript": "^5.9.3",
"vitest": "^4.1.11"
},
"engines": {
Expand Down
Loading
Loading