diff --git a/.changeset/tailor-aigateway-get.md b/.changeset/tailor-aigateway-get.md new file mode 100644 index 0000000..909b28d --- /dev/null +++ b/.changeset/tailor-aigateway-get.md @@ -0,0 +1,5 @@ +--- +"@tailor-platform/function-types": minor +--- + +Add `tailor.aigateway.get(name)` types for resolving an AI Gateway URL in the caller's workspace. diff --git a/packages/types/tailor.d.ts b/packages/types/tailor.d.ts index 8f80d24..d22d162 100644 --- a/packages/types/tailor.d.ts +++ b/packages/types/tailor.d.ts @@ -61,6 +61,27 @@ declare namespace tailor.authconnection { function getConnectionToken(connectionName: string): Promise; } +declare namespace tailor.aigateway { + /** + * AIGateway describes a resolved AI Gateway in the caller's workspace. + */ + interface AIGateway { + /** + * Base URL of the AI Gateway, e.g. + * `https://my-aigateway-.ai.erp.dev`. Requests to this URL + * are automatically authenticated for the calling workspace. + */ + url: string; + } + + /** + * get resolves a named AI Gateway in the caller's own workspace and returns + * it. The gateway's existence is verified at call time, so resolving a name + * that does not exist rejects rather than failing later inside `fetch`. + */ + function get(name: string): Promise; +} + declare namespace tailor.iconv { /** * Convert string from one encoding to another