@raisindb/client 0.5.9 → 0.5.10

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.
Files changed (40) hide show
  1. package/README.md +32 -0
  2. package/dist/{chunk-IFV4ECHC.mjs → chunk-ASOWGNQZ.mjs} +3 -3
  3. package/dist/{chunk-ZUUSBLVP.mjs → chunk-FYWYSNQG.mjs} +3 -3
  4. package/dist/{chunk-765DLJMZ.mjs → chunk-NOPZAMIV.mjs} +31 -2
  5. package/dist/chunk-NOPZAMIV.mjs.map +1 -0
  6. package/dist/{chunk-AULHRX5C.mjs → chunk-TPZNJNZR.mjs} +2 -2
  7. package/dist/{chunk-VMUT6PIO.mjs → chunk-ZCRYQCXS.mjs} +2 -2
  8. package/dist/{conversation-list-store-CHaqGtSi.d.mts → conversation-list-store-CqgIk8Rn.d.mts} +179 -3
  9. package/dist/{conversation-list-store-CHaqGtSi.d.ts → conversation-list-store-CqgIk8Rn.d.ts} +179 -3
  10. package/dist/{index-AobOnS4A.d.mts → index-BD3rutlF.d.mts} +1 -1
  11. package/dist/{index-DiL2gplR.d.ts → index-CDUAMIub.d.ts} +1 -1
  12. package/dist/index.d.mts +4 -4
  13. package/dist/index.d.ts +4 -4
  14. package/dist/index.js +383 -6
  15. package/dist/index.js.map +1 -1
  16. package/dist/index.mjs +356 -10
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/react.d.mts +2 -2
  19. package/dist/react.d.ts +2 -2
  20. package/dist/react.js +30 -1
  21. package/dist/react.js.map +1 -1
  22. package/dist/react.mjs +3 -3
  23. package/dist/{svelte-sql-FQqis53r.d.ts → svelte-sql-D9YU1wYS.d.ts} +1 -1
  24. package/dist/{svelte-sql-BUrNcoHR.d.mts → svelte-sql-l1wmTWM4.d.mts} +1 -1
  25. package/dist/svelte.d.mts +2 -2
  26. package/dist/svelte.d.ts +2 -2
  27. package/dist/svelte.js +30 -1
  28. package/dist/svelte.js.map +1 -1
  29. package/dist/svelte.mjs +3 -3
  30. package/dist/vue.d.mts +2 -2
  31. package/dist/vue.d.ts +2 -2
  32. package/dist/vue.js +30 -1
  33. package/dist/vue.js.map +1 -1
  34. package/dist/vue.mjs +2 -2
  35. package/package.json +1 -1
  36. package/dist/chunk-765DLJMZ.mjs.map +0 -1
  37. /package/dist/{chunk-IFV4ECHC.mjs.map → chunk-ASOWGNQZ.mjs.map} +0 -0
  38. /package/dist/{chunk-ZUUSBLVP.mjs.map → chunk-FYWYSNQG.mjs.map} +0 -0
  39. /package/dist/{chunk-AULHRX5C.mjs.map → chunk-TPZNJNZR.mjs.map} +0 -0
  40. /package/dist/{chunk-VMUT6PIO.mjs.map → chunk-ZCRYQCXS.mjs.map} +0 -0
package/dist/react.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createRaisinReact
3
- } from "./chunk-IFV4ECHC.mjs";
4
- import "./chunk-AULHRX5C.mjs";
5
- import "./chunk-765DLJMZ.mjs";
3
+ } from "./chunk-ASOWGNQZ.mjs";
4
+ import "./chunk-TPZNJNZR.mjs";
5
+ import "./chunk-NOPZAMIV.mjs";
6
6
  export {
7
7
  createRaisinReact
8
8
  };
@@ -1,4 +1,4 @@
1
- import { D as Database } from './conversation-list-store-CHaqGtSi.js';
1
+ import { D as Database } from './conversation-list-store-CqgIk8Rn.js';
2
2
 
3
3
  interface SqlAdapterOptions {
4
4
  enabled?: boolean;
@@ -1,4 +1,4 @@
1
- import { D as Database } from './conversation-list-store-CHaqGtSi.mjs';
1
+ import { D as Database } from './conversation-list-store-CqgIk8Rn.mjs';
2
2
 
3
3
  interface SqlAdapterOptions {
4
4
  enabled?: boolean;
package/dist/svelte.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { f as ConversationStoreOptions, c as ConversationStore, a as ConversationStoreSnapshot, b as ChatMessage, g as ConversationListStoreOptions, e as ConversationListStore, h as ConversationListSnapshot, d as ConversationListItem, R as RaisinClient, I as IdentityUser, C as ConnectionState, D as Database, S as SubscriptionFilters, E as EventMessage, A as AuthManager, F as FlowClientOptions, i as FlowsApi, j as FlowExecutionEvent } from './conversation-list-store-CHaqGtSi.mjs';
2
- export { b as SqlAdapter, S as SqlAdapterOptions, a as SqlSnapshot, c as createSqlAdapter } from './svelte-sql-BUrNcoHR.mjs';
1
+ import { f as ConversationStoreOptions, c as ConversationStore, a as ConversationStoreSnapshot, b as ChatMessage, g as ConversationListStoreOptions, e as ConversationListStore, h as ConversationListSnapshot, d as ConversationListItem, R as RaisinClient, I as IdentityUser, C as ConnectionState, D as Database, S as SubscriptionFilters, E as EventMessage, A as AuthManager, F as FlowClientOptions, i as FlowsApi, j as FlowExecutionEvent } from './conversation-list-store-CqgIk8Rn.mjs';
2
+ export { b as SqlAdapter, S as SqlAdapterOptions, a as SqlSnapshot, c as createSqlAdapter } from './svelte-sql-l1wmTWM4.mjs';
3
3
  import 'events';
4
4
  import 'fs/promises';
5
5
 
package/dist/svelte.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { f as ConversationStoreOptions, c as ConversationStore, a as ConversationStoreSnapshot, b as ChatMessage, g as ConversationListStoreOptions, e as ConversationListStore, h as ConversationListSnapshot, d as ConversationListItem, R as RaisinClient, I as IdentityUser, C as ConnectionState, D as Database, S as SubscriptionFilters, E as EventMessage, A as AuthManager, F as FlowClientOptions, i as FlowsApi, j as FlowExecutionEvent } from './conversation-list-store-CHaqGtSi.js';
2
- export { b as SqlAdapter, S as SqlAdapterOptions, a as SqlSnapshot, c as createSqlAdapter } from './svelte-sql-FQqis53r.js';
1
+ import { f as ConversationStoreOptions, c as ConversationStore, a as ConversationStoreSnapshot, b as ChatMessage, g as ConversationListStoreOptions, e as ConversationListStore, h as ConversationListSnapshot, d as ConversationListItem, R as RaisinClient, I as IdentityUser, C as ConnectionState, D as Database, S as SubscriptionFilters, E as EventMessage, A as AuthManager, F as FlowClientOptions, i as FlowsApi, j as FlowExecutionEvent } from './conversation-list-store-CqgIk8Rn.js';
2
+ export { b as SqlAdapter, S as SqlAdapterOptions, a as SqlSnapshot, c as createSqlAdapter } from './svelte-sql-D9YU1wYS.js';
3
3
  import 'events';
4
4
  import 'fs/promises';
5
5
 
package/dist/svelte.js CHANGED
@@ -1590,6 +1590,34 @@ var ConversationStore = class {
1590
1590
  this._watchdogIntervalMs = options.watchdogIntervalMs ?? 3e4;
1591
1591
  if (this._conversationPath) {
1592
1592
  this.ensureSubscription();
1593
+ } else if (this.createOptions?.anonymous) {
1594
+ void this.resumeAnonymous();
1595
+ }
1596
+ }
1597
+ anonymousOptions() {
1598
+ const a = this.createOptions?.anonymous;
1599
+ if (!a) return null;
1600
+ return a === true ? {} : a;
1601
+ }
1602
+ /**
1603
+ * Resume the visitor conversation this tab already has (the session secret
1604
+ * and conversation id live in sessionStorage), and load its history. A tab
1605
+ * without one starts nothing until the first message.
1606
+ */
1607
+ async resumeAnonymous() {
1608
+ const opts = this.anonymousOptions();
1609
+ if (!opts || !this.createOptions || this._conversationPath) return;
1610
+ const agent = this.createOptions.participant;
1611
+ try {
1612
+ if (!this.manager.hasStoredAnonymous(agent, opts)) return;
1613
+ const convo = await this.manager.startAnonymous(agent, opts);
1614
+ if (this._conversationPath) return;
1615
+ this._conversationPath = convo.conversationPath;
1616
+ this._conversationType = convo.type;
1617
+ this.ensureSubscription();
1618
+ await this.loadMessages();
1619
+ } catch (err) {
1620
+ logger.debug("[ConversationStore] No visitor conversation to resume", err);
1593
1621
  }
1594
1622
  }
1595
1623
  // ==========================================================================
@@ -1644,7 +1672,8 @@ var ConversationStore = class {
1644
1672
  throw new Error("No conversationPath and no createOptions provided");
1645
1673
  }
1646
1674
  try {
1647
- const convo = await this.manager.create({
1675
+ const anonymous = this.anonymousOptions();
1676
+ const convo = anonymous ? await this.manager.startAnonymous(this.createOptions.participant, anonymous) : await this.manager.create({
1648
1677
  participant: this.createOptions.participant,
1649
1678
  input: this.createOptions.input
1650
1679
  });