@ayni.org/ayni-ui-core 0.3.4 → 0.3.5

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.
@@ -26,7 +26,9 @@ export declare class ProfileClient {
26
26
  constructor(sessionsUrl: string, fetchFn?: typeof fetch);
27
27
  private url;
28
28
  private headers;
29
- create(client: ClientDescription, locale?: string, siblingOfToken?: string, deviceHandle?: string, resumeSessionId?: string, deviceProof?: string, conversationId?: string, newConversation?: boolean): Promise<CreateSessionResponse>;
29
+ create(client: ClientDescription, locale?: string, siblingOfToken?: string, deviceHandle?: string, resumeSessionId?: string, deviceProof?: string, conversationId?: string, newConversation?: boolean,
30
+ /** a bound session or none (PROF-SESS-015): 409 when the device proof does not bind, nothing asked on the phone */
31
+ silent?: boolean): Promise<CreateSessionResponse>;
30
32
  /** The Principal's conversations with this agent (PROF-CONV-001). */
31
33
  conversations(token: string): Promise<ConversationsResponse>;
32
34
  /** Rename, archive or unarchive (PROF-CONV-002/003). */
@@ -37,7 +37,9 @@ export class ProfileClient {
37
37
  headers(token, extra = {}) {
38
38
  return { accept: 'application/json', ...(token ? { authorization: `Bearer ${token}` } : {}), ...extra };
39
39
  }
40
- async create(client, locale, siblingOfToken, deviceHandle, resumeSessionId, deviceProof, conversationId, newConversation = false) {
40
+ async create(client, locale, siblingOfToken, deviceHandle, resumeSessionId, deviceProof, conversationId, newConversation = false,
41
+ /** a bound session or none (PROF-SESS-015): 409 when the device proof does not bind, nothing asked on the phone */
42
+ silent = false) {
41
43
  const response = await this.fetchFn(this.url(), {
42
44
  method: 'POST',
43
45
  headers: this.headers(siblingOfToken, { 'content-type': 'application/json' }),
@@ -48,6 +50,7 @@ export class ProfileClient {
48
50
  ...(deviceHandle && deviceProof && !siblingOfToken ? { deviceProof } : {}),
49
51
  ...(conversationId ? { conversationId } : resumeSessionId ? { resumeSessionId } : {}),
50
52
  ...(newConversation ? { newConversation: true } : {}),
53
+ ...(silent && !siblingOfToken ? { silent: true } : {}),
51
54
  }),
52
55
  });
53
56
  if (!response.ok)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ayni.org/ayni-ui-core",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Framework-independent core of the Ayni UI (UI-SHELL-004): agents and controllers, trust resolution, sessions and binding, the conversation reducer, the local store and sync; shared by the browser UI and the Ayni app",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",