@go1/go1-embedding-react-sdk 0.0.76 → 0.1.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/README.md +9 -1
- package/dist/CHANGELOG.md +7 -0
- package/dist/README.md +9 -1
- package/dist/common/params.js +4 -5
- package/dist/common/types.d.ts +13 -6
- package/dist/common/types.js +1 -0
- package/dist/go1-embedding-react-sdk/src/index.js +1 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -159,6 +159,13 @@ export interface FeatureAttributesGo1LearnSearch extends FeatureAttributeCommon
|
|
|
159
159
|
searchProvider?: string; // If the embedding search feature includes a search provider, the app will initialize with the pre-filled search provider.
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
export type FeatureAttributesRecommendations = Omit<FeatureAttributesGo1LearnSearch, 'searchProvider'> & {
|
|
163
|
+
providers?: string[]; // If the embedding recommendations feature includes a search providers, the app will initialize with the pre-filled search provider
|
|
164
|
+
skills?: string[]; // If the embedding recommendations feature includes a search skills, the app will initialize with the pre-filled search skills
|
|
165
|
+
topics?: string[]; // If the embedding recommendations feature includes a search topics, the app will initialize with the pre-filled search topics
|
|
166
|
+
sort?: string; // If the embedding recommendations feature includes a search sort, the app will initialize with the pre-filled search sort
|
|
167
|
+
}
|
|
168
|
+
|
|
162
169
|
export type FeatureAttributes =
|
|
163
170
|
| FeatureAttributesAIChat
|
|
164
171
|
| FeatureAttributesPreview
|
|
@@ -166,7 +173,8 @@ export type FeatureAttributes =
|
|
|
166
173
|
| FeatureAttributesLibrary
|
|
167
174
|
| FeatureAttributesSearch
|
|
168
175
|
| FeatureAttributesMyPlaylists
|
|
169
|
-
| FeatureAttributesMyLearning
|
|
176
|
+
| FeatureAttributesMyLearning
|
|
177
|
+
| FeatureAttributesRecommendations;
|
|
170
178
|
|
|
171
179
|
export interface AdditionalUserInfo {
|
|
172
180
|
jobTitle: string;
|
package/dist/README.md
CHANGED
|
@@ -159,6 +159,13 @@ export interface FeatureAttributesGo1LearnSearch extends FeatureAttributeCommon
|
|
|
159
159
|
searchProvider?: string; // If the embedding search feature includes a search provider, the app will initialize with the pre-filled search provider.
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
export type FeatureAttributesRecommendations = Omit<FeatureAttributesGo1LearnSearch, 'searchProvider'> & {
|
|
163
|
+
providers?: string[]; // If the embedding recommendations feature includes a search providers, the app will initialize with the pre-filled search provider
|
|
164
|
+
skills?: string[]; // If the embedding recommendations feature includes a search skills, the app will initialize with the pre-filled search skills
|
|
165
|
+
topics?: string[]; // If the embedding recommendations feature includes a search topics, the app will initialize with the pre-filled search topics
|
|
166
|
+
sort?: string; // If the embedding recommendations feature includes a search sort, the app will initialize with the pre-filled search sort
|
|
167
|
+
}
|
|
168
|
+
|
|
162
169
|
export type FeatureAttributes =
|
|
163
170
|
| FeatureAttributesAIChat
|
|
164
171
|
| FeatureAttributesPreview
|
|
@@ -166,7 +173,8 @@ export type FeatureAttributes =
|
|
|
166
173
|
| FeatureAttributesLibrary
|
|
167
174
|
| FeatureAttributesSearch
|
|
168
175
|
| FeatureAttributesMyPlaylists
|
|
169
|
-
| FeatureAttributesMyLearning
|
|
176
|
+
| FeatureAttributesMyLearning
|
|
177
|
+
| FeatureAttributesRecommendations;
|
|
170
178
|
|
|
171
179
|
export interface AdditionalUserInfo {
|
|
172
180
|
jobTitle: string;
|
package/dist/common/params.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.addPortalURL = addPortalURL;
|
|
4
|
+
exports.addOneTimeToken = addOneTimeToken;
|
|
5
|
+
exports.isValidOTT = isValidOTT;
|
|
6
|
+
exports.isValidFeature = isValidFeature;
|
|
4
7
|
const types_1 = require("./types");
|
|
5
8
|
function addPortalURL(url, portalURL, env = 'production') {
|
|
6
9
|
let validPortalURL = /^(?=.{1,255}$)([a-zA-Z0-9-]+\.)+mygo1\.com$/;
|
|
@@ -14,7 +17,6 @@ function addPortalURL(url, portalURL, env = 'production') {
|
|
|
14
17
|
throw new Error(`Invalid formatting for portalURL ${portalURL}, env ${env}`);
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
|
-
exports.addPortalURL = addPortalURL;
|
|
18
20
|
function addOneTimeToken(url, oneTimeToken) {
|
|
19
21
|
if (isValidOTT(oneTimeToken)) {
|
|
20
22
|
url.searchParams.append('one_time_token', oneTimeToken);
|
|
@@ -23,13 +25,10 @@ function addOneTimeToken(url, oneTimeToken) {
|
|
|
23
25
|
throw new Error('Invalid formatting for oneTimeToken');
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
|
-
exports.addOneTimeToken = addOneTimeToken;
|
|
27
28
|
function isValidOTT(oneTimeToken) {
|
|
28
29
|
const validOTT = /^[A-Za-z0-9]+$/;
|
|
29
30
|
return validOTT.test(oneTimeToken);
|
|
30
31
|
}
|
|
31
|
-
exports.isValidOTT = isValidOTT;
|
|
32
32
|
function isValidFeature(feature) {
|
|
33
33
|
return types_1.features.includes(feature);
|
|
34
34
|
}
|
|
35
|
-
exports.isValidFeature = isValidFeature;
|
package/dist/common/types.d.ts
CHANGED
|
@@ -16,15 +16,16 @@ export interface AdditionalInfoMessage {
|
|
|
16
16
|
export interface ThemeInformation {
|
|
17
17
|
accent: string;
|
|
18
18
|
}
|
|
19
|
-
export type Go1MessageType = 'preview_start_content' | 'preview_close' | 'preview_add_content_success' | 'preview_add_content_failure' | 'preview_remove_content_success' | 'preview_remove_content_failure' | 'parent_show_preview' | 'set_additional_embedding_data' | 'go1_app_initialised' | 'ott_required' | 'search_result_selected' | 'search_filter_toggle' | 'search_redirected' | 'pass_ott' | 'logout' | 'sync_content' | 'open_save_to_playlist_modal' | 'update_experience' | 'inter_feature_navigation' | 'side_drawer_open' | 'side_drawer_close' | 'elysium_modal_open' | 'elysium_modal_close' | 'play_content' | 'go1pay_custom_data';
|
|
20
|
-
export
|
|
19
|
+
export type Go1MessageType = 'preview_start_content' | 'preview_close' | 'preview_add_content_success' | 'preview_add_content_failure' | 'preview_remove_content_success' | 'preview_remove_content_failure' | 'parent_show_preview' | 'set_additional_embedding_data' | 'go1_app_initialised' | 'ott_required' | 'search_result_selected' | 'search_filter_toggle' | 'search_redirected' | 'pass_ott' | 'logout' | 'sync_content' | 'open_save_to_playlist_modal' | 'update_experience' | 'inter_feature_navigation' | 'side_drawer_open' | 'side_drawer_close' | 'elysium_modal_open' | 'elysium_modal_close' | 'play_content' | 'go1pay_custom_data' | 'bulk_upload_content' | 'bulk_upload_metadata' | 'bulk_upload_close';
|
|
20
|
+
export type Go1Message = {
|
|
21
21
|
type: Go1MessageType;
|
|
22
22
|
payload?: any;
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
24
|
export type ExternalExperience = 'manager' | 'learner' | 'role-aware';
|
|
25
25
|
export interface FeatureAttributeCommon {
|
|
26
26
|
shouldSuppressPreview?: boolean;
|
|
27
27
|
shouldSuppressOpeningPlayer?: boolean;
|
|
28
|
+
shouldShowSelectWelcomeModal?: boolean;
|
|
28
29
|
experience?: ExternalExperience;
|
|
29
30
|
contentScope?: 'subscription' | 'library';
|
|
30
31
|
}
|
|
@@ -51,6 +52,7 @@ export interface FeatureAttributesWallet extends FeatureAttributeCommon {
|
|
|
51
52
|
}
|
|
52
53
|
export interface FeatureAttributesBulkUpload extends FeatureAttributeCommon {
|
|
53
54
|
bulkMode: 'create' | 'update';
|
|
55
|
+
isStandalone?: boolean;
|
|
54
56
|
}
|
|
55
57
|
export interface FeatureAttributesContentStatus extends FeatureAttributeCommon {
|
|
56
58
|
isStandalone?: boolean;
|
|
@@ -80,13 +82,18 @@ export interface FeatureAttributesMyLearning extends FeatureAttributeCommon {
|
|
|
80
82
|
export interface FeatureAttributesGo1LearnSearch extends FeatureAttributeCommon {
|
|
81
83
|
searchTerm?: string;
|
|
82
84
|
searchProvider?: string;
|
|
83
|
-
searchTab?: 'items' | 'playlists';
|
|
84
85
|
}
|
|
85
|
-
export type
|
|
86
|
+
export type FeatureAttributesRecommendations = Omit<FeatureAttributesGo1LearnSearch, 'searchProvider'> & {
|
|
87
|
+
providers?: string[];
|
|
88
|
+
skills?: string[];
|
|
89
|
+
topics?: string[];
|
|
90
|
+
sort?: string;
|
|
91
|
+
};
|
|
92
|
+
export type FeatureAttributes = FeatureAttributesAIChat | FeatureAttributesPreview | FeatureAttributesWallet | FeatureAttributesLibrary | FeatureAttributesSearch | FeatureAttributesMyPlaylists | FeatureAttributesMyLearning | FeatureAttributesBulkUpload | FeatureAttributesContentStatus | FeatureAttributesGo1LearnSearch | FeatureAttributesRecommendations;
|
|
86
93
|
export interface AdditionalUserInfo {
|
|
87
94
|
jobTitle: string;
|
|
88
95
|
}
|
|
89
|
-
export declare const features: readonly ["ai-chat", "content-hub", "preview", "library", "search", "wallet", "content-retirement", "my-playlists", "activity-feed", "my-learning", "insights", "go1-learn/library", "go1-learn/my-learning", "go1-learn/learner-content", "go1-learn/search", "bulk-upload", "content-status", "partner-sales", "home"];
|
|
96
|
+
export declare const features: readonly ["ai-chat", "content-hub", "preview", "library", "search", "wallet", "content-retirement", "my-playlists", "activity-feed", "my-learning", "insights", "go1-learn/library", "go1-learn/my-learning", "go1-learn/learner-content", "go1-learn/search", "bulk-upload", "content-status", "partner-sales", "home", "recommendations"];
|
|
90
97
|
export type FeatureType = (typeof features)[number];
|
|
91
98
|
export interface InitOptions {
|
|
92
99
|
feature: FeatureType;
|
package/dist/common/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useGo1ContentView =
|
|
3
|
+
exports.useGo1ContentView = useGo1ContentView;
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const constants_1 = require("../../common/constants");
|
|
@@ -78,7 +78,6 @@ function useGo1ContentView(props) {
|
|
|
78
78
|
}, [iframeRef, iframeURL, iframeID]);
|
|
79
79
|
return { sendMessageToGo1, ContentView };
|
|
80
80
|
}
|
|
81
|
-
exports.useGo1ContentView = useGo1ContentView;
|
|
82
81
|
function Go1ContentView(iframeRef, iframeURL, iframeID, userProps) {
|
|
83
82
|
return (React.createElement("iframe", { id: iframeID, ref: iframeRef, src: iframeURL.toString(), style: { border: 0, width: '100%', height: '100%' }, ...userProps }));
|
|
84
83
|
}
|