@omni-co/embed 0.11.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 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, entity, entityFolderContentRole, entityFolderLabel, entityGroupLabel, externalId, filterSearchParam, groups: rawGroups, host, linkAccess, mode, name, nonce, organizationName, prefersDark, port, secret, theme, uiSettings: rawUiSettings, userAttributes: rawUserAttributes, } = props;
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,7 @@ const embedSsoContent = async (props) => {
86
86
  email,
87
87
  entity,
88
88
  entityFolderContentRole,
89
+ entityFolderGroupContentRole,
89
90
  entityFolderLabel,
90
91
  entityGroupLabel,
91
92
  filterSearchParam,
@@ -119,6 +120,8 @@ const embedSsoContent = async (props) => {
119
120
  mode && url.searchParams.append("mode", mode);
120
121
  entityFolderContentRole &&
121
122
  url.searchParams.append("entityFolderContentRole", entityFolderContentRole);
123
+ entityFolderGroupContentRole &&
124
+ url.searchParams.append("entityFolderGroupContentRole", entityFolderGroupContentRole);
122
125
  groups && url.searchParams.append("groups", groups);
123
126
  email && url.searchParams.append("email", email);
124
127
  uiSettings && url.searchParams.append("uiSettings", uiSettings);
@@ -58,6 +58,10 @@ 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;
61
65
  /**
62
66
  * The label for the generated entity folder.
63
67
  */
@@ -121,6 +125,6 @@ type SignSessionRedemptionProps = Pick<SignatureProps, "nonce" | "prefersDark" |
121
125
  */
122
126
  export declare const signSessionRedemption: ({ requestUrl, nonce, sessionId, secret, prefersDark, theme, }: SignSessionRedemptionProps) => string;
123
127
  export declare const TEST_ONLY: {
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;
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;
125
129
  };
126
130
  export {};
@@ -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, entityFolderLabel, entityGroupLabel, 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,7 @@ accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityF
28
28
  ...(email && { email }),
29
29
  ...(entity && { entity }),
30
30
  ...(entityFolderContentRole && { entityFolderContentRole }),
31
+ ...(entityFolderGroupContentRole && { entityFolderGroupContentRole }),
31
32
  ...(entityFolderLabel && { entityFolderLabel }),
32
33
  ...(entityGroupLabel && { entityGroupLabel }),
33
34
  ...(filterSearchParam && { filterSearchParam }),
@@ -55,15 +55,30 @@ type EmbedSsoBaseProps = {
55
55
  */
56
56
  mode?: EmbedSessionMode;
57
57
  /**
58
- * Optional content role setting. Can be one of "MANAGER", "EDITOR", or "VIEWER".
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;
67
82
  /**
68
83
  * Optional setting that customizes the generated entity folder label. This only affects the entity folder
69
84
  * corresponding to the `entity` parameter value in the relevant generated SSO embed URL.
@@ -213,7 +228,8 @@ export declare enum EmbedConnectionRoles {
213
228
  export declare enum EmbedEntityFolderContentRoles {
214
229
  MANAGER = "MANAGER",
215
230
  EDITOR = "EDITOR",
216
- VIEWER = "VIEWER"
231
+ VIEWER = "VIEWER",
232
+ NO_ACCESS = "NO_ACCESS"
217
233
  }
218
234
  /**
219
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, entity, entityFolderContentRole, entityFolderLabel, entityGroupLabel, externalId, filterSearchParam, groups: rawGroups, host, linkAccess, mode, name, nonce, organizationName, prefersDark, port, secret, theme, uiSettings: rawUiSettings, userAttributes: rawUserAttributes, } = props;
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,7 @@ const embedSsoContent = async (props) => {
83
83
  email,
84
84
  entity,
85
85
  entityFolderContentRole,
86
+ entityFolderGroupContentRole,
86
87
  entityFolderLabel,
87
88
  entityGroupLabel,
88
89
  filterSearchParam,
@@ -116,6 +117,8 @@ const embedSsoContent = async (props) => {
116
117
  mode && url.searchParams.append("mode", mode);
117
118
  entityFolderContentRole &&
118
119
  url.searchParams.append("entityFolderContentRole", entityFolderContentRole);
120
+ entityFolderGroupContentRole &&
121
+ url.searchParams.append("entityFolderGroupContentRole", entityFolderGroupContentRole);
119
122
  groups && url.searchParams.append("groups", groups);
120
123
  email && url.searchParams.append("email", email);
121
124
  uiSettings && url.searchParams.append("uiSettings", uiSettings);
@@ -58,6 +58,10 @@ 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;
61
65
  /**
62
66
  * The label for the generated entity folder.
63
67
  */
@@ -121,6 +125,6 @@ type SignSessionRedemptionProps = Pick<SignatureProps, "nonce" | "prefersDark" |
121
125
  */
122
126
  export declare const signSessionRedemption: ({ requestUrl, nonce, sessionId, secret, prefersDark, theme, }: SignSessionRedemptionProps) => string;
123
127
  export declare const TEST_ONLY: {
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;
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;
125
129
  };
126
130
  export {};
@@ -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, entityFolderLabel, entityGroupLabel, 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,7 @@ accessBoost, connectionRoles, customTheme, customThemeId, email, entity, entityF
21
21
  ...(email && { email }),
22
22
  ...(entity && { entity }),
23
23
  ...(entityFolderContentRole && { entityFolderContentRole }),
24
+ ...(entityFolderGroupContentRole && { entityFolderGroupContentRole }),
24
25
  ...(entityFolderLabel && { entityFolderLabel }),
25
26
  ...(entityGroupLabel && { entityGroupLabel }),
26
27
  ...(filterSearchParam && { filterSearchParam }),
@@ -55,15 +55,30 @@ type EmbedSsoBaseProps = {
55
55
  */
56
56
  mode?: EmbedSessionMode;
57
57
  /**
58
- * Optional content role setting. Can be one of "MANAGER", "EDITOR", or "VIEWER".
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;
67
82
  /**
68
83
  * Optional setting that customizes the generated entity folder label. This only affects the entity folder
69
84
  * corresponding to the `entity` parameter value in the relevant generated SSO embed URL.
@@ -213,7 +228,8 @@ export declare enum EmbedConnectionRoles {
213
228
  export declare enum EmbedEntityFolderContentRoles {
214
229
  MANAGER = "MANAGER",
215
230
  EDITOR = "EDITOR",
216
- VIEWER = "VIEWER"
231
+ VIEWER = "VIEWER",
232
+ NO_ACCESS = "NO_ACCESS"
217
233
  }
218
234
  /**
219
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
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.11.0",
2
+ "version": "0.12.0",
3
3
  "license": "MIT",
4
4
  "name": "@omni-co/embed",
5
5
  "author": "Nate Agrin <nate@exploreomni.com>",