@go1/go1-embedding-react-sdk 0.6.0 → 0.7.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 +15 -0
- package/dist/CHANGELOG.md +6 -0
- package/dist/README.md +15 -0
- package/dist/common/params.d.ts +1 -0
- package/dist/common/params.js +4 -0
- package/dist/common/types.d.ts +7 -0
- package/dist/go1-embedding-react-sdk/src/index.js +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -58,7 +58,13 @@ export interface FeatureAttributeCommon {
|
|
|
58
58
|
shouldSuppressBookmark?: boolean;
|
|
59
59
|
shouldSuppressPlaylistAdministration?: boolean;
|
|
60
60
|
shouldSuppressShareLink?: boolean;
|
|
61
|
+
shouldSuppressLibrary?: boolean;
|
|
62
|
+
shouldSuppressPlaylist?: boolean;
|
|
63
|
+
shouldSuppressCopyRightFooter?: boolean;
|
|
64
|
+
shouldSuppressPlay?: boolean;
|
|
65
|
+
shouldSuppressExport?: boolean;
|
|
61
66
|
contentScope?: 'subscription' | 'library';
|
|
67
|
+
shouldSuppressEndorsement?: boolean;
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
|
|
@@ -104,7 +110,13 @@ export interface FeatureAttributeCommon {
|
|
|
104
110
|
shouldSuppressBookmark?: boolean;
|
|
105
111
|
shouldSuppressPlaylistAdministration?: boolean;
|
|
106
112
|
shouldSuppressShareLink?: boolean;
|
|
113
|
+
shouldSuppressLibrary?: boolean;
|
|
114
|
+
shouldSuppressPlaylist?: boolean;
|
|
115
|
+
shouldSuppressCopyRightFooter?: boolean;
|
|
116
|
+
shouldSuppressPlay?: boolean;
|
|
117
|
+
shouldSuppressExport?: boolean;
|
|
107
118
|
contentScope?: 'subscription' | 'library';
|
|
119
|
+
shouldSuppressEndorsement?: boolean;
|
|
108
120
|
}
|
|
109
121
|
|
|
110
122
|
/**
|
|
@@ -221,6 +233,8 @@ export interface InitOptions {
|
|
|
221
233
|
integrationSystemId?: string;
|
|
222
234
|
/** Optional Id that let us know which integration system users are coming from, if using an intermediary system to embed */
|
|
223
235
|
presentingIntegrationSystemId?: string;
|
|
236
|
+
/** Optional flag to control JWT persistence in browser storage, if false, JWT will not be stored in localStorage, sessionStorage, or cookies */
|
|
237
|
+
persistJWT?: boolean;
|
|
224
238
|
}
|
|
225
239
|
```
|
|
226
240
|
|
|
@@ -253,6 +267,7 @@ const options = useMemo<ContentViewProps>(() => {
|
|
|
253
267
|
featureAttributes: {
|
|
254
268
|
shouldSuppressShareLink: true,
|
|
255
269
|
},
|
|
270
|
+
persistJWT: false,
|
|
256
271
|
onGo1MessageReceived,
|
|
257
272
|
additionalUserInfo: {
|
|
258
273
|
jobTitle: 'Sales development representative',
|
package/dist/CHANGELOG.md
CHANGED
package/dist/README.md
CHANGED
|
@@ -58,7 +58,13 @@ export interface FeatureAttributeCommon {
|
|
|
58
58
|
shouldSuppressBookmark?: boolean;
|
|
59
59
|
shouldSuppressPlaylistAdministration?: boolean;
|
|
60
60
|
shouldSuppressShareLink?: boolean;
|
|
61
|
+
shouldSuppressLibrary?: boolean;
|
|
62
|
+
shouldSuppressPlaylist?: boolean;
|
|
63
|
+
shouldSuppressCopyRightFooter?: boolean;
|
|
64
|
+
shouldSuppressPlay?: boolean;
|
|
65
|
+
shouldSuppressExport?: boolean;
|
|
61
66
|
contentScope?: 'subscription' | 'library';
|
|
67
|
+
shouldSuppressEndorsement?: boolean;
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
|
|
@@ -104,7 +110,13 @@ export interface FeatureAttributeCommon {
|
|
|
104
110
|
shouldSuppressBookmark?: boolean;
|
|
105
111
|
shouldSuppressPlaylistAdministration?: boolean;
|
|
106
112
|
shouldSuppressShareLink?: boolean;
|
|
113
|
+
shouldSuppressLibrary?: boolean;
|
|
114
|
+
shouldSuppressPlaylist?: boolean;
|
|
115
|
+
shouldSuppressCopyRightFooter?: boolean;
|
|
116
|
+
shouldSuppressPlay?: boolean;
|
|
117
|
+
shouldSuppressExport?: boolean;
|
|
107
118
|
contentScope?: 'subscription' | 'library';
|
|
119
|
+
shouldSuppressEndorsement?: boolean;
|
|
108
120
|
}
|
|
109
121
|
|
|
110
122
|
/**
|
|
@@ -221,6 +233,8 @@ export interface InitOptions {
|
|
|
221
233
|
integrationSystemId?: string;
|
|
222
234
|
/** Optional Id that let us know which integration system users are coming from, if using an intermediary system to embed */
|
|
223
235
|
presentingIntegrationSystemId?: string;
|
|
236
|
+
/** Optional flag to control JWT persistence in browser storage, if false, JWT will not be stored in localStorage, sessionStorage, or cookies */
|
|
237
|
+
persistJWT?: boolean;
|
|
224
238
|
}
|
|
225
239
|
```
|
|
226
240
|
|
|
@@ -253,6 +267,7 @@ const options = useMemo<ContentViewProps>(() => {
|
|
|
253
267
|
featureAttributes: {
|
|
254
268
|
shouldSuppressShareLink: true,
|
|
255
269
|
},
|
|
270
|
+
persistJWT: false,
|
|
256
271
|
onGo1MessageReceived,
|
|
257
272
|
additionalUserInfo: {
|
|
258
273
|
jobTitle: 'Sales development representative',
|
package/dist/common/params.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ import { FeatureType } from './types';
|
|
|
2
2
|
export declare function addPortalURL(url: URL, portalURL: string, env?: 'staging' | 'production'): void;
|
|
3
3
|
export declare function addOneTimeToken(url: URL, oneTimeToken: string): void;
|
|
4
4
|
export declare function addForceReauth(url: URL): void;
|
|
5
|
+
export declare function addPersistJWT(url: URL, persistJWT: boolean): void;
|
|
5
6
|
export declare function isValidOTT(oneTimeToken: string): boolean;
|
|
6
7
|
export declare function isValidFeature(feature: FeatureType): boolean;
|
package/dist/common/params.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addPortalURL = addPortalURL;
|
|
4
4
|
exports.addOneTimeToken = addOneTimeToken;
|
|
5
5
|
exports.addForceReauth = addForceReauth;
|
|
6
|
+
exports.addPersistJWT = addPersistJWT;
|
|
6
7
|
exports.isValidOTT = isValidOTT;
|
|
7
8
|
exports.isValidFeature = isValidFeature;
|
|
8
9
|
const types_1 = require("./types");
|
|
@@ -29,6 +30,9 @@ function addOneTimeToken(url, oneTimeToken) {
|
|
|
29
30
|
function addForceReauth(url) {
|
|
30
31
|
url.searchParams.append('force_reauth', 'true');
|
|
31
32
|
}
|
|
33
|
+
function addPersistJWT(url, persistJWT) {
|
|
34
|
+
url.searchParams.append('persist_jwt', persistJWT.toString());
|
|
35
|
+
}
|
|
32
36
|
function isValidOTT(oneTimeToken) {
|
|
33
37
|
const validOTT = /^[A-Za-z0-9]+$/;
|
|
34
38
|
return validOTT.test(oneTimeToken);
|
package/dist/common/types.d.ts
CHANGED
|
@@ -39,8 +39,14 @@ export interface FeatureAttributeCommon {
|
|
|
39
39
|
shouldSuppressBookmark?: boolean;
|
|
40
40
|
shouldSuppressPlaylistAdministration?: boolean;
|
|
41
41
|
shouldSuppressShareLink?: boolean;
|
|
42
|
+
shouldSuppressLibrary?: boolean;
|
|
43
|
+
shouldSuppressPlaylist?: boolean;
|
|
44
|
+
shouldSuppressCopyRightFooter?: boolean;
|
|
45
|
+
shouldSuppressPlay?: boolean;
|
|
46
|
+
shouldSuppressExport?: boolean;
|
|
42
47
|
experience?: ExternalExperience;
|
|
43
48
|
contentScope?: 'subscription' | 'library';
|
|
49
|
+
shouldSuppressEndorsement?: boolean;
|
|
44
50
|
}
|
|
45
51
|
interface FeatureAttributesPreviewCommon extends FeatureAttributeCommon {
|
|
46
52
|
startWith1Player?: boolean;
|
|
@@ -127,5 +133,6 @@ export interface InitOptions {
|
|
|
127
133
|
presentingIntegrationSystemId?: string;
|
|
128
134
|
previewHost?: string;
|
|
129
135
|
disableFSOuterScript?: boolean;
|
|
136
|
+
persistJWT?: boolean;
|
|
130
137
|
}
|
|
131
138
|
export {};
|
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const constants_1 = require("../../common/constants");
|
|
7
7
|
const params_1 = require("../../common/params");
|
|
8
8
|
function useGo1ContentView(props) {
|
|
9
|
-
const { feature, featureAttributes, portalURL, oneTimeToken, onGo1MessageReceived, additionalUserInfo, themeInformation, integrationSystemId, presentingIntegrationSystemId, env = 'production', previewHost, disableFSOuterScript, accessToken, } = props;
|
|
9
|
+
const { feature, featureAttributes, portalURL, oneTimeToken, onGo1MessageReceived, additionalUserInfo, themeInformation, integrationSystemId, presentingIntegrationSystemId, env = 'production', previewHost, disableFSOuterScript, accessToken, persistJWT, } = props;
|
|
10
10
|
const iframeRef = (0, react_1.useRef)(null);
|
|
11
11
|
let url = 'https://embedding.go1.com';
|
|
12
12
|
if (previewHost) {
|
|
@@ -32,9 +32,12 @@ function useGo1ContentView(props) {
|
|
|
32
32
|
if (accessToken) {
|
|
33
33
|
(0, params_1.addForceReauth)(iframeURL);
|
|
34
34
|
}
|
|
35
|
+
if (persistJWT !== undefined) {
|
|
36
|
+
(0, params_1.addPersistJWT)(iframeURL, persistJWT);
|
|
37
|
+
}
|
|
35
38
|
const iframeID = `go1-iframe-${feature}`;
|
|
36
39
|
return { iframeURL, iframeID };
|
|
37
|
-
}, [url, feature, portalURL, oneTimeToken, env, accessToken]);
|
|
40
|
+
}, [url, feature, portalURL, oneTimeToken, env, accessToken, persistJWT]);
|
|
38
41
|
const eventListenerInstance = (0, react_1.useCallback)((event) => {
|
|
39
42
|
const { _type, ...rest } = event.data;
|
|
40
43
|
if (_type === constants_1.GO1_MESSAGE) {
|