obi-sdk 0.12.3 → 0.12.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.
@@ -0,0 +1,6 @@
1
+ import { O } from "./obi-widget-d4244993.js";
2
+ import "./types-f38a47f6.js";
3
+ export {
4
+ O as ObiWidget
5
+ };
6
+ //# sourceMappingURL=index-4cdc2bce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-4cdc2bce.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1,4 +1,4 @@
1
- import { S as SDKState, E as EventEmitter, R as RoomEvent, T as Track, z as z$2, a as Room, A as API_BASE_URL, N as N$1 } from "./types-e0297e7b.js";
1
+ import { S as SDKState, E as EventEmitter, R as RoomEvent, T as Track, z as z$2, a as Room, A as API_BASE_URL, N as N$1 } from "./types-f38a47f6.js";
2
2
  const PATH_PARAM_RE = /\{[^{}]+\}/g;
3
3
  function randomID() {
4
4
  return Math.random().toString(36).slice(2, 11);
@@ -419,204 +419,204 @@ class ObiClient {
419
419
  }
420
420
  // Auth endpoints
421
421
  async getAuthUrl(type) {
422
- return await this.client.GET("/auth/{type}", {
422
+ return await this.client.GET("/api/auth/{type}", {
423
423
  params: { path: { type } }
424
424
  });
425
425
  }
426
426
  async getConnectUrl(type) {
427
- return await this.client.GET("/connect/{type}", {
427
+ return await this.client.GET("/api/connect/{type}", {
428
428
  params: { path: { type } }
429
429
  });
430
430
  }
431
431
  async logout() {
432
- return await this.client.POST("/logout");
432
+ return await this.client.POST("/api/logout");
433
433
  }
434
434
  async getCurrentUser() {
435
- return await this.client.GET("/me");
435
+ return await this.client.GET("/api/me");
436
436
  }
437
437
  // Files
438
438
  async createPresignedUploadUrl(data) {
439
- return await this.client.POST("/files", {
439
+ return await this.client.POST("/api/files", {
440
440
  body: data
441
441
  });
442
442
  }
443
443
  // Knowledge blocks
444
444
  async createKnowledgeBlock(data) {
445
- return await this.client.POST("/knowledge", {
445
+ return await this.client.POST("/api/knowledge", {
446
446
  body: data
447
447
  });
448
448
  }
449
449
  // Onboardees
450
450
  async listOnboardees() {
451
- return await this.client.GET("/onboardees");
451
+ return await this.client.GET("/api/onboardees");
452
452
  }
453
453
  async getOnboardee(id) {
454
- return await this.client.GET("/onboardees/{id}", {
455
- params: { path: { id } }
456
- });
457
- }
458
- async getOnboardeeWhitelistedDomains(id) {
459
- return await this.client.GET("/onboardees/{id}/whitelisted-domains", {
454
+ return await this.client.GET("/api/onboardees/{id}", {
460
455
  params: { path: { id } }
461
456
  });
462
457
  }
463
458
  async getOnboardeeWidgetConfig(id, signal) {
464
- return await this.client.GET("/onboardees/{id}/config", {
459
+ return await this.client.GET("/api/onboardees/{id}/config", {
465
460
  params: { path: { id } },
466
461
  signal
467
462
  });
468
463
  }
469
464
  // Plans
470
465
  async listPlans() {
471
- return await this.client.GET("/plans");
466
+ return await this.client.GET("/api/plans");
472
467
  }
473
468
  // Products
474
469
  async listProducts() {
475
- return await this.client.GET("/products");
470
+ return await this.client.GET("/api/products");
471
+ }
472
+ async getProduct(id) {
473
+ return await this.client.GET("/api/products/{id}", {
474
+ params: { path: { id } }
475
+ });
476
476
  }
477
477
  async createProduct(data) {
478
- return await this.client.POST("/products", {
478
+ return await this.client.POST("/api/products", {
479
479
  body: data
480
480
  });
481
481
  }
482
482
  async updateProduct(id, data) {
483
- return await this.client.PATCH("/products/{id}", {
483
+ return await this.client.PATCH("/api/products/{id}", {
484
484
  params: { path: { id } },
485
485
  body: data
486
486
  });
487
487
  }
488
488
  async createPlan(data) {
489
- return await this.client.POST("/plans", {
489
+ return await this.client.POST("/api/plans", {
490
490
  body: data
491
491
  });
492
492
  }
493
493
  async getPlan(id) {
494
- return await this.client.GET("/plans/{id}", {
494
+ return await this.client.GET("/api/plans/{id}", {
495
495
  params: { path: { id } }
496
496
  });
497
497
  }
498
498
  async replacePlan(id, data) {
499
- return await this.client.PUT("/plans/{id}", {
499
+ return await this.client.PUT("/api/plans/{id}", {
500
500
  params: { path: { id } },
501
501
  body: data
502
502
  });
503
503
  }
504
504
  async updatePlan(id, data) {
505
- return await this.client.PATCH("/plans/{id}", {
505
+ return await this.client.PATCH("/api/plans/{id}", {
506
506
  params: { path: { id } },
507
507
  body: data
508
508
  });
509
509
  }
510
510
  async getPlanVideoUrl(id) {
511
- return await this.client.GET("/plans/{id}/video-url", {
511
+ return await this.client.GET("/api/plans/{id}/video-url", {
512
512
  params: { path: { id } }
513
513
  });
514
514
  }
515
515
  async deletePlan(id) {
516
- return await this.client.DELETE("/admin/plans/{id}", {
516
+ return await this.client.DELETE("/api/admin/plans/{id}", {
517
517
  params: { path: { id } }
518
518
  });
519
519
  }
520
520
  async publishPlanRevision(id, data) {
521
- return await this.client.POST("/plans/{id}/publish", {
521
+ return await this.client.POST("/api/plans/{id}/publish", {
522
522
  params: { path: { id } },
523
523
  body: data
524
524
  });
525
525
  }
526
526
  async listPlanRevisions(id) {
527
- return await this.client.GET("/plans/{id}/revisions", {
527
+ return await this.client.GET("/api/plans/{id}/revisions", {
528
528
  params: { path: { id } }
529
529
  });
530
530
  }
531
531
  async getRevisionNavigationIndex(revisionId) {
532
- return await this.client.GET("/revisions/{id}/navigation-index", {
532
+ return await this.client.GET("/api/revisions/{id}/navigation-index", {
533
533
  params: { path: { id: revisionId } }
534
534
  });
535
535
  }
536
536
  async replaceRevisionNavigationIndex(revisionId, data) {
537
- return await this.client.PUT("/revisions/{id}/navigation-index", {
537
+ return await this.client.PUT("/api/revisions/{id}/navigation-index", {
538
538
  params: { path: { id: revisionId } },
539
539
  body: data
540
540
  });
541
541
  }
542
542
  async getRevisionFAQ(revisionId) {
543
- return await this.client.GET("/revisions/{id}/faq", {
543
+ return await this.client.GET("/api/revisions/{id}/faq", {
544
544
  params: { path: { id: revisionId } }
545
545
  });
546
546
  }
547
547
  async replaceRevisionFAQ(revisionId, data) {
548
- return await this.client.PUT("/revisions/{id}/faq", {
548
+ return await this.client.PUT("/api/revisions/{id}/faq", {
549
549
  params: { path: { id: revisionId } },
550
550
  body: data
551
551
  });
552
552
  }
553
553
  async listRevisionKnowledgeBlocks(revisionId) {
554
- return await this.client.GET("/revisions/{id}/knowledge-blocks", {
554
+ return await this.client.GET("/api/revisions/{id}/knowledge-blocks", {
555
555
  params: { path: { id: revisionId } }
556
556
  });
557
557
  }
558
558
  async replaceRevisionKnowledgeBlocks(revisionId, data) {
559
- return await this.client.PUT("/revisions/{id}/knowledge-blocks", {
559
+ return await this.client.PUT("/api/revisions/{id}/knowledge-blocks", {
560
560
  params: { path: { id: revisionId } },
561
561
  body: data
562
562
  });
563
563
  }
564
564
  async createRevisionKnowledgeBlock(revisionId, data) {
565
- return await this.client.POST("/revisions/{id}/knowledge-blocks", {
565
+ return await this.client.POST("/api/revisions/{id}/knowledge-blocks", {
566
566
  params: { path: { id: revisionId } },
567
567
  body: data
568
568
  });
569
569
  }
570
570
  async updateRevisionKnowledgeBlock(revisionId, blockId, data) {
571
- return await this.client.PUT("/revisions/{id}/knowledge-blocks/{blockId}", {
571
+ return await this.client.PUT("/api/revisions/{id}/knowledge-blocks/{blockId}", {
572
572
  params: { path: { id: revisionId, blockId } },
573
573
  body: data
574
574
  });
575
575
  }
576
576
  async deleteRevisionKnowledgeBlock(revisionId, blockId) {
577
- return await this.client.DELETE("/revisions/{id}/knowledge-blocks/{blockId}", {
577
+ return await this.client.DELETE("/api/revisions/{id}/knowledge-blocks/{blockId}", {
578
578
  params: { path: { id: revisionId, blockId } }
579
579
  });
580
580
  }
581
581
  // Sessions
582
582
  async listSessions(token) {
583
- return await this.client.GET("/sessions", {
584
- params: { query: token ? { token } : {} }
583
+ return await this.client.GET("/api/sessions", {
584
+ params: { query: { token } }
585
585
  });
586
586
  }
587
587
  async createSession(data) {
588
- return await this.client.POST("/sessions", {
588
+ return await this.client.POST("/api/sessions", {
589
589
  body: data
590
590
  });
591
591
  }
592
592
  async getSession(id) {
593
- return await this.client.GET("/sessions/{id}", {
593
+ return await this.client.GET("/api/sessions/{id}", {
594
594
  params: { path: { id } }
595
595
  });
596
596
  }
597
597
  async startSession(id, token) {
598
- return await this.client.GET("/sessions/{id}/start-session", {
599
- params: { path: { id }, query: token ? { token } : {} }
598
+ return await this.client.GET("/api/sessions/{id}/start-session", {
599
+ params: { path: { id }, query: { token } }
600
600
  });
601
601
  }
602
602
  async getSessionRecording(id) {
603
- return await this.client.GET("/sessions/{id}/recording", {
603
+ return await this.client.GET("/api/sessions/{id}/recording", {
604
604
  params: { path: { id } }
605
605
  });
606
606
  }
607
607
  async getSessionProductUrl(id) {
608
- return await this.client.GET("/sessions/{id}/product-url", {
608
+ return await this.client.GET("/api/sessions/{id}/product-url", {
609
609
  params: { path: { id } }
610
610
  });
611
611
  }
612
612
  async updateSession(id, data) {
613
- return await this.client.PATCH("/sessions/{id}", {
613
+ return await this.client.PATCH("/api/sessions/{id}", {
614
614
  params: { path: { id } },
615
615
  body: data
616
616
  });
617
617
  }
618
618
  async getJoinToken(token, { skipIntro, user } = {}) {
619
- return await this.client.GET("/join-token", {
619
+ return await this.client.GET("/api/join-token", {
620
620
  params: {
621
621
  query: {
622
622
  token,
@@ -633,7 +633,7 @@ class ObiClient {
633
633
  return this.client;
634
634
  }
635
635
  }
636
- const DEFAULT_API_BASE_URL = "https://app.coragents.ai/api";
636
+ const DEFAULT_API_BASE_URL = "https://app.coragents.ai";
637
637
  class ObiSession {
638
638
  constructor({ sessionId, apiBaseUrl, user }) {
639
639
  this.currentState = SDKState.READY;
@@ -16650,6 +16650,11 @@ class CourseList extends i$1 {
16650
16650
  this.selectedCourseId = null;
16651
16651
  this.loading = false;
16652
16652
  this.error = "";
16653
+ this.searchTerm = "";
16654
+ }
16655
+ handleSearch(event) {
16656
+ const input = event.currentTarget;
16657
+ this.searchTerm = input.value;
16653
16658
  }
16654
16659
  render() {
16655
16660
  if (this.loading) {
@@ -16661,9 +16666,37 @@ class CourseList extends i$1 {
16661
16666
  if (!this.courses || this.courses.length === 0) {
16662
16667
  return x`<div class="empty">No courses available</div>`;
16663
16668
  }
16669
+ const filteredCourses = this.courses.filter(
16670
+ (course) => course.name.toLowerCase().includes(this.searchTerm.toLowerCase()) || (course.description || "").toLowerCase().includes(this.searchTerm.toLowerCase())
16671
+ );
16664
16672
  return x`
16673
+ <div class="controls">
16674
+ <div class="tabs">
16675
+ <button class="tab active">All</button>
16676
+ </div>
16677
+ <div class="filter">
16678
+ <svg
16679
+ width="14"
16680
+ height="14"
16681
+ viewBox="0 0 14 14"
16682
+ fill="none"
16683
+ xmlns="http://www.w3.org/2000/svg"
16684
+ >
16685
+ <path
16686
+ d="M10.0417 8.75002H9.42087L9.20004 8.53502C9.96921 7.63585 10.4417 6.47502 10.4417 5.20835C10.4417 2.56085 8.32254 0.441681 5.67504 0.441681C3.02754 0.441681 0.908374 2.56085 0.908374 5.20835C0.908374 7.85585 3.02754 9.97502 5.67504 9.97502C6.94171 9.97502 8.10254 9.50252 9.00171 8.73335L9.22671 8.95418V9.57502L13.2167 13.5592L14.375 12.4008L10.0417 8.75002ZM5.67504 8.75002C3.72754 8.75002 2.15837 7.18085 2.15837 5.20835C2.15837 3.23585 3.72754 1.66668 5.67504 1.66668C7.62254 1.66668 9.19171 3.23585 9.19171 5.20835C9.19171 7.18085 7.62254 8.75002 5.67504 8.75002Z"
16687
+ fill="#6B7280"
16688
+ />
16689
+ </svg>
16690
+ <input
16691
+ type="text"
16692
+ placeholder="Search..."
16693
+ .value=${this.searchTerm}
16694
+ @input=${this.handleSearch}
16695
+ />
16696
+ </div>
16697
+ </div>
16665
16698
  <div class="course-grid">
16666
- ${this.courses.sort((a2, b2) => (a2.order || 0) - (b2.order || 0)).map((course) => {
16699
+ ${filteredCourses.sort((a2, b2) => (a2.order || 0) - (b2.order || 0)).map((course) => {
16667
16700
  const isSelected = course.id === this.selectedCourseId;
16668
16701
  return x`
16669
16702
  <obi-course
@@ -16689,12 +16722,81 @@ CourseList.styles = i$4`
16689
16722
  display: grid;
16690
16723
  grid-template-columns: 1fr 1fr 1fr;
16691
16724
  gap: 4px;
16692
- padding: 12px 0px;
16725
+ padding: 0;
16693
16726
  flex: 1 0 0;
16694
16727
  align-self: stretch;
16695
16728
  min-height: 364px; /* Ensure minimum 2 rows: 2 * 180px + 4px gap */
16696
16729
  }
16697
16730
 
16731
+ .controls {
16732
+ display: flex;
16733
+ justify-content: space-between;
16734
+ align-items: center;
16735
+ margin-bottom: 12px;
16736
+ }
16737
+
16738
+ .tabs {
16739
+ display: flex;
16740
+ gap: 10px;
16741
+ }
16742
+
16743
+ .tab {
16744
+ display: flex;
16745
+ padding: var(--spacing-1-5, 6px) var(--spacing-3, 12px);
16746
+ justify-content: center;
16747
+ align-items: center;
16748
+ align-self: stretch;
16749
+ border: none;
16750
+ background: none;
16751
+ cursor: pointer;
16752
+ font-family: Satoshi;
16753
+ font-size: 16px;
16754
+ font-weight: 500;
16755
+ color: rgba(0, 0, 0, 0.4);
16756
+ border-bottom: 2px solid transparent;
16757
+ transition: all 0.2s;
16758
+ }
16759
+
16760
+ .tab.active {
16761
+ color: #000;
16762
+ border-bottom: 2px solid var(--obi-primary);
16763
+ }
16764
+
16765
+ .tab:hover {
16766
+ color: #000;
16767
+ }
16768
+
16769
+ .filter {
16770
+ position: relative;
16771
+ display: flex;
16772
+ align-items: center;
16773
+ width: 336px;
16774
+ height: var(--width-w-10, 40px);
16775
+ }
16776
+
16777
+ .filter input {
16778
+ padding: 8px 12px 8px 36px;
16779
+ border-radius: var(--border-radius-default, 6px);
16780
+ border: 1px solid rgba(0, 0, 0, 0.1);
16781
+ background: #fff;
16782
+ font-family: Satoshi;
16783
+ font-size: 14px;
16784
+ line-height: 20px;
16785
+ width: 100%;
16786
+ height: 100%;
16787
+ box-sizing: border-box;
16788
+ }
16789
+
16790
+ .filter input::placeholder {
16791
+ color: rgba(0, 0, 0, 0.4);
16792
+ }
16793
+
16794
+ .filter svg {
16795
+ position: absolute;
16796
+ left: 12px;
16797
+ pointer-events: none;
16798
+ }
16799
+
16698
16800
  @media (max-width: 767px) {
16699
16801
  .course-grid {
16700
16802
  grid-template-columns: 1fr;
@@ -16726,6 +16828,9 @@ __decorateClass$5([
16726
16828
  __decorateClass$5([
16727
16829
  n$2({ type: String })
16728
16830
  ], CourseList.prototype, "error", 2);
16831
+ __decorateClass$5([
16832
+ n$2({ type: String })
16833
+ ], CourseList.prototype, "searchTerm", 2);
16729
16834
  if (!customElements.get("obi-course")) {
16730
16835
  customElements.define("obi-course", Course);
16731
16836
  }
@@ -16777,7 +16882,7 @@ class CourseModal extends i$1 {
16777
16882
  console.log("[CourseModal] Fetching sessions from API", {
16778
16883
  apiKey: this.apiKey ? "present" : "missing"
16779
16884
  });
16780
- const raw_response = await fetch(`${this.apiBaseUrl}/sessions?token=${this.apiKey}`, {
16885
+ const raw_response = await fetch(`${this.apiBaseUrl}/api/sessions?token=${this.apiKey}`, {
16781
16886
  cache: "no-cache"
16782
16887
  });
16783
16888
  if (!raw_response.ok) {
@@ -16904,7 +17009,8 @@ class CourseModal extends i$1 {
16904
17009
  Sessions are securely recorded for quality improvement purposes.
16905
17010
  </p>
16906
17011
  </div>
16907
- <div class="powered-by-container">
17012
+
17013
+ <!-- <div class="powered-by-container">
16908
17014
  <a href="https://getcor.ai/" target="_blank" class="powered-by-link">
16909
17015
  <div style="display: flex; align-items: end; gap: 4px;">
16910
17016
  <p class="powered-by">Powered by</p>
@@ -16922,7 +17028,7 @@ class CourseModal extends i$1 {
16922
17028
  </svg>
16923
17029
  </div>
16924
17030
  </a>
16925
- </div>
17031
+ </div> -->
16926
17032
  </div>
16927
17033
  `;
16928
17034
  }
@@ -16981,6 +17087,27 @@ CourseModal.styles = i$4`
16981
17087
  overflow-y: auto;
16982
17088
  width: 100%;
16983
17089
  min-height: 0;
17090
+ max-height: 424px; /* 2 rows (2 * 180px) + controls height (~60px) + gap (4px) */
17091
+ padding-right: 3px; /* Space for scrollbar + gap from border */
17092
+ box-sizing: border-box;
17093
+ }
17094
+
17095
+ .course-list-wrapper::-webkit-scrollbar {
17096
+ width: 3px;
17097
+ }
17098
+
17099
+ .course-list-wrapper::-webkit-scrollbar-track {
17100
+ background: transparent;
17101
+ }
17102
+
17103
+ .course-list-wrapper::-webkit-scrollbar-thumb {
17104
+ background-color: #000;
17105
+ border-radius: 2px;
17106
+ min-height: 20px; /* Ensure minimum height for proper rounding */
17107
+ }
17108
+
17109
+ .course-list-wrapper::-webkit-scrollbar-thumb:hover {
17110
+ background-color: #333;
16984
17111
  }
16985
17112
 
16986
17113
  .container:hover {
@@ -19098,4 +19225,4 @@ export {
19098
19225
  withSentryAsyncHandler as w,
19099
19226
  x
19100
19227
  };
19101
- //# sourceMappingURL=obi-widget-fa809230.js.map
19228
+ //# sourceMappingURL=obi-widget-d4244993.js.map