@alia.onl/sdk 22.4.0 → 22.5.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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/runtime/api.ts +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @alia.onl/sdk
|
|
2
2
|
|
|
3
|
+
## 22.5.0
|
|
4
|
+
|
|
5
|
+
- **`AliaApi.put`.** The REST API (`useAliaApi`, `createAliaApi`) sends PUT like PATCH: the
|
|
6
|
+
linked Oxy client's authentication and 401 replay, the app assertion and a JSON body. Alia's
|
|
7
|
+
memory profile takes its sections by PUT (`/memory/context`, `/memory/preferences`,
|
|
8
|
+
`/memory/settings`), so a host's personalization settings can save them without its own client.
|
|
9
|
+
|
|
3
10
|
## 22.4.0
|
|
4
11
|
|
|
5
12
|
- **A shared conversation shows its artifacts.** `readSharedConversation` keeps an assistant
|
package/package.json
CHANGED
package/src/runtime/api.ts
CHANGED
|
@@ -44,6 +44,8 @@ export interface AliaApi {
|
|
|
44
44
|
get<T>(path: string, request?: AliaApiRequest): Promise<AliaApiResult<T>>;
|
|
45
45
|
post<T>(path: string, body?: unknown, request?: AliaApiRequest): Promise<AliaApiResult<T>>;
|
|
46
46
|
patch<T>(path: string, body?: unknown, request?: AliaApiRequest): Promise<AliaApiResult<T>>;
|
|
47
|
+
/** Replaces a resource whole, for the routes that take PUT (the memory profile's sections). */
|
|
48
|
+
put<T>(path: string, body?: unknown, request?: AliaApiRequest): Promise<AliaApiResult<T>>;
|
|
47
49
|
delete<T>(path: string, request?: AliaApiRequest): Promise<AliaApiResult<T>>;
|
|
48
50
|
}
|
|
49
51
|
|
|
@@ -95,7 +97,7 @@ export function createAliaApi(
|
|
|
95
97
|
appAssertionHeaders: AppAssertionHeaders = NO_APP_ASSERTION,
|
|
96
98
|
): AliaApi {
|
|
97
99
|
async function send<T>(
|
|
98
|
-
method: 'GET' | 'POST' | 'PATCH' | 'DELETE',
|
|
100
|
+
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',
|
|
99
101
|
path: string,
|
|
100
102
|
request: AliaApiRequest = {},
|
|
101
103
|
): Promise<AliaApiResult<T>> {
|
|
@@ -125,6 +127,7 @@ export function createAliaApi(
|
|
|
125
127
|
get: (path, request) => send('GET', path, request),
|
|
126
128
|
post: (path, body, request) => send('POST', path, { ...request, body: body ?? {} }),
|
|
127
129
|
patch: (path, body, request) => send('PATCH', path, { ...request, body: body ?? {} }),
|
|
130
|
+
put: (path, body, request) => send('PUT', path, { ...request, body: body ?? {} }),
|
|
128
131
|
delete: (path, request) => send('DELETE', path, request),
|
|
129
132
|
};
|
|
130
133
|
}
|