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/modular/chunks/index-21eeed74.js +6 -0
- package/dist/modular/chunks/index-21eeed74.js.map +1 -0
- package/dist/modular/chunks/{obi-widget-585f773a.js → obi-widget-6b2916f1.js} +58 -18
- package/dist/modular/chunks/obi-widget-6b2916f1.js.map +1 -0
- package/dist/modular/index.js +1 -1
- package/dist/modular/ui.js +10 -10
- package/dist/obi-sdk.standalone.iife.js +13 -20
- package/dist/obi-sdk.standalone.iife.js.map +1 -1
- package/dist/react.es.js +38 -15
- package/dist/react.es.js.map +1 -1
- package/dist/react.umd.js +3 -10
- package/dist/react.umd.js.map +1 -1
- package/dist/ui/components/obi-widget/obi-widget.d.ts +1 -1
- package/package.json +1 -1
- package/dist/modular/chunks/index-4be516d9.js +0 -6
- package/dist/modular/chunks/index-4be516d9.js.map +0 -1
- package/dist/modular/chunks/obi-widget-585f773a.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-21eeed74.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -550,6 +550,34 @@ class ObiClient {
|
|
|
550
550
|
body: data
|
|
551
551
|
});
|
|
552
552
|
}
|
|
553
|
+
async listRevisionKnowledgeBlocks(revisionId) {
|
|
554
|
+
return await this.client.GET("/revisions/{id}/knowledge-blocks", {
|
|
555
|
+
params: { path: { id: revisionId } }
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
async replaceRevisionKnowledgeBlocks(revisionId, data) {
|
|
559
|
+
return await this.client.PUT("/revisions/{id}/knowledge-blocks", {
|
|
560
|
+
params: { path: { id: revisionId } },
|
|
561
|
+
body: data
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
async createRevisionKnowledgeBlock(revisionId, data) {
|
|
565
|
+
return await this.client.POST("/revisions/{id}/knowledge-blocks", {
|
|
566
|
+
params: { path: { id: revisionId } },
|
|
567
|
+
body: data
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
async updateRevisionKnowledgeBlock(revisionId, blockId, data) {
|
|
571
|
+
return await this.client.PUT("/revisions/{id}/knowledge-blocks/{blockId}", {
|
|
572
|
+
params: { path: { id: revisionId, blockId } },
|
|
573
|
+
body: data
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
async deleteRevisionKnowledgeBlock(revisionId, blockId) {
|
|
577
|
+
return await this.client.DELETE("/revisions/{id}/knowledge-blocks/{blockId}", {
|
|
578
|
+
params: { path: { id: revisionId, blockId } }
|
|
579
|
+
});
|
|
580
|
+
}
|
|
553
581
|
// Sessions
|
|
554
582
|
async listSessions(token) {
|
|
555
583
|
return await this.client.GET("/sessions", {
|
|
@@ -581,12 +609,13 @@ class ObiClient {
|
|
|
581
609
|
params: { path: { id } }
|
|
582
610
|
});
|
|
583
611
|
}
|
|
584
|
-
async getJoinToken(token, { skipIntro } = {}) {
|
|
612
|
+
async getJoinToken(token, { skipIntro, user } = {}) {
|
|
585
613
|
return await this.client.GET("/join-token", {
|
|
586
614
|
params: {
|
|
587
615
|
query: {
|
|
588
616
|
token,
|
|
589
|
-
...skipIntro && { skip_intro: "true" }
|
|
617
|
+
...skipIntro && { skip_intro: "true" },
|
|
618
|
+
...user && { user: encodeURIComponent(user) }
|
|
590
619
|
}
|
|
591
620
|
}
|
|
592
621
|
});
|
|
@@ -17764,13 +17793,6 @@ SessionStartModal.styles = i$4`
|
|
|
17764
17793
|
aspect-ratio: 1/1;
|
|
17765
17794
|
border-radius: 8px;
|
|
17766
17795
|
background: var(--obi-primary, #a10fff);
|
|
17767
|
-
box-shadow:
|
|
17768
|
-
0px 0px 8px 0px rgba(168, 85, 247, 0.12),
|
|
17769
|
-
0px 0px 8px 0px rgba(192, 132, 252, 0.24),
|
|
17770
|
-
0px 0px 4px 0px rgba(192, 132, 252, 0.24),
|
|
17771
|
-
0px 0px 4px 0px rgba(192, 132, 252, 0.24),
|
|
17772
|
-
0px 0px 2px 0px rgba(192, 132, 252, 0.12),
|
|
17773
|
-
0px 0px 1px 0px rgba(168, 85, 247, 0.24);
|
|
17774
17796
|
}
|
|
17775
17797
|
|
|
17776
17798
|
.logo img {
|
|
@@ -17983,7 +18005,7 @@ class ObiWidget extends i$1 {
|
|
|
17983
18005
|
};
|
|
17984
18006
|
this.databaseConfig = null;
|
|
17985
18007
|
this.configLoaded = false;
|
|
17986
|
-
this.
|
|
18008
|
+
this.configAllInCode = false;
|
|
17987
18009
|
this.sessionToken = null;
|
|
17988
18010
|
this.roomToken = null;
|
|
17989
18011
|
this.roomUrl = null;
|
|
@@ -18269,12 +18291,32 @@ class ObiWidget extends i$1 {
|
|
|
18269
18291
|
updateFromConfig() {
|
|
18270
18292
|
if (window.obiWidgetConfig) {
|
|
18271
18293
|
this.apiKey = window.obiWidgetConfig.apiKey || this.apiKey;
|
|
18294
|
+
if (window.obiWidgetConfig.position !== void 0) {
|
|
18295
|
+
this.position = window.obiWidgetConfig.position;
|
|
18296
|
+
this.setAttribute("position", this.position);
|
|
18297
|
+
}
|
|
18298
|
+
if (window.obiWidgetConfig.primaryColor !== void 0) {
|
|
18299
|
+
this.style.setProperty("--obi-primary", window.obiWidgetConfig.primaryColor);
|
|
18300
|
+
this.generateColorVariables(window.obiWidgetConfig.primaryColor);
|
|
18301
|
+
}
|
|
18302
|
+
if (window.obiWidgetConfig.user !== void 0) {
|
|
18303
|
+
this.user = window.obiWidgetConfig.user;
|
|
18304
|
+
}
|
|
18305
|
+
if (window.obiWidgetConfig.isActive !== void 0) {
|
|
18306
|
+
this.isActive = window.obiWidgetConfig.isActive;
|
|
18307
|
+
}
|
|
18308
|
+
if (window.obiWidgetConfig.linkOnlyAccess !== void 0) {
|
|
18309
|
+
this.linkOnlyAccess = window.obiWidgetConfig.linkOnlyAccess;
|
|
18310
|
+
}
|
|
18311
|
+
if (window.obiWidgetConfig.urlBlacklist !== void 0) {
|
|
18312
|
+
this.urlBlacklist = window.obiWidgetConfig.urlBlacklist;
|
|
18313
|
+
}
|
|
18272
18314
|
const hasPosition = window.obiWidgetConfig.position !== void 0;
|
|
18273
18315
|
const hasPrimaryColor = window.obiWidgetConfig.primaryColor !== void 0;
|
|
18274
18316
|
const hasLinkOnlyAccess = window.obiWidgetConfig.linkOnlyAccess !== void 0;
|
|
18275
18317
|
const hasUrlBlacklist = window.obiWidgetConfig.urlBlacklist !== void 0;
|
|
18276
|
-
this.
|
|
18277
|
-
if (this.
|
|
18318
|
+
this.configAllInCode = hasPosition && hasPrimaryColor && hasLinkOnlyAccess && hasUrlBlacklist;
|
|
18319
|
+
if (this.configAllInCode) {
|
|
18278
18320
|
this.configLoaded = true;
|
|
18279
18321
|
this.applyFinalConfiguration();
|
|
18280
18322
|
} else if (!this.configLoaded) {
|
|
@@ -18325,7 +18367,8 @@ class ObiWidget extends i$1 {
|
|
|
18325
18367
|
try {
|
|
18326
18368
|
const session = new ObiSession({
|
|
18327
18369
|
sessionId: sessionToken,
|
|
18328
|
-
apiBaseUrl: API_BASE_URL
|
|
18370
|
+
apiBaseUrl: API_BASE_URL,
|
|
18371
|
+
...this.user && { user: this.user }
|
|
18329
18372
|
});
|
|
18330
18373
|
if (!session) {
|
|
18331
18374
|
console.error("Failed to create session");
|
|
@@ -18491,9 +18534,6 @@ class ObiWidget extends i$1 {
|
|
|
18491
18534
|
const updatedConfig = customEvent.detail;
|
|
18492
18535
|
const needsInit = updatedConfig.isActive && !this.isActive;
|
|
18493
18536
|
this.updateFromConfig();
|
|
18494
|
-
if (this.position) {
|
|
18495
|
-
this.setAttribute("position", this.position);
|
|
18496
|
-
}
|
|
18497
18537
|
if (needsInit && !isCurrentUrlBlacklisted(this.urlBlacklist)) {
|
|
18498
18538
|
this.sessionConnectionCheck();
|
|
18499
18539
|
}
|
|
@@ -18896,7 +18936,7 @@ __decorateClass([
|
|
|
18896
18936
|
], ObiWidget.prototype, "configLoaded", 2);
|
|
18897
18937
|
__decorateClass([
|
|
18898
18938
|
r$1()
|
|
18899
|
-
], ObiWidget.prototype, "
|
|
18939
|
+
], ObiWidget.prototype, "configAllInCode", 2);
|
|
18900
18940
|
if (!customElements.get("obi-widget")) {
|
|
18901
18941
|
customElements.define("obi-widget", ObiWidget);
|
|
18902
18942
|
}
|
|
@@ -18927,4 +18967,4 @@ export {
|
|
|
18927
18967
|
withSentryAsyncHandler as w,
|
|
18928
18968
|
x
|
|
18929
18969
|
};
|
|
18930
|
-
//# sourceMappingURL=obi-widget-
|
|
18970
|
+
//# sourceMappingURL=obi-widget-6b2916f1.js.map
|