obi-sdk 0.11.0 → 0.12.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/dist/react.es.js CHANGED
@@ -16499,6 +16499,34 @@ class _g {
16499
16499
  body: t
16500
16500
  });
16501
16501
  }
16502
+ async listRevisionKnowledgeBlocks(e) {
16503
+ return await this.client.GET("/revisions/{id}/knowledge-blocks", {
16504
+ params: { path: { id: e } }
16505
+ });
16506
+ }
16507
+ async replaceRevisionKnowledgeBlocks(e, t) {
16508
+ return await this.client.PUT("/revisions/{id}/knowledge-blocks", {
16509
+ params: { path: { id: e } },
16510
+ body: t
16511
+ });
16512
+ }
16513
+ async createRevisionKnowledgeBlock(e, t) {
16514
+ return await this.client.POST("/revisions/{id}/knowledge-blocks", {
16515
+ params: { path: { id: e } },
16516
+ body: t
16517
+ });
16518
+ }
16519
+ async updateRevisionKnowledgeBlock(e, t, n) {
16520
+ return await this.client.PUT("/revisions/{id}/knowledge-blocks/{blockId}", {
16521
+ params: { path: { id: e, blockId: t } },
16522
+ body: n
16523
+ });
16524
+ }
16525
+ async deleteRevisionKnowledgeBlock(e, t) {
16526
+ return await this.client.DELETE("/revisions/{id}/knowledge-blocks/{blockId}", {
16527
+ params: { path: { id: e, blockId: t } }
16528
+ });
16529
+ }
16502
16530
  // Sessions
16503
16531
  async listSessions(e) {
16504
16532
  return await this.client.GET("/sessions", {
@@ -16530,12 +16558,13 @@ class _g {
16530
16558
  params: { path: { id: e } }
16531
16559
  });
16532
16560
  }
16533
- async getJoinToken(e, { skipIntro: t } = {}) {
16561
+ async getJoinToken(e, { skipIntro: t, user: n } = {}) {
16534
16562
  return await this.client.GET("/join-token", {
16535
16563
  params: {
16536
16564
  query: {
16537
16565
  token: e,
16538
- ...t && { skip_intro: "true" }
16566
+ ...t && { skip_intro: "true" },
16567
+ ...n && { user: encodeURIComponent(n) }
16539
16568
  }
16540
16569
  }
16541
16570
  });
@@ -28559,13 +28588,6 @@ LA.styles = Qt`
28559
28588
  aspect-ratio: 1/1;
28560
28589
  border-radius: 8px;
28561
28590
  background: var(--obi-primary, #a10fff);
28562
- box-shadow:
28563
- 0px 0px 8px 0px rgba(168, 85, 247, 0.12),
28564
- 0px 0px 8px 0px rgba(192, 132, 252, 0.24),
28565
- 0px 0px 4px 0px rgba(192, 132, 252, 0.24),
28566
- 0px 0px 4px 0px rgba(192, 132, 252, 0.24),
28567
- 0px 0px 2px 0px rgba(192, 132, 252, 0.12),
28568
- 0px 0px 1px 0px rgba(168, 85, 247, 0.24);
28569
28591
  }
28570
28592
 
28571
28593
  .logo img {
@@ -28752,7 +28774,7 @@ let Ce = class extends Ft {
28752
28774
  speaker: "ASSISTANT",
28753
28775
  volume: 0,
28754
28776
  spectrum: []
28755
- }, this.databaseConfig = null, this.configLoaded = !1, this.configInCode = !1, this.sessionToken = null, this.roomToken = null, this.roomUrl = null, this.boundSaveSessionData = null, this.obiClient = null, this.closeNavTimeoutRef = null, this.researchingTimeoutRef = null, this.urlCheckInterval = null, this.currentUrl = "", this.connectObi = li(
28777
+ }, this.databaseConfig = null, this.configLoaded = !1, this.configAllInCode = !1, this.sessionToken = null, this.roomToken = null, this.roomUrl = null, this.boundSaveSessionData = null, this.obiClient = null, this.closeNavTimeoutRef = null, this.researchingTimeoutRef = null, this.urlCheckInterval = null, this.currentUrl = "", this.connectObi = li(
28756
28778
  async (e) => {
28757
28779
  if (this.activeSession) {
28758
28780
  ne("connection_already_exists", { sessionToken: e }, "ObiWidget"), console.log("Connection already exists");
@@ -28950,9 +28972,9 @@ let Ce = class extends Ft {
28950
28972
  }
28951
28973
  updateFromConfig() {
28952
28974
  if (window.obiWidgetConfig) {
28953
- this.apiKey = window.obiWidgetConfig.apiKey || this.apiKey;
28975
+ this.apiKey = window.obiWidgetConfig.apiKey || this.apiKey, window.obiWidgetConfig.position !== void 0 && (this.position = window.obiWidgetConfig.position, this.setAttribute("position", this.position)), window.obiWidgetConfig.primaryColor !== void 0 && (this.style.setProperty("--obi-primary", window.obiWidgetConfig.primaryColor), this.generateColorVariables(window.obiWidgetConfig.primaryColor)), window.obiWidgetConfig.user !== void 0 && (this.user = window.obiWidgetConfig.user), window.obiWidgetConfig.isActive !== void 0 && (this.isActive = window.obiWidgetConfig.isActive), window.obiWidgetConfig.linkOnlyAccess !== void 0 && (this.linkOnlyAccess = window.obiWidgetConfig.linkOnlyAccess), window.obiWidgetConfig.urlBlacklist !== void 0 && (this.urlBlacklist = window.obiWidgetConfig.urlBlacklist);
28954
28976
  const e = window.obiWidgetConfig.position !== void 0, t = window.obiWidgetConfig.primaryColor !== void 0, n = window.obiWidgetConfig.linkOnlyAccess !== void 0, i = window.obiWidgetConfig.urlBlacklist !== void 0;
28955
- this.configInCode = e && t && n && i, this.configInCode ? (this.configLoaded = !0, this.applyFinalConfiguration()) : this.configLoaded || this.fetchDatabaseConfig(), window.obiWidgetConfig.showMenu === !0 && (this.state = O.LOADING, this.showCourseModal = !0, window.obiWidgetConfig.showMenu = !1);
28977
+ this.configAllInCode = e && t && n && i, this.configAllInCode ? (this.configLoaded = !0, this.applyFinalConfiguration()) : this.configLoaded || this.fetchDatabaseConfig(), window.obiWidgetConfig.showMenu === !0 && (this.state = O.LOADING, this.showCourseModal = !0, window.obiWidgetConfig.showMenu = !1);
28956
28978
  } else
28957
28979
  this.configLoaded || this.fetchDatabaseConfig();
28958
28980
  }
@@ -28978,7 +29000,8 @@ let Ce = class extends Ft {
28978
29000
  try {
28979
29001
  const t = new KC({
28980
29002
  sessionId: e,
28981
- apiBaseUrl: nc
29003
+ apiBaseUrl: nc,
29004
+ ...this.user && { user: this.user }
28982
29005
  });
28983
29006
  return t || (console.error("Failed to create session"), null);
28984
29007
  } catch (t) {
@@ -29063,7 +29086,7 @@ let Ce = class extends Ft {
29063
29086
  }
29064
29087
  handleConfigUpdate(e) {
29065
29088
  const i = e.detail.isActive && !this.isActive;
29066
- this.updateFromConfig(), this.position && this.setAttribute("position", this.position), i && !Pr(this.urlBlacklist) && this.sessionConnectionCheck(), this.requestUpdate();
29089
+ this.updateFromConfig(), i && !Pr(this.urlBlacklist) && this.sessionConnectionCheck(), this.requestUpdate();
29067
29090
  }
29068
29091
  handleMouseEnter() {
29069
29092
  this.isHovering = !0, this.navVisible = !0;
@@ -29390,7 +29413,7 @@ Qe([
29390
29413
  ], Ce.prototype, "configLoaded", 2);
29391
29414
  Qe([
29392
29415
  oe()
29393
- ], Ce.prototype, "configInCode", 2);
29416
+ ], Ce.prototype, "configAllInCode", 2);
29394
29417
  customElements.get("obi-widget") || customElements.define("obi-widget", Ce);
29395
29418
  const X_ = Ji({
29396
29419
  tagName: "obi-course-modal",