@omni-co/embed 0.10.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/lib/cjs/embed.js +10 -1
- package/lib/cjs/signature.d.ts +13 -1
- package/lib/cjs/signature.js +4 -1
- package/lib/cjs/types.d.ts +28 -2
- package/lib/cjs/types.js +1 -0
- package/lib/esm/embed.js +10 -1
- package/lib/esm/signature.d.ts +13 -1
- package/lib/esm/signature.js +4 -1
- package/lib/esm/types.d.ts +28 -2
- package/lib/esm/types.js +1 -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, entityFolderGroupContentRole, 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,9 @@ const embedSsoContent = async (props) => {
|
|
|
86
86
|
email,
|
|
87
87
|
entity,
|
|
88
88
|
entityFolderContentRole,
|
|
89
|
+
entityFolderGroupContentRole,
|
|
90
|
+
entityFolderLabel,
|
|
91
|
+
entityGroupLabel,
|
|
89
92
|
filterSearchParam,
|
|
90
93
|
groups,
|
|
91
94
|
linkAccess,
|
|
@@ -117,9 +120,15 @@ const embedSsoContent = async (props) => {
|
|
|
117
120
|
mode && url.searchParams.append("mode", mode);
|
|
118
121
|
entityFolderContentRole &&
|
|
119
122
|
url.searchParams.append("entityFolderContentRole", entityFolderContentRole);
|
|
123
|
+
entityFolderGroupContentRole &&
|
|
124
|
+
url.searchParams.append("entityFolderGroupContentRole", entityFolderGroupContentRole);
|
|
120
125
|
groups && url.searchParams.append("groups", groups);
|
|
121
126
|
email && url.searchParams.append("email", email);
|
|
122
127
|
uiSettings && url.searchParams.append("uiSettings", uiSettings);
|
|
128
|
+
entityGroupLabel &&
|
|
129
|
+
url.searchParams.append("entityGroupLabel", entityGroupLabel);
|
|
130
|
+
entityFolderLabel &&
|
|
131
|
+
url.searchParams.append("entityFolderLabel", entityFolderLabel);
|
|
123
132
|
return url.toString();
|
|
124
133
|
};
|
|
125
134
|
const buildContentPath = (contentType, contentId) => `/${contentType}/${contentId}`;
|
package/lib/cjs/signature.d.ts
CHANGED
|
@@ -58,6 +58,18 @@ type SignatureProps = {
|
|
|
58
58
|
* The content role for the embed user on the entity folder.
|
|
59
59
|
*/
|
|
60
60
|
entityFolderContentRole?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The content role for the entity group on the entity folder.
|
|
63
|
+
*/
|
|
64
|
+
entityFolderGroupContentRole?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The label for the generated entity folder.
|
|
67
|
+
*/
|
|
68
|
+
entityFolderLabel?: string;
|
|
69
|
+
/**
|
|
70
|
+
* The label for the generated entity group.
|
|
71
|
+
*/
|
|
72
|
+
entityGroupLabel?: string;
|
|
61
73
|
/**
|
|
62
74
|
* Filter search parameter.
|
|
63
75
|
*/
|
|
@@ -113,6 +125,6 @@ type SignSessionRedemptionProps = Pick<SignatureProps, "nonce" | "prefersDark" |
|
|
|
113
125
|
*/
|
|
114
126
|
export declare const signSessionRedemption: ({ requestUrl, nonce, sessionId, secret, prefersDark, theme, }: SignSessionRedemptionProps) => string;
|
|
115
127
|
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;
|
|
128
|
+
generateStringForSignature: ({ loginUrl, contentPath, externalId, name, nonce, accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityFolderContentRole, entityFolderGroupContentRole, entityFolderLabel, entityGroupLabel, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, uiSettings, userAttributes, }: Omit<SignatureProps, "secret">) => string;
|
|
117
129
|
};
|
|
118
130
|
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, entityFolderGroupContentRole, 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,9 @@ accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityF
|
|
|
28
28
|
...(email && { email }),
|
|
29
29
|
...(entity && { entity }),
|
|
30
30
|
...(entityFolderContentRole && { entityFolderContentRole }),
|
|
31
|
+
...(entityFolderGroupContentRole && { entityFolderGroupContentRole }),
|
|
32
|
+
...(entityFolderLabel && { entityFolderLabel }),
|
|
33
|
+
...(entityGroupLabel && { entityGroupLabel }),
|
|
31
34
|
...(filterSearchParam && { filterSearchParam }),
|
|
32
35
|
...(groups && { groups }),
|
|
33
36
|
...(linkAccess && { linkAccess }),
|
package/lib/cjs/types.d.ts
CHANGED
|
@@ -55,15 +55,40 @@ type EmbedSsoBaseProps = {
|
|
|
55
55
|
*/
|
|
56
56
|
mode?: EmbedSessionMode;
|
|
57
57
|
/**
|
|
58
|
-
* Optional content role setting. Can be one of "MANAGER", "EDITOR", or "
|
|
58
|
+
* Optional content role setting for the embed user on the entity folder. Can be one of "MANAGER", "EDITOR", "VIEWER", or "NO_ACCESS".
|
|
59
59
|
*
|
|
60
60
|
* MANAGER: the user will have the ability to manage content and content permissions of the entity folder.
|
|
61
61
|
*
|
|
62
62
|
* EDITOR: the user will have the ability to manage content in the entity folder.
|
|
63
63
|
*
|
|
64
64
|
* VIEWER: the user will only be able to view content in the entity folder.
|
|
65
|
+
*
|
|
66
|
+
* NO_ACCESS: the user will not have access to the entity folder. Note that the group content role must
|
|
67
|
+
* also be set to NO_ACCESS for the user to not have access to the entity folder.
|
|
65
68
|
*/
|
|
66
69
|
entityFolderContentRole?: EmbedEntityFolderContentRoles;
|
|
70
|
+
/**
|
|
71
|
+
* Optional content role setting for the entity group on the entity folder. Can be one of "MANAGER", "EDITOR", "VIEWER", or "NO_ACCESS".
|
|
72
|
+
*
|
|
73
|
+
* MANAGER: all entity group embed users will have the ability to manage content and content permissions of the entity folder.
|
|
74
|
+
*
|
|
75
|
+
* EDITOR: all entity group embed users will have the ability to manage content in the entity folder.
|
|
76
|
+
*
|
|
77
|
+
* VIEWER: all entity group embed users will only be able to view content in the entity folder.
|
|
78
|
+
*
|
|
79
|
+
* NO_ACCESS: all entity group embed users will not have access to the entity folder.
|
|
80
|
+
*/
|
|
81
|
+
entityFolderGroupContentRole?: EmbedEntityFolderContentRoles;
|
|
82
|
+
/**
|
|
83
|
+
* Optional setting that customizes the generated entity folder label. This only affects the entity folder
|
|
84
|
+
* corresponding to the `entity` parameter value in the relevant generated SSO embed URL.
|
|
85
|
+
*/
|
|
86
|
+
entityFolderLabel?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Optional setting that customizes the generated entity group label. This only affects the entity group
|
|
89
|
+
* corresponding to the `entity` parameter value in the relevant generated SSO embed URL.
|
|
90
|
+
*/
|
|
91
|
+
entityGroupLabel?: string;
|
|
67
92
|
/**
|
|
68
93
|
* Optional groups setting. An array of group names that the user will be added to.
|
|
69
94
|
*/
|
|
@@ -203,7 +228,8 @@ export declare enum EmbedConnectionRoles {
|
|
|
203
228
|
export declare enum EmbedEntityFolderContentRoles {
|
|
204
229
|
MANAGER = "MANAGER",
|
|
205
230
|
EDITOR = "EDITOR",
|
|
206
|
-
VIEWER = "VIEWER"
|
|
231
|
+
VIEWER = "VIEWER",
|
|
232
|
+
NO_ACCESS = "NO_ACCESS"
|
|
207
233
|
}
|
|
208
234
|
/**
|
|
209
235
|
* UI settings used as keys of the uiSettings sso embed parameter.
|
package/lib/cjs/types.js
CHANGED
|
@@ -82,6 +82,7 @@ var EmbedEntityFolderContentRoles;
|
|
|
82
82
|
EmbedEntityFolderContentRoles["MANAGER"] = "MANAGER";
|
|
83
83
|
EmbedEntityFolderContentRoles["EDITOR"] = "EDITOR";
|
|
84
84
|
EmbedEntityFolderContentRoles["VIEWER"] = "VIEWER";
|
|
85
|
+
EmbedEntityFolderContentRoles["NO_ACCESS"] = "NO_ACCESS";
|
|
85
86
|
})(EmbedEntityFolderContentRoles || (exports.EmbedEntityFolderContentRoles = EmbedEntityFolderContentRoles = {}));
|
|
86
87
|
/**
|
|
87
88
|
* UI settings used as keys of the uiSettings sso embed parameter.
|
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, entityFolderGroupContentRole, 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,9 @@ const embedSsoContent = async (props) => {
|
|
|
83
83
|
email,
|
|
84
84
|
entity,
|
|
85
85
|
entityFolderContentRole,
|
|
86
|
+
entityFolderGroupContentRole,
|
|
87
|
+
entityFolderLabel,
|
|
88
|
+
entityGroupLabel,
|
|
86
89
|
filterSearchParam,
|
|
87
90
|
groups,
|
|
88
91
|
linkAccess,
|
|
@@ -114,9 +117,15 @@ const embedSsoContent = async (props) => {
|
|
|
114
117
|
mode && url.searchParams.append("mode", mode);
|
|
115
118
|
entityFolderContentRole &&
|
|
116
119
|
url.searchParams.append("entityFolderContentRole", entityFolderContentRole);
|
|
120
|
+
entityFolderGroupContentRole &&
|
|
121
|
+
url.searchParams.append("entityFolderGroupContentRole", entityFolderGroupContentRole);
|
|
117
122
|
groups && url.searchParams.append("groups", groups);
|
|
118
123
|
email && url.searchParams.append("email", email);
|
|
119
124
|
uiSettings && url.searchParams.append("uiSettings", uiSettings);
|
|
125
|
+
entityGroupLabel &&
|
|
126
|
+
url.searchParams.append("entityGroupLabel", entityGroupLabel);
|
|
127
|
+
entityFolderLabel &&
|
|
128
|
+
url.searchParams.append("entityFolderLabel", entityFolderLabel);
|
|
120
129
|
return url.toString();
|
|
121
130
|
};
|
|
122
131
|
const buildContentPath = (contentType, contentId) => `/${contentType}/${contentId}`;
|
package/lib/esm/signature.d.ts
CHANGED
|
@@ -58,6 +58,18 @@ type SignatureProps = {
|
|
|
58
58
|
* The content role for the embed user on the entity folder.
|
|
59
59
|
*/
|
|
60
60
|
entityFolderContentRole?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The content role for the entity group on the entity folder.
|
|
63
|
+
*/
|
|
64
|
+
entityFolderGroupContentRole?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The label for the generated entity folder.
|
|
67
|
+
*/
|
|
68
|
+
entityFolderLabel?: string;
|
|
69
|
+
/**
|
|
70
|
+
* The label for the generated entity group.
|
|
71
|
+
*/
|
|
72
|
+
entityGroupLabel?: string;
|
|
61
73
|
/**
|
|
62
74
|
* Filter search parameter.
|
|
63
75
|
*/
|
|
@@ -113,6 +125,6 @@ type SignSessionRedemptionProps = Pick<SignatureProps, "nonce" | "prefersDark" |
|
|
|
113
125
|
*/
|
|
114
126
|
export declare const signSessionRedemption: ({ requestUrl, nonce, sessionId, secret, prefersDark, theme, }: SignSessionRedemptionProps) => string;
|
|
115
127
|
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;
|
|
128
|
+
generateStringForSignature: ({ loginUrl, contentPath, externalId, name, nonce, accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityFolderContentRole, entityFolderGroupContentRole, entityFolderLabel, entityGroupLabel, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, uiSettings, userAttributes, }: Omit<SignatureProps, "secret">) => string;
|
|
117
129
|
};
|
|
118
130
|
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, entityFolderGroupContentRole, 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,9 @@ accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityF
|
|
|
21
21
|
...(email && { email }),
|
|
22
22
|
...(entity && { entity }),
|
|
23
23
|
...(entityFolderContentRole && { entityFolderContentRole }),
|
|
24
|
+
...(entityFolderGroupContentRole && { entityFolderGroupContentRole }),
|
|
25
|
+
...(entityFolderLabel && { entityFolderLabel }),
|
|
26
|
+
...(entityGroupLabel && { entityGroupLabel }),
|
|
24
27
|
...(filterSearchParam && { filterSearchParam }),
|
|
25
28
|
...(groups && { groups }),
|
|
26
29
|
...(linkAccess && { linkAccess }),
|
package/lib/esm/types.d.ts
CHANGED
|
@@ -55,15 +55,40 @@ type EmbedSsoBaseProps = {
|
|
|
55
55
|
*/
|
|
56
56
|
mode?: EmbedSessionMode;
|
|
57
57
|
/**
|
|
58
|
-
* Optional content role setting. Can be one of "MANAGER", "EDITOR", or "
|
|
58
|
+
* Optional content role setting for the embed user on the entity folder. Can be one of "MANAGER", "EDITOR", "VIEWER", or "NO_ACCESS".
|
|
59
59
|
*
|
|
60
60
|
* MANAGER: the user will have the ability to manage content and content permissions of the entity folder.
|
|
61
61
|
*
|
|
62
62
|
* EDITOR: the user will have the ability to manage content in the entity folder.
|
|
63
63
|
*
|
|
64
64
|
* VIEWER: the user will only be able to view content in the entity folder.
|
|
65
|
+
*
|
|
66
|
+
* NO_ACCESS: the user will not have access to the entity folder. Note that the group content role must
|
|
67
|
+
* also be set to NO_ACCESS for the user to not have access to the entity folder.
|
|
65
68
|
*/
|
|
66
69
|
entityFolderContentRole?: EmbedEntityFolderContentRoles;
|
|
70
|
+
/**
|
|
71
|
+
* Optional content role setting for the entity group on the entity folder. Can be one of "MANAGER", "EDITOR", "VIEWER", or "NO_ACCESS".
|
|
72
|
+
*
|
|
73
|
+
* MANAGER: all entity group embed users will have the ability to manage content and content permissions of the entity folder.
|
|
74
|
+
*
|
|
75
|
+
* EDITOR: all entity group embed users will have the ability to manage content in the entity folder.
|
|
76
|
+
*
|
|
77
|
+
* VIEWER: all entity group embed users will only be able to view content in the entity folder.
|
|
78
|
+
*
|
|
79
|
+
* NO_ACCESS: all entity group embed users will not have access to the entity folder.
|
|
80
|
+
*/
|
|
81
|
+
entityFolderGroupContentRole?: EmbedEntityFolderContentRoles;
|
|
82
|
+
/**
|
|
83
|
+
* Optional setting that customizes the generated entity folder label. This only affects the entity folder
|
|
84
|
+
* corresponding to the `entity` parameter value in the relevant generated SSO embed URL.
|
|
85
|
+
*/
|
|
86
|
+
entityFolderLabel?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Optional setting that customizes the generated entity group label. This only affects the entity group
|
|
89
|
+
* corresponding to the `entity` parameter value in the relevant generated SSO embed URL.
|
|
90
|
+
*/
|
|
91
|
+
entityGroupLabel?: string;
|
|
67
92
|
/**
|
|
68
93
|
* Optional groups setting. An array of group names that the user will be added to.
|
|
69
94
|
*/
|
|
@@ -203,7 +228,8 @@ export declare enum EmbedConnectionRoles {
|
|
|
203
228
|
export declare enum EmbedEntityFolderContentRoles {
|
|
204
229
|
MANAGER = "MANAGER",
|
|
205
230
|
EDITOR = "EDITOR",
|
|
206
|
-
VIEWER = "VIEWER"
|
|
231
|
+
VIEWER = "VIEWER",
|
|
232
|
+
NO_ACCESS = "NO_ACCESS"
|
|
207
233
|
}
|
|
208
234
|
/**
|
|
209
235
|
* UI settings used as keys of the uiSettings sso embed parameter.
|
package/lib/esm/types.js
CHANGED
|
@@ -79,6 +79,7 @@ export var EmbedEntityFolderContentRoles;
|
|
|
79
79
|
EmbedEntityFolderContentRoles["MANAGER"] = "MANAGER";
|
|
80
80
|
EmbedEntityFolderContentRoles["EDITOR"] = "EDITOR";
|
|
81
81
|
EmbedEntityFolderContentRoles["VIEWER"] = "VIEWER";
|
|
82
|
+
EmbedEntityFolderContentRoles["NO_ACCESS"] = "NO_ACCESS";
|
|
82
83
|
})(EmbedEntityFolderContentRoles || (EmbedEntityFolderContentRoles = {}));
|
|
83
84
|
/**
|
|
84
85
|
* UI settings used as keys of the uiSettings sso embed parameter.
|
package/package.json
CHANGED