@omni-co/embed 0.11.0 → 0.12.2

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/README.md CHANGED
@@ -143,14 +143,29 @@ type EmbedSsoDashboardProps = {
143
143
  entity?: string;
144
144
 
145
145
  /**
146
- * Optional content role setting for the entity folder. Can be one of "MANAGER", "EDITOR", or "VIEWER".
146
+ * Sets embed user content permission on the entity folder. Can be one of "MANAGER", "EDITOR", "VIEWER",
147
+ * or "NO_ACCESS".
147
148
  *
148
149
  * MANAGER: the user will have the ability to manage content and content permissions of the entity folder.
149
150
  * EDITOR: the user will have the ability to manage content in the entity folder.
150
151
  * VIEWER: the user will only be able to view content in the entity folder.
152
+ * NO_ACCESS: the user will have no access to content in the top-level entity folder. Note that the
153
+ * entityFolderGroupContentRole should also be set to NO_ACCESS in order to completely restrict access
154
+ * to the top-level entity folder.
151
155
  */
152
156
  entityFolderContentRole?: EmbedEntityFolderContentRoles;
153
157
 
158
+ /**
159
+ * Sets embed entity group content permission on the entity folder. Can be one of "MANAGER", "EDITOR", "VIEWER",
160
+ * or "NO_ACCESS".
161
+ *
162
+ * MANAGER: all users in the group will have the ability to manage content and content permissions of the entity folder.
163
+ * EDITOR: all users in the group have the ability to manage content in the entity folder.
164
+ * VIEWER: all users in the group are restricted to just view content in the entity folder.
165
+ * NO_ACCESS: all users in the group will have no access to content in the top-level entity folder.
166
+ */
167
+ entityFolderGroupContentRole?: EmbedEntityFolderContentRoles;
168
+
154
169
  // Required identifier to associate the external user with an automatically generated internal Omni user.
155
170
  externalId: string;
156
171
 
@@ -280,14 +295,29 @@ type EmbedSsoWorkbookProps = {
280
295
  entity?: string;
281
296
 
282
297
  /**
283
- * Optional content role setting for the entity folder. Can be one of "MANAGER", "EDITOR", or "VIEWER".
298
+ * Sets embed user content permission on the entity folder. Can be one of "MANAGER", "EDITOR", "VIEWER",
299
+ * or "NO_ACCESS".
284
300
  *
285
301
  * MANAGER: the user will have the ability to manage content and content permissions of the entity folder.
286
302
  * EDITOR: the user will have the ability to manage content in the entity folder.
287
303
  * VIEWER: the user will only be able to view content in the entity folder.
304
+ * NO_ACCESS: the user will have no access to content in the top-level entity folder. Note that the
305
+ * entityFolderGroupContentRole should also be set to NO_ACCESS in order to completely restrict access
306
+ * to the top-level entity folder.
288
307
  */
289
308
  entityFolderContentRole?: EmbedEntityFolderContentRoles;
290
309
 
310
+ /**
311
+ * Sets embed entity group content permission on the entity folder. Can be one of "MANAGER", "EDITOR", "VIEWER",
312
+ * or "NO_ACCESS".
313
+ *
314
+ * MANAGER: all users in the group will have the ability to manage content and content permissions of the entity folder.
315
+ * EDITOR: all users in the group have the ability to manage content in the entity folder.
316
+ * VIEWER: all users in the group are restricted to just view content in the entity folder.
317
+ * NO_ACCESS: all users in the group will have no access to content in the top-level entity folder.
318
+ */
319
+ entityFolderGroupContentRole?: EmbedEntityFolderContentRoles;
320
+
291
321
  // Required identifier to associate the external user with an
292
322
  // automatically generated internal Omni user.
293
323
  externalId: string;
@@ -393,14 +423,29 @@ type EmbedSsoContentDiscoveryProps = {
393
423
  entity?: string;
394
424
 
395
425
  /**
396
- * Optional content role setting for the entity folder. Can be one of "MANAGER", "EDITOR", or "VIEWER".
426
+ * Sets embed user content permission on the entity folder. Can be one of "MANAGER", "EDITOR", "VIEWER",
427
+ * or "NO_ACCESS".
397
428
  *
398
429
  * MANAGER: the user will have the ability to manage content and content permissions of the entity folder.
399
430
  * EDITOR: the user will have the ability to manage content in the entity folder.
400
431
  * VIEWER: the user will only be able to view content in the entity folder.
432
+ * NO_ACCESS: the user will have no access to content in the top-level entity folder. Note that the
433
+ * entityFolderGroupContentRole should also be set to NO_ACCESS in order to completely restrict access
434
+ * to the top-level entity folder.
401
435
  */
402
436
  entityFolderContentRole?: EmbedEntityFolderContentRoles;
403
437
 
438
+ /**
439
+ * Sets embed entity group content permission on the entity folder. Can be one of "MANAGER", "EDITOR", "VIEWER",
440
+ * or "NO_ACCESS".
441
+ *
442
+ * MANAGER: all users in the group will have the ability to manage content and content permissions of the entity folder.
443
+ * EDITOR: all users in the group have the ability to manage content in the entity folder.
444
+ * VIEWER: all users in the group are restricted to just view content in the entity folder.
445
+ * NO_ACCESS: all users in the group will have no access to content in the top-level entity folder.
446
+ */
447
+ entityFolderGroupContentRole?: EmbedEntityFolderContentRoles;
448
+
404
449
  // Required identifier to associate the external user with an
405
450
  // automatically generated internal Omni user.
406
451
  externalId: string;
@@ -522,14 +567,29 @@ type CreateSessionTokenProps = {
522
567
  entity?: string;
523
568
 
524
569
  /**
525
- * Optional content role setting for the entity folder. Can be one of "MANAGER", "EDITOR", or "VIEWER".
570
+ * Sets embed user content permission on the entity folder. Can be one of "MANAGER", "EDITOR", "VIEWER",
571
+ * or "NO_ACCESS".
526
572
  *
527
573
  * MANAGER: the user will have the ability to manage content and content permissions of the entity folder.
528
574
  * EDITOR: the user will have the ability to manage content in the entity folder.
529
575
  * VIEWER: the user will only be able to view content in the entity folder.
576
+ * NO_ACCESS: the user will have no access to content in the top-level entity folder. Note that the
577
+ * entityFolderGroupContentRole should also be set to NO_ACCESS in order to completely restrict access
578
+ * to the top-level entity folder.
530
579
  */
531
580
  entityFolderContentRole?: EmbedEntityFolderContentRoles;
532
581
 
582
+ /**
583
+ * Sets embed entity group content permission on the entity folder. Can be one of "MANAGER", "EDITOR", "VIEWER",
584
+ * or "NO_ACCESS".
585
+ *
586
+ * MANAGER: all users in the group will have the ability to manage content and content permissions of the entity folder.
587
+ * EDITOR: all users in the group have the ability to manage content in the entity folder.
588
+ * VIEWER: all users in the group are restricted to just view content in the entity folder.
589
+ * NO_ACCESS: all users in the group will have no access to content in the top-level entity folder.
590
+ */
591
+ entityFolderGroupContentRole?: EmbedEntityFolderContentRoles;
592
+
533
593
  // Required identifier to associate the external user with an automatically generated internal Omni user.
534
594
  externalId: string;
535
595
 
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.2",
3
3
  "license": "MIT",
4
4
  "name": "@omni-co/embed",
5
5
  "author": "Nate Agrin <nate@exploreomni.com>",