@go1/go1-embedding-react-sdk 0.0.12 → 0.0.14
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/common/params.js +11 -2
- package/dist/common/types.d.ts +5 -2
- package/package.json +1 -1
package/dist/common/params.js
CHANGED
|
@@ -4,7 +4,8 @@ exports.isValidFeature = exports.addOneTimeToken = exports.addPortalURL = void 0
|
|
|
4
4
|
function addPortalURL(url, portalURL, env = 'production') {
|
|
5
5
|
let validPortalURL = /^(?=.{1,255}$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,245}[a-zA-Z0-9])?\.mygo1\.com$/;
|
|
6
6
|
if (env === 'staging') {
|
|
7
|
-
validPortalURL =
|
|
7
|
+
validPortalURL =
|
|
8
|
+
/^(?=.{1,255}$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,245}[a-zA-Z0-9])?\.qa\.go1\.cloud$/;
|
|
8
9
|
}
|
|
9
10
|
if (validPortalURL.test(portalURL)) {
|
|
10
11
|
url.searchParams.append('portal_url', portalURL);
|
|
@@ -25,6 +26,14 @@ function addOneTimeToken(url, oneTimeToken) {
|
|
|
25
26
|
}
|
|
26
27
|
exports.addOneTimeToken = addOneTimeToken;
|
|
27
28
|
function isValidFeature(feature) {
|
|
28
|
-
return [
|
|
29
|
+
return [
|
|
30
|
+
'ai-chat',
|
|
31
|
+
'content-hub',
|
|
32
|
+
'preview',
|
|
33
|
+
'library',
|
|
34
|
+
'search',
|
|
35
|
+
'wallet',
|
|
36
|
+
'learner-search',
|
|
37
|
+
].includes(feature);
|
|
29
38
|
}
|
|
30
39
|
exports.isValidFeature = isValidFeature;
|
package/dist/common/types.d.ts
CHANGED
|
@@ -28,12 +28,15 @@ export interface FeatureAttributesPreview {
|
|
|
28
28
|
id: number;
|
|
29
29
|
experience?: 'manager' | 'learner';
|
|
30
30
|
}
|
|
31
|
-
export
|
|
31
|
+
export interface FeatureAttributesWallet {
|
|
32
|
+
walletMode: 'setup' | 'main';
|
|
33
|
+
}
|
|
34
|
+
export type FeatureAttributes = FeatureAttributesAIChat | FeatureAttributesPreview | FeatureAttributesWallet;
|
|
32
35
|
export interface AdditionalUserInfo {
|
|
33
36
|
jobTitle: string;
|
|
34
37
|
}
|
|
35
38
|
export interface InitOptions {
|
|
36
|
-
feature: 'ai-chat' | 'content-hub' | 'preview' | 'library' | 'search';
|
|
39
|
+
feature: 'ai-chat' | 'content-hub' | 'preview' | 'library' | 'search' | 'wallet' | 'learner-search';
|
|
37
40
|
iframeParentId?: string;
|
|
38
41
|
iframeParentElement?: HTMLElement;
|
|
39
42
|
featureAttributes?: FeatureAttributes;
|