@esri/hub-common 14.60.1 → 14.62.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/dist/esm/core/getEntityDefaultWorkspacePane.js +7 -0
- package/dist/esm/core/getEntityDefaultWorkspacePane.js.map +1 -0
- package/dist/esm/core/getRelativeWorkspaceUrl.js +4 -1
- package/dist/esm/core/getRelativeWorkspaceUrl.js.map +1 -1
- package/dist/esm/core/index.js +2 -0
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/core/processActionLinks.js +62 -0
- package/dist/esm/core/processActionLinks.js.map +1 -0
- package/dist/node/core/getEntityDefaultWorkspacePane.js +10 -0
- package/dist/node/core/getEntityDefaultWorkspacePane.js.map +1 -0
- package/dist/node/core/getRelativeWorkspaceUrl.js +4 -1
- package/dist/node/core/getRelativeWorkspaceUrl.js.map +1 -1
- package/dist/node/core/index.js +2 -0
- package/dist/node/core/index.js.map +1 -1
- package/dist/node/core/processActionLinks.js +67 -0
- package/dist/node/core/processActionLinks.js.map +1 -0
- package/dist/types/core/getEntityDefaultWorkspacePane.d.ts +1 -0
- package/dist/types/core/getRelativeWorkspaceUrl.d.ts +1 -1
- package/dist/types/core/index.d.ts +2 -0
- package/dist/types/core/processActionLinks.d.ts +30 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEntityDefaultWorkspacePane.js","sourceRoot":"","sources":["../../../src/core/getEntityDefaultWorkspacePane.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,UAAkB,EAAU,EAAE;IAC1E,MAAM,aAAa,GAA2B;QAC5C,UAAU,EAAE,SAAS;KACtB,CAAC;IACF,OAAO,aAAa,CAAC,UAAU,CAAC,CAAC;AACnC,CAAC,CAAC"}
|
|
@@ -7,7 +7,7 @@ import { isValidEntityType } from "./isValidEntityType";
|
|
|
7
7
|
* @param type entity type
|
|
8
8
|
* @param identifier entity id or slug
|
|
9
9
|
*/
|
|
10
|
-
export const getRelativeWorkspaceUrl = (type, identifier) => {
|
|
10
|
+
export const getRelativeWorkspaceUrl = (type, identifier, pane) => {
|
|
11
11
|
let url = "/";
|
|
12
12
|
const entityType = getTypeFromEntity({ type });
|
|
13
13
|
/**
|
|
@@ -21,6 +21,9 @@ export const getRelativeWorkspaceUrl = (type, identifier) => {
|
|
|
21
21
|
typeSegment = `${typeSegment}s`;
|
|
22
22
|
}
|
|
23
23
|
url = `/workspace/${typeSegment}/${identifier}`;
|
|
24
|
+
if (pane) {
|
|
25
|
+
url += `/${pane}`;
|
|
26
|
+
}
|
|
24
27
|
}
|
|
25
28
|
return url;
|
|
26
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRelativeWorkspaceUrl.js","sourceRoot":"","sources":["../../../src/core/getRelativeWorkspaceUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,IAAY,EACZ,UAAkB,
|
|
1
|
+
{"version":3,"file":"getRelativeWorkspaceUrl.js","sourceRoot":"","sources":["../../../src/core/getRelativeWorkspaceUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,IAAY,EACZ,UAAkB,EAClB,IAAa,EACL,EAAE;IACV,IAAI,GAAG,GAAG,GAAG,CAAC;IACd,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,IAAI,EAAe,CAAC,CAAC;IAE5D;;;;OAIG;IACH,IAAI,iBAAiB,CAAC,UAAU,CAAC,EAAE;QACjC,IAAI,WAAW,GAAG,UAAoB,CAAC;QACvC,IAAI,WAAW,KAAK,SAAS,EAAE;YAC7B,WAAW,GAAG,GAAG,WAAW,GAAG,CAAC;SACjC;QACD,GAAG,GAAG,cAAc,WAAW,IAAI,UAAU,EAAE,CAAC;QAChD,IAAI,IAAI,EAAE;YACR,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;SACnB;KACF;IAED,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
|
package/dist/esm/core/index.js
CHANGED
|
@@ -3,9 +3,11 @@ export * from "./types";
|
|
|
3
3
|
export * from "./behaviors";
|
|
4
4
|
export * from "./schemas";
|
|
5
5
|
export * from "./fetchHubEntity";
|
|
6
|
+
export * from "./getEntityDefaultWorkspacePane";
|
|
6
7
|
export * from "./getTypeFromEntity";
|
|
7
8
|
export * from "./getRelativeWorkspaceUrl";
|
|
8
9
|
export * from "./isValidEntityType";
|
|
10
|
+
export * from "./processActionLinks";
|
|
9
11
|
// For sme reason, if updateHubEntity is exported here,
|
|
10
12
|
// it is not actually exported in the final package.
|
|
11
13
|
// export * from "./updateHubEntity";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AAErC,uDAAuD;AACvD,oDAAoD;AACpD,qCAAqC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { hubSearch } from "../search";
|
|
2
|
+
/**
|
|
3
|
+
* Given an array of IHubActionLinks, the following util will
|
|
4
|
+
* "pre-process" the action links. This includes:
|
|
5
|
+
*
|
|
6
|
+
* 1. For kind = "content": Fetching the content item, grabbing
|
|
7
|
+
* its site relative href, and transforming the link into an
|
|
8
|
+
* external action link that can be consumed in the UI
|
|
9
|
+
*
|
|
10
|
+
* Note: we can add other pre-processing as necessary
|
|
11
|
+
*
|
|
12
|
+
* @param links hub action links
|
|
13
|
+
* @param requestOptions hub request options
|
|
14
|
+
*/
|
|
15
|
+
export async function processActionLinks(links, requestOptions) {
|
|
16
|
+
const processedActionLinks = await Promise.all(links.map(async (link) => {
|
|
17
|
+
return processActionLink(link, requestOptions);
|
|
18
|
+
}));
|
|
19
|
+
return processedActionLinks;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Given a single IHubActionLink, the following util will
|
|
23
|
+
* "pre-process" the action link. This includes:
|
|
24
|
+
*
|
|
25
|
+
* 1. For kind = "content": Fetching the content item, grabbing
|
|
26
|
+
* its site relative href, and transforming the link into an
|
|
27
|
+
* external action link that can be consumed in the UI
|
|
28
|
+
*
|
|
29
|
+
* Note: we can add other pre-processing as necessary
|
|
30
|
+
*
|
|
31
|
+
* @param link hub action link
|
|
32
|
+
* @param requestOptions hub request options
|
|
33
|
+
*/
|
|
34
|
+
export async function processActionLink(link, requestOptions) {
|
|
35
|
+
// recursively process nested links
|
|
36
|
+
if (link.kind === "section") {
|
|
37
|
+
link.children = await processActionLinks(link.children, requestOptions);
|
|
38
|
+
}
|
|
39
|
+
if (link.kind === "content") {
|
|
40
|
+
try {
|
|
41
|
+
// 1. query for the content item so we can grab its
|
|
42
|
+
// siteRelative href
|
|
43
|
+
const query = {
|
|
44
|
+
targetEntity: "item",
|
|
45
|
+
filters: [{ predicates: [{ id: link.contentId }] }],
|
|
46
|
+
};
|
|
47
|
+
const { results } = await hubSearch(query, { requestOptions });
|
|
48
|
+
// 2. construct a new "external" action link
|
|
49
|
+
// with the content item's site relative href
|
|
50
|
+
delete link.contentId;
|
|
51
|
+
const processedLink = Object.assign(Object.assign({}, link), { kind: "external", href: results[0].links.siteRelative });
|
|
52
|
+
return processedLink;
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
throw new Error(`Unable to fetch entity: ${link.contentId}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return link;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=processActionLinks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processActionLinks.js","sourceRoot":"","sources":["../../../src/core/processActionLinks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,SAAS,EAAE,MAAM,WAAW,CAAC;AAQ9C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,KAAsB,EACtB,cAAkC;IAElC,MAAM,oBAAoB,GAAG,MAAM,OAAO,CAAC,GAAG,CAC5C,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAmB,EAAE,EAAE;QACtC,OAAO,iBAAiB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACjD,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,IAAmB,EACnB,cAAkC;IAElC,mCAAmC;IACnC,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE;QAC3B,IAAI,CAAC,QAAQ,GAAG,MAAM,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;KACzE;IACD,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE;QAC3B,IAAI;YACF,mDAAmD;YACnD,oBAAoB;YACpB,MAAM,KAAK,GAAW;gBACpB,YAAY,EAAE,MAAM;gBACpB,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC;aACpD,CAAC;YACF,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,SAAS,CAAC,KAAK,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;YAE/D,4CAA4C;YAC5C,6CAA6C;YAC7C,OAAO,IAAI,CAAC,SAAS,CAAC;YACtB,MAAM,aAAa,mCACd,IAAI,KACP,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,GACpC,CAAC;YAEF,OAAO,aAAa,CAAC;SACtB;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;SAC9D;KACF;SAAM;QACL,OAAO,IAAI,CAAC;KACb;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEntityDefaultWorkspacePane = void 0;
|
|
4
|
+
exports.getEntityDefaultWorkspacePane = (entityType) => {
|
|
5
|
+
const DEFAULT_PANES = {
|
|
6
|
+
discussion: "details",
|
|
7
|
+
};
|
|
8
|
+
return DEFAULT_PANES[entityType];
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=getEntityDefaultWorkspacePane.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEntityDefaultWorkspacePane.js","sourceRoot":"","sources":["../../../src/core/getEntityDefaultWorkspacePane.ts"],"names":[],"mappings":";;;AAAa,QAAA,6BAA6B,GAAG,CAAC,UAAkB,EAAU,EAAE;IAC1E,MAAM,aAAa,GAA2B;QAC5C,UAAU,EAAE,SAAS;KACtB,CAAC;IACF,OAAO,aAAa,CAAC,UAAU,CAAC,CAAC;AACnC,CAAC,CAAC"}
|
|
@@ -10,7 +10,7 @@ const isValidEntityType_1 = require("./isValidEntityType");
|
|
|
10
10
|
* @param type entity type
|
|
11
11
|
* @param identifier entity id or slug
|
|
12
12
|
*/
|
|
13
|
-
exports.getRelativeWorkspaceUrl = (type, identifier) => {
|
|
13
|
+
exports.getRelativeWorkspaceUrl = (type, identifier, pane) => {
|
|
14
14
|
let url = "/";
|
|
15
15
|
const entityType = getTypeFromEntity_1.getTypeFromEntity({ type });
|
|
16
16
|
/**
|
|
@@ -24,6 +24,9 @@ exports.getRelativeWorkspaceUrl = (type, identifier) => {
|
|
|
24
24
|
typeSegment = `${typeSegment}s`;
|
|
25
25
|
}
|
|
26
26
|
url = `/workspace/${typeSegment}/${identifier}`;
|
|
27
|
+
if (pane) {
|
|
28
|
+
url += `/${pane}`;
|
|
29
|
+
}
|
|
27
30
|
}
|
|
28
31
|
return url;
|
|
29
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRelativeWorkspaceUrl.js","sourceRoot":"","sources":["../../../src/core/getRelativeWorkspaceUrl.ts"],"names":[],"mappings":";;;AAAA,2DAAwD;AACxD,2DAAwD;AAGxD;;;;;;GAMG;AACU,QAAA,uBAAuB,GAAG,CACrC,IAAY,EACZ,UAAkB,
|
|
1
|
+
{"version":3,"file":"getRelativeWorkspaceUrl.js","sourceRoot":"","sources":["../../../src/core/getRelativeWorkspaceUrl.ts"],"names":[],"mappings":";;;AAAA,2DAAwD;AACxD,2DAAwD;AAGxD;;;;;;GAMG;AACU,QAAA,uBAAuB,GAAG,CACrC,IAAY,EACZ,UAAkB,EAClB,IAAa,EACL,EAAE;IACV,IAAI,GAAG,GAAG,GAAG,CAAC;IACd,MAAM,UAAU,GAAG,qCAAiB,CAAC,EAAE,IAAI,EAAe,CAAC,CAAC;IAE5D;;;;OAIG;IACH,IAAI,qCAAiB,CAAC,UAAU,CAAC,EAAE;QACjC,IAAI,WAAW,GAAG,UAAoB,CAAC;QACvC,IAAI,WAAW,KAAK,SAAS,EAAE;YAC7B,WAAW,GAAG,GAAG,WAAW,GAAG,CAAC;SACjC;QACD,GAAG,GAAG,cAAc,WAAW,IAAI,UAAU,EAAE,CAAC;QAChD,IAAI,IAAI,EAAE;YACR,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;SACnB;KACF;IAED,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
|
package/dist/node/core/index.js
CHANGED
|
@@ -6,9 +6,11 @@ tslib_1.__exportStar(require("./types"), exports);
|
|
|
6
6
|
tslib_1.__exportStar(require("./behaviors"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./schemas"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./fetchHubEntity"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./getEntityDefaultWorkspacePane"), exports);
|
|
9
10
|
tslib_1.__exportStar(require("./getTypeFromEntity"), exports);
|
|
10
11
|
tslib_1.__exportStar(require("./getRelativeWorkspaceUrl"), exports);
|
|
11
12
|
tslib_1.__exportStar(require("./isValidEntityType"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./processActionLinks"), exports);
|
|
12
14
|
// For sme reason, if updateHubEntity is exported here,
|
|
13
15
|
// it is not actually exported in the final package.
|
|
14
16
|
// export * from "./updateHubEntity";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,kDAAwB;AACxB,sDAA4B;AAC5B,oDAA0B;AAC1B,2DAAiC;AACjC,8DAAoC;AACpC,oEAA0C;AAC1C,8DAAoC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,kDAAwB;AACxB,sDAA4B;AAC5B,oDAA0B;AAC1B,2DAAiC;AACjC,0EAAgD;AAChD,8DAAoC;AACpC,oEAA0C;AAC1C,8DAAoC;AACpC,+DAAqC;AAErC,uDAAuD;AACvD,oDAAoD;AACpD,qCAAqC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processActionLink = exports.processActionLinks = void 0;
|
|
4
|
+
const search_1 = require("../search");
|
|
5
|
+
/**
|
|
6
|
+
* Given an array of IHubActionLinks, the following util will
|
|
7
|
+
* "pre-process" the action links. This includes:
|
|
8
|
+
*
|
|
9
|
+
* 1. For kind = "content": Fetching the content item, grabbing
|
|
10
|
+
* its site relative href, and transforming the link into an
|
|
11
|
+
* external action link that can be consumed in the UI
|
|
12
|
+
*
|
|
13
|
+
* Note: we can add other pre-processing as necessary
|
|
14
|
+
*
|
|
15
|
+
* @param links hub action links
|
|
16
|
+
* @param requestOptions hub request options
|
|
17
|
+
*/
|
|
18
|
+
async function processActionLinks(links, requestOptions) {
|
|
19
|
+
const processedActionLinks = await Promise.all(links.map(async (link) => {
|
|
20
|
+
return processActionLink(link, requestOptions);
|
|
21
|
+
}));
|
|
22
|
+
return processedActionLinks;
|
|
23
|
+
}
|
|
24
|
+
exports.processActionLinks = processActionLinks;
|
|
25
|
+
/**
|
|
26
|
+
* Given a single IHubActionLink, the following util will
|
|
27
|
+
* "pre-process" the action link. This includes:
|
|
28
|
+
*
|
|
29
|
+
* 1. For kind = "content": Fetching the content item, grabbing
|
|
30
|
+
* its site relative href, and transforming the link into an
|
|
31
|
+
* external action link that can be consumed in the UI
|
|
32
|
+
*
|
|
33
|
+
* Note: we can add other pre-processing as necessary
|
|
34
|
+
*
|
|
35
|
+
* @param link hub action link
|
|
36
|
+
* @param requestOptions hub request options
|
|
37
|
+
*/
|
|
38
|
+
async function processActionLink(link, requestOptions) {
|
|
39
|
+
// recursively process nested links
|
|
40
|
+
if (link.kind === "section") {
|
|
41
|
+
link.children = await processActionLinks(link.children, requestOptions);
|
|
42
|
+
}
|
|
43
|
+
if (link.kind === "content") {
|
|
44
|
+
try {
|
|
45
|
+
// 1. query for the content item so we can grab its
|
|
46
|
+
// siteRelative href
|
|
47
|
+
const query = {
|
|
48
|
+
targetEntity: "item",
|
|
49
|
+
filters: [{ predicates: [{ id: link.contentId }] }],
|
|
50
|
+
};
|
|
51
|
+
const { results } = await search_1.hubSearch(query, { requestOptions });
|
|
52
|
+
// 2. construct a new "external" action link
|
|
53
|
+
// with the content item's site relative href
|
|
54
|
+
delete link.contentId;
|
|
55
|
+
const processedLink = Object.assign(Object.assign({}, link), { kind: "external", href: results[0].links.siteRelative });
|
|
56
|
+
return processedLink;
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
throw new Error(`Unable to fetch entity: ${link.contentId}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
return link;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.processActionLink = processActionLink;
|
|
67
|
+
//# sourceMappingURL=processActionLinks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processActionLinks.js","sourceRoot":"","sources":["../../../src/core/processActionLinks.ts"],"names":[],"mappings":";;;AAAA,sCAA8C;AAQ9C;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,kBAAkB,CACtC,KAAsB,EACtB,cAAkC;IAElC,MAAM,oBAAoB,GAAG,MAAM,OAAO,CAAC,GAAG,CAC5C,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAmB,EAAE,EAAE;QACtC,OAAO,iBAAiB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACjD,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAXD,gDAWC;AAED;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,iBAAiB,CACrC,IAAmB,EACnB,cAAkC;IAElC,mCAAmC;IACnC,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE;QAC3B,IAAI,CAAC,QAAQ,GAAG,MAAM,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;KACzE;IACD,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE;QAC3B,IAAI;YACF,mDAAmD;YACnD,oBAAoB;YACpB,MAAM,KAAK,GAAW;gBACpB,YAAY,EAAE,MAAM;gBACpB,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC;aACpD,CAAC;YACF,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,kBAAS,CAAC,KAAK,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;YAE/D,4CAA4C;YAC5C,6CAA6C;YAC7C,OAAO,IAAI,CAAC,SAAS,CAAC;YACtB,MAAM,aAAa,mCACd,IAAI,KACP,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,GACpC,CAAC;YAEF,OAAO,aAAa,CAAC;SACtB;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;SAC9D;KACF;SAAM;QACL,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AAlCD,8CAkCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getEntityDefaultWorkspacePane: (entityType: string) => string;
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* @param type entity type
|
|
6
6
|
* @param identifier entity id or slug
|
|
7
7
|
*/
|
|
8
|
-
export declare const getRelativeWorkspaceUrl: (type: string, identifier: string) => string;
|
|
8
|
+
export declare const getRelativeWorkspaceUrl: (type: string, identifier: string, pane?: string) => string;
|
|
@@ -3,6 +3,8 @@ export * from "./types";
|
|
|
3
3
|
export * from "./behaviors";
|
|
4
4
|
export * from "./schemas";
|
|
5
5
|
export * from "./fetchHubEntity";
|
|
6
|
+
export * from "./getEntityDefaultWorkspacePane";
|
|
6
7
|
export * from "./getTypeFromEntity";
|
|
7
8
|
export * from "./getRelativeWorkspaceUrl";
|
|
8
9
|
export * from "./isValidEntityType";
|
|
10
|
+
export * from "./processActionLinks";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IHubRequestOptions } from "../types";
|
|
2
|
+
import { HubActionLink, IHubContentActionLink } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Given an array of IHubActionLinks, the following util will
|
|
5
|
+
* "pre-process" the action links. This includes:
|
|
6
|
+
*
|
|
7
|
+
* 1. For kind = "content": Fetching the content item, grabbing
|
|
8
|
+
* its site relative href, and transforming the link into an
|
|
9
|
+
* external action link that can be consumed in the UI
|
|
10
|
+
*
|
|
11
|
+
* Note: we can add other pre-processing as necessary
|
|
12
|
+
*
|
|
13
|
+
* @param links hub action links
|
|
14
|
+
* @param requestOptions hub request options
|
|
15
|
+
*/
|
|
16
|
+
export declare function processActionLinks(links: HubActionLink[], requestOptions: IHubRequestOptions): Promise<Array<Exclude<HubActionLink, IHubContentActionLink>>>;
|
|
17
|
+
/**
|
|
18
|
+
* Given a single IHubActionLink, the following util will
|
|
19
|
+
* "pre-process" the action link. This includes:
|
|
20
|
+
*
|
|
21
|
+
* 1. For kind = "content": Fetching the content item, grabbing
|
|
22
|
+
* its site relative href, and transforming the link into an
|
|
23
|
+
* external action link that can be consumed in the UI
|
|
24
|
+
*
|
|
25
|
+
* Note: we can add other pre-processing as necessary
|
|
26
|
+
*
|
|
27
|
+
* @param link hub action link
|
|
28
|
+
* @param requestOptions hub request options
|
|
29
|
+
*/
|
|
30
|
+
export declare function processActionLink(link: HubActionLink, requestOptions: IHubRequestOptions): Promise<Exclude<HubActionLink, IHubContentActionLink>>;
|