@omni-co/embed 0.3.12 → 0.3.13
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.d.ts +7 -1
- package/lib/cjs/embed.js +16 -3
- package/lib/cjs/types.d.ts +13 -2
- package/lib/cjs/types.js +2 -1
- package/lib/esm/embed.d.ts +7 -1
- package/lib/esm/embed.js +15 -3
- package/lib/esm/types.d.ts +13 -2
- package/lib/esm/types.js +1 -0
- package/package.json +1 -1
package/lib/cjs/embed.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import { EmbedSsoDashboardProps, EmbedSsoWorkbookProps } from "./types";
|
|
1
|
+
import { EmbedSsoContentDiscoveryProps, EmbedSsoDashboardProps, EmbedSsoWorkbookProps } from "./types";
|
|
2
2
|
export declare const embedSsoDashboard: (props: EmbedSsoDashboardProps) => Promise<string>;
|
|
3
3
|
export declare const embedSsoWorkbook: (props: EmbedSsoWorkbookProps) => Promise<string>;
|
|
4
|
+
/**
|
|
5
|
+
* *IN BETA* Generates an embed login URL using the passed-in content discovery page id.
|
|
6
|
+
* @param EmbedSsoContentDiscoveryProps
|
|
7
|
+
* @returns Promise wrapped around a generated embed login url.
|
|
8
|
+
*/
|
|
9
|
+
export declare const embedSsoContentDiscovery: (props: EmbedSsoContentDiscoveryProps) => Promise<string>;
|
package/lib/cjs/embed.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.embedSsoWorkbook = exports.embedSsoDashboard = void 0;
|
|
3
|
+
exports.embedSsoContentDiscovery = exports.embedSsoWorkbook = exports.embedSsoDashboard = void 0;
|
|
4
4
|
const random_str_1 = require("./random-str");
|
|
5
5
|
const signature_1 = require("./signature");
|
|
6
6
|
const types_1 = require("./types");
|
|
7
7
|
const defaultEmbedDomain = "embed-omniapp.co";
|
|
8
|
-
const embedLoginPath =
|
|
8
|
+
const embedLoginPath = "/embed/login";
|
|
9
9
|
const validateProps = (props) => {
|
|
10
|
-
const { externalId, name, nonce, organizationName, secret, userAttributes
|
|
10
|
+
const { externalId, name, nonce, organizationName, secret, userAttributes } = props;
|
|
11
11
|
if (!externalId) {
|
|
12
12
|
throw new Error("externalId is required");
|
|
13
13
|
}
|
|
@@ -82,3 +82,16 @@ const embedSsoWorkbook = async (props) => {
|
|
|
82
82
|
return embedSsoContent({ ...props, contentPath });
|
|
83
83
|
};
|
|
84
84
|
exports.embedSsoWorkbook = embedSsoWorkbook;
|
|
85
|
+
/**
|
|
86
|
+
* *IN BETA* Generates an embed login URL using the passed-in content discovery page id.
|
|
87
|
+
* @param EmbedSsoContentDiscoveryProps
|
|
88
|
+
* @returns Promise wrapped around a generated embed login url.
|
|
89
|
+
*/
|
|
90
|
+
const embedSsoContentDiscovery = async (props) => {
|
|
91
|
+
const contentPath = `/${props.path}`;
|
|
92
|
+
return embedSsoContent({
|
|
93
|
+
...props,
|
|
94
|
+
contentPath,
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
exports.embedSsoContentDiscovery = embedSsoContentDiscovery;
|
package/lib/cjs/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
type UserAttributeValue = string | string[] | number | number[];
|
|
2
2
|
type EmbedSsoBaseProps = {
|
|
3
|
-
contentId: string;
|
|
4
3
|
externalId: string;
|
|
5
4
|
name: string;
|
|
6
5
|
organizationName: string;
|
|
@@ -21,6 +20,9 @@ type EmbedSsoDashboardOnlyProps = {
|
|
|
21
20
|
type EmbedContentIdProp = {
|
|
22
21
|
contentId: string;
|
|
23
22
|
};
|
|
23
|
+
type EmbedContentPathProp = {
|
|
24
|
+
contentPath: string;
|
|
25
|
+
};
|
|
24
26
|
export type CustomThemeProperties = {
|
|
25
27
|
"dashboard-background"?: string;
|
|
26
28
|
"dashboard-tile-background"?: string;
|
|
@@ -43,9 +45,18 @@ export declare enum EmbeddedContent {
|
|
|
43
45
|
Dashboard = "dashboards",
|
|
44
46
|
Workbook = "w"
|
|
45
47
|
}
|
|
48
|
+
export declare const EmbedSsoContentDiscoveryPaths: readonly ["my"];
|
|
49
|
+
export type EmbedSsoContentDiscoveryPath = (typeof EmbedSsoContentDiscoveryPaths)[number];
|
|
50
|
+
export type EmbedSsoContentProps = EmbedSsoBaseProps & EmbedSsoDashboardOnlyProps & EmbedContentPathProp;
|
|
46
51
|
/**
|
|
47
|
-
* Consumers of this SDK will rely on these
|
|
52
|
+
* Consumers of this SDK will rely on these three types to embed workbooks and dashboards.
|
|
48
53
|
*/
|
|
49
54
|
export type EmbedSsoDashboardProps = EmbedSsoBaseProps & EmbedSsoDashboardOnlyProps & EmbedContentIdProp;
|
|
50
55
|
export type EmbedSsoWorkbookProps = EmbedSsoBaseProps & EmbedContentIdProp;
|
|
56
|
+
export type EmbedSsoContentDiscoveryProps = EmbedSsoBaseProps & {
|
|
57
|
+
/**
|
|
58
|
+
* Path name of the content discovery page to embed.
|
|
59
|
+
*/
|
|
60
|
+
path: EmbedSsoContentDiscoveryPath;
|
|
61
|
+
};
|
|
51
62
|
export {};
|
package/lib/cjs/types.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EmbeddedContent = void 0;
|
|
3
|
+
exports.EmbedSsoContentDiscoveryPaths = exports.EmbeddedContent = void 0;
|
|
4
4
|
var EmbeddedContent;
|
|
5
5
|
(function (EmbeddedContent) {
|
|
6
6
|
EmbeddedContent["Dashboard"] = "dashboards";
|
|
7
7
|
EmbeddedContent["Workbook"] = "w";
|
|
8
8
|
})(EmbeddedContent || (exports.EmbeddedContent = EmbeddedContent = {}));
|
|
9
|
+
exports.EmbedSsoContentDiscoveryPaths = ["my"];
|
package/lib/esm/embed.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import { EmbedSsoDashboardProps, EmbedSsoWorkbookProps } from "./types";
|
|
1
|
+
import { EmbedSsoContentDiscoveryProps, EmbedSsoDashboardProps, EmbedSsoWorkbookProps } from "./types";
|
|
2
2
|
export declare const embedSsoDashboard: (props: EmbedSsoDashboardProps) => Promise<string>;
|
|
3
3
|
export declare const embedSsoWorkbook: (props: EmbedSsoWorkbookProps) => Promise<string>;
|
|
4
|
+
/**
|
|
5
|
+
* *IN BETA* Generates an embed login URL using the passed-in content discovery page id.
|
|
6
|
+
* @param EmbedSsoContentDiscoveryProps
|
|
7
|
+
* @returns Promise wrapped around a generated embed login url.
|
|
8
|
+
*/
|
|
9
|
+
export declare const embedSsoContentDiscovery: (props: EmbedSsoContentDiscoveryProps) => Promise<string>;
|
package/lib/esm/embed.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { random32ByteString } from "./random-str";
|
|
2
2
|
import { getSignature } from "./signature";
|
|
3
|
-
import { EmbeddedContent } from "./types";
|
|
3
|
+
import { EmbeddedContent, } from "./types";
|
|
4
4
|
const defaultEmbedDomain = "embed-omniapp.co";
|
|
5
|
-
const embedLoginPath =
|
|
5
|
+
const embedLoginPath = "/embed/login";
|
|
6
6
|
const validateProps = (props) => {
|
|
7
|
-
const { externalId, name, nonce, organizationName, secret, userAttributes
|
|
7
|
+
const { externalId, name, nonce, organizationName, secret, userAttributes } = props;
|
|
8
8
|
if (!externalId) {
|
|
9
9
|
throw new Error("externalId is required");
|
|
10
10
|
}
|
|
@@ -77,3 +77,15 @@ export const embedSsoWorkbook = async (props) => {
|
|
|
77
77
|
const contentPath = `${buildContentPath(EmbeddedContent.Workbook, props.contentId)}/duplicate`;
|
|
78
78
|
return embedSsoContent({ ...props, contentPath });
|
|
79
79
|
};
|
|
80
|
+
/**
|
|
81
|
+
* *IN BETA* Generates an embed login URL using the passed-in content discovery page id.
|
|
82
|
+
* @param EmbedSsoContentDiscoveryProps
|
|
83
|
+
* @returns Promise wrapped around a generated embed login url.
|
|
84
|
+
*/
|
|
85
|
+
export const embedSsoContentDiscovery = async (props) => {
|
|
86
|
+
const contentPath = `/${props.path}`;
|
|
87
|
+
return embedSsoContent({
|
|
88
|
+
...props,
|
|
89
|
+
contentPath,
|
|
90
|
+
});
|
|
91
|
+
};
|
package/lib/esm/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
type UserAttributeValue = string | string[] | number | number[];
|
|
2
2
|
type EmbedSsoBaseProps = {
|
|
3
|
-
contentId: string;
|
|
4
3
|
externalId: string;
|
|
5
4
|
name: string;
|
|
6
5
|
organizationName: string;
|
|
@@ -21,6 +20,9 @@ type EmbedSsoDashboardOnlyProps = {
|
|
|
21
20
|
type EmbedContentIdProp = {
|
|
22
21
|
contentId: string;
|
|
23
22
|
};
|
|
23
|
+
type EmbedContentPathProp = {
|
|
24
|
+
contentPath: string;
|
|
25
|
+
};
|
|
24
26
|
export type CustomThemeProperties = {
|
|
25
27
|
"dashboard-background"?: string;
|
|
26
28
|
"dashboard-tile-background"?: string;
|
|
@@ -43,9 +45,18 @@ export declare enum EmbeddedContent {
|
|
|
43
45
|
Dashboard = "dashboards",
|
|
44
46
|
Workbook = "w"
|
|
45
47
|
}
|
|
48
|
+
export declare const EmbedSsoContentDiscoveryPaths: readonly ["my"];
|
|
49
|
+
export type EmbedSsoContentDiscoveryPath = (typeof EmbedSsoContentDiscoveryPaths)[number];
|
|
50
|
+
export type EmbedSsoContentProps = EmbedSsoBaseProps & EmbedSsoDashboardOnlyProps & EmbedContentPathProp;
|
|
46
51
|
/**
|
|
47
|
-
* Consumers of this SDK will rely on these
|
|
52
|
+
* Consumers of this SDK will rely on these three types to embed workbooks and dashboards.
|
|
48
53
|
*/
|
|
49
54
|
export type EmbedSsoDashboardProps = EmbedSsoBaseProps & EmbedSsoDashboardOnlyProps & EmbedContentIdProp;
|
|
50
55
|
export type EmbedSsoWorkbookProps = EmbedSsoBaseProps & EmbedContentIdProp;
|
|
56
|
+
export type EmbedSsoContentDiscoveryProps = EmbedSsoBaseProps & {
|
|
57
|
+
/**
|
|
58
|
+
* Path name of the content discovery page to embed.
|
|
59
|
+
*/
|
|
60
|
+
path: EmbedSsoContentDiscoveryPath;
|
|
61
|
+
};
|
|
51
62
|
export {};
|
package/lib/esm/types.js
CHANGED
package/package.json
CHANGED