@esri/hub-common 17.9.0 → 17.10.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/items/_internal/ensureUniqueEntitySlug.js +7 -0
- package/dist/esm/items/_internal/ensureUniqueEntitySlug.js.map +1 -1
- package/dist/esm/items/fetch.js +13 -1
- package/dist/esm/items/fetch.js.map +1 -1
- package/dist/esm/sites/_internal/SiteBusinessRules.js +3 -14
- package/dist/esm/sites/_internal/SiteBusinessRules.js.map +1 -1
- package/dist/node/items/_internal/ensureUniqueEntitySlug.js +7 -0
- package/dist/node/items/_internal/ensureUniqueEntitySlug.js.map +1 -1
- package/dist/node/items/fetch.js +13 -1
- package/dist/node/items/fetch.js.map +1 -1
- package/dist/node/sites/_internal/SiteBusinessRules.js +3 -14
- package/dist/node/sites/_internal/SiteBusinessRules.js.map +1 -1
- package/dist/types/sites/_internal/SiteBusinessRules.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { getUniqueSlug, setSlugKeyword } from "../slugs";
|
|
2
|
+
import { truncateSlug } from "./slugs";
|
|
2
3
|
// NOTE: this mutates the entity that is passed in
|
|
3
4
|
export const ensureUniqueEntitySlug = async (entity, requestOptions) => {
|
|
5
|
+
// if we got the entity from the entity editor, the slug will already have the orgUrlKey prefix
|
|
6
|
+
// but it might not have been edited with the entity editor...
|
|
7
|
+
// ie a dev might have just set the slug to "my-slug" and not "org|my-slug" (like i did)
|
|
8
|
+
if (entity.slug && !entity.slug.startsWith(`${entity.orgUrlKey}|`)) {
|
|
9
|
+
entity.slug = truncateSlug(entity.slug, entity.orgUrlKey);
|
|
10
|
+
}
|
|
4
11
|
// verify that the slug is unique
|
|
5
12
|
const { id: existingId, slug } = entity;
|
|
6
13
|
const slugInfo = existingId ? { slug, existingId } : { slug };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensureUniqueEntitySlug.js","sourceRoot":"","sources":["../../../../src/items/_internal/ensureUniqueEntitySlug.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ensureUniqueEntitySlug.js","sourceRoot":"","sources":["../../../../src/items/_internal/ensureUniqueEntitySlug.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,kDAAkD;AAClD,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EACzC,MAAsB,EACtB,cAAkC,EACT,EAAE;IAC3B,+FAA+F;IAC/F,8DAA8D;IAC9D,wFAAwF;IACxF,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,SAAS,GAAG,CAAC,EAAE;QAClE,MAAM,CAAC,IAAI,GAAG,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;KAC3D;IACD,iCAAiC;IACjC,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IACxC,MAAM,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IAC9D,MAAM,CAAC,IAAI,GAAG,MAAM,aAAa,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC5D,uBAAuB;IACvB,MAAM,CAAC,YAAY,GAAG,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACvE,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/dist/esm/items/fetch.js
CHANGED
|
@@ -18,7 +18,19 @@ export function fetchItem(identifier, requestOptions) {
|
|
|
18
18
|
// first, ensure the slug has the org key
|
|
19
19
|
const fullyQualifiedSlug = addContextToSlug(slug, orgKey || requestOptions.siteOrgKey);
|
|
20
20
|
const slugKeyword = uriSlugToKeywordSlug(fullyQualifiedSlug);
|
|
21
|
-
return findItemsBySlug({ slug: slugKeyword }, requestOptions)
|
|
21
|
+
return findItemsBySlug({ slug: slugKeyword }, requestOptions)
|
|
22
|
+
.then((results) => {
|
|
23
|
+
if (results.length) {
|
|
24
|
+
return results;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
// we had a bug where page slugs could have been stored without the org url key prefix
|
|
28
|
+
// we decided to fall back to looking for them without the prefix
|
|
29
|
+
const slugWithoutOrgKey = slugKeyword.split("|").slice(1).join("|");
|
|
30
|
+
return findItemsBySlug({ slug: slugWithoutOrgKey }, requestOptions);
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
.then((results) => {
|
|
22
34
|
if (results.length) {
|
|
23
35
|
// search results only include a subset of properties of the item, so
|
|
24
36
|
// issue a subsequent call to getItem to get the full item details
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../src/items/fetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAWpD;;;;GAIG;AACH,MAAM,UAAU,SAAS,CACvB,UAAkB,EAClB,cAAiC;IAEjC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../src/items/fetch.ts"],"names":[],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,qEAAqE;YACrE,kEAAkE;YAClE,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;SAC/C;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -32,8 +32,6 @@ export const SitePermissions = [
|
|
|
32
32
|
"hub:site:workspace:details",
|
|
33
33
|
"hub:site:workspace:settings",
|
|
34
34
|
"hub:site:workspace:collaborators",
|
|
35
|
-
// DEPRECATED - use hub:site:workspace:catalog instead
|
|
36
|
-
"hub:site:workspace:content",
|
|
37
35
|
"hub:site:workspace:catalog",
|
|
38
36
|
"hub:site:workspace:catalog:content",
|
|
39
37
|
"hub:site:workspace:catalog:events",
|
|
@@ -152,20 +150,9 @@ export const SitesPermissionPolicies = [
|
|
|
152
150
|
permission: "hub:site:workspace:collaborators",
|
|
153
151
|
dependencies: ["hub:site:workspace", "hub:site:edit"],
|
|
154
152
|
},
|
|
155
|
-
// DEPRECATED - use hub:site:workspace:catalog instead
|
|
156
|
-
// NOTE: this is still used in opendata-ui as of 03/26/2025
|
|
157
|
-
// TODO: remove in next breaking change
|
|
158
|
-
{
|
|
159
|
-
permission: "hub:site:workspace:content",
|
|
160
|
-
dependencies: ["hub:site:workspace", "hub:site:edit"],
|
|
161
|
-
},
|
|
162
153
|
{
|
|
163
154
|
permission: "hub:site:workspace:catalog",
|
|
164
|
-
dependencies: [
|
|
165
|
-
"hub:site:workspace",
|
|
166
|
-
"hub:feature:catalogs",
|
|
167
|
-
"hub:site:edit",
|
|
168
|
-
],
|
|
155
|
+
dependencies: ["hub:site:workspace", "hub:site:edit"],
|
|
169
156
|
},
|
|
170
157
|
{
|
|
171
158
|
permission: "hub:site:workspace:catalog:content",
|
|
@@ -175,6 +162,8 @@ export const SitesPermissionPolicies = [
|
|
|
175
162
|
permission: "hub:site:workspace:catalog:events",
|
|
176
163
|
licenses: ["hub-premium"],
|
|
177
164
|
dependencies: ["hub:site:workspace:catalog", "hub:event"],
|
|
165
|
+
environments: ["qaext"],
|
|
166
|
+
availability: ["alpha"],
|
|
178
167
|
},
|
|
179
168
|
{
|
|
180
169
|
permission: "hub:site:workspace:pages",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteBusinessRules.js","sourceRoot":"","sources":["../../../../src/sites/_internal/SiteBusinessRules.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAkB;IAChD,iBAAiB,EAAE,KAAK;IACxB,kBAAkB,EAAE,IAAI;IACxB,sBAAsB,EAAE,KAAK;IAC7B,yBAAyB,EAAE,IAAI;IAC/B,8BAA8B,EAAE,IAAI;IACpC,0BAA0B,EAAE,KAAK;CAClC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,UAAU;IACV,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,gBAAgB;IAChB,0BAA0B;IAC1B,iBAAiB;IACjB,kBAAkB;IAClB,sBAAsB;IACtB,yBAAyB;IACzB,8BAA8B;IAC9B,oBAAoB;IACpB,6BAA6B;IAC7B,8BAA8B;IAC9B,4BAA4B;IAC5B,6BAA6B;IAC7B,kCAAkC;IAClC,
|
|
1
|
+
{"version":3,"file":"SiteBusinessRules.js","sourceRoot":"","sources":["../../../../src/sites/_internal/SiteBusinessRules.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAkB;IAChD,iBAAiB,EAAE,KAAK;IACxB,kBAAkB,EAAE,IAAI;IACxB,sBAAsB,EAAE,KAAK;IAC7B,yBAAyB,EAAE,IAAI;IAC/B,8BAA8B,EAAE,IAAI;IACpC,0BAA0B,EAAE,KAAK;CAClC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,UAAU;IACV,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;I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AAqB;gBAC/B,IAAI,EAAE,gBAAgB;gBACtB,KAAK,EAAE,yBAAyB;aACjC;SACF;KACF;IACD,yCAAyC;IACzC;QACE,UAAU,EAAE,qCAAqC;QACjD,YAAY,EAAE,CAAC,8BAA8B,EAAE,kBAAkB,CAAC;QAClE,UAAU,EAAE,CAAC,uCAAuC,CAAC;KACtD;IACD;QACE,UAAU,EAAE,+BAA+B;QAC3C,YAAY,EAAE,CAAC,oBAAoB,EAAE,eAAe,CAAC;KACtD;IACD;QACE,UAAU,EAAE,6BAA6B;QACzC,YAAY,EAAE,CAAC,oBAAoB,EAAE,eAAe,CAAC;QACrD,YAAY,EAAE,CAAC,OAAO,CAAC;KACxB;IACD;QACE,UAAU,EAAE,gCAAgC;QAC5C,YAAY,EAAE,CAAC,oBAAoB,EAAE,eAAe,CAAC;QACrD,YAAY,EAAE,CAAC,OAAO,CAAC;KACxB;IACD;QACE,UAAU,EAAE,iBAAiB;QAC7B,YAAY,EAAE,CAAC,eAAe,CAAC;KAChC;IACD;QACE,UAAU,EAAE,0BAA0B;QACtC,YAAY,EAAE,CAAC,oBAAoB,EAAE,eAAe,CAAC;QACrD,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC;KAChD;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,oBAAoB;IACpB,mBAAmB;IACnB,yBAAyB;CAC1B,CAAC"}
|
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ensureUniqueEntitySlug = void 0;
|
|
4
4
|
const slugs_1 = require("../slugs");
|
|
5
|
+
const slugs_2 = require("./slugs");
|
|
5
6
|
// NOTE: this mutates the entity that is passed in
|
|
6
7
|
exports.ensureUniqueEntitySlug = async (entity, requestOptions) => {
|
|
8
|
+
// if we got the entity from the entity editor, the slug will already have the orgUrlKey prefix
|
|
9
|
+
// but it might not have been edited with the entity editor...
|
|
10
|
+
// ie a dev might have just set the slug to "my-slug" and not "org|my-slug" (like i did)
|
|
11
|
+
if (entity.slug && !entity.slug.startsWith(`${entity.orgUrlKey}|`)) {
|
|
12
|
+
entity.slug = slugs_2.truncateSlug(entity.slug, entity.orgUrlKey);
|
|
13
|
+
}
|
|
7
14
|
// verify that the slug is unique
|
|
8
15
|
const { id: existingId, slug } = entity;
|
|
9
16
|
const slugInfo = existingId ? { slug, existingId } : { slug };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensureUniqueEntitySlug.js","sourceRoot":"","sources":["../../../../src/items/_internal/ensureUniqueEntitySlug.ts"],"names":[],"mappings":";;;AAEA,oCAAyD;
|
|
1
|
+
{"version":3,"file":"ensureUniqueEntitySlug.js","sourceRoot":"","sources":["../../../../src/items/_internal/ensureUniqueEntitySlug.ts"],"names":[],"mappings":";;;AAEA,oCAAyD;AACzD,mCAAuC;AAEvC,kDAAkD;AACrC,QAAA,sBAAsB,GAAG,KAAK,EACzC,MAAsB,EACtB,cAAkC,EACT,EAAE;IAC3B,+FAA+F;IAC/F,8DAA8D;IAC9D,wFAAwF;IACxF,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,SAAS,GAAG,CAAC,EAAE;QAClE,MAAM,CAAC,IAAI,GAAG,oBAAY,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;KAC3D;IACD,iCAAiC;IACjC,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IACxC,MAAM,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IAC9D,MAAM,CAAC,IAAI,GAAG,MAAM,qBAAa,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC5D,uBAAuB;IACvB,MAAM,CAAC,YAAY,GAAG,sBAAc,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACvE,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/dist/node/items/fetch.js
CHANGED
|
@@ -21,7 +21,19 @@ function fetchItem(identifier, requestOptions) {
|
|
|
21
21
|
// first, ensure the slug has the org key
|
|
22
22
|
const fullyQualifiedSlug = content_1.addContextToSlug(slug, orgKey || requestOptions.siteOrgKey);
|
|
23
23
|
const slugKeyword = slugConverters_1.uriSlugToKeywordSlug(fullyQualifiedSlug);
|
|
24
|
-
return slugs_1.findItemsBySlug({ slug: slugKeyword }, requestOptions)
|
|
24
|
+
return slugs_1.findItemsBySlug({ slug: slugKeyword }, requestOptions)
|
|
25
|
+
.then((results) => {
|
|
26
|
+
if (results.length) {
|
|
27
|
+
return results;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
// we had a bug where page slugs could have been stored without the org url key prefix
|
|
31
|
+
// we decided to fall back to looking for them without the prefix
|
|
32
|
+
const slugWithoutOrgKey = slugKeyword.split("|").slice(1).join("|");
|
|
33
|
+
return slugs_1.findItemsBySlug({ slug: slugWithoutOrgKey }, requestOptions);
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
.then((results) => {
|
|
25
37
|
if (results.length) {
|
|
26
38
|
// search results only include a subset of properties of the item, so
|
|
27
39
|
// issue a subsequent call to getItem to get the full item details
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../src/items/fetch.ts"],"names":[],"mappings":";;;AACA,iEAA0D;AAC1D,wCAA8C;AAC9C,mCAA0C;AAC1C,+DAAkE;AAClE,6CAAoD;AAWpD;;;;GAIG;AACH,SAAgB,SAAS,CACvB,UAAkB,EAClB,cAAiC;IAEjC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,uBAAe,CAAC,UAAU,CA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,CAAC,CAAC;SAC/C;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC,CAAC,CAAC;AACP,CAAC;AAxCD,8BAwCC"}
|
|
@@ -35,8 +35,6 @@ exports.SitePermissions = [
|
|
|
35
35
|
"hub:site:workspace:details",
|
|
36
36
|
"hub:site:workspace:settings",
|
|
37
37
|
"hub:site:workspace:collaborators",
|
|
38
|
-
// DEPRECATED - use hub:site:workspace:catalog instead
|
|
39
|
-
"hub:site:workspace:content",
|
|
40
38
|
"hub:site:workspace:catalog",
|
|
41
39
|
"hub:site:workspace:catalog:content",
|
|
42
40
|
"hub:site:workspace:catalog:events",
|
|
@@ -155,20 +153,9 @@ exports.SitesPermissionPolicies = [
|
|
|
155
153
|
permission: "hub:site:workspace:collaborators",
|
|
156
154
|
dependencies: ["hub:site:workspace", "hub:site:edit"],
|
|
157
155
|
},
|
|
158
|
-
// DEPRECATED - use hub:site:workspace:catalog instead
|
|
159
|
-
// NOTE: this is still used in opendata-ui as of 03/26/2025
|
|
160
|
-
// TODO: remove in next breaking change
|
|
161
|
-
{
|
|
162
|
-
permission: "hub:site:workspace:content",
|
|
163
|
-
dependencies: ["hub:site:workspace", "hub:site:edit"],
|
|
164
|
-
},
|
|
165
156
|
{
|
|
166
157
|
permission: "hub:site:workspace:catalog",
|
|
167
|
-
dependencies: [
|
|
168
|
-
"hub:site:workspace",
|
|
169
|
-
"hub:feature:catalogs",
|
|
170
|
-
"hub:site:edit",
|
|
171
|
-
],
|
|
158
|
+
dependencies: ["hub:site:workspace", "hub:site:edit"],
|
|
172
159
|
},
|
|
173
160
|
{
|
|
174
161
|
permission: "hub:site:workspace:catalog:content",
|
|
@@ -178,6 +165,8 @@ exports.SitesPermissionPolicies = [
|
|
|
178
165
|
permission: "hub:site:workspace:catalog:events",
|
|
179
166
|
licenses: ["hub-premium"],
|
|
180
167
|
dependencies: ["hub:site:workspace:catalog", "hub:event"],
|
|
168
|
+
environments: ["qaext"],
|
|
169
|
+
availability: ["alpha"],
|
|
181
170
|
},
|
|
182
171
|
{
|
|
183
172
|
permission: "hub:site:workspace:pages",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteBusinessRules.js","sourceRoot":"","sources":["../../../../src/sites/_internal/SiteBusinessRules.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACU,QAAA,mBAAmB,GAAkB;IAChD,iBAAiB,EAAE,KAAK;IACxB,kBAAkB,EAAE,IAAI;IACxB,sBAAsB,EAAE,KAAK;IAC7B,yBAAyB,EAAE,IAAI;IAC/B,8BAA8B,EAAE,IAAI;IACpC,0BAA0B,EAAE,KAAK;CAClC,CAAC;AAEF;;;GAGG;AACU,QAAA,eAAe,GAAG;IAC7B,UAAU;IACV,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,gBAAgB;IAChB,0BAA0B;IAC1B,iBAAiB;IACjB,kBAAkB;IAClB,sBAAsB;IACtB,yBAAyB;IACzB,8BAA8B;IAC9B,oBAAoB;IACpB,6BAA6B;IAC7B,8BAA8B;IAC9B,4BAA4B;IAC5B,6BAA6B;IAC7B,kCAAkC;IAClC,
|
|
1
|
+
{"version":3,"file":"SiteBusinessRules.js","sourceRoot":"","sources":["../../../../src/sites/_internal/SiteBusinessRules.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACU,QAAA,mBAAmB,GAAkB;IAChD,iBAAiB,EAAE,KAAK;IACxB,kBAAkB,EAAE,IAAI;IACxB,sBAAsB,EAAE,KAAK;IAC7B,yBAAyB,EAAE,IAAI;IAC/B,8BAA8B,EAAE,IAAI;IACpC,0BAA0B,EAAE,KAAK;CAClC,CAAC;AAEF;;;GAGG;AACU,QAAA,eAAe,GAAG;IAC7B,UAAU;IACV,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,gBAAgB;IAChB,0BAA0B;IAC1B,iBAAiB;IACjB,kBAAkB;IAClB,sBAAsB;IACtB,yBAAyB;IACzB,8BAA8B;IAC9B,o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AY,EAAE,CAAC,8BAA8B,EAAE,kBAAkB,CAAC;QAClE,UAAU,EAAE,CAAC,uCAAuC,CAAC;KACtD;IACD;QACE,UAAU,EAAE,+BAA+B;QAC3C,YAAY,EAAE,CAAC,oBAAoB,EAAE,eAAe,CAAC;KACtD;IACD;QACE,UAAU,EAAE,6BAA6B;QACzC,YAAY,EAAE,CAAC,oBAAoB,EAAE,eAAe,CAAC;QACrD,YAAY,EAAE,CAAC,OAAO,CAAC;KACxB;IACD;QACE,UAAU,EAAE,gCAAgC;QAC5C,YAAY,EAAE,CAAC,oBAAoB,EAAE,eAAe,CAAC;QACrD,YAAY,EAAE,CAAC,OAAO,CAAC;KACxB;IACD;QACE,UAAU,EAAE,iBAAiB;QAC7B,YAAY,EAAE,CAAC,eAAe,CAAC;KAChC;IACD;QACE,UAAU,EAAE,0BAA0B;QACtC,YAAY,EAAE,CAAC,oBAAoB,EAAE,eAAe,CAAC;QACrD,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC;KAChD;CACF,CAAC;AAEF;;GAEG;AACU,QAAA,sBAAsB,GAAG;IACpC,oBAAoB;IACpB,mBAAmB;IACnB,yBAAyB;CAC1B,CAAC"}
|
|
@@ -7,7 +7,7 @@ export declare const SiteDefaultFeatures: IFeatureFlags;
|
|
|
7
7
|
* Site Permissions
|
|
8
8
|
* This feeds into the Permissions type
|
|
9
9
|
*/
|
|
10
|
-
export declare const SitePermissions: readonly ["hub:site", "hub:site:create", "hub:site:delete", "hub:site:edit", "hub:site:view", "hub:site:owner", "hub:site:canChangeAccess", "hub:site:events", "hub:site:content", "hub:site:discussions", "hub:site:feature:follow", "hub:site:feature:discussions", "hub:site:workspace", "hub:site:workspace:overview", "hub:site:workspace:dashboard", "hub:site:workspace:details", "hub:site:workspace:settings", "hub:site:workspace:collaborators", "hub:site:workspace:
|
|
10
|
+
export declare const SitePermissions: readonly ["hub:site", "hub:site:create", "hub:site:delete", "hub:site:edit", "hub:site:view", "hub:site:owner", "hub:site:canChangeAccess", "hub:site:events", "hub:site:content", "hub:site:discussions", "hub:site:feature:follow", "hub:site:feature:discussions", "hub:site:workspace", "hub:site:workspace:overview", "hub:site:workspace:dashboard", "hub:site:workspace:details", "hub:site:workspace:settings", "hub:site:workspace:collaborators", "hub:site:workspace:catalog", "hub:site:workspace:catalog:content", "hub:site:workspace:catalog:events", "hub:site:workspace:metrics", "hub:site:workspace:followers", "hub:site:workspace:followers:member", "hub:site:workspace:followers:manager", "hub:site:workspace:followers:create", "hub:site:workspace:discussion", "hub:site:workspace:pages", "hub:site:workspace:events", "hub:site:workspace:projects", "hub:site:workspace:initiatives", "hub:site:manage", "hub:site:workspace:feeds"];
|
|
11
11
|
/**
|
|
12
12
|
* Site permission policies
|
|
13
13
|
* @private
|