@esri/hub-common 13.18.0 → 13.19.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.
Files changed (74) hide show
  1. package/dist/esm/capabilities/_internal/checkCapabilityAccess.js.map +1 -1
  2. package/dist/esm/capabilities/checkCapability.js.map +1 -1
  3. package/dist/esm/core/fetchHubEntity.js +3 -1
  4. package/dist/esm/core/fetchHubEntity.js.map +1 -1
  5. package/dist/esm/core/getTypeFromEntity.js.map +1 -1
  6. package/dist/esm/core/schemas/getEntityEditorSchemas.js +9 -0
  7. package/dist/esm/core/schemas/getEntityEditorSchemas.js.map +1 -1
  8. package/dist/esm/core/updateHubEntity.js +5 -0
  9. package/dist/esm/core/updateHubEntity.js.map +1 -1
  10. package/dist/esm/pages/HubPage.js +137 -0
  11. package/dist/esm/pages/HubPage.js.map +1 -0
  12. package/dist/esm/pages/HubPages.js +116 -2
  13. package/dist/esm/pages/HubPages.js.map +1 -1
  14. package/dist/esm/pages/_internal/PageBusinessRules.js +80 -0
  15. package/dist/esm/pages/_internal/PageBusinessRules.js.map +1 -1
  16. package/dist/esm/pages/_internal/PageSchema.js +31 -0
  17. package/dist/esm/pages/_internal/PageSchema.js.map +1 -0
  18. package/dist/esm/pages/_internal/PageUiSchemaEdit.js +100 -0
  19. package/dist/esm/pages/_internal/PageUiSchemaEdit.js.map +1 -0
  20. package/dist/esm/pages/_internal/computeProps.js +31 -0
  21. package/dist/esm/pages/_internal/computeProps.js.map +1 -0
  22. package/dist/esm/pages/_internal/getPropertyMap.js +20 -0
  23. package/dist/esm/pages/_internal/getPropertyMap.js.map +1 -0
  24. package/dist/esm/pages/defaults.js +41 -0
  25. package/dist/esm/pages/defaults.js.map +1 -0
  26. package/dist/esm/pages/index.js +1 -0
  27. package/dist/esm/pages/index.js.map +1 -1
  28. package/dist/esm/permissions/types/Permission.js +2 -0
  29. package/dist/esm/permissions/types/Permission.js.map +1 -1
  30. package/dist/node/capabilities/_internal/checkCapabilityAccess.js.map +1 -1
  31. package/dist/node/capabilities/checkCapability.js.map +1 -1
  32. package/dist/node/core/fetchHubEntity.js +3 -1
  33. package/dist/node/core/fetchHubEntity.js.map +1 -1
  34. package/dist/node/core/getTypeFromEntity.js.map +1 -1
  35. package/dist/node/core/schemas/getEntityEditorSchemas.js +9 -0
  36. package/dist/node/core/schemas/getEntityEditorSchemas.js.map +1 -1
  37. package/dist/node/core/updateHubEntity.js +5 -0
  38. package/dist/node/core/updateHubEntity.js.map +1 -1
  39. package/dist/node/pages/HubPage.js +141 -0
  40. package/dist/node/pages/HubPage.js.map +1 -0
  41. package/dist/node/pages/HubPages.js +120 -1
  42. package/dist/node/pages/HubPages.js.map +1 -1
  43. package/dist/node/pages/_internal/PageBusinessRules.js +81 -1
  44. package/dist/node/pages/_internal/PageBusinessRules.js.map +1 -1
  45. package/dist/node/pages/_internal/PageSchema.js +34 -0
  46. package/dist/node/pages/_internal/PageSchema.js.map +1 -0
  47. package/dist/node/pages/_internal/PageUiSchemaEdit.js +103 -0
  48. package/dist/node/pages/_internal/PageUiSchemaEdit.js.map +1 -0
  49. package/dist/node/pages/_internal/computeProps.js +35 -0
  50. package/dist/node/pages/_internal/computeProps.js.map +1 -0
  51. package/dist/node/pages/_internal/getPropertyMap.js +24 -0
  52. package/dist/node/pages/_internal/getPropertyMap.js.map +1 -0
  53. package/dist/node/pages/defaults.js +44 -0
  54. package/dist/node/pages/defaults.js.map +1 -0
  55. package/dist/node/pages/index.js +1 -0
  56. package/dist/node/pages/index.js.map +1 -1
  57. package/dist/node/permissions/types/Permission.js +2 -0
  58. package/dist/node/permissions/types/Permission.js.map +1 -1
  59. package/dist/types/capabilities/_internal/checkCapabilityAccess.d.ts +2 -2
  60. package/dist/types/capabilities/checkCapability.d.ts +2 -2
  61. package/dist/types/core/getTypeFromEntity.d.ts +2 -2
  62. package/dist/types/core/schemas/getEntityEditorSchemas.d.ts +1 -1
  63. package/dist/types/core/types/IHubPage.d.ts +2 -2
  64. package/dist/types/pages/HubPage.d.ts +59 -0
  65. package/dist/types/pages/HubPages.d.ts +44 -1
  66. package/dist/types/pages/_internal/PageBusinessRules.d.ts +27 -0
  67. package/dist/types/pages/_internal/PageSchema.d.ts +7 -0
  68. package/dist/types/pages/_internal/PageUiSchemaEdit.d.ts +7 -0
  69. package/dist/types/pages/_internal/computeProps.d.ts +12 -0
  70. package/dist/types/pages/_internal/getPropertyMap.d.ts +8 -0
  71. package/dist/types/pages/defaults.d.ts +13 -0
  72. package/dist/types/pages/index.d.ts +1 -0
  73. package/dist/types/permissions/types/Permission.d.ts +1 -1
  74. package/package.json +1 -1
@@ -1,6 +1,86 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PageVersionIncludeList = void 0;
3
+ exports.PageVersionIncludeList = exports.PagePermissionPolicies = exports.PagePermissions = exports.PageCapabilityPermissions = exports.PageDefaultCapabilities = void 0;
4
+ /**
5
+ * Default capabilities for a Page. If not listed here, the capability will not be available
6
+ * This hash is combined with the capabilities hash stored in the item data. Regardless of what
7
+ * properties are defined in the item data, only the capabilities defined here will be available
8
+ * @private
9
+ */
10
+ exports.PageDefaultCapabilities = {
11
+ overview: true,
12
+ details: true,
13
+ settings: true,
14
+ };
15
+ /**
16
+ * List of all the Page Capability Permissions
17
+ * These are considered Hub Business Rules and are not intended
18
+ * to be modified by consumers
19
+ * @private
20
+ */
21
+ exports.PageCapabilityPermissions = [
22
+ {
23
+ entity: "page",
24
+ capability: "overview",
25
+ permissions: ["hub:page:view"],
26
+ },
27
+ {
28
+ entity: "page",
29
+ capability: "details",
30
+ permissions: ["hub:page:edit"],
31
+ },
32
+ {
33
+ entity: "page",
34
+ capability: "settings",
35
+ permissions: ["hub:page:edit"],
36
+ },
37
+ ];
38
+ /**
39
+ * Page Permission Policies
40
+ * These define the requirements any user must meet to perform related actions
41
+ * @private
42
+ */
43
+ exports.PagePermissions = [
44
+ "hub:page:create",
45
+ "hub:page:delete",
46
+ "hub:page:edit",
47
+ "hub:page:view",
48
+ ];
49
+ /**
50
+ * Page permission policies
51
+ * @private
52
+ */
53
+ exports.PagePermissionPolicies = [
54
+ {
55
+ permission: "hub:page:create",
56
+ subsystems: ["pages", "sites"],
57
+ authenticated: true,
58
+ privileges: ["portal:user:createItem"],
59
+ licenses: ["hub-basic", "hub-premium", "enterprise-sites"],
60
+ },
61
+ {
62
+ permission: "hub:page:view",
63
+ subsystems: ["pages", "sites"],
64
+ authenticated: false,
65
+ licenses: ["hub-basic", "hub-premium", "enterprise-sites"],
66
+ },
67
+ {
68
+ permission: "hub:page:edit",
69
+ authenticated: true,
70
+ subsystems: ["pages", "sites"],
71
+ entityEdit: true,
72
+ // privileges: ["portal:admin:updateItems"], // maybe this too?
73
+ licenses: ["hub-basic", "hub-premium", "enterprise-sites"],
74
+ },
75
+ {
76
+ permission: "hub:page:delete",
77
+ authenticated: true,
78
+ subsystems: ["pages", "sites"],
79
+ entityOwner: true,
80
+ // privileges: ["portal:admin:deleteItems"], // maybe this too?
81
+ licenses: ["hub-basic", "hub-premium", "enterprise-sites"],
82
+ },
83
+ ];
4
84
  /**
5
85
  * Page versioning include list
6
86
  */
@@ -1 +1 @@
1
- {"version":3,"file":"PageBusinessRules.js","sourceRoot":"","sources":["../../../../src/pages/_internal/PageBusinessRules.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,sBAAsB,GAAG;IACpC,oBAAoB;IACpB,yBAAyB;CAC1B,CAAC"}
1
+ {"version":3,"file":"PageBusinessRules.js","sourceRoot":"","sources":["../../../../src/pages/_internal/PageBusinessRules.ts"],"names":[],"mappings":";;;AAGA;;;;;GAKG;AACU,QAAA,uBAAuB,GAAuB;IACzD,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF;;;;;GAKG;AACU,QAAA,yBAAyB,GAA4B;IAChE;QACE,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,UAAU;QACtB,WAAW,EAAE,CAAC,eAAe,CAAC;KAC/B;IACD;QACE,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,SAAS;QACrB,WAAW,EAAE,CAAC,eAAe,CAAC;KAC/B;IACD;QACE,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,UAAU;QACtB,WAAW,EAAE,CAAC,eAAe,CAAC;KAC/B;CACF,CAAC;AAEF;;;;GAIG;AACU,QAAA,eAAe,GAAG;IAC7B,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,eAAe;CACP,CAAC;AAEX;;;GAGG;AACU,QAAA,sBAAsB,GAAwB;IACzD;QACE,UAAU,EAAE,iBAAiB;QAC7B,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;QAC9B,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,CAAC,wBAAwB,CAAC;QACtC,QAAQ,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,kBAAkB,CAAC;KAC3D;IACD;QACE,UAAU,EAAE,eAAe;QAC3B,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;QAC9B,aAAa,EAAE,KAAK;QACpB,QAAQ,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,kBAAkB,CAAC;KAC3D;IACD;QACE,UAAU,EAAE,eAAe;QAC3B,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;QAC9B,UAAU,EAAE,IAAI;QAChB,+DAA+D;QAC/D,QAAQ,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,kBAAkB,CAAC;KAC3D;IACD;QACE,UAAU,EAAE,iBAAiB;QAC7B,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;QAC9B,WAAW,EAAE,IAAI;QACjB,+DAA+D;QAC/D,QAAQ,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,kBAAkB,CAAC;KAC3D;CACF,CAAC;AAEF;;GAEG;AACU,QAAA,sBAAsB,GAAG;IACpC,oBAAoB;IACpB,yBAAyB;CAC1B,CAAC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PageSchema = exports.PageEditorTypes = void 0;
4
+ const shared_1 = require("../../core/schemas/shared");
5
+ exports.PageEditorTypes = ["hub:page:edit"];
6
+ /**
7
+ * defines the JSON schema for a Hub Site's editable fields
8
+ */
9
+ exports.PageSchema = {
10
+ required: ["name"],
11
+ type: "object",
12
+ properties: {
13
+ name: shared_1.ENTITY_NAME_SCHEMA,
14
+ summary: {
15
+ type: "string",
16
+ },
17
+ description: {
18
+ type: "string",
19
+ },
20
+ access: shared_1.ENTITY_ACCESS_SCHEMA,
21
+ groups: {
22
+ type: "array",
23
+ items: {
24
+ type: "string",
25
+ },
26
+ },
27
+ location: {
28
+ type: "object",
29
+ },
30
+ tags: shared_1.ENTITY_TAGS_SCHEMA,
31
+ categories: shared_1.ENTITY_CATEGORIES_SCHEMA,
32
+ },
33
+ };
34
+ //# sourceMappingURL=PageSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageSchema.js","sourceRoot":"","sources":["../../../../src/pages/_internal/PageSchema.ts"],"names":[],"mappings":";;;AACA,sDAKmC;AAEtB,QAAA,eAAe,GAAG,CAAC,eAAe,CAAU,CAAC;AAG1D;;GAEG;AACU,QAAA,UAAU,GAAyB;IAC9C,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,IAAI,EAAE,2BAAkB;QACxB,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;SACf;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;SACf;QACD,MAAM,EAAE,6BAAoB;QAC5B,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;aACf;SACF;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;SACf;QACD,IAAI,EAAE,2BAAkB;QACxB,UAAU,EAAE,iCAAwB;KACrC;CACiC,CAAC"}
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uiSchema = void 0;
4
+ /**
5
+ * complete edit uiSchema for Hub Projects - this defines
6
+ * how the schema properties should be rendered in the
7
+ * project editing experience
8
+ */
9
+ exports.uiSchema = {
10
+ type: "Layout",
11
+ elements: [
12
+ {
13
+ type: "Section",
14
+ labelKey: "{{i18nScope}}.sections.basicInfo.label",
15
+ elements: [
16
+ {
17
+ labelKey: "{{i18nScope}}.fields.name.label",
18
+ scope: "/properties/name",
19
+ type: "Control",
20
+ options: {
21
+ messages: [
22
+ {
23
+ type: "ERROR",
24
+ keyword: "required",
25
+ icon: true,
26
+ labelKey: "{{i18nScope}}.fields.name.requiredError",
27
+ },
28
+ ],
29
+ },
30
+ },
31
+ {
32
+ labelKey: "{{i18nScope}}.fields.summary.label",
33
+ scope: "/properties/summary",
34
+ type: "Control",
35
+ options: {
36
+ control: "hub-field-input-input",
37
+ type: "textarea",
38
+ helperText: {
39
+ labelKey: "{{i18nScope}}.fields.summary.helperText",
40
+ },
41
+ },
42
+ },
43
+ {
44
+ labelKey: "{{i18nScope}}.fields.description.label",
45
+ scope: "/properties/description",
46
+ type: "Control",
47
+ options: {
48
+ control: "hub-field-input-input",
49
+ type: "textarea",
50
+ helperText: {
51
+ labelKey: "{{i18nScope}}.fields.description.helperText",
52
+ },
53
+ },
54
+ },
55
+ {
56
+ labelKey: "{{i18nScope}}.fields.tags.label",
57
+ scope: "/properties/tags",
58
+ type: "Control",
59
+ options: {
60
+ control: "hub-field-input-combobox",
61
+ allowCustomValues: true,
62
+ selectionMode: "multiple",
63
+ placeholderIcon: "label",
64
+ helperText: { labelKey: "{{i18nScope}}.fields.tags.helperText" },
65
+ },
66
+ },
67
+ {
68
+ labelKey: "{{i18nScope}}.fields.categories.label",
69
+ scope: "/properties/categories",
70
+ type: "Control",
71
+ options: {
72
+ control: "hub-field-input-combobox",
73
+ allowCustomValues: false,
74
+ selectionMode: "multiple",
75
+ placeholderIcon: "select-category",
76
+ helperText: {
77
+ labelKey: "{{i18nScope}}.fields.categories.helperText",
78
+ },
79
+ },
80
+ },
81
+ ],
82
+ },
83
+ {
84
+ type: "Section",
85
+ labelKey: "{{i18nScope}}.sections.location.label",
86
+ options: {
87
+ helperText: {
88
+ labelKey: "{{i18nScope}}.sections.location.helperText",
89
+ },
90
+ },
91
+ elements: [
92
+ {
93
+ scope: "/properties/location",
94
+ type: "Control",
95
+ options: {
96
+ control: "hub-field-input-location-picker",
97
+ },
98
+ },
99
+ ],
100
+ },
101
+ ],
102
+ };
103
+ //# sourceMappingURL=PageUiSchemaEdit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageUiSchemaEdit.js","sourceRoot":"","sources":["../../../../src/pages/_internal/PageUiSchemaEdit.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACU,QAAA,QAAQ,GAAc;IACjC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,wCAAwC;YAClD,QAAQ,EAAE;gBACR;oBACE,QAAQ,EAAE,iCAAiC;oBAC3C,KAAK,EAAE,kBAAkB;oBACzB,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,QAAQ,EAAE;4BACR;gCACE,IAAI,EAAE,OAAO;gCACb,OAAO,EAAE,UAAU;gCACnB,IAAI,EAAE,IAAI;gCACV,QAAQ,EAAE,yCAAyC;6BACpD;yBACF;qBACF;iBACF;gBACD;oBACE,QAAQ,EAAE,oCAAoC;oBAC9C,KAAK,EAAE,qBAAqB;oBAC5B,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,uBAAuB;wBAChC,IAAI,EAAE,UAAU;wBAChB,UAAU,EAAE;4BACV,QAAQ,EAAE,yCAAyC;yBACpD;qBACF;iBACF;gBACD;oBACE,QAAQ,EAAE,wCAAwC;oBAClD,KAAK,EAAE,yBAAyB;oBAChC,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,uBAAuB;wBAChC,IAAI,EAAE,UAAU;wBAChB,UAAU,EAAE;4BACV,QAAQ,EAAE,6CAA6C;yBACxD;qBACF;iBACF;gBAED;oBACE,QAAQ,EAAE,iCAAiC;oBAC3C,KAAK,EAAE,kBAAkB;oBACzB,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,0BAA0B;wBACnC,iBAAiB,EAAE,IAAI;wBACvB,aAAa,EAAE,UAAU;wBACzB,eAAe,EAAE,OAAO;wBACxB,UAAU,EAAE,EAAE,QAAQ,EAAE,sCAAsC,EAAE;qBACjE;iBACF;gBACD;oBACE,QAAQ,EAAE,uCAAuC;oBACjD,KAAK,EAAE,wBAAwB;oBAC/B,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,0BAA0B;wBACnC,iBAAiB,EAAE,KAAK;wBACxB,aAAa,EAAE,UAAU;wBACzB,eAAe,EAAE,iBAAiB;wBAClC,UAAU,EAAE;4BACV,QAAQ,EAAE,4CAA4C;yBACvD;qBACF;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,uCAAuC;YACjD,OAAO,EAAE;gBACP,UAAU,EAAE;oBACV,QAAQ,EAAE,4CAA4C;iBACvD;aACF;YACD,QAAQ,EAAE;gBACR;oBACE,KAAK,EAAE,sBAAsB;oBAC7B,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,iCAAiC;qBAC3C;iBACF;aACF;SACF;KACF;CACF,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.computeProps = void 0;
4
+ const resources_1 = require("../../resources");
5
+ const PageBusinessRules_1 = require("./PageBusinessRules");
6
+ const capabilities_1 = require("../../capabilities");
7
+ /**
8
+ * Given a model and a page, set various computed properties that can't be directly mapped
9
+ * @private
10
+ * @param model
11
+ * @param page
12
+ * @param requestOptions
13
+ * @returns
14
+ */
15
+ function computeProps(model, page, requestOptions) {
16
+ var _a;
17
+ let token;
18
+ if (requestOptions.authentication) {
19
+ const session = requestOptions.authentication;
20
+ token = session.token;
21
+ }
22
+ // thumbnail url
23
+ page.thumbnailUrl = resources_1.getItemThumbnailUrl(model.item, requestOptions, token);
24
+ // Handle Dates
25
+ page.createdDate = new Date(model.item.created);
26
+ page.createdDateSource = "item.created";
27
+ page.updatedDate = new Date(model.item.modified);
28
+ page.updatedDateSource = "item.modified";
29
+ // // Handle capabilities
30
+ page.capabilities = capabilities_1.processEntityCapabilities(((_a = model.data.settings) === null || _a === void 0 ? void 0 : _a.capabilities) || {}, PageBusinessRules_1.PageDefaultCapabilities);
31
+ // cast b/c this takes a partial but returns a full page
32
+ return page;
33
+ }
34
+ exports.computeProps = computeProps;
35
+ //# sourceMappingURL=computeProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeProps.js","sourceRoot":"","sources":["../../../../src/pages/_internal/computeProps.ts"],"names":[],"mappings":";;;AAEA,+CAAsD;AAGtD,2DAA8D;AAC9D,qDAA+D;AAE/D;;;;;;;GAOG;AACH,SAAgB,YAAY,CAC1B,KAAa,EACb,IAAuB,EACvB,cAA+B;;IAE/B,IAAI,KAAa,CAAC;IAClB,IAAI,cAAc,CAAC,cAAc,EAAE;QACjC,MAAM,OAAO,GAAgB,cAAc,CAAC,cAA6B,CAAC;QAC1E,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;KACvB;IACD,gBAAgB;IAChB,IAAI,CAAC,YAAY,GAAG,+BAAmB,CAAC,KAAK,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;IAE3E,eAAe;IACf,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAChD,IAAI,CAAC,iBAAiB,GAAG,cAAc,CAAC;IACxC,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,CAAC,iBAAiB,GAAG,eAAe,CAAC;IAEzC,yBAAyB;IACzB,IAAI,CAAC,YAAY,GAAG,wCAAyB,CAC3C,OAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,0CAAE,YAAY,KAAI,EAAE,EACvC,2CAAuB,CACxB,CAAC;IAEF,wDAAwD;IACxD,OAAO,IAAgB,CAAC;AAC1B,CAAC;AA3BD,oCA2BC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPropertyMap = void 0;
4
+ const getBasePropertyMap_1 = require("../../core/_internal/getBasePropertyMap");
5
+ /**
6
+ * Returns an Array of IPropertyMap objects
7
+ * that define the projection of properties from a IModel to an IHubPage
8
+ * @returns
9
+ * @private
10
+ */
11
+ function getPropertyMap() {
12
+ const map = getBasePropertyMap_1.getBasePropertyMap();
13
+ /**
14
+ * page-specific mappings.
15
+ */
16
+ // map.push({ entityKey: "permissions", storeKey: "data.permissions" });
17
+ const valueProps = ["headContent", "layout"];
18
+ valueProps.forEach((entityKey) => {
19
+ map.push({ entityKey, storeKey: `data.values.${entityKey}` });
20
+ });
21
+ return map;
22
+ }
23
+ exports.getPropertyMap = getPropertyMap;
24
+ //# sourceMappingURL=getPropertyMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPropertyMap.js","sourceRoot":"","sources":["../../../../src/pages/_internal/getPropertyMap.ts"],"names":[],"mappings":";;;AACA,gFAA6E;AAE7E;;;;;GAKG;AAEH,SAAgB,cAAc;IAC5B,MAAM,GAAG,GAAG,uCAAkB,EAAE,CAAC;IAEjC;;OAEG;IACH,wEAAwE;IACxE,MAAM,UAAU,GAAG,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IAC7C,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;QAC/B,GAAG,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,SAAS,EAAE,EAAE,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC;AAbD,wCAaC"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_PAGE_MODEL = exports.DEFAULT_PAGE = exports.PAGE_TYPE_KEYWORD = exports.ENTERPRISE_PAGE_ITEM_TYPE = exports.HUB_PAGE_ITEM_TYPE = void 0;
4
+ exports.HUB_PAGE_ITEM_TYPE = "Hub Page";
5
+ exports.ENTERPRISE_PAGE_ITEM_TYPE = "Site Page";
6
+ exports.PAGE_TYPE_KEYWORD = "hubPage";
7
+ /**
8
+ * Default values of a IHubPage
9
+ */
10
+ exports.DEFAULT_PAGE = {
11
+ name: "No title provided",
12
+ permissions: [],
13
+ schemaVersion: 1,
14
+ tags: [],
15
+ typeKeywords: [exports.PAGE_TYPE_KEYWORD],
16
+ view: {
17
+ contacts: [],
18
+ featuredContentIds: [],
19
+ showMap: true,
20
+ },
21
+ };
22
+ /**
23
+ * Default values for a new HubPage Model
24
+ */
25
+ exports.DEFAULT_PAGE_MODEL = {
26
+ item: {
27
+ type: exports.HUB_PAGE_ITEM_TYPE,
28
+ title: "No Title Provided",
29
+ description: "",
30
+ snippet: "",
31
+ tags: [],
32
+ typeKeywords: [exports.PAGE_TYPE_KEYWORD],
33
+ properties: {
34
+ slug: "",
35
+ schemaVersion: 1,
36
+ },
37
+ },
38
+ data: {
39
+ values: {
40
+ layout: {},
41
+ },
42
+ },
43
+ };
44
+ //# sourceMappingURL=defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../src/pages/defaults.ts"],"names":[],"mappings":";;;AAGa,QAAA,kBAAkB,GAAG,UAAU,CAAC;AAChC,QAAA,yBAAyB,GAAG,WAAW,CAAC;AACxC,QAAA,iBAAiB,GAAG,SAAS,CAAC;AAC3C;;GAEG;AACU,QAAA,YAAY,GAAsB;IAC7C,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,EAAE;IACf,aAAa,EAAE,CAAC;IAChB,IAAI,EAAE,EAAE;IACR,YAAY,EAAE,CAAC,yBAAiB,CAAC;IACjC,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE;QACZ,kBAAkB,EAAE,EAAE;QACtB,OAAO,EAAE,IAAI;KACd;CACF,CAAC;AAEF;;GAEG;AACU,QAAA,kBAAkB,GAAW;IACxC,IAAI,EAAE;QACJ,IAAI,EAAE,0BAAkB;QACxB,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,EAAE;QACR,YAAY,EAAE,CAAC,yBAAiB,CAAC;QACjC,UAAU,EAAE;YACV,IAAI,EAAE,EAAE;YACR,aAAa,EAAE,CAAC;SACjB;KACF;IACD,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;SACX;KACF;CACmB,CAAC"}
@@ -2,4 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./HubPages"), exports);
5
+ tslib_1.__exportStar(require("./HubPage"), exports);
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pages/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pages/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,oDAA0B"}
@@ -6,6 +6,7 @@ const SiteBusinessRules_1 = require("../../sites/_internal/SiteBusinessRules");
6
6
  const InitiativeBusinessRules_1 = require("../../initiatives/_internal/InitiativeBusinessRules");
7
7
  const DiscussionBusinessRules_1 = require("../../discussions/_internal/DiscussionBusinessRules");
8
8
  const ContentBusinessRules_1 = require("../../content/_internal/ContentBusinessRules");
9
+ const PageBusinessRules_1 = require("../../pages/_internal/PageBusinessRules");
9
10
  /**
10
11
  * Defines the values for Permissions
11
12
  * It's critical that the arrays defined in the modules use `as const`
@@ -17,6 +18,7 @@ const validPermissions = [
17
18
  ...InitiativeBusinessRules_1.InitiativePermissions,
18
19
  ...DiscussionBusinessRules_1.DiscussionPermissions,
19
20
  ...ContentBusinessRules_1.ContentPermissions,
21
+ ...PageBusinessRules_1.PagePermissions,
20
22
  ];
21
23
  /**
22
24
  * Validate a Permission
@@ -1 +1 @@
1
- {"version":3,"file":"Permission.js","sourceRoot":"","sources":["../../../../src/permissions/types/Permission.ts"],"names":[],"mappings":";;;AAAA,wFAAmF;AACnF,+EAA0E;AAC1E,iGAA4F;AAC5F,iGAA4F;AAC5F,uFAAkF;AAElF;;;;GAIG;AACH,MAAM,gBAAgB,GAAG;IACvB,GAAG,mCAAe;IAClB,GAAG,yCAAkB;IACrB,GAAG,+CAAqB;IACxB,GAAG,+CAAqB;IACxB,GAAG,yCAAkB;CACb,CAAC;AAOX;;;;GAIG;AACH,SAAgB,YAAY,CAAC,eAAuB;IAClD,OAAO,gBAAgB,CAAC,QAAQ,CAAC,eAA6B,CAAC,CAAC;AAClE,CAAC;AAFD,oCAEC"}
1
+ {"version":3,"file":"Permission.js","sourceRoot":"","sources":["../../../../src/permissions/types/Permission.ts"],"names":[],"mappings":";;;AAAA,wFAAmF;AACnF,+EAA0E;AAC1E,iGAA4F;AAC5F,iGAA4F;AAC5F,uFAAkF;AAClF,+EAA0E;AAE1E;;;;GAIG;AACH,MAAM,gBAAgB,GAAG;IACvB,GAAG,mCAAe;IAClB,GAAG,yCAAkB;IACrB,GAAG,+CAAqB;IACxB,GAAG,+CAAqB;IACxB,GAAG,yCAAkB;IACrB,GAAG,mCAAe;CACV,CAAC;AAOX;;;;GAIG;AACH,SAAgB,YAAY,CAAC,eAAuB;IAClD,OAAO,gBAAgB,CAAC,QAAQ,CAAC,eAA6B,CAAC,CAAC;AAClE,CAAC;AAFD,oCAEC"}
@@ -1,5 +1,5 @@
1
1
  import { IArcGISContext } from "../../ArcGISContext";
2
- import { HubEntity } from "../../core";
2
+ import { HubEntity, IHubItemEntity } from "../../core";
3
3
  import { ICapabilityAccessResponse, ICapabilityPermission } from "../types";
4
4
  /**
5
5
  * Check an individual capability access rule
@@ -8,4 +8,4 @@ import { ICapabilityAccessResponse, ICapabilityPermission } from "../types";
8
8
  * @param entity
9
9
  * @returns
10
10
  */
11
- export declare function checkCapabilityAccess(rule: ICapabilityPermission, context: IArcGISContext, entity: HubEntity): ICapabilityAccessResponse;
11
+ export declare function checkCapabilityAccess(rule: ICapabilityPermission, context: IArcGISContext, entity: IHubItemEntity | HubEntity): ICapabilityAccessResponse;
@@ -1,5 +1,5 @@
1
1
  import { Capability, ICapabilityAccessResponse } from "./types";
2
- import { IArcGISContext, HubEntity } from "../index";
2
+ import { IArcGISContext, HubEntity, IHubItemEntity } from "../index";
3
3
  /**
4
4
  * Check if a capability is enabled for a given entity and if the current user has necessary permissions to access it
5
5
  * @param capability
@@ -7,4 +7,4 @@ import { IArcGISContext, HubEntity } from "../index";
7
7
  * @param entity
8
8
  * @returns
9
9
  */
10
- export declare function checkCapability(capability: Capability, context: IArcGISContext, entity: HubEntity): ICapabilityAccessResponse;
10
+ export declare function checkCapability(capability: Capability, context: IArcGISContext, entity: IHubItemEntity | HubEntity): ICapabilityAccessResponse;
@@ -1,7 +1,7 @@
1
- import { HubEntity, HubEntityType } from "./types";
1
+ import { HubEntity, IHubItemEntity, HubEntityType } from "./types";
2
2
  /**
3
3
  * Given a HubEntity, return it's HubEntityType
4
4
  * @param entity
5
5
  * @returns
6
6
  */
7
- export declare function getTypeFromEntity(entity: HubEntity): HubEntityType;
7
+ export declare function getTypeFromEntity(entity: IHubItemEntity | HubEntity): HubEntityType;
@@ -5,7 +5,7 @@ import { UiSchemaElementOptions } from "./types";
5
5
  * to the supported/defined uiSchema configurations
6
6
  */
7
7
  export declare type EditorType = (typeof validEditorTypes)[number];
8
- export declare const validEditorTypes: readonly ["hub:project:create", "hub:project:edit", "hub:initiative:edit", "hub:site:edit", "hub:discussion:edit", "hub:discussion:create"];
8
+ export declare const validEditorTypes: readonly ["hub:project:create", "hub:project:edit", "hub:initiative:edit", "hub:site:edit", "hub:discussion:edit", "hub:discussion:create", "hub:page:edit"];
9
9
  /**
10
10
  * get the editor schema and uiSchema defined for an entity.
11
11
  * The schema and uiSchema that are returned can be used to
@@ -1,8 +1,8 @@
1
- import { IWithLayout } from "../traits/IWithLayout";
2
1
  import { IHubItemEntity } from "./IHubItemEntity";
2
+ import { IWithLayout, IWithPermissions, IWithSlug } from "../traits";
3
3
  /**
4
4
  * DRAFT: Under development and more properties will likely be added
5
5
  * @internal
6
6
  */
7
- export interface IHubPage extends IHubItemEntity, IWithLayout {
7
+ export interface IHubPage extends IHubItemEntity, IWithLayout, IWithPermissions, IWithSlug {
8
8
  }
@@ -0,0 +1,59 @@
1
+ import { IHubPage, IWithStoreBehavior, IWithSharingBehavior, UiSchemaElementOptions } from "../core";
2
+ import { IArcGISContext } from "../ArcGISContext";
3
+ import { HubItemEntity } from "../core/HubItemEntity";
4
+ import { IEditorConfig } from "../core/behaviors/IWithEditorBehavior";
5
+ import { PageEditorType } from "./_internal/PageSchema";
6
+ /**
7
+ * Hub Page Class
8
+ * NOTE: This is a minimal implementation.
9
+ */
10
+ export declare class HubPage extends HubItemEntity<IHubPage> implements IWithStoreBehavior<IHubPage>, IWithSharingBehavior {
11
+ /**
12
+ * Private constructor so we don't have `new` all over the place. Allows for
13
+ * more flexibility in how we create the HubPageManager over time.
14
+ * @param context
15
+ */
16
+ private constructor();
17
+ /**
18
+ * Create an instance from an IHubPage object
19
+ * @param json - JSON object to create a HubPage from
20
+ * @param context - ArcGIS context
21
+ * @returns
22
+ */
23
+ static fromJson(json: Partial<IHubPage>, context: IArcGISContext): HubPage;
24
+ /**
25
+ *
26
+ * Create a new HubPage, returning a HubPage instance.
27
+ * By default, this does not save the page to the backing store.
28
+ * @param partialPage
29
+ * @param context
30
+ * @returns
31
+ */
32
+ static create(partialPage: Partial<IHubPage>, context: IArcGISContext, save?: boolean): Promise<HubPage>;
33
+ /**
34
+ * Fetch a Page from the backing store and return a HubPage instance.
35
+ * @param identifier - Identifier of the page to load
36
+ * @param context
37
+ * @returns
38
+ */
39
+ static fetch(identifier: string, context: IArcGISContext): Promise<HubPage>;
40
+ static getEditorConfig(i18nScope: string, type: PageEditorType, options?: UiSchemaElementOptions[]): Promise<IEditorConfig>;
41
+ private static applyDefaults;
42
+ /**
43
+ * Apply a new state to the instance
44
+ * @param changes
45
+ */
46
+ update(changes: Partial<IHubPage>): void;
47
+ /**
48
+ * Save the HubPage to the backing store.
49
+ * Currently Pages are stored as Items in Portal
50
+ * @returns
51
+ */
52
+ save(): Promise<void>;
53
+ /**
54
+ * Delete the HubPage from the store
55
+ * set a flag to indicate that it is destroyed
56
+ * @returns
57
+ */
58
+ delete(): Promise<void>;
59
+ }
@@ -1,6 +1,49 @@
1
- import { IItem } from "@esri/arcgis-rest-types";
2
1
  import { IHubSearchResult } from "../search";
3
2
  import { IHubRequestOptions } from "../types";
3
+ import { IRequestOptions } from "@esri/arcgis-rest-request";
4
+ import { IItem } from "@esri/arcgis-rest-portal";
5
+ import { IHubPage } from "../core";
6
+ import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
7
+ /**
8
+ * @private
9
+ * Create a new Hub Page item
10
+ *
11
+ * Minimal properties are name and org
12
+ *
13
+ * @param partialPage
14
+ * @param requestOptions
15
+ */
16
+ export declare function createPage(partialPage: Partial<IHubPage>, requestOptions: IUserRequestOptions): Promise<IHubPage>;
17
+ /**
18
+ * @private
19
+ * Update a Hub Page
20
+ * @param page
21
+ * @param requestOptions
22
+ */
23
+ export declare function updatePage(page: IHubPage, requestOptions: IUserRequestOptions): Promise<IHubPage>;
24
+ /**
25
+ * @private
26
+ * Get a Hub Page by id or slug
27
+ * @param identifier item id or slug
28
+ * @param requestOptions
29
+ */
30
+ export declare function fetchPage(identifier: string, requestOptions: IRequestOptions): Promise<IHubPage>;
31
+ /**
32
+ * @private
33
+ * Convert an Hub Page Item into a Hub Page, fetching any additional
34
+ * information that may be required
35
+ * @param item
36
+ * @param auth
37
+ * @returns
38
+ */
39
+ export declare function convertItemToPage(item: IItem, requestOptions: IRequestOptions): Promise<IHubPage>;
40
+ /**
41
+ * @private
42
+ * Remove a Hub Page
43
+ * @param id
44
+ * @param requestOptions
45
+ */
46
+ export declare function deletePage(id: string, requestOptions: IUserRequestOptions): Promise<void>;
4
47
  /**
5
48
  * Fetch Page specific Enrichments
6
49
  * @param item
@@ -1,3 +1,30 @@
1
+ import { EntityCapabilities, ICapabilityPermission } from "../../capabilities";
2
+ import { IPermissionPolicy } from "../../permissions";
3
+ /**
4
+ * Default capabilities for a Page. If not listed here, the capability will not be available
5
+ * This hash is combined with the capabilities hash stored in the item data. Regardless of what
6
+ * properties are defined in the item data, only the capabilities defined here will be available
7
+ * @private
8
+ */
9
+ export declare const PageDefaultCapabilities: EntityCapabilities;
10
+ /**
11
+ * List of all the Page Capability Permissions
12
+ * These are considered Hub Business Rules and are not intended
13
+ * to be modified by consumers
14
+ * @private
15
+ */
16
+ export declare const PageCapabilityPermissions: ICapabilityPermission[];
17
+ /**
18
+ * Page Permission Policies
19
+ * These define the requirements any user must meet to perform related actions
20
+ * @private
21
+ */
22
+ export declare const PagePermissions: readonly ["hub:page:create", "hub:page:delete", "hub:page:edit", "hub:page:view"];
23
+ /**
24
+ * Page permission policies
25
+ * @private
26
+ */
27
+ export declare const PagePermissionPolicies: IPermissionPolicy[];
1
28
  /**
2
29
  * Page versioning include list
3
30
  */
@@ -0,0 +1,7 @@
1
+ import { IConfigurationSchema } from "../../core";
2
+ export declare const PageEditorTypes: readonly ["hub:page:edit"];
3
+ export declare type PageEditorType = (typeof PageEditorTypes)[number];
4
+ /**
5
+ * defines the JSON schema for a Hub Site's editable fields
6
+ */
7
+ export declare const PageSchema: IConfigurationSchema;
@@ -0,0 +1,7 @@
1
+ import { IUiSchema } from "../../core";
2
+ /**
3
+ * complete edit uiSchema for Hub Projects - this defines
4
+ * how the schema properties should be rendered in the
5
+ * project editing experience
6
+ */
7
+ export declare const uiSchema: IUiSchema;
@@ -0,0 +1,12 @@
1
+ import { IRequestOptions } from "@esri/arcgis-rest-request";
2
+ import { IHubPage } from "../../core";
3
+ import { IModel } from "../../types";
4
+ /**
5
+ * Given a model and a page, set various computed properties that can't be directly mapped
6
+ * @private
7
+ * @param model
8
+ * @param page
9
+ * @param requestOptions
10
+ * @returns
11
+ */
12
+ export declare function computeProps(model: IModel, page: Partial<IHubPage>, requestOptions: IRequestOptions): IHubPage;
@@ -0,0 +1,8 @@
1
+ import { IPropertyMap } from "../../core/_internal/PropertyMapper";
2
+ /**
3
+ * Returns an Array of IPropertyMap objects
4
+ * that define the projection of properties from a IModel to an IHubPage
5
+ * @returns
6
+ * @private
7
+ */
8
+ export declare function getPropertyMap(): IPropertyMap[];
@@ -0,0 +1,13 @@
1
+ import { IHubPage } from "../core";
2
+ import { IModel } from "../types";
3
+ export declare const HUB_PAGE_ITEM_TYPE = "Hub Page";
4
+ export declare const ENTERPRISE_PAGE_ITEM_TYPE = "Site Page";
5
+ export declare const PAGE_TYPE_KEYWORD = "hubPage";
6
+ /**
7
+ * Default values of a IHubPage
8
+ */
9
+ export declare const DEFAULT_PAGE: Partial<IHubPage>;
10
+ /**
11
+ * Default values for a new HubPage Model
12
+ */
13
+ export declare const DEFAULT_PAGE_MODEL: IModel;