chore: release sdks

This commit is contained in:
Abhishek Kumar 2026-05-31 17:13:42 +05:30
parent fcb7004c7a
commit 13b30dee9e
8 changed files with 70 additions and 17 deletions

View file

@ -81,8 +81,29 @@ ts.write_text(
re.sub(r'"version": "[^"]+"', f'"version": "{version}"', ts.read_text(), count=1)
)
ts_lock = pathlib.Path("sdk/typescript/package-lock.json")
if ts_lock.exists():
lock_text = ts_lock.read_text()
lock_text = re.sub(
r'^ "version": "[^"]+"',
f' "version": "{version}"',
lock_text,
count=1,
flags=re.M,
)
lock_text = re.sub(
r'^( "version": ")[^"]+(")',
rf'\g<1>{version}\2',
lock_text,
count=1,
flags=re.M,
)
ts_lock.write_text(lock_text)
print(f" pyproject.toml → {version}")
print(f" package.json → {version}")
if ts_lock.exists():
print(f" package-lock.json → {version}")
PY
echo "→ Building Python wheel + sdist..."

View file

@ -1,6 +1,6 @@
[project]
name = "dograh-sdk"
version = "0.1.6"
version = "0.1.7"
description = "Typed builder for Dograh voice-AI workflows"
readme = "README.md"
requires-python = ">=3.10"

View file

@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: dograh-openapi-EZT8BU.json
# timestamp: 2026-05-31T10:54:36+00:00
# filename: dograh-openapi-DuffQq.json
# timestamp: 2026-05-31T11:41:57+00:00
from __future__ import annotations

View file

@ -1,12 +1,12 @@
{
"name": "@dograh/sdk",
"version": "0.1.3",
"version": "0.1.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@dograh/sdk",
"version": "0.1.3",
"version": "0.1.7",
"license": "BSD-2-Clause",
"devDependencies": {
"openapi-typescript": "^7.13.0",

View file

@ -1,6 +1,6 @@
{
"name": "@dograh/sdk",
"version": "0.1.6",
"version": "0.1.7",
"description": "Typed builder for Dograh voice-AI workflows",
"license": "BSD-2-Clause",
"author": "Zansat Technologies Private Limited",

View file

@ -16,19 +16,48 @@ import type {
import { ApiError, SpecMismatchError } from "./errors.js";
import { Workflow, type SpecProvider } from "./workflow.js";
type RuntimeProcess = {
env?: Record<string, string | undefined>;
};
export interface DograhFetchInit {
method?: string;
headers?: Record<string, string>;
body?: string;
signal?: unknown;
}
export interface DograhFetchResponse {
ok: boolean;
status: number;
statusText: string;
json(): Promise<unknown>;
text(): Promise<string>;
}
export type DograhFetch = (
url: string,
init?: DograhFetchInit,
) => Promise<DograhFetchResponse>;
function getRuntimeEnv(name: string): string | undefined {
const runtime = globalThis as typeof globalThis & { process?: RuntimeProcess };
return runtime.process?.env?.[name];
}
export interface DograhClientOptions {
baseUrl?: string;
apiKey?: string;
/** Request timeout in ms. */
timeoutMs?: number;
/** Optional fetch override for tests / custom transports. */
fetch?: typeof globalThis.fetch;
fetch?: DograhFetch;
}
export class DograhClient extends _GeneratedClient implements SpecProvider {
readonly baseUrl: string;
readonly apiKey: string | undefined;
private readonly fetchImpl: typeof globalThis.fetch;
private readonly fetchImpl: DograhFetch;
private readonly timeoutMs: number;
private readonly headers: Record<string, string>;
private readonly specCache = new Map<string, NodeSpec>();
@ -38,13 +67,11 @@ export class DograhClient extends _GeneratedClient implements SpecProvider {
super();
const rawBase =
opts.baseUrl ??
(typeof process !== "undefined" ? process.env.DOGRAH_API_URL : undefined) ??
getRuntimeEnv("DOGRAH_API_URL") ??
"http://localhost:8000";
this.baseUrl = rawBase.replace(/\/+$/, "");
this.apiKey =
opts.apiKey ??
(typeof process !== "undefined" ? process.env.DOGRAH_API_KEY : undefined);
this.fetchImpl = opts.fetch ?? globalThis.fetch;
this.apiKey = opts.apiKey ?? getRuntimeEnv("DOGRAH_API_KEY");
this.fetchImpl = opts.fetch ?? (globalThis.fetch as unknown as DograhFetch);
this.timeoutMs = opts.timeoutMs ?? 30_000;
this.headers = { Accept: "application/json" };
if (this.apiKey) this.headers["X-API-Key"] = this.apiKey;
@ -126,7 +153,7 @@ export class DograhClient extends _GeneratedClient implements SpecProvider {
}
const hasBody = opts?.json !== undefined;
const init: RequestInit = {
const init: DograhFetchInit = {
method,
headers: {
...this.headers,
@ -139,7 +166,7 @@ export class DograhClient extends _GeneratedClient implements SpecProvider {
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
init.signal = controller.signal;
let resp: Response;
let resp: DograhFetchResponse;
try {
resp = await this.fetchImpl(url, init);
} finally {

View file

@ -26,7 +26,12 @@
*/
export { DograhClient } from "./client.js";
export type { DograhClientOptions } from "./client.js";
export type {
DograhClientOptions,
DograhFetch,
DograhFetchInit,
DograhFetchResponse,
} from "./client.js";
export {
ApiError,
DograhSdkError,

View file

@ -3,7 +3,7 @@
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"lib": ["ES2022"],
"lib": ["ES2022", "DOM"],
"strict": true,
"noUncheckedIndexedAccess": true,
"declaration": true,