@amigo-ai/platform-sdk 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api.md CHANGED
@@ -51,7 +51,7 @@ Notes:
51
51
  - Webhooks: `verifyWebhookSignature`, `parseWebhookEvent`, `WebhookVerificationError`
52
52
  - Pagination and response helpers: `paginate`, `buildLastResponse`, `extractRequestId`
53
53
  - Conversation helpers: `textStreamAuthProtocols`
54
- - Conversation types: `ConversationMessage`, `SendMessageRequest`, `SendMessageResponse`, `TextStreamAuthProtocols` (WebSocket constructor subprotocol tuple), `TextStreamUrlParams`
54
+ - Conversation types: `ConversationDetail`, `ConversationListResponse`, `ConversationSummary`, `ConversationTurn`, `CreateConversationRequest`, `ListConversationsParams`, `TextStreamAuthProtocols` (WebSocket constructor subprotocol tuple), `TextStreamUrlParams`, `TurnRequest`, `TurnResponse`
55
55
  - Response and hook types: `PaginatedList`, `ListParams`, `LastResponseInfo`, `ResponseMetadata`, `WithResponseMetadata`, `AmigoResponse`, `RetryOptions`, `RateLimitInfo`, `ClientHooks`, `RequestHookContext`, `ResponseHookContext`, `ErrorHookContext`
56
56
  - Generated OpenAPI types: `paths`, `components`, `operations`
57
57
  - Generated API types are produced with `npm run gen-types` from the committed `openapi.json` snapshot.
@@ -230,7 +230,11 @@ All workspace-scoped resources also expose `withOptions(options)`.
230
230
 
231
231
  ### `conversations`
232
232
 
233
- - `sendMessage`
233
+ - `list`
234
+ - `create`
235
+ - `get`
236
+ - `close`
237
+ - `createTurn`
234
238
  - `textStreamUrl`
235
239
 
236
240
  ### `phoneNumbers`
package/dist/index.cjs CHANGED
@@ -1937,15 +1937,50 @@ var ConversationsResource = class extends WorkspaceScopedResource {
1937
1937
  constructor(client, workspaceId2) {
1938
1938
  super(client, workspaceId2);
1939
1939
  }
1940
- /** Send one user-first text message and receive synchronous agent responses. */
1941
- async sendMessage(request) {
1940
+ async list(params) {
1942
1941
  return extractData(
1943
- await this.client.POST("/v1/{workspace_id}/conversations/messages", {
1942
+ await this.client.GET("/v1/{workspace_id}/conversations", {
1943
+ params: { path: { workspace_id: this.workspaceId }, query: params }
1944
+ })
1945
+ );
1946
+ }
1947
+ async create(request) {
1948
+ return extractData(
1949
+ await this.client.POST("/v1/{workspace_id}/conversations", {
1944
1950
  params: { path: { workspace_id: this.workspaceId } },
1945
1951
  body: request
1946
1952
  })
1947
1953
  );
1948
1954
  }
1955
+ async get(conversationId) {
1956
+ return extractData(
1957
+ await this.client.GET("/v1/{workspace_id}/conversations/{conversation_id}", {
1958
+ params: {
1959
+ path: { workspace_id: this.workspaceId, conversation_id: conversationId }
1960
+ }
1961
+ })
1962
+ );
1963
+ }
1964
+ async close(conversationId) {
1965
+ await this.client.DELETE("/v1/{workspace_id}/conversations/{conversation_id}", {
1966
+ params: {
1967
+ path: { workspace_id: this.workspaceId, conversation_id: conversationId }
1968
+ }
1969
+ });
1970
+ }
1971
+ async createTurn(conversationId, request) {
1972
+ return extractData(
1973
+ await this.client.POST(
1974
+ "/v1/{workspace_id}/conversations/{conversation_id}/turns",
1975
+ {
1976
+ params: {
1977
+ path: { workspace_id: this.workspaceId, conversation_id: conversationId }
1978
+ },
1979
+ body: request
1980
+ }
1981
+ )
1982
+ );
1983
+ }
1949
1984
  /** Build the real-time text WebSocket URL for browser or custom clients. */
1950
1985
  textStreamUrl(params) {
1951
1986
  const url = buildTextStreamUrl({