Skip to content

Commit 2e2f241

Browse files
authored
feat: add tailor.aigateway.get types for AI Gateway URL resolution (#189)
1 parent 323a89b commit 2e2f241

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

.changeset/tailor-aigateway-get.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tailor-platform/function-types": minor
3+
---
4+
5+
Add `tailor.aigateway.get(name)` types for resolving an AI Gateway URL in the caller's workspace.

packages/types/tailor.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,27 @@ declare namespace tailor.authconnection {
6161
function getConnectionToken(connectionName: string): Promise<any>;
6262
}
6363

64+
declare namespace tailor.aigateway {
65+
/**
66+
* AIGateway describes a resolved AI Gateway in the caller's workspace.
67+
*/
68+
interface AIGateway {
69+
/**
70+
* Base URL of the AI Gateway, e.g.
71+
* `https://my-aigateway-<workspace_hash>.ai.erp.dev`. Requests to this URL
72+
* are automatically authenticated for the calling workspace.
73+
*/
74+
url: string;
75+
}
76+
77+
/**
78+
* get resolves a named AI Gateway in the caller's own workspace and returns
79+
* it. The gateway's existence is verified at call time, so resolving a name
80+
* that does not exist rejects rather than failing later inside `fetch`.
81+
*/
82+
function get(name: string): Promise<AIGateway>;
83+
}
84+
6485
declare namespace tailor.iconv {
6586
/**
6687
* Convert string from one encoding to another

0 commit comments

Comments
 (0)