@omni-co/embed 0.10.0 → 0.11.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/lib/cjs/embed.js +7 -1
- package/lib/cjs/signature.d.ts +9 -1
- package/lib/cjs/signature.js +3 -1
- package/lib/cjs/types.d.ts +10 -0
- package/lib/esm/embed.js +7 -1
- package/lib/esm/signature.d.ts +9 -1
- package/lib/esm/signature.js +3 -1
- package/lib/esm/types.d.ts +10 -0
- package/package.json +1 -1
package/lib/cjs/embed.js
CHANGED
|
@@ -54,7 +54,7 @@ const validateProps = (props) => {
|
|
|
54
54
|
};
|
|
55
55
|
const embedSsoContent = async (props) => {
|
|
56
56
|
validateProps(props);
|
|
57
|
-
let { accessBoost, connectionRoles: rawConnectionRoles, contentPath, customTheme: rawCustomTheme, customThemeId, domain, email, externalId, filterSearchParam, host, linkAccess, mode, name, nonce, organizationName, port, secret, uiSettings: rawUiSettings, userAttributes: rawUserAttributes,
|
|
57
|
+
let { accessBoost, connectionRoles: rawConnectionRoles, contentPath, customTheme: rawCustomTheme, customThemeId, domain, email, entity, entityFolderContentRole, entityFolderLabel, entityGroupLabel, externalId, filterSearchParam, groups: rawGroups, host, linkAccess, mode, name, nonce, organizationName, prefersDark, port, secret, theme, uiSettings: rawUiSettings, userAttributes: rawUserAttributes, } = props;
|
|
58
58
|
// Handle defaults
|
|
59
59
|
nonce = nonce !== null && nonce !== void 0 ? nonce : (await (0, random_str_1.random32ByteString)());
|
|
60
60
|
const uiSettings = rawUiSettings && JSON.stringify(rawUiSettings);
|
|
@@ -86,6 +86,8 @@ const embedSsoContent = async (props) => {
|
|
|
86
86
|
email,
|
|
87
87
|
entity,
|
|
88
88
|
entityFolderContentRole,
|
|
89
|
+
entityFolderLabel,
|
|
90
|
+
entityGroupLabel,
|
|
89
91
|
filterSearchParam,
|
|
90
92
|
groups,
|
|
91
93
|
linkAccess,
|
|
@@ -120,6 +122,10 @@ const embedSsoContent = async (props) => {
|
|
|
120
122
|
groups && url.searchParams.append("groups", groups);
|
|
121
123
|
email && url.searchParams.append("email", email);
|
|
122
124
|
uiSettings && url.searchParams.append("uiSettings", uiSettings);
|
|
125
|
+
entityGroupLabel &&
|
|
126
|
+
url.searchParams.append("entityGroupLabel", entityGroupLabel);
|
|
127
|
+
entityFolderLabel &&
|
|
128
|
+
url.searchParams.append("entityFolderLabel", entityFolderLabel);
|
|
123
129
|
return url.toString();
|
|
124
130
|
};
|
|
125
131
|
const buildContentPath = (contentType, contentId) => `/${contentType}/${contentId}`;
|
package/lib/cjs/signature.d.ts
CHANGED
|
@@ -58,6 +58,14 @@ type SignatureProps = {
|
|
|
58
58
|
* The content role for the embed user on the entity folder.
|
|
59
59
|
*/
|
|
60
60
|
entityFolderContentRole?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The label for the generated entity folder.
|
|
63
|
+
*/
|
|
64
|
+
entityFolderLabel?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The label for the generated entity group.
|
|
67
|
+
*/
|
|
68
|
+
entityGroupLabel?: string;
|
|
61
69
|
/**
|
|
62
70
|
* Filter search parameter.
|
|
63
71
|
*/
|
|
@@ -113,6 +121,6 @@ type SignSessionRedemptionProps = Pick<SignatureProps, "nonce" | "prefersDark" |
|
|
|
113
121
|
*/
|
|
114
122
|
export declare const signSessionRedemption: ({ requestUrl, nonce, sessionId, secret, prefersDark, theme, }: SignSessionRedemptionProps) => string;
|
|
115
123
|
export declare const TEST_ONLY: {
|
|
116
|
-
generateStringForSignature: ({ loginUrl, contentPath, externalId, name, nonce, accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityFolderContentRole, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, uiSettings, userAttributes, }: Omit<SignatureProps, "secret">) => string;
|
|
124
|
+
generateStringForSignature: ({ loginUrl, contentPath, externalId, name, nonce, accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityFolderContentRole, entityFolderLabel, entityGroupLabel, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, uiSettings, userAttributes, }: Omit<SignatureProps, "secret">) => string;
|
|
117
125
|
};
|
|
118
126
|
export {};
|
package/lib/cjs/signature.js
CHANGED
|
@@ -17,7 +17,7 @@ const generateStringForSignature = ({
|
|
|
17
17
|
// Required parameters
|
|
18
18
|
loginUrl, contentPath, externalId, name, nonce,
|
|
19
19
|
// Optional parameters
|
|
20
|
-
accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityFolderContentRole, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, uiSettings, userAttributes, }) => {
|
|
20
|
+
accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityFolderContentRole, entityFolderLabel, entityGroupLabel, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, uiSettings, userAttributes, }) => {
|
|
21
21
|
// We create a map of optional params and convert it to an array
|
|
22
22
|
// to ensure that the order of the optional params is alphabetical and consistent.
|
|
23
23
|
const optionalParamsMap = {
|
|
@@ -28,6 +28,8 @@ accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityF
|
|
|
28
28
|
...(email && { email }),
|
|
29
29
|
...(entity && { entity }),
|
|
30
30
|
...(entityFolderContentRole && { entityFolderContentRole }),
|
|
31
|
+
...(entityFolderLabel && { entityFolderLabel }),
|
|
32
|
+
...(entityGroupLabel && { entityGroupLabel }),
|
|
31
33
|
...(filterSearchParam && { filterSearchParam }),
|
|
32
34
|
...(groups && { groups }),
|
|
33
35
|
...(linkAccess && { linkAccess }),
|
package/lib/cjs/types.d.ts
CHANGED
|
@@ -64,6 +64,16 @@ type EmbedSsoBaseProps = {
|
|
|
64
64
|
* VIEWER: the user will only be able to view content in the entity folder.
|
|
65
65
|
*/
|
|
66
66
|
entityFolderContentRole?: EmbedEntityFolderContentRoles;
|
|
67
|
+
/**
|
|
68
|
+
* Optional setting that customizes the generated entity folder label. This only affects the entity folder
|
|
69
|
+
* corresponding to the `entity` parameter value in the relevant generated SSO embed URL.
|
|
70
|
+
*/
|
|
71
|
+
entityFolderLabel?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Optional setting that customizes the generated entity group label. This only affects the entity group
|
|
74
|
+
* corresponding to the `entity` parameter value in the relevant generated SSO embed URL.
|
|
75
|
+
*/
|
|
76
|
+
entityGroupLabel?: string;
|
|
67
77
|
/**
|
|
68
78
|
* Optional groups setting. An array of group names that the user will be added to.
|
|
69
79
|
*/
|
package/lib/esm/embed.js
CHANGED
|
@@ -51,7 +51,7 @@ const validateProps = (props) => {
|
|
|
51
51
|
};
|
|
52
52
|
const embedSsoContent = async (props) => {
|
|
53
53
|
validateProps(props);
|
|
54
|
-
let { accessBoost, connectionRoles: rawConnectionRoles, contentPath, customTheme: rawCustomTheme, customThemeId, domain, email, externalId, filterSearchParam, host, linkAccess, mode, name, nonce, organizationName, port, secret, uiSettings: rawUiSettings, userAttributes: rawUserAttributes,
|
|
54
|
+
let { accessBoost, connectionRoles: rawConnectionRoles, contentPath, customTheme: rawCustomTheme, customThemeId, domain, email, entity, entityFolderContentRole, entityFolderLabel, entityGroupLabel, externalId, filterSearchParam, groups: rawGroups, host, linkAccess, mode, name, nonce, organizationName, prefersDark, port, secret, theme, uiSettings: rawUiSettings, userAttributes: rawUserAttributes, } = props;
|
|
55
55
|
// Handle defaults
|
|
56
56
|
nonce = nonce !== null && nonce !== void 0 ? nonce : (await random32ByteString());
|
|
57
57
|
const uiSettings = rawUiSettings && JSON.stringify(rawUiSettings);
|
|
@@ -83,6 +83,8 @@ const embedSsoContent = async (props) => {
|
|
|
83
83
|
email,
|
|
84
84
|
entity,
|
|
85
85
|
entityFolderContentRole,
|
|
86
|
+
entityFolderLabel,
|
|
87
|
+
entityGroupLabel,
|
|
86
88
|
filterSearchParam,
|
|
87
89
|
groups,
|
|
88
90
|
linkAccess,
|
|
@@ -117,6 +119,10 @@ const embedSsoContent = async (props) => {
|
|
|
117
119
|
groups && url.searchParams.append("groups", groups);
|
|
118
120
|
email && url.searchParams.append("email", email);
|
|
119
121
|
uiSettings && url.searchParams.append("uiSettings", uiSettings);
|
|
122
|
+
entityGroupLabel &&
|
|
123
|
+
url.searchParams.append("entityGroupLabel", entityGroupLabel);
|
|
124
|
+
entityFolderLabel &&
|
|
125
|
+
url.searchParams.append("entityFolderLabel", entityFolderLabel);
|
|
120
126
|
return url.toString();
|
|
121
127
|
};
|
|
122
128
|
const buildContentPath = (contentType, contentId) => `/${contentType}/${contentId}`;
|
package/lib/esm/signature.d.ts
CHANGED
|
@@ -58,6 +58,14 @@ type SignatureProps = {
|
|
|
58
58
|
* The content role for the embed user on the entity folder.
|
|
59
59
|
*/
|
|
60
60
|
entityFolderContentRole?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The label for the generated entity folder.
|
|
63
|
+
*/
|
|
64
|
+
entityFolderLabel?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The label for the generated entity group.
|
|
67
|
+
*/
|
|
68
|
+
entityGroupLabel?: string;
|
|
61
69
|
/**
|
|
62
70
|
* Filter search parameter.
|
|
63
71
|
*/
|
|
@@ -113,6 +121,6 @@ type SignSessionRedemptionProps = Pick<SignatureProps, "nonce" | "prefersDark" |
|
|
|
113
121
|
*/
|
|
114
122
|
export declare const signSessionRedemption: ({ requestUrl, nonce, sessionId, secret, prefersDark, theme, }: SignSessionRedemptionProps) => string;
|
|
115
123
|
export declare const TEST_ONLY: {
|
|
116
|
-
generateStringForSignature: ({ loginUrl, contentPath, externalId, name, nonce, accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityFolderContentRole, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, uiSettings, userAttributes, }: Omit<SignatureProps, "secret">) => string;
|
|
124
|
+
generateStringForSignature: ({ loginUrl, contentPath, externalId, name, nonce, accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityFolderContentRole, entityFolderLabel, entityGroupLabel, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, uiSettings, userAttributes, }: Omit<SignatureProps, "secret">) => string;
|
|
117
125
|
};
|
|
118
126
|
export {};
|
package/lib/esm/signature.js
CHANGED
|
@@ -10,7 +10,7 @@ const generateStringForSignature = ({
|
|
|
10
10
|
// Required parameters
|
|
11
11
|
loginUrl, contentPath, externalId, name, nonce,
|
|
12
12
|
// Optional parameters
|
|
13
|
-
accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityFolderContentRole, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, uiSettings, userAttributes, }) => {
|
|
13
|
+
accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityFolderContentRole, entityFolderLabel, entityGroupLabel, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, uiSettings, userAttributes, }) => {
|
|
14
14
|
// We create a map of optional params and convert it to an array
|
|
15
15
|
// to ensure that the order of the optional params is alphabetical and consistent.
|
|
16
16
|
const optionalParamsMap = {
|
|
@@ -21,6 +21,8 @@ accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityF
|
|
|
21
21
|
...(email && { email }),
|
|
22
22
|
...(entity && { entity }),
|
|
23
23
|
...(entityFolderContentRole && { entityFolderContentRole }),
|
|
24
|
+
...(entityFolderLabel && { entityFolderLabel }),
|
|
25
|
+
...(entityGroupLabel && { entityGroupLabel }),
|
|
24
26
|
...(filterSearchParam && { filterSearchParam }),
|
|
25
27
|
...(groups && { groups }),
|
|
26
28
|
...(linkAccess && { linkAccess }),
|
package/lib/esm/types.d.ts
CHANGED
|
@@ -64,6 +64,16 @@ type EmbedSsoBaseProps = {
|
|
|
64
64
|
* VIEWER: the user will only be able to view content in the entity folder.
|
|
65
65
|
*/
|
|
66
66
|
entityFolderContentRole?: EmbedEntityFolderContentRoles;
|
|
67
|
+
/**
|
|
68
|
+
* Optional setting that customizes the generated entity folder label. This only affects the entity folder
|
|
69
|
+
* corresponding to the `entity` parameter value in the relevant generated SSO embed URL.
|
|
70
|
+
*/
|
|
71
|
+
entityFolderLabel?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Optional setting that customizes the generated entity group label. This only affects the entity group
|
|
74
|
+
* corresponding to the `entity` parameter value in the relevant generated SSO embed URL.
|
|
75
|
+
*/
|
|
76
|
+
entityGroupLabel?: string;
|
|
67
77
|
/**
|
|
68
78
|
* Optional groups setting. An array of group names that the user will be added to.
|
|
69
79
|
*/
|
package/package.json
CHANGED