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
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pnpm clean # rm dist in all packages
# Per-package (run from repo root)
pnpm --filter @ambosstech/core run build
pnpm --filter @ambosstech/payments run codegen # regenerate GraphQL SDK from schema
pnpm --filter @ambosstech/core run refresh-schema # pull latest schema from rails.amboss.tech
pnpm --filter @ambosstech/core run refresh-schema # pull latest schema from app.amboss.tech
```

## Architecture
Expand All @@ -38,7 +38,7 @@ Shared HTTP/GraphQL transport. Not consumed directly by end users.

- `AmbossClient` — base class; wraps `graphql-request`. Accepts
`{ apiKey?, serviceApiKey?, baseUrl?, fetch?, timeoutMs? }`.
Default `baseUrl`: `https://rails.amboss.tech/graphql`.
Default `baseUrl`: `https://app.amboss.tech/graphql`.
- Two auth headers: `apiKey` is sent as `Authorization: Bearer ...`
(cross-product key); `serviceApiKey` is sent as `x-api-key`
(scoped payments key). Payments resources require `serviceApiKey`.
Expand Down
2 changes: 1 addition & 1 deletion docs/INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ All options:
new Payments({
serviceApiKey?: string, // omit for webhook-only usage
webhookSecret?: string, // omit if you only call the API
baseUrl?: string, // default: https://rails.amboss.tech/graphql
baseUrl?: string, // default: https://app.amboss.tech/graphql
fetch?: typeof fetch, // override for tests / non-Node runtimes
timeoutMs?: number, // default: 30000
send?: Array<{ walletId, password?, teamId? }>, // pre-warm sending — see Step 4
Expand Down
2 changes: 1 addition & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The pinned GraphQL schema lives at [`schema/rails.graphql`](./schema/rails.graph
pnpm --filter @ambosstech/core run refresh-schema
```

The endpoint defaults to `https://rails.amboss.tech/graphql`. Override with `AMBOSS_SCHEMA_URL`.
The endpoint defaults to `https://app.amboss.tech/graphql`. Override with `AMBOSS_SCHEMA_URL`.

## License

Expand Down
2 changes: 1 addition & 1 deletion packages/core/scripts/refresh-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
type IntrospectionQuery,
} from 'graphql';

const SCHEMA_ENDPOINT = process.env.AMBOSS_SCHEMA_URL ?? 'https://rails.amboss.tech/graphql';
const SCHEMA_ENDPOINT = process.env.AMBOSS_SCHEMA_URL ?? 'https://app.amboss.tech/graphql';
const OUTPUT_PATH = resolve(
dirname(fileURLToPath(import.meta.url)),
'..',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ConfigError } from './errors.js';
describe('AmbossClient', () => {
it('defaults baseUrl to production endpoint', () => {
const config = AmbossClient.resolveConfig({});
assert.equal(config.baseUrl, 'https://rails.amboss.tech/graphql');
assert.equal(config.baseUrl, 'https://app.amboss.tech/graphql');
});

it('respects baseUrl override', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ClientError, GraphQLClient, type RequestDocument, type Variables } from
import { ApiError, ConfigError, NetworkError } from './errors.js';
import type { ClientConfig, FetchLike, ResolvedClientConfig } from './types.js';

const DEFAULT_BASE_URL = 'https://rails.amboss.tech/graphql';
const DEFAULT_BASE_URL = 'https://app.amboss.tech/graphql';
const DEFAULT_TIMEOUT_MS = 30_000;
const SDK_VERSION = '0.4.0'; // x-release-please-version

Expand Down
2 changes: 1 addition & 1 deletion packages/payments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const wallets = await payments.wallets.list({ environmentId: envs[0].id });
new Payments({
serviceApiKey?: string, // scoped payments key (sent as x-api-key); omit for webhook-only use
webhookSecret?: string, // omit if you only call the API
baseUrl?: string, // default: https://rails.amboss.tech/graphql
baseUrl?: string, // default: https://app.amboss.tech/graphql
fetch?: typeof fetch, // override for tests / non-Node runtimes
timeoutMs?: number, // default: 30000
send?: Array<{ walletId: string, password?: string, teamId?: string }>, // pre-warm — see Sending
Expand Down
2 changes: 1 addition & 1 deletion packages/payments/examples/receive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function required(name: string): string {

async function main(): Promise<void> {
const serviceApiKey = required('AMBOSS_API_KEY'); // the scoped payments service key (amb_live...)
const baseUrl = process.env.AMBOSS_BASE_URL; // optional; defaults to https://rails.amboss.tech/graphql
const baseUrl = process.env.AMBOSS_BASE_URL; // optional; defaults to https://app.amboss.tech/graphql

const payments = new Payments({ serviceApiKey, ...(baseUrl ? { baseUrl } : {}) });

Expand Down
2 changes: 1 addition & 1 deletion packages/payments/examples/send.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function resolveDestination(): SendDestination | null {

async function main(): Promise<void> {
const serviceApiKey = required('AMBOSS_API_KEY'); // the scoped payments service key (amb_live...)
const baseUrl = process.env.AMBOSS_BASE_URL; // optional; defaults to https://rails.amboss.tech/graphql
const baseUrl = process.env.AMBOSS_BASE_URL; // optional; defaults to https://app.amboss.tech/graphql

const payments = new Payments({ serviceApiKey, ...(baseUrl ? { baseUrl } : {}) });

Expand Down
Loading