@pstdio/sdk 0.13.0 → 0.13.2
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/README.md +3 -1
- package/dist/api/index.d.ts +2 -1
- package/dist/api/index.js +14845 -0
- package/dist/api/sessions.d.ts +2 -1
- package/dist/client/index.js +11 -0
- package/dist/client/sessions.d.ts +7 -1
- package/dist/resources/index.js +327 -227
- package/package.json +1 -1
package/dist/api/sessions.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export type { ApprovalInput, CreateSessionInput, FollowUpDecision, FollowUpInput, FollowUpResponse, ListSessionActivityInput, ListSessionActivityResponse, ResolveSessionIdInput, ResolveSessionIdResponse, SessionConversationResponse, } from "pstdio-api-contracts";
|
|
1
|
+
export type { ApprovalInput, CreateSessionInput, FollowUpDecision, FollowUpInput, FollowUpResponse, ListSessionActivityInput, ListSessionActivityResponse, ResolveSessionIdInput, ResolveSessionIdResponse, SessionAttachment, SessionAttachmentRef, SessionConversationResponse, } from "pstdio-api-contracts";
|
|
2
|
+
export { sessionAttachmentMimeTypesByExtension } from "pstdio-api-contracts";
|
package/dist/client/index.js
CHANGED
|
@@ -273,6 +273,17 @@ var createSessionClient = (request, clientOptions) => ({
|
|
|
273
273
|
},
|
|
274
274
|
list: (projectId, input) => request(`/v1/sessions?${buildSessionsQuery(projectId, input)}`),
|
|
275
275
|
get: (sessionId) => request(`/v1/sessions/${sessionId}`),
|
|
276
|
+
uploadAttachment: (projectId, input) => request(`/v1/projects/${encodeURIComponent(projectId)}/session-attachments`, {
|
|
277
|
+
method: "POST",
|
|
278
|
+
body: input.data,
|
|
279
|
+
headers: {
|
|
280
|
+
"content-type": input.mimeType || "application/octet-stream",
|
|
281
|
+
"x-file-name": encodeURIComponent(input.name)
|
|
282
|
+
}
|
|
283
|
+
}),
|
|
284
|
+
deleteAttachment: (projectId, fileId) => request(`/v1/projects/${encodeURIComponent(projectId)}/session-attachments/${encodeURIComponent(fileId)}`, {
|
|
285
|
+
method: "DELETE"
|
|
286
|
+
}),
|
|
276
287
|
create: (input) => request("/v1/sessions", { method: "POST", body: input }),
|
|
277
288
|
archive: (sessionId) => request(`/v1/sessions/${sessionId}/archive`, { method: "POST" }),
|
|
278
289
|
followUp: (sessionId, input) => request(`/v1/sessions/${sessionId}/follow-up`, { method: "POST", body: input }),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApprovalInput, CreateSessionInput, FollowUpInput, FollowUpResponse, ListSessionActivityInput, ListSessionActivityResponse, ResolveSessionIdInput, ResolveSessionIdResponse, SessionConversationResponse } from "pstdio-api-contracts";
|
|
1
|
+
import type { ApprovalInput, CreateSessionInput, FollowUpInput, FollowUpResponse, ListSessionActivityInput, ListSessionActivityResponse, ResolveSessionIdInput, ResolveSessionIdResponse, SessionAttachment, SessionConversationResponse } from "pstdio-api-contracts";
|
|
2
2
|
import type { Session } from "../resources";
|
|
3
3
|
import { type ClientOptions, type RequestFn } from "./request";
|
|
4
4
|
import { type SseEvent } from "./sse";
|
|
@@ -10,6 +10,12 @@ export type ListSessionsInput = {
|
|
|
10
10
|
export type SessionClient = {
|
|
11
11
|
list(projectId: string, input?: ListSessionsInput): Promise<Session[]>;
|
|
12
12
|
get(sessionId: string): Promise<Session>;
|
|
13
|
+
uploadAttachment(projectId: string, input: {
|
|
14
|
+
name: string;
|
|
15
|
+
data: Uint8Array | ArrayBuffer;
|
|
16
|
+
mimeType?: string | null;
|
|
17
|
+
}): Promise<SessionAttachment>;
|
|
18
|
+
deleteAttachment(projectId: string, fileId: string): Promise<void>;
|
|
13
19
|
create(input: CreateSessionInput): Promise<Session>;
|
|
14
20
|
archive(sessionId: string): Promise<void>;
|
|
15
21
|
followUp(sessionId: string, input: FollowUpInput): Promise<FollowUpResponse>;
|