Files
boc/landvex/node_modules/openai/resources/beta/chatkit/threads.mjs
T
Bernt 6989a98d75 feat: Passwordless cross-device authentication
- Arkitektur: docs/auth/passwordless-architecture.md
- Backend: iom/quixzoom-auth-service/ (FastAPI + Redis)
- Webb: quixzoom-market-pages/se/login/ (QR-kod + polling)
- App: iom/quixzoom-app/src/features/auth/ (push + deep links)

Flöde: QR-kod → app-godkännande → webb-inloggad
2026-07-07 07:11:50 +00:00

81 lines
2.6 KiB
JavaScript

// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { ConversationCursorPage, } from "../../../core/pagination.mjs";
import { buildHeaders } from "../../../internal/headers.mjs";
import { path } from "../../../internal/utils/path.mjs";
export class Threads extends APIResource {
/**
* Retrieve a ChatKit thread by its identifier.
*
* @example
* ```ts
* const chatkitThread =
* await client.beta.chatkit.threads.retrieve('cthr_123');
* ```
*/
retrieve(threadID, options) {
return this._client.get(path `/chatkit/threads/${threadID}`, {
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]),
__security: { bearerAuth: true },
});
}
/**
* List ChatKit threads with optional pagination and user filters.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const chatkitThread of client.beta.chatkit.threads.list()) {
* // ...
* }
* ```
*/
list(query = {}, options) {
return this._client.getAPIList('/chatkit/threads', (ConversationCursorPage), {
query,
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]),
__security: { bearerAuth: true },
});
}
/**
* Delete a ChatKit thread along with its items and stored attachments.
*
* @example
* ```ts
* const thread = await client.beta.chatkit.threads.delete(
* 'cthr_123',
* );
* ```
*/
delete(threadID, options) {
return this._client.delete(path `/chatkit/threads/${threadID}`, {
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]),
__security: { bearerAuth: true },
});
}
/**
* List items that belong to a ChatKit thread.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const thread of client.beta.chatkit.threads.listItems(
* 'cthr_123',
* )) {
* // ...
* }
* ```
*/
listItems(threadID, query = {}, options) {
return this._client.getAPIList(path `/chatkit/threads/${threadID}/items`, (ConversationCursorPage), {
query,
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]),
__security: { bearerAuth: true },
});
}
}
//# sourceMappingURL=threads.mjs.map