@omni-co/embed 0.14.1-alpha.3 → 0.15.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/omni_internal_browser.d.ts +1 -0
- package/lib/cjs/omni_internal_browser.js +1 -0
- package/lib/esm/omni_internal_browser.d.ts +1 -0
- package/lib/esm/omni_internal_browser.js +1 -0
- package/lib/omni_internal_browser/omni_internal_browser.d.ts +1 -0
- package/lib/omni_internal_browser/omni_internal_browser.js +1 -0
- package/lib/omni_internal_browser/types.d.ts +204 -0
- package/lib/omni_internal_browser/types.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { CustomThemeProperty, EmbedConnectionRoles, EmbedEntityFolderContentRoles, EmbedSessionMode, EmbedUiSettings } from "./constants.js";
|
|
2
|
+
type UserAttributeValue = string | string[] | number | number[];
|
|
3
|
+
type HostProps = {
|
|
4
|
+
host?: never;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Introduced for internal testing only. For vanity domains, use the `host` prop instead.
|
|
7
|
+
*
|
|
8
|
+
* @throws Error if `host` is provided.
|
|
9
|
+
*/
|
|
10
|
+
domain?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Name of the organization the content belongs to. If provided, generates a default embed host
|
|
13
|
+
* URL in the form of `https://<organizationName>.embed-omniapp.co`.
|
|
14
|
+
*
|
|
15
|
+
* @throws Error if `host` is provided.
|
|
16
|
+
*/
|
|
17
|
+
organizationName: string;
|
|
18
|
+
} | {
|
|
19
|
+
domain?: never;
|
|
20
|
+
organizationName?: never;
|
|
21
|
+
/**
|
|
22
|
+
* Used to set the host of signed embed URL, required when using vanity domains.
|
|
23
|
+
* Protocol is not required, as https is assumed.
|
|
24
|
+
* Port is not accepted. If required, use the `port` prop.
|
|
25
|
+
*
|
|
26
|
+
* @throws Error if `domain` or `organizationName` are provided.
|
|
27
|
+
* @example "omni.example.com"
|
|
28
|
+
* @example "omni.another-example.app"
|
|
29
|
+
*/
|
|
30
|
+
host: string;
|
|
31
|
+
};
|
|
32
|
+
type EmbedSsoBaseProps = {
|
|
33
|
+
externalId: string;
|
|
34
|
+
name: string;
|
|
35
|
+
secret: string;
|
|
36
|
+
entity?: string;
|
|
37
|
+
userAttributes?: Record<string, UserAttributeValue>;
|
|
38
|
+
prefersDark?: string;
|
|
39
|
+
theme?: string;
|
|
40
|
+
customTheme?: CustomThemeProperties;
|
|
41
|
+
customThemeId?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Optional connection roles setting. Object keys should be connection IDs from the embedded Omni instance.
|
|
44
|
+
* Object values should be connection roles.
|
|
45
|
+
*/
|
|
46
|
+
connectionRoles?: Record<string, EmbedConnectionRoles>;
|
|
47
|
+
/**
|
|
48
|
+
* Optional model roles setting. Object keys should be model IDs from the embedded Omni instance.
|
|
49
|
+
* Object values should be connection roles.
|
|
50
|
+
*/
|
|
51
|
+
modelRoles?: Record<string, EmbedConnectionRoles>;
|
|
52
|
+
/**
|
|
53
|
+
* Optional mode setting that determines whether the entire application should be embedded or a single piece of content.
|
|
54
|
+
*
|
|
55
|
+
* APPLICATION: the entire application will be embedded, meaning in-app navigation and document header options will be available.
|
|
56
|
+
* SINGLE_CONTENT: only the content specified in the contentId will be embedded and application mode features will be hidden.
|
|
57
|
+
*/
|
|
58
|
+
mode?: EmbedSessionMode;
|
|
59
|
+
/**
|
|
60
|
+
* Optional content role setting for the embed user on the entity folder. Can be one of "MANAGER", "EDITOR", "VIEWER", or "NO_ACCESS".
|
|
61
|
+
*
|
|
62
|
+
* MANAGER: the user will have the ability to manage content and content permissions of the entity folder.
|
|
63
|
+
*
|
|
64
|
+
* EDITOR: the user will have the ability to manage content in the entity folder.
|
|
65
|
+
*
|
|
66
|
+
* VIEWER: the user will only be able to view content in the entity folder.
|
|
67
|
+
*
|
|
68
|
+
* NO_ACCESS: the user will not have access to the entity folder. Note that the group content role must
|
|
69
|
+
* also be set to NO_ACCESS for the user to not have access to the entity folder.
|
|
70
|
+
*/
|
|
71
|
+
entityFolderContentRole?: EmbedEntityFolderContentRoles;
|
|
72
|
+
/**
|
|
73
|
+
* Optional content role setting for the entity group on the entity folder. Can be one of "MANAGER", "EDITOR", "VIEWER", or "NO_ACCESS".
|
|
74
|
+
*
|
|
75
|
+
* MANAGER: all entity group embed users will have the ability to manage content and content permissions of the entity folder.
|
|
76
|
+
*
|
|
77
|
+
* EDITOR: all entity group embed users will have the ability to manage content in the entity folder.
|
|
78
|
+
*
|
|
79
|
+
* VIEWER: all entity group embed users will only be able to view content in the entity folder.
|
|
80
|
+
*
|
|
81
|
+
* NO_ACCESS: all entity group embed users will not have access to the entity folder.
|
|
82
|
+
*/
|
|
83
|
+
entityFolderGroupContentRole?: EmbedEntityFolderContentRoles;
|
|
84
|
+
/**
|
|
85
|
+
* When true, an existing content role for the embed user on the entity folder will not be overwritten
|
|
86
|
+
* by the `entityFolderContentRole` value. If a content role does not exist on the entity folder for the embed user,
|
|
87
|
+
* the `entityFolderContentRole` value will be applied.
|
|
88
|
+
*/
|
|
89
|
+
preserveEntityFolderContentRole?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Optional setting that customizes the generated entity folder label. This only affects the entity folder
|
|
92
|
+
* corresponding to the `entity` parameter value in the relevant generated SSO embed URL.
|
|
93
|
+
*/
|
|
94
|
+
entityFolderLabel?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Optional setting that customizes the generated entity group label. This only affects the entity group
|
|
97
|
+
* corresponding to the `entity` parameter value in the relevant generated SSO embed URL.
|
|
98
|
+
*/
|
|
99
|
+
entityGroupLabel?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Optional groups setting. An array of group names that the user will be added to.
|
|
102
|
+
*/
|
|
103
|
+
groups?: string[];
|
|
104
|
+
/**
|
|
105
|
+
* Optional email setting for the generated embed user.
|
|
106
|
+
*/
|
|
107
|
+
email?: string;
|
|
108
|
+
filterSearchParam?: string;
|
|
109
|
+
linkAccess?: string;
|
|
110
|
+
uiSettings?: Record<EmbedUiSettings, boolean>;
|
|
111
|
+
nonce?: string;
|
|
112
|
+
port?: number;
|
|
113
|
+
} & HostProps;
|
|
114
|
+
type EmbedSsoDashboardOnlyProps = {
|
|
115
|
+
accessBoost?: boolean;
|
|
116
|
+
};
|
|
117
|
+
type EmbedContentIdProp = {
|
|
118
|
+
contentId: string;
|
|
119
|
+
};
|
|
120
|
+
type EmbedContentPathProp = {
|
|
121
|
+
contentPath: string;
|
|
122
|
+
};
|
|
123
|
+
export type CustomThemeProperties = {
|
|
124
|
+
[CustomThemeProperty.DASHBOARD_BACKGROUND]?: string;
|
|
125
|
+
[CustomThemeProperty.DASHBOARD_PAGE_PADDING]?: string;
|
|
126
|
+
[CustomThemeProperty.DASHBOARD_TILE_MARGIN]?: string;
|
|
127
|
+
[CustomThemeProperty.DASHBOARD_TILE_BACKGROUND]?: string;
|
|
128
|
+
[CustomThemeProperty.DASHBOARD_TILE_SHADOW]?: string;
|
|
129
|
+
[CustomThemeProperty.DASHBOARD_TILE_TEXT_BODY_COLOR]?: string;
|
|
130
|
+
[CustomThemeProperty.DASHBOARD_TILE_TEXT_SECONDARY_COLOR]?: string;
|
|
131
|
+
[CustomThemeProperty.DASHBOARD_TILE_BORDER_COLOR]?: string;
|
|
132
|
+
[CustomThemeProperty.DASHBOARD_TILE_BORDER_RADIUS]?: string;
|
|
133
|
+
[CustomThemeProperty.DASHBOARD_TILE_BORDER_STYLE]?: string;
|
|
134
|
+
[CustomThemeProperty.DASHBOARD_TILE_BORDER_WIDTH]?: string;
|
|
135
|
+
[CustomThemeProperty.DASHBOARD_TILE_TITLE_FONT_SIZE]?: string;
|
|
136
|
+
[CustomThemeProperty.DASHBOARD_TILE_TITLE_FONT_WEIGHT]?: string;
|
|
137
|
+
[CustomThemeProperty.DASHBOARD_TILE_TITLE_TEXT_COLOR]?: string;
|
|
138
|
+
[CustomThemeProperty.DASHBOARD_TILE_TITLE_FONT_FAMILY]?: string;
|
|
139
|
+
[CustomThemeProperty.DASHBOARD_TILE_TEXT_BODY_FONT_FAMILY]?: string;
|
|
140
|
+
[CustomThemeProperty.DASHBOARD_TILE_TEXT_CODE_FONT_FAMILY]?: string;
|
|
141
|
+
[CustomThemeProperty.DASHBOARD_KEY_COLOR]?: string;
|
|
142
|
+
[CustomThemeProperty.DASHBOARD_KEY_TEXT_COLOR]?: string;
|
|
143
|
+
[CustomThemeProperty.DASHBOARD_BUTTON_TRANSPARENT_TEXT_COLOR]?: string;
|
|
144
|
+
[CustomThemeProperty.DASHBOARD_BUTTON_TRANSPARENT_INTERACTIVE_COLOR]?: string;
|
|
145
|
+
[CustomThemeProperty.DASHBOARD_MENU_ITEM_INTERACTIVE_COLOR]?: string;
|
|
146
|
+
[CustomThemeProperty.DASHBOARD_CONTROL_BACKGROUND]?: string;
|
|
147
|
+
[CustomThemeProperty.DASHBOARD_CONTROL_BORDER_COLOR]?: string;
|
|
148
|
+
[CustomThemeProperty.DASHBOARD_CONTROL_TEXT_COLOR]?: string;
|
|
149
|
+
[CustomThemeProperty.DASHBOARD_CONTROL_PLACEHOLDER_COLOR]?: string;
|
|
150
|
+
[CustomThemeProperty.DASHBOARD_CONTROL_LABEL_COLOR]?: string;
|
|
151
|
+
[CustomThemeProperty.DASHBOARD_CONTROL_POPOVER_BACKGROUND]?: string;
|
|
152
|
+
[CustomThemeProperty.DASHBOARD_CONTROL_POPOVER_TEXT_COLOR]?: string;
|
|
153
|
+
[CustomThemeProperty.DASHBOARD_CONTROL_POPOVER_SECONDARY_TEXT_COLOR]?: string;
|
|
154
|
+
[CustomThemeProperty.DASHBOARD_CONTROL_POPOVER_LINK_COLOR]?: string;
|
|
155
|
+
[CustomThemeProperty.DASHBOARD_CONTROL_POPOVER_DIVIDER_COLOR]?: string;
|
|
156
|
+
[CustomThemeProperty.DASHBOARD_CONTROL_POPOVER_BORDER_COLOR]?: string;
|
|
157
|
+
[CustomThemeProperty.DASHBOARD_CONTROL_OUTLINE_COLOR]?: string;
|
|
158
|
+
[CustomThemeProperty.DASHBOARD_CONTROL_POPOVER_RADIUS]?: string;
|
|
159
|
+
[CustomThemeProperty.DASHBOARD_CONTROL_RADIUS]?: string;
|
|
160
|
+
[CustomThemeProperty.DASHBOARD_FILTER_INPUT_BORDER_COLOR]?: string;
|
|
161
|
+
[CustomThemeProperty.DASHBOARD_FILTER_INPUT_TEXT_COLOR]?: string;
|
|
162
|
+
[CustomThemeProperty.DASHBOARD_FILTER_INPUT_PLACEHOLDER_COLOR]?: string;
|
|
163
|
+
[CustomThemeProperty.DASHBOARD_FILTER_INPUT_BACKGROUND]?: string;
|
|
164
|
+
[CustomThemeProperty.DASHBOARD_FILTER_INPUT_RADIUS]?: string;
|
|
165
|
+
[CustomThemeProperty.DASHBOARD_FILTER_INPUT_PLACEHOLDER_COLOR]?: string;
|
|
166
|
+
[CustomThemeProperty.DASHBOARD_FILTER_INPUT_ICON_COLOR]?: string;
|
|
167
|
+
[CustomThemeProperty.DASHBOARD_FILTER_INPUT_OUTLINE_COLOR]?: string;
|
|
168
|
+
[CustomThemeProperty.DASHBOARD_FILTER_INPUT_ACCENT_COLOR]?: string;
|
|
169
|
+
[CustomThemeProperty.DASHBOARD_FILTER_INPUT_ACCENT_INVERT_COLOR]?: string;
|
|
170
|
+
[CustomThemeProperty.DASHBOARD_FILTER_INPUT_TOKEN_COLOR]?: string;
|
|
171
|
+
[CustomThemeProperty.DASHBOARD_FILTER_INPUT_TOKEN_TEXT_COLOR]?: string;
|
|
172
|
+
[CustomThemeProperty.DASHBOARD_BUTTON_RADIUS]?: string;
|
|
173
|
+
};
|
|
174
|
+
export type EmbedSsoContentProps = EmbedSsoBaseProps & EmbedSsoDashboardOnlyProps & EmbedContentPathProp;
|
|
175
|
+
/**
|
|
176
|
+
* Consumers of this SDK will rely on these three types to embed workbooks and dashboards.
|
|
177
|
+
*/
|
|
178
|
+
export type EmbedSsoDashboardProps = EmbedSsoBaseProps & EmbedSsoDashboardOnlyProps & EmbedContentIdProp;
|
|
179
|
+
export type EmbedSsoWorkbookProps = EmbedSsoBaseProps & EmbedContentIdProp;
|
|
180
|
+
export type EmbedSsoContentDiscoveryProps = EmbedSsoBaseProps & {
|
|
181
|
+
/**
|
|
182
|
+
* Path name of the content discovery page to embed.
|
|
183
|
+
*/
|
|
184
|
+
path: string;
|
|
185
|
+
} & ({
|
|
186
|
+
/**
|
|
187
|
+
* Required connection roles object. Object keys should be connection IDs from the embedded Omni instance.
|
|
188
|
+
* Object values should be connection roles.
|
|
189
|
+
*/
|
|
190
|
+
connectionRoles: Record<string, EmbedConnectionRoles>;
|
|
191
|
+
} | {
|
|
192
|
+
/**
|
|
193
|
+
* Required model roles object. Object keys should be connection IDs from the embedded Omni instance.
|
|
194
|
+
* Object values should be connection roles.
|
|
195
|
+
*/
|
|
196
|
+
modelRoles: Record<string, EmbedConnectionRoles>;
|
|
197
|
+
});
|
|
198
|
+
export type CreateSessionTokenProps = Omit<EmbedSsoContentProps, "prefersDark" | "theme" | "secret" | "nonce"> & {
|
|
199
|
+
apiKey: string;
|
|
200
|
+
} & HostProps;
|
|
201
|
+
export type RedeemSessionTokenProps = Pick<EmbedSsoContentProps, "nonce" | "prefersDark" | "secret" | "theme" | "port"> & {
|
|
202
|
+
sessionToken: string;
|
|
203
|
+
} & HostProps;
|
|
204
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { CustomThemeProperty, } from "./constants.js";
|
package/package.json
CHANGED