@omni-co/embed 0.4.5 → 0.4.6-alpha.1
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 +3 -1
- package/lib/cjs/signature.d.ts +5 -1
- package/lib/cjs/signature.js +2 -1
- package/lib/cjs/types.d.ts +4 -0
- package/lib/esm/embed.js +3 -1
- package/lib/esm/signature.d.ts +5 -1
- package/lib/esm/signature.js +2 -1
- package/lib/esm/types.d.ts +4 -0
- package/package.json +1 -1
package/lib/cjs/embed.js
CHANGED
|
@@ -36,7 +36,7 @@ const validateProps = (props) => {
|
|
|
36
36
|
};
|
|
37
37
|
const embedSsoContent = async (props) => {
|
|
38
38
|
validateProps(props);
|
|
39
|
-
let { accessBoost, connectionRoles: rawConnectionRoles, contentPath, customTheme: rawCustomTheme, customThemeId, externalId, filterSearchParam, linkAccess, mode, name, nonce, port, secret, userAttributes: rawUserAttributes, entity, prefersDark, theme, entityFolderContentRole, groups: rawGroups, } = props;
|
|
39
|
+
let { accessBoost, connectionRoles: rawConnectionRoles, contentPath, customTheme: rawCustomTheme, customThemeId, email, externalId, filterSearchParam, linkAccess, mode, name, nonce, port, secret, userAttributes: rawUserAttributes, entity, prefersDark, theme, entityFolderContentRole, groups: rawGroups, } = props;
|
|
40
40
|
let host, domain, organizationName;
|
|
41
41
|
if ("host" in props)
|
|
42
42
|
host = props.host;
|
|
@@ -68,6 +68,7 @@ const embedSsoContent = async (props) => {
|
|
|
68
68
|
connectionRoles,
|
|
69
69
|
customTheme,
|
|
70
70
|
customThemeId,
|
|
71
|
+
email,
|
|
71
72
|
entity,
|
|
72
73
|
entityFolderContentRole,
|
|
73
74
|
filterSearchParam,
|
|
@@ -100,6 +101,7 @@ const embedSsoContent = async (props) => {
|
|
|
100
101
|
entityFolderContentRole &&
|
|
101
102
|
url.searchParams.append("entityFolderContentRole", entityFolderContentRole);
|
|
102
103
|
groups && url.searchParams.append("groups", groups);
|
|
104
|
+
email && url.searchParams.append("email", email);
|
|
103
105
|
return url.toString();
|
|
104
106
|
};
|
|
105
107
|
const buildContentPath = (contentType, contentId) => `/${contentType}/${contentId}`;
|
package/lib/cjs/signature.d.ts
CHANGED
|
@@ -46,6 +46,10 @@ type SignatureProps = {
|
|
|
46
46
|
* The custom theme id to be sent with the request. This Id refers to an Custom Theme created in the Omni App.
|
|
47
47
|
*/
|
|
48
48
|
customThemeId?: string;
|
|
49
|
+
/**
|
|
50
|
+
* The email of the embed user.
|
|
51
|
+
*/
|
|
52
|
+
email?: string;
|
|
49
53
|
/**
|
|
50
54
|
* An associated entity / group for the embed user.
|
|
51
55
|
*/
|
|
@@ -87,6 +91,6 @@ type SignatureProps = {
|
|
|
87
91
|
};
|
|
88
92
|
export declare const getSignature: ({ secret, ...props }: SignatureProps) => string;
|
|
89
93
|
export declare const TEST_ONLY: {
|
|
90
|
-
generateStringForSignature: ({ loginUrl, contentPath, externalId, name, nonce, accessBoost, connectionRoles, customTheme, customThemeId, entity, entityFolderContentRole, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, userAttributes, }: Omit<SignatureProps, "secret">) => string;
|
|
94
|
+
generateStringForSignature: ({ loginUrl, contentPath, externalId, name, nonce, accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityFolderContentRole, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, userAttributes, }: Omit<SignatureProps, "secret">) => string;
|
|
91
95
|
};
|
|
92
96
|
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, entity, entityFolderContentRole, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, userAttributes, }) => {
|
|
20
|
+
accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityFolderContentRole, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, 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 = {
|
|
@@ -25,6 +25,7 @@ accessBoost, connectionRoles, customTheme, customThemeId, entity, entityFolderCo
|
|
|
25
25
|
...(connectionRoles && { connectionRoles }),
|
|
26
26
|
...(customTheme && { customTheme }),
|
|
27
27
|
...(customThemeId && { customThemeId }),
|
|
28
|
+
...(email && { email }),
|
|
28
29
|
...(entity && { entity }),
|
|
29
30
|
...(entityFolderContentRole && { entityFolderContentRole }),
|
|
30
31
|
...(filterSearchParam && { filterSearchParam }),
|
package/lib/cjs/types.d.ts
CHANGED
|
@@ -32,6 +32,10 @@ type EmbedSsoBaseProps = {
|
|
|
32
32
|
* Optional groups setting. An array of group names that the user will be added to.
|
|
33
33
|
*/
|
|
34
34
|
groups?: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Optional email setting for the generated embed user.
|
|
37
|
+
*/
|
|
38
|
+
email?: string;
|
|
35
39
|
nonce?: string;
|
|
36
40
|
port?: number;
|
|
37
41
|
} & ({
|
package/lib/esm/embed.js
CHANGED
|
@@ -33,7 +33,7 @@ const validateProps = (props) => {
|
|
|
33
33
|
};
|
|
34
34
|
const embedSsoContent = async (props) => {
|
|
35
35
|
validateProps(props);
|
|
36
|
-
let { accessBoost, connectionRoles: rawConnectionRoles, contentPath, customTheme: rawCustomTheme, customThemeId, externalId, filterSearchParam, linkAccess, mode, name, nonce, port, secret, userAttributes: rawUserAttributes, entity, prefersDark, theme, entityFolderContentRole, groups: rawGroups, } = props;
|
|
36
|
+
let { accessBoost, connectionRoles: rawConnectionRoles, contentPath, customTheme: rawCustomTheme, customThemeId, email, externalId, filterSearchParam, linkAccess, mode, name, nonce, port, secret, userAttributes: rawUserAttributes, entity, prefersDark, theme, entityFolderContentRole, groups: rawGroups, } = props;
|
|
37
37
|
let host, domain, organizationName;
|
|
38
38
|
if ("host" in props)
|
|
39
39
|
host = props.host;
|
|
@@ -65,6 +65,7 @@ const embedSsoContent = async (props) => {
|
|
|
65
65
|
connectionRoles,
|
|
66
66
|
customTheme,
|
|
67
67
|
customThemeId,
|
|
68
|
+
email,
|
|
68
69
|
entity,
|
|
69
70
|
entityFolderContentRole,
|
|
70
71
|
filterSearchParam,
|
|
@@ -97,6 +98,7 @@ const embedSsoContent = async (props) => {
|
|
|
97
98
|
entityFolderContentRole &&
|
|
98
99
|
url.searchParams.append("entityFolderContentRole", entityFolderContentRole);
|
|
99
100
|
groups && url.searchParams.append("groups", groups);
|
|
101
|
+
email && url.searchParams.append("email", email);
|
|
100
102
|
return url.toString();
|
|
101
103
|
};
|
|
102
104
|
const buildContentPath = (contentType, contentId) => `/${contentType}/${contentId}`;
|
package/lib/esm/signature.d.ts
CHANGED
|
@@ -46,6 +46,10 @@ type SignatureProps = {
|
|
|
46
46
|
* The custom theme id to be sent with the request. This Id refers to an Custom Theme created in the Omni App.
|
|
47
47
|
*/
|
|
48
48
|
customThemeId?: string;
|
|
49
|
+
/**
|
|
50
|
+
* The email of the embed user.
|
|
51
|
+
*/
|
|
52
|
+
email?: string;
|
|
49
53
|
/**
|
|
50
54
|
* An associated entity / group for the embed user.
|
|
51
55
|
*/
|
|
@@ -87,6 +91,6 @@ type SignatureProps = {
|
|
|
87
91
|
};
|
|
88
92
|
export declare const getSignature: ({ secret, ...props }: SignatureProps) => string;
|
|
89
93
|
export declare const TEST_ONLY: {
|
|
90
|
-
generateStringForSignature: ({ loginUrl, contentPath, externalId, name, nonce, accessBoost, connectionRoles, customTheme, customThemeId, entity, entityFolderContentRole, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, userAttributes, }: Omit<SignatureProps, "secret">) => string;
|
|
94
|
+
generateStringForSignature: ({ loginUrl, contentPath, externalId, name, nonce, accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityFolderContentRole, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, userAttributes, }: Omit<SignatureProps, "secret">) => string;
|
|
91
95
|
};
|
|
92
96
|
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, entity, entityFolderContentRole, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, userAttributes, }) => {
|
|
13
|
+
accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityFolderContentRole, filterSearchParam, groups, linkAccess, mode, prefersDark, theme, 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 = {
|
|
@@ -18,6 +18,7 @@ accessBoost, connectionRoles, customTheme, customThemeId, entity, entityFolderCo
|
|
|
18
18
|
...(connectionRoles && { connectionRoles }),
|
|
19
19
|
...(customTheme && { customTheme }),
|
|
20
20
|
...(customThemeId && { customThemeId }),
|
|
21
|
+
...(email && { email }),
|
|
21
22
|
...(entity && { entity }),
|
|
22
23
|
...(entityFolderContentRole && { entityFolderContentRole }),
|
|
23
24
|
...(filterSearchParam && { filterSearchParam }),
|
package/lib/esm/types.d.ts
CHANGED
|
@@ -32,6 +32,10 @@ type EmbedSsoBaseProps = {
|
|
|
32
32
|
* Optional groups setting. An array of group names that the user will be added to.
|
|
33
33
|
*/
|
|
34
34
|
groups?: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Optional email setting for the generated embed user.
|
|
37
|
+
*/
|
|
38
|
+
email?: string;
|
|
35
39
|
nonce?: string;
|
|
36
40
|
port?: number;
|
|
37
41
|
} & ({
|
package/package.json
CHANGED