@omni-co/embed 0.4.1 → 0.4.3
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 +4 -1
- package/lib/cjs/signature.d.ts +6 -3
- package/lib/cjs/signature.js +2 -1
- package/lib/cjs/types.d.ts +14 -1
- package/lib/cjs/types.js +14 -2
- package/lib/esm/embed.js +4 -1
- package/lib/esm/signature.d.ts +6 -3
- package/lib/esm/signature.js +2 -1
- package/lib/esm/types.d.ts +14 -1
- package/lib/esm/types.js +13 -1
- 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, } = props;
|
|
39
|
+
let { accessBoost, connectionRoles: rawConnectionRoles, contentPath, customTheme: rawCustomTheme, customThemeId, externalId, filterSearchParam, linkAccess, mode, name, nonce, port, secret, userAttributes: rawUserAttributes, entity, prefersDark, theme, entityFolderContentRole, } = props;
|
|
40
40
|
let host, domain, organizationName;
|
|
41
41
|
if ("host" in props)
|
|
42
42
|
host = props.host;
|
|
@@ -72,6 +72,7 @@ const embedSsoContent = async (props) => {
|
|
|
72
72
|
connectionRoles,
|
|
73
73
|
accessBoost,
|
|
74
74
|
mode,
|
|
75
|
+
entityFolderContentRole,
|
|
75
76
|
});
|
|
76
77
|
// Build and return the signed url
|
|
77
78
|
url.searchParams.append("contentPath", contentPath);
|
|
@@ -92,6 +93,8 @@ const embedSsoContent = async (props) => {
|
|
|
92
93
|
connectionRoles &&
|
|
93
94
|
url.searchParams.append("connectionRoles", connectionRoles);
|
|
94
95
|
mode && url.searchParams.append("mode", mode);
|
|
96
|
+
entityFolderContentRole &&
|
|
97
|
+
url.searchParams.append("entityFolderContentRole", entityFolderContentRole);
|
|
95
98
|
return url.toString();
|
|
96
99
|
};
|
|
97
100
|
const buildContentPath = (contentType, contentId) => `/${contentType}/${contentId}`;
|
package/lib/cjs/signature.d.ts
CHANGED
|
@@ -47,10 +47,13 @@ type SignatureProps = {
|
|
|
47
47
|
*/
|
|
48
48
|
customThemeId?: string;
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
51
|
-
* user will this value assigned to its omni_user_embed_entity user attribute.
|
|
50
|
+
* An associated entity / group for the embed user.
|
|
52
51
|
*/
|
|
53
52
|
entity?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The content role for the embed user on the entity folder.
|
|
55
|
+
*/
|
|
56
|
+
entityFolderContentRole?: string;
|
|
54
57
|
/**
|
|
55
58
|
* Filter search parameter.
|
|
56
59
|
*/
|
|
@@ -80,6 +83,6 @@ type SignatureProps = {
|
|
|
80
83
|
};
|
|
81
84
|
export declare const getSignature: ({ secret, ...props }: SignatureProps) => string;
|
|
82
85
|
export declare const TEST_ONLY: {
|
|
83
|
-
generateStringForSignature: ({ loginUrl, contentPath, externalId, name, nonce, accessBoost, connectionRoles, customTheme, customThemeId, entity, filterSearchParam, linkAccess, mode, prefersDark, theme, userAttributes, }: Omit<SignatureProps, "secret">) => string;
|
|
86
|
+
generateStringForSignature: ({ loginUrl, contentPath, externalId, name, nonce, accessBoost, connectionRoles, customTheme, customThemeId, entity, entityFolderContentRole, filterSearchParam, linkAccess, mode, prefersDark, theme, userAttributes, }: Omit<SignatureProps, "secret">) => string;
|
|
84
87
|
};
|
|
85
88
|
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, filterSearchParam, linkAccess, mode, prefersDark, theme, userAttributes, }) => {
|
|
20
|
+
accessBoost, connectionRoles, customTheme, customThemeId, entity, entityFolderContentRole, filterSearchParam, 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 = {
|
|
@@ -26,6 +26,7 @@ accessBoost, connectionRoles, customTheme, customThemeId, entity, filterSearchPa
|
|
|
26
26
|
...(customTheme && { customTheme }),
|
|
27
27
|
...(customThemeId && { customThemeId }),
|
|
28
28
|
...(entity && { entity }),
|
|
29
|
+
...(entityFolderContentRole && { entityFolderContentRole }),
|
|
29
30
|
...(filterSearchParam && { filterSearchParam }),
|
|
30
31
|
...(linkAccess && { linkAccess }),
|
|
31
32
|
...(mode && { mode }),
|
package/lib/cjs/types.d.ts
CHANGED
|
@@ -22,6 +22,12 @@ type EmbedSsoBaseProps = {
|
|
|
22
22
|
* only the content specified in the contentId will be embedded.
|
|
23
23
|
*/
|
|
24
24
|
mode?: EmbedSessionMode;
|
|
25
|
+
/**
|
|
26
|
+
* Optional content role setting. Can be one of "EDITOR" or "VIEWER". If set to "EDITOR", the user will have the ability to manage
|
|
27
|
+
* content in their associated embed entity folder. If set to "VIEWER", the user will only be able to view content in
|
|
28
|
+
* their associated embed entity folder.
|
|
29
|
+
*/
|
|
30
|
+
entityFolderContentRole?: EmbedEntityFolderContentRoles;
|
|
25
31
|
nonce?: string;
|
|
26
32
|
port?: number;
|
|
27
33
|
} & ({
|
|
@@ -110,11 +116,18 @@ export declare enum EmbeddedContent {
|
|
|
110
116
|
Dashboard = "dashboards",
|
|
111
117
|
Workbook = "w"
|
|
112
118
|
}
|
|
113
|
-
export declare const EmbedSsoContentDiscoveryPaths: readonly ["my"];
|
|
119
|
+
export declare const EmbedSsoContentDiscoveryPaths: readonly ["my", "entity-folder", "root"];
|
|
114
120
|
export type EmbedSsoContentDiscoveryPath = (typeof EmbedSsoContentDiscoveryPaths)[number];
|
|
115
121
|
export declare enum EmbedConnectionRoles {
|
|
116
122
|
RESTRICTED_QUERIER = "RESTRICTED_QUERIER"
|
|
117
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Levels of access a user can have to their associated embed entity folder.
|
|
126
|
+
*/
|
|
127
|
+
export declare enum EmbedEntityFolderContentRoles {
|
|
128
|
+
EDITOR = "EDITOR",
|
|
129
|
+
VIEWER = "VIEWER"
|
|
130
|
+
}
|
|
118
131
|
export type EmbedSsoContentProps = EmbedSsoBaseProps & EmbedSsoDashboardOnlyProps & EmbedContentPathProp;
|
|
119
132
|
/**
|
|
120
133
|
* Consumers of this SDK will rely on these three types to embed workbooks and dashboards.
|
package/lib/cjs/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EmbedConnectionRoles = exports.EmbedSsoContentDiscoveryPaths = exports.EmbeddedContent = exports.CustomThemeProperty = exports.EmbedSessionMode = void 0;
|
|
3
|
+
exports.EmbedEntityFolderContentRoles = exports.EmbedConnectionRoles = exports.EmbedSsoContentDiscoveryPaths = exports.EmbeddedContent = exports.CustomThemeProperty = exports.EmbedSessionMode = void 0;
|
|
4
4
|
var EmbedSessionMode;
|
|
5
5
|
(function (EmbedSessionMode) {
|
|
6
6
|
EmbedSessionMode["Application"] = "APPLICATION";
|
|
@@ -32,7 +32,11 @@ var EmbeddedContent;
|
|
|
32
32
|
EmbeddedContent["Dashboard"] = "dashboards";
|
|
33
33
|
EmbeddedContent["Workbook"] = "w";
|
|
34
34
|
})(EmbeddedContent || (exports.EmbeddedContent = EmbeddedContent = {}));
|
|
35
|
-
exports.EmbedSsoContentDiscoveryPaths = [
|
|
35
|
+
exports.EmbedSsoContentDiscoveryPaths = [
|
|
36
|
+
"my",
|
|
37
|
+
"entity-folder",
|
|
38
|
+
"root",
|
|
39
|
+
];
|
|
36
40
|
var EmbedConnectionRoles;
|
|
37
41
|
(function (EmbedConnectionRoles) {
|
|
38
42
|
// TODO: Eventually we'll want to add VIEWER. Currently though, since the sole use case of the
|
|
@@ -40,3 +44,11 @@ var EmbedConnectionRoles;
|
|
|
40
44
|
// keep scope as limited as possible.
|
|
41
45
|
EmbedConnectionRoles["RESTRICTED_QUERIER"] = "RESTRICTED_QUERIER";
|
|
42
46
|
})(EmbedConnectionRoles || (exports.EmbedConnectionRoles = EmbedConnectionRoles = {}));
|
|
47
|
+
/**
|
|
48
|
+
* Levels of access a user can have to their associated embed entity folder.
|
|
49
|
+
*/
|
|
50
|
+
var EmbedEntityFolderContentRoles;
|
|
51
|
+
(function (EmbedEntityFolderContentRoles) {
|
|
52
|
+
EmbedEntityFolderContentRoles["EDITOR"] = "EDITOR";
|
|
53
|
+
EmbedEntityFolderContentRoles["VIEWER"] = "VIEWER";
|
|
54
|
+
})(EmbedEntityFolderContentRoles || (exports.EmbedEntityFolderContentRoles = EmbedEntityFolderContentRoles = {}));
|
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, } = props;
|
|
36
|
+
let { accessBoost, connectionRoles: rawConnectionRoles, contentPath, customTheme: rawCustomTheme, customThemeId, externalId, filterSearchParam, linkAccess, mode, name, nonce, port, secret, userAttributes: rawUserAttributes, entity, prefersDark, theme, entityFolderContentRole, } = props;
|
|
37
37
|
let host, domain, organizationName;
|
|
38
38
|
if ("host" in props)
|
|
39
39
|
host = props.host;
|
|
@@ -69,6 +69,7 @@ const embedSsoContent = async (props) => {
|
|
|
69
69
|
connectionRoles,
|
|
70
70
|
accessBoost,
|
|
71
71
|
mode,
|
|
72
|
+
entityFolderContentRole,
|
|
72
73
|
});
|
|
73
74
|
// Build and return the signed url
|
|
74
75
|
url.searchParams.append("contentPath", contentPath);
|
|
@@ -89,6 +90,8 @@ const embedSsoContent = async (props) => {
|
|
|
89
90
|
connectionRoles &&
|
|
90
91
|
url.searchParams.append("connectionRoles", connectionRoles);
|
|
91
92
|
mode && url.searchParams.append("mode", mode);
|
|
93
|
+
entityFolderContentRole &&
|
|
94
|
+
url.searchParams.append("entityFolderContentRole", entityFolderContentRole);
|
|
92
95
|
return url.toString();
|
|
93
96
|
};
|
|
94
97
|
const buildContentPath = (contentType, contentId) => `/${contentType}/${contentId}`;
|
package/lib/esm/signature.d.ts
CHANGED
|
@@ -47,10 +47,13 @@ type SignatureProps = {
|
|
|
47
47
|
*/
|
|
48
48
|
customThemeId?: string;
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
51
|
-
* user will this value assigned to its omni_user_embed_entity user attribute.
|
|
50
|
+
* An associated entity / group for the embed user.
|
|
52
51
|
*/
|
|
53
52
|
entity?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The content role for the embed user on the entity folder.
|
|
55
|
+
*/
|
|
56
|
+
entityFolderContentRole?: string;
|
|
54
57
|
/**
|
|
55
58
|
* Filter search parameter.
|
|
56
59
|
*/
|
|
@@ -80,6 +83,6 @@ type SignatureProps = {
|
|
|
80
83
|
};
|
|
81
84
|
export declare const getSignature: ({ secret, ...props }: SignatureProps) => string;
|
|
82
85
|
export declare const TEST_ONLY: {
|
|
83
|
-
generateStringForSignature: ({ loginUrl, contentPath, externalId, name, nonce, accessBoost, connectionRoles, customTheme, customThemeId, entity, filterSearchParam, linkAccess, mode, prefersDark, theme, userAttributes, }: Omit<SignatureProps, "secret">) => string;
|
|
86
|
+
generateStringForSignature: ({ loginUrl, contentPath, externalId, name, nonce, accessBoost, connectionRoles, customTheme, customThemeId, entity, entityFolderContentRole, filterSearchParam, linkAccess, mode, prefersDark, theme, userAttributes, }: Omit<SignatureProps, "secret">) => string;
|
|
84
87
|
};
|
|
85
88
|
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, filterSearchParam, linkAccess, mode, prefersDark, theme, userAttributes, }) => {
|
|
13
|
+
accessBoost, connectionRoles, customTheme, customThemeId, entity, entityFolderContentRole, filterSearchParam, 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 = {
|
|
@@ -19,6 +19,7 @@ accessBoost, connectionRoles, customTheme, customThemeId, entity, filterSearchPa
|
|
|
19
19
|
...(customTheme && { customTheme }),
|
|
20
20
|
...(customThemeId && { customThemeId }),
|
|
21
21
|
...(entity && { entity }),
|
|
22
|
+
...(entityFolderContentRole && { entityFolderContentRole }),
|
|
22
23
|
...(filterSearchParam && { filterSearchParam }),
|
|
23
24
|
...(linkAccess && { linkAccess }),
|
|
24
25
|
...(mode && { mode }),
|
package/lib/esm/types.d.ts
CHANGED
|
@@ -22,6 +22,12 @@ type EmbedSsoBaseProps = {
|
|
|
22
22
|
* only the content specified in the contentId will be embedded.
|
|
23
23
|
*/
|
|
24
24
|
mode?: EmbedSessionMode;
|
|
25
|
+
/**
|
|
26
|
+
* Optional content role setting. Can be one of "EDITOR" or "VIEWER". If set to "EDITOR", the user will have the ability to manage
|
|
27
|
+
* content in their associated embed entity folder. If set to "VIEWER", the user will only be able to view content in
|
|
28
|
+
* their associated embed entity folder.
|
|
29
|
+
*/
|
|
30
|
+
entityFolderContentRole?: EmbedEntityFolderContentRoles;
|
|
25
31
|
nonce?: string;
|
|
26
32
|
port?: number;
|
|
27
33
|
} & ({
|
|
@@ -110,11 +116,18 @@ export declare enum EmbeddedContent {
|
|
|
110
116
|
Dashboard = "dashboards",
|
|
111
117
|
Workbook = "w"
|
|
112
118
|
}
|
|
113
|
-
export declare const EmbedSsoContentDiscoveryPaths: readonly ["my"];
|
|
119
|
+
export declare const EmbedSsoContentDiscoveryPaths: readonly ["my", "entity-folder", "root"];
|
|
114
120
|
export type EmbedSsoContentDiscoveryPath = (typeof EmbedSsoContentDiscoveryPaths)[number];
|
|
115
121
|
export declare enum EmbedConnectionRoles {
|
|
116
122
|
RESTRICTED_QUERIER = "RESTRICTED_QUERIER"
|
|
117
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Levels of access a user can have to their associated embed entity folder.
|
|
126
|
+
*/
|
|
127
|
+
export declare enum EmbedEntityFolderContentRoles {
|
|
128
|
+
EDITOR = "EDITOR",
|
|
129
|
+
VIEWER = "VIEWER"
|
|
130
|
+
}
|
|
118
131
|
export type EmbedSsoContentProps = EmbedSsoBaseProps & EmbedSsoDashboardOnlyProps & EmbedContentPathProp;
|
|
119
132
|
/**
|
|
120
133
|
* Consumers of this SDK will rely on these three types to embed workbooks and dashboards.
|
package/lib/esm/types.js
CHANGED
|
@@ -29,7 +29,11 @@ export var EmbeddedContent;
|
|
|
29
29
|
EmbeddedContent["Dashboard"] = "dashboards";
|
|
30
30
|
EmbeddedContent["Workbook"] = "w";
|
|
31
31
|
})(EmbeddedContent || (EmbeddedContent = {}));
|
|
32
|
-
export const EmbedSsoContentDiscoveryPaths = [
|
|
32
|
+
export const EmbedSsoContentDiscoveryPaths = [
|
|
33
|
+
"my",
|
|
34
|
+
"entity-folder",
|
|
35
|
+
"root",
|
|
36
|
+
];
|
|
33
37
|
export var EmbedConnectionRoles;
|
|
34
38
|
(function (EmbedConnectionRoles) {
|
|
35
39
|
// TODO: Eventually we'll want to add VIEWER. Currently though, since the sole use case of the
|
|
@@ -37,3 +41,11 @@ export var EmbedConnectionRoles;
|
|
|
37
41
|
// keep scope as limited as possible.
|
|
38
42
|
EmbedConnectionRoles["RESTRICTED_QUERIER"] = "RESTRICTED_QUERIER";
|
|
39
43
|
})(EmbedConnectionRoles || (EmbedConnectionRoles = {}));
|
|
44
|
+
/**
|
|
45
|
+
* Levels of access a user can have to their associated embed entity folder.
|
|
46
|
+
*/
|
|
47
|
+
export var EmbedEntityFolderContentRoles;
|
|
48
|
+
(function (EmbedEntityFolderContentRoles) {
|
|
49
|
+
EmbedEntityFolderContentRoles["EDITOR"] = "EDITOR";
|
|
50
|
+
EmbedEntityFolderContentRoles["VIEWER"] = "VIEWER";
|
|
51
|
+
})(EmbedEntityFolderContentRoles || (EmbedEntityFolderContentRoles = {}));
|
package/package.json
CHANGED