@esri/hub-common 15.41.3 → 15.42.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 (156) hide show
  1. package/dist/esm/channels/HubChannel.js +173 -0
  2. package/dist/esm/channels/HubChannel.js.map +1 -0
  3. package/dist/esm/channels/_internal/ChannelBusinessRules.js +39 -0
  4. package/dist/esm/channels/_internal/ChannelBusinessRules.js.map +1 -0
  5. package/dist/esm/channels/_internal/ChannelSchema.js +198 -0
  6. package/dist/esm/channels/_internal/ChannelSchema.js.map +1 -0
  7. package/dist/esm/channels/_internal/ChannelUiSchemaCreate.js +288 -0
  8. package/dist/esm/channels/_internal/ChannelUiSchemaCreate.js.map +1 -0
  9. package/dist/esm/channels/_internal/ChannelUiSchemaEdit.js +20 -0
  10. package/dist/esm/channels/_internal/ChannelUiSchemaEdit.js.map +1 -0
  11. package/dist/esm/channels/_internal/buildDefaultChannel.js +26 -0
  12. package/dist/esm/channels/_internal/buildDefaultChannel.js.map +1 -0
  13. package/dist/esm/channels/_internal/transformAclPermissionToEntityPermissionPolicy.js +49 -0
  14. package/dist/esm/channels/_internal/transformAclPermissionToEntityPermissionPolicy.js.map +1 -0
  15. package/dist/esm/channels/_internal/transformChannelToEntity.js +61 -0
  16. package/dist/esm/channels/_internal/transformChannelToEntity.js.map +1 -0
  17. package/dist/esm/channels/_internal/transformEditorToEntity.js +22 -0
  18. package/dist/esm/channels/_internal/transformEditorToEntity.js.map +1 -0
  19. package/dist/esm/channels/_internal/transformEntityPermissionPoliciesToFormValues.js +164 -0
  20. package/dist/esm/channels/_internal/transformEntityPermissionPoliciesToFormValues.js.map +1 -0
  21. package/dist/esm/channels/_internal/transformEntityToChannelData.js +69 -0
  22. package/dist/esm/channels/_internal/transformEntityToChannelData.js.map +1 -0
  23. package/dist/esm/channels/_internal/transformEntityToEditor.js +20 -0
  24. package/dist/esm/channels/_internal/transformEntityToEditor.js.map +1 -0
  25. package/dist/esm/channels/_internal/transformFormValuesToEntityPermissionPolicies.js +68 -0
  26. package/dist/esm/channels/_internal/transformFormValuesToEntityPermissionPolicies.js.map +1 -0
  27. package/dist/esm/channels/edit.js +35 -0
  28. package/dist/esm/channels/edit.js.map +1 -0
  29. package/dist/esm/channels/fetch.js +14 -0
  30. package/dist/esm/channels/fetch.js.map +1 -0
  31. package/dist/esm/channels/index.js +4 -0
  32. package/dist/esm/channels/index.js.map +1 -0
  33. package/dist/esm/core/EntityEditor.js +4 -0
  34. package/dist/esm/core/EntityEditor.js.map +1 -1
  35. package/dist/esm/core/fetchHubEntity.js +4 -0
  36. package/dist/esm/core/fetchHubEntity.js.map +1 -1
  37. package/dist/esm/core/getTypeFromEntity.js +3 -0
  38. package/dist/esm/core/getTypeFromEntity.js.map +1 -1
  39. package/dist/esm/core/schemas/internal/getEditorSchemas.js +16 -0
  40. package/dist/esm/core/schemas/internal/getEditorSchemas.js.map +1 -1
  41. package/dist/esm/core/schemas/shared/CatalogSchema.js +2 -0
  42. package/dist/esm/core/schemas/shared/CatalogSchema.js.map +1 -1
  43. package/dist/esm/core/schemas/types.js +2 -0
  44. package/dist/esm/core/schemas/types.js.map +1 -1
  45. package/dist/esm/core/types/HubEntityType.js +1 -0
  46. package/dist/esm/core/types/HubEntityType.js.map +1 -1
  47. package/dist/esm/core/types/IHubChannel.js +1 -0
  48. package/dist/esm/core/types/IHubChannel.js.map +1 -0
  49. package/dist/esm/core/types/index.js +1 -0
  50. package/dist/esm/core/types/index.js.map +1 -1
  51. package/dist/esm/discussions/api/settings/getDefaultEntitySettings.js +1 -0
  52. package/dist/esm/discussions/api/settings/getDefaultEntitySettings.js.map +1 -1
  53. package/dist/esm/discussions/utils.js +3 -3
  54. package/dist/esm/discussions/utils.js.map +1 -1
  55. package/dist/esm/index.js +1 -0
  56. package/dist/esm/index.js.map +1 -1
  57. package/dist/esm/permissions/types/IEntityPermissionPolicy.js +13 -0
  58. package/dist/esm/permissions/types/IEntityPermissionPolicy.js.map +1 -1
  59. package/dist/esm/permissions/types/Permission.js +2 -0
  60. package/dist/esm/permissions/types/Permission.js.map +1 -1
  61. package/dist/esm/search/_internal/getEntityTypeFromType.js +1 -1
  62. package/dist/esm/search/_internal/getEntityTypeFromType.js.map +1 -1
  63. package/dist/esm/search/_internal/hubSearchChannels.js +5 -3
  64. package/dist/esm/search/_internal/hubSearchChannels.js.map +1 -1
  65. package/dist/node/channels/HubChannel.js +177 -0
  66. package/dist/node/channels/HubChannel.js.map +1 -0
  67. package/dist/node/channels/_internal/ChannelBusinessRules.js +42 -0
  68. package/dist/node/channels/_internal/ChannelBusinessRules.js.map +1 -0
  69. package/dist/node/channels/_internal/ChannelSchema.js +201 -0
  70. package/dist/node/channels/_internal/ChannelSchema.js.map +1 -0
  71. package/dist/node/channels/_internal/ChannelUiSchemaCreate.js +291 -0
  72. package/dist/node/channels/_internal/ChannelUiSchemaCreate.js.map +1 -0
  73. package/dist/node/channels/_internal/ChannelUiSchemaEdit.js +23 -0
  74. package/dist/node/channels/_internal/ChannelUiSchemaEdit.js.map +1 -0
  75. package/dist/node/channels/_internal/buildDefaultChannel.js +30 -0
  76. package/dist/node/channels/_internal/buildDefaultChannel.js.map +1 -0
  77. package/dist/node/channels/_internal/transformAclPermissionToEntityPermissionPolicy.js +52 -0
  78. package/dist/node/channels/_internal/transformAclPermissionToEntityPermissionPolicy.js.map +1 -0
  79. package/dist/node/channels/_internal/transformChannelToEntity.js +65 -0
  80. package/dist/node/channels/_internal/transformChannelToEntity.js.map +1 -0
  81. package/dist/node/channels/_internal/transformEditorToEntity.js +26 -0
  82. package/dist/node/channels/_internal/transformEditorToEntity.js.map +1 -0
  83. package/dist/node/channels/_internal/transformEntityPermissionPoliciesToFormValues.js +167 -0
  84. package/dist/node/channels/_internal/transformEntityPermissionPoliciesToFormValues.js.map +1 -0
  85. package/dist/node/channels/_internal/transformEntityToChannelData.js +73 -0
  86. package/dist/node/channels/_internal/transformEntityToChannelData.js.map +1 -0
  87. package/dist/node/channels/_internal/transformEntityToEditor.js +24 -0
  88. package/dist/node/channels/_internal/transformEntityToEditor.js.map +1 -0
  89. package/dist/node/channels/_internal/transformFormValuesToEntityPermissionPolicies.js +72 -0
  90. package/dist/node/channels/_internal/transformFormValuesToEntityPermissionPolicies.js.map +1 -0
  91. package/dist/node/channels/edit.js +41 -0
  92. package/dist/node/channels/edit.js.map +1 -0
  93. package/dist/node/channels/fetch.js +18 -0
  94. package/dist/node/channels/fetch.js.map +1 -0
  95. package/dist/node/channels/index.js +7 -0
  96. package/dist/node/channels/index.js.map +1 -0
  97. package/dist/node/core/EntityEditor.js +4 -0
  98. package/dist/node/core/EntityEditor.js.map +1 -1
  99. package/dist/node/core/fetchHubEntity.js +4 -0
  100. package/dist/node/core/fetchHubEntity.js.map +1 -1
  101. package/dist/node/core/getTypeFromEntity.js +3 -0
  102. package/dist/node/core/getTypeFromEntity.js.map +1 -1
  103. package/dist/node/core/schemas/internal/getEditorSchemas.js +16 -0
  104. package/dist/node/core/schemas/internal/getEditorSchemas.js.map +1 -1
  105. package/dist/node/core/schemas/shared/CatalogSchema.js +2 -0
  106. package/dist/node/core/schemas/shared/CatalogSchema.js.map +1 -1
  107. package/dist/node/core/schemas/types.js +2 -0
  108. package/dist/node/core/schemas/types.js.map +1 -1
  109. package/dist/node/core/types/HubEntityType.js +1 -0
  110. package/dist/node/core/types/HubEntityType.js.map +1 -1
  111. package/dist/node/core/types/IHubChannel.js +3 -0
  112. package/dist/node/core/types/IHubChannel.js.map +1 -0
  113. package/dist/node/core/types/index.js +1 -0
  114. package/dist/node/core/types/index.js.map +1 -1
  115. package/dist/node/discussions/api/settings/getDefaultEntitySettings.js +1 -0
  116. package/dist/node/discussions/api/settings/getDefaultEntitySettings.js.map +1 -1
  117. package/dist/node/discussions/utils.js +3 -3
  118. package/dist/node/discussions/utils.js.map +1 -1
  119. package/dist/node/index.js +1 -0
  120. package/dist/node/index.js.map +1 -1
  121. package/dist/node/permissions/types/IEntityPermissionPolicy.js +14 -0
  122. package/dist/node/permissions/types/IEntityPermissionPolicy.js.map +1 -1
  123. package/dist/node/permissions/types/Permission.js +2 -0
  124. package/dist/node/permissions/types/Permission.js.map +1 -1
  125. package/dist/node/search/_internal/getEntityTypeFromType.js +1 -1
  126. package/dist/node/search/_internal/getEntityTypeFromType.js.map +1 -1
  127. package/dist/node/search/_internal/hubSearchChannels.js +4 -2
  128. package/dist/node/search/_internal/hubSearchChannels.js.map +1 -1
  129. package/dist/types/channels/HubChannel.d.ts +105 -0
  130. package/dist/types/channels/_internal/ChannelBusinessRules.d.ts +19 -0
  131. package/dist/types/channels/_internal/ChannelSchema.d.ts +16 -0
  132. package/dist/types/channels/_internal/ChannelUiSchemaCreate.d.ts +10 -0
  133. package/dist/types/channels/_internal/ChannelUiSchemaEdit.d.ts +10 -0
  134. package/dist/types/channels/_internal/buildDefaultChannel.d.ts +8 -0
  135. package/dist/types/channels/_internal/transformAclPermissionToEntityPermissionPolicy.d.ts +11 -0
  136. package/dist/types/channels/_internal/transformChannelToEntity.d.ts +11 -0
  137. package/dist/types/channels/_internal/transformEditorToEntity.d.ts +8 -0
  138. package/dist/types/channels/_internal/transformEntityPermissionPoliciesToFormValues.d.ts +44 -0
  139. package/dist/types/channels/_internal/transformEntityToChannelData.d.ts +9 -0
  140. package/dist/types/channels/_internal/transformEntityToEditor.d.ts +9 -0
  141. package/dist/types/channels/_internal/transformFormValuesToEntityPermissionPolicies.d.ts +9 -0
  142. package/dist/types/channels/edit.d.ts +23 -0
  143. package/dist/types/channels/fetch.d.ts +9 -0
  144. package/dist/types/channels/index.d.ts +3 -0
  145. package/dist/types/content/_internal/internalContentUtils.d.ts +1 -1
  146. package/dist/types/content/get-family.d.ts +1 -1
  147. package/dist/types/core/EntityEditor.d.ts +1 -1
  148. package/dist/types/core/schemas/types.d.ts +2 -2
  149. package/dist/types/core/types/HubEntity.d.ts +3 -2
  150. package/dist/types/core/types/HubEntityType.d.ts +1 -1
  151. package/dist/types/core/types/IHubChannel.d.ts +91 -0
  152. package/dist/types/core/types/index.d.ts +1 -0
  153. package/dist/types/index.d.ts +1 -0
  154. package/dist/types/permissions/types/IEntityPermissionPolicy.d.ts +10 -2
  155. package/dist/types/permissions/types/Permission.d.ts +2 -1
  156. package/package.json +1 -1
@@ -0,0 +1,44 @@
1
+ import { HubEntityType } from "../../core/types";
2
+ import { IEntityPermissionPolicy } from "../../permissions/types/IEntityPermissionPolicy";
3
+ export interface IHubRoleConfigValue {
4
+ key: string;
5
+ entityId?: string;
6
+ entityType?: HubEntityType;
7
+ roles: Record<string, {
8
+ value: string;
9
+ id?: string;
10
+ }>;
11
+ }
12
+ /**
13
+ * @private
14
+ * Transforms an array of IEntityPermissionPolicy (Hub entity) objects to an array of IHubRoleConfigValue (entity editor) objects
15
+ * representing the channel's public (anonymous & authenticated) permissions
16
+ * @param permissionPolicies An array of IEntityPermissionPolicy objects
17
+ * @returns an array of IHubRoleConfigValue objects
18
+ */
19
+ export declare const transformEntityPermissionPoliciesToPublicFormValues: (permissionPolicies: IEntityPermissionPolicy[]) => IHubRoleConfigValue[];
20
+ /**
21
+ * @private
22
+ * Transforms an array of IEntityPermissionPolicy (Hub entity) objects to an array of IHubRoleConfigValue (entity editor) objects
23
+ * representing the channel's group (member & admin) permissions
24
+ * @param permissionPolicies An array of IEntityPermissionPolicy objects
25
+ * @returns an array of IHubRoleConfigValue objects
26
+ */
27
+ export declare const transformEntityPermissionPoliciesToGroupFormValues: (permissionPolicies: IEntityPermissionPolicy[]) => IHubRoleConfigValue[];
28
+ /**
29
+ * @private
30
+ * Transforms an array of IEntityPermissionPolicy (Hub entity) objects to an array of IHubRoleConfigValue (entity editor) objects
31
+ * representing the channel's org (member & admin) permissions
32
+ * @param permissionPolicies An array of IEntityPermissionPolicy objects
33
+ * @param defaultOrgId The current user's orgId
34
+ * @returns an array of IHubRoleConfigValue objects
35
+ */
36
+ export declare const transformEntityPermissionPoliciesToOrgFormValues: (permissionPolicies: IEntityPermissionPolicy[], defaultOrgId?: string) => IHubRoleConfigValue[];
37
+ /**
38
+ * @private
39
+ * Transforms an array of IEntityPermissionPolicy (Hub entity) objects to an array of IHubRoleConfigValue (entity editor) objects
40
+ * representing the channel's individual user permissions
41
+ * @param permissionPolicies An array of IEntityPermissionPolicy objects
42
+ * @returns an array of IHubRoleConfigValue objects
43
+ */
44
+ export declare const transformEntityPermissionPoliciesToUserFormValues: (permissionPolicies: IEntityPermissionPolicy[]) => IHubRoleConfigValue[];
@@ -0,0 +1,9 @@
1
+ import { IHubChannel } from "../../core/types/IHubChannel";
2
+ import { IUpdateChannelV2, ICreateChannelV2 } from "../../discussions/api/types";
3
+ /**
4
+ * @private
5
+ * Transforms an IHubChannel entity pojo object to an object that can be passed V2 channel create and update methods
6
+ * @param entity an IHubChannel object
7
+ * @returns an object that can be passed to V2 channel create and update methods
8
+ */
9
+ export declare function transformEntityToChannelData<T extends ICreateChannelV2 | IUpdateChannelV2>(entity: IHubChannel): T;
@@ -0,0 +1,9 @@
1
+ import { IHubChannel, IHubChannelEditor } from "../../core/types/IHubChannel";
2
+ import { IArcGISContext } from "../../types/IArcGISContext";
3
+ /**
4
+ * @private
5
+ * Transforms an IHubChannel entity pojo to an IHubChannelEditor object
6
+ * @param entity an IHubChannel object
7
+ * @returns an IHubChannelEditor object
8
+ */
9
+ export declare function transformEntityToEditor(entity: IHubChannel, context: IArcGISContext): IHubChannelEditor;
@@ -0,0 +1,9 @@
1
+ import { IEntityPermissionPolicy } from "../../permissions/types";
2
+ import { IHubRoleConfigValue } from "./transformEntityPermissionPoliciesToFormValues";
3
+ /**
4
+ * @private
5
+ * Transforms an array of IHubRoleConfigValue objects into an array of IEntityPermissionPolicy objects
6
+ * @param roleConfigs an array of IHubRoleConfigValue objects
7
+ * @returns an array of IEntityPermissionPolicy objects
8
+ */
9
+ export declare function transformFormValuesToEntityPermissionPolicies(roleConfigs: IHubRoleConfigValue[]): IEntityPermissionPolicy[];
@@ -0,0 +1,23 @@
1
+ import { IHubChannel } from "../core";
2
+ import { IArcGISContext } from "../types";
3
+ /**
4
+ * Creates a new Channel from the given IHubChannel object
5
+ * @param entity An IHubChannel object
6
+ * @param context ArcGIS context
7
+ * @returns a promise that resolves an IHubChannel representing the newly created channel
8
+ */
9
+ export declare function createHubChannel(entity: IHubChannel, context: IArcGISContext): Promise<IHubChannel>;
10
+ /**
11
+ * Updates an existing Channel from the given IHubChannel object
12
+ * @param entity An IHubChannel object
13
+ * @param context ArcGIS context
14
+ * @returns a promise that resolves an IHubChannel representing the updated channel
15
+ */
16
+ export declare function updateHubChannel(entity: IHubChannel, context: IArcGISContext): Promise<IHubChannel>;
17
+ /**
18
+ * Updates an existing Channel from the given IHubChannel object
19
+ * @param channelId The ID of the channel to delete
20
+ * @param context ArcGIS context
21
+ * @returns a promise
22
+ */
23
+ export declare function deleteHubChannel(channelId: string, context: IArcGISContext): Promise<void>;
@@ -0,0 +1,9 @@
1
+ import { IHubChannel } from "../core/types/IHubChannel";
2
+ import { IArcGISContext } from "../types";
3
+ /**
4
+ * Fetches a Channel for the given channelId
5
+ * @param channelId The ID of the channel to fetch
6
+ * @param context ArcGIS context
7
+ * @returns a promise that resolves an IHubChannel for the given channelId
8
+ */
9
+ export declare function fetchHubChannel(channelId: string, context: IArcGISContext): Promise<IHubChannel>;
@@ -0,0 +1,3 @@
1
+ export * from "./HubChannel";
2
+ export * from "./edit";
3
+ export * from "./fetch";
@@ -44,7 +44,7 @@ export declare const setContentBoundary: (content: IHubContent, boundary: Geogra
44
44
  control?: import("../../hub-types").AccessControl;
45
45
  groups?: import("@esri/arcgis-rest-portal").IGroup[];
46
46
  };
47
- family?: "map" | "template" | "document" | "content" | "discussion" | "event" | "initiative" | "organization" | "project" | "site" | "app" | "dataset" | "feedback" | "people" | "team" | "channel" | "eventAttendee";
47
+ family?: "map" | "template" | "document" | "content" | "discussion" | "event" | "initiative" | "organization" | "project" | "site" | "channel" | "app" | "dataset" | "feedback" | "people" | "team" | "eventAttendee";
48
48
  categories?: string[];
49
49
  isDownloadable: boolean;
50
50
  structuredLicense?: import("../..").IStructuredLicense;
@@ -4,7 +4,7 @@ import { HubFamily } from "../hub-types";
4
4
  * @param type item type
5
5
  * @returns Hub family
6
6
  */
7
- export declare function getFamily(type: string): "map" | "template" | "document" | "content" | "discussion" | "event" | "initiative" | "organization" | "project" | "site" | "app" | "dataset" | "feedback" | "people" | "team" | "channel" | "eventAttendee";
7
+ export declare function getFamily(type: string): "map" | "template" | "document" | "content" | "discussion" | "event" | "initiative" | "organization" | "project" | "site" | "channel" | "app" | "dataset" | "feedback" | "people" | "team" | "eventAttendee";
8
8
  /**
9
9
  * return the types associated with a provided Hub Family
10
10
  * Overrides are provided to match getFamily implementation
@@ -8,6 +8,6 @@ export declare class EntityEditor {
8
8
  private constructor();
9
9
  static fromEntity(entity: HubEntity, context: IArcGISContext): EntityEditor;
10
10
  getConfig(i18nScope: string, type: EntityEditorType): Promise<IEditorConfig>;
11
- toEditor(editorContext?: IEntityEditorContext, include?: string[]): HubEntityEditor;
11
+ toEditor(editorContext?: IEntityEditorContext, include?: string[]): Promise<HubEntityEditor>;
12
12
  save(editor: HubEntityEditor, editorContext?: IEntityEditorContext): Promise<HubEntity>;
13
13
  }
@@ -12,7 +12,7 @@ export interface IEditorConfig {
12
12
  * to the supported/defined uiSchema configurations
13
13
  */
14
14
  export declare type EntityEditorType = (typeof validEntityEditorTypes)[number];
15
- export declare const validEntityEditorTypes: readonly ["hub:project:create", "hub:project:create2", "hub:project:edit", "hub:project:metrics", "hub:project:settings", "hub:content:edit", "hub:content:settings", "hub:content:discussions", "hub:initiative:edit", "hub:initiative:create", "hub:initiative:create2", "hub:initiative:metrics", "hub:initiative:associations", "hub:initiative:settings", "hub:site:edit", "hub:site:create", "hub:site:followers", "hub:site:discussions", "hub:site:settings", "hub:discussion:edit", "hub:discussion:create", "hub:discussion:settings", "hub:page:edit", "hub:page:create", "hub:template:edit", "hub:group:edit", "hub:group:settings", "hub:group:discussions", "hub:group:create:followers", "hub:group:create:association", "hub:group:create:view", "hub:group:create:edit", "hub:group:create", "hub:initiativeTemplate:edit", "hub:survey:edit", "hub:survey:settings", "hub:event:create", "hub:event:edit", "hub:event:registrants", "hub:user:settings"];
15
+ export declare const validEntityEditorTypes: readonly ["hub:project:create", "hub:project:create2", "hub:project:edit", "hub:project:metrics", "hub:project:settings", "hub:content:edit", "hub:content:settings", "hub:content:discussions", "hub:initiative:edit", "hub:initiative:create", "hub:initiative:create2", "hub:initiative:metrics", "hub:initiative:associations", "hub:initiative:settings", "hub:site:edit", "hub:site:create", "hub:site:followers", "hub:site:discussions", "hub:site:settings", "hub:discussion:edit", "hub:discussion:create", "hub:discussion:settings", "hub:page:edit", "hub:page:create", "hub:template:edit", "hub:group:edit", "hub:group:settings", "hub:group:discussions", "hub:group:create:followers", "hub:group:create:association", "hub:group:create:view", "hub:group:create:edit", "hub:group:create", "hub:initiativeTemplate:edit", "hub:survey:edit", "hub:survey:settings", "hub:event:create", "hub:event:edit", "hub:event:registrants", "hub:user:settings", "hub:channel:create", "hub:channel:edit"];
16
16
  /** Defines the possible editor type values for a stat card. These
17
17
  * correspond to the supported/defined uiSchema configurations. This should
18
18
  * have its own signature in the getEditorConfig function.
@@ -42,7 +42,7 @@ export declare const validCardEditorTypes: readonly ["hub:card:stat", "hub:card:
42
42
  * to defined schema/uiSchema configurations
43
43
  */
44
44
  export declare type EditorType = (typeof validEditorTypes)[number];
45
- export declare const validEditorTypes: readonly ["hub:project:create", "hub:project:create2", "hub:project:edit", "hub:project:metrics", "hub:project:settings", "hub:content:edit", "hub:content:settings", "hub:content:discussions", "hub:initiative:edit", "hub:initiative:create", "hub:initiative:create2", "hub:initiative:metrics", "hub:initiative:associations", "hub:initiative:settings", "hub:site:edit", "hub:site:create", "hub:site:followers", "hub:site:discussions", "hub:site:settings", "hub:discussion:edit", "hub:discussion:create", "hub:discussion:settings", "hub:page:edit", "hub:page:create", "hub:template:edit", "hub:group:edit", "hub:group:settings", "hub:group:discussions", "hub:group:create:followers", "hub:group:create:association", "hub:group:create:view", "hub:group:create:edit", "hub:group:create", "hub:initiativeTemplate:edit", "hub:survey:edit", "hub:survey:settings", "hub:event:create", "hub:event:edit", "hub:event:registrants", "hub:user:settings", "hub:card:stat", "hub:card:follow", "hub:card:eventGallery"];
45
+ export declare const validEditorTypes: readonly ["hub:project:create", "hub:project:create2", "hub:project:edit", "hub:project:metrics", "hub:project:settings", "hub:content:edit", "hub:content:settings", "hub:content:discussions", "hub:initiative:edit", "hub:initiative:create", "hub:initiative:create2", "hub:initiative:metrics", "hub:initiative:associations", "hub:initiative:settings", "hub:site:edit", "hub:site:create", "hub:site:followers", "hub:site:discussions", "hub:site:settings", "hub:discussion:edit", "hub:discussion:create", "hub:discussion:settings", "hub:page:edit", "hub:page:create", "hub:template:edit", "hub:group:edit", "hub:group:settings", "hub:group:discussions", "hub:group:create:followers", "hub:group:create:association", "hub:group:create:view", "hub:group:create:edit", "hub:group:create", "hub:initiativeTemplate:edit", "hub:survey:edit", "hub:survey:settings", "hub:event:create", "hub:event:edit", "hub:event:registrants", "hub:user:settings", "hub:channel:create", "hub:channel:edit", "hub:card:stat", "hub:card:follow", "hub:card:eventGallery"];
46
46
  /**
47
47
  * An editor's module when dynamically imported depending on the EditorType. This
48
48
  * will always have a buildUiSchema function, and sometimes it will have a
@@ -8,5 +8,6 @@ import { IHubTemplate } from "./IHubTemplate";
8
8
  import { IHubSurvey } from "./IHubSurvey";
9
9
  import { IHubEvent } from "./IHubEvent";
10
10
  import { IHubUser } from "./IHubUser";
11
- import { IHubOrganization } from "../..";
12
- export declare type HubEntity = IHubDiscussion | IHubEvent | IHubGroup | IHubInitiative | IHubOrganization | IHubPage | IHubProject | IHubSite | IHubSurvey | IHubTemplate | IHubUser;
11
+ import { IHubOrganization } from "./IHubOrganization";
12
+ import { IHubChannel } from "./IHubChannel";
13
+ export declare type HubEntity = IHubDiscussion | IHubEvent | IHubGroup | IHubInitiative | IHubOrganization | IHubPage | IHubProject | IHubSite | IHubSurvey | IHubTemplate | IHubUser | IHubChannel;
@@ -1,2 +1,2 @@
1
- export declare const HUB_ENTITY_TYPES: readonly ["content", "discussion", "event", "group", "initiative", "initiativeTemplate", "org", "organization", "page", "project", "site", "survey", "template", "user"];
1
+ export declare const HUB_ENTITY_TYPES: readonly ["content", "discussion", "event", "group", "initiative", "initiativeTemplate", "org", "organization", "page", "project", "site", "survey", "template", "user", "channel"];
2
2
  export declare type HubEntityType = (typeof HUB_ENTITY_TYPES)[number];
@@ -0,0 +1,91 @@
1
+ import { IChannel } from "../../discussions/api/types";
2
+ import { IEntityPermissionPolicy } from "../../permissions/types/IEntityPermissionPolicy";
3
+ import { IWithViewSettings } from "../traits/IWithViewSettings";
4
+ import { HubEntityType } from "./HubEntityType";
5
+ import { IHubEntityBase } from "./IHubEntityBase";
6
+ import { IHubLocation } from "./IHubLocation";
7
+ import { AccessLevel } from "./types";
8
+ /**
9
+ * Defines the properties of a Hub Channel object
10
+ */
11
+ export interface IHubChannel extends IHubEntityBase {
12
+ /**
13
+ * An array of blocked words. Posts & replies created/edited containing these words will result in the post status being automatically set to blocked
14
+ */
15
+ blockWords: string[];
16
+ /**
17
+ * An array of IEntityPermissionPolicy representing the configured permissions for the channel
18
+ */
19
+ permissions: IEntityPermissionPolicy[];
20
+ /**
21
+ * True when authenticated users can post pseudo-anonymously, masking their identity
22
+ */
23
+ allowAsAnonymous: boolean;
24
+ /**
25
+ * True when the currently authenticated user can edit the channel
26
+ */
27
+ canEdit: boolean;
28
+ /**
29
+ * True when the currently authenticated user can delete the channel
30
+ */
31
+ canDelete: boolean;
32
+ /**
33
+ * The ID of the organization the channel was created within
34
+ */
35
+ orgId: string;
36
+ /**
37
+ * The owner of the channel
38
+ */
39
+ owner: string;
40
+ /**
41
+ * A reference to the underlying IChannel object
42
+ */
43
+ channel: IChannel;
44
+ /**
45
+ * The access level of the channel
46
+ */
47
+ access: AccessLevel;
48
+ /**
49
+ * Typekeywords applied to the channel
50
+ */
51
+ typeKeywords: string[];
52
+ /**
53
+ * Thumbnail of the channel
54
+ */
55
+ thumbnail?: string;
56
+ /**
57
+ * View settings of the channel
58
+ */
59
+ view?: IWithViewSettings;
60
+ /**
61
+ * Description of the channel
62
+ */
63
+ description?: string;
64
+ /**
65
+ * Tags applied to the channel
66
+ */
67
+ tags: string[];
68
+ /**
69
+ * The location of the channel
70
+ */
71
+ location?: IHubLocation;
72
+ }
73
+ export interface IHubRoleConfigValue {
74
+ key: string;
75
+ entityId?: string;
76
+ entityType?: HubEntityType;
77
+ roles: Record<string, {
78
+ value: string;
79
+ id?: string;
80
+ }>;
81
+ }
82
+ export interface IHubChannelEditor {
83
+ id: string;
84
+ name: string;
85
+ blockWords: string;
86
+ publicConfigs: IHubRoleConfigValue[];
87
+ orgConfigs: IHubRoleConfigValue[];
88
+ groupConfigs: IHubRoleConfigValue[];
89
+ userConfigs: IHubRoleConfigValue[];
90
+ allowAsAnonymous: boolean;
91
+ }
@@ -10,6 +10,7 @@ export * from "./IHubDiscussion";
10
10
  export * from "./IHubEditableContent";
11
11
  export * from "./IHubEntityBase";
12
12
  export * from "./IHubEvent";
13
+ export * from "./IHubChannel";
13
14
  export * from "./IHubSurvey";
14
15
  export * from "./IHubGroup";
15
16
  export * from "./IHubImage";
@@ -14,6 +14,7 @@ export * from "./i18n";
14
14
  export * from "./initiatives";
15
15
  export * from "./initiative-templates";
16
16
  export * from "./discussions";
17
+ export * from "./channels";
17
18
  export * from "./surveys";
18
19
  export * from "./events";
19
20
  export * from "./items";
@@ -14,9 +14,17 @@ export interface IEntityPermissionPolicy {
14
14
  /**
15
15
  * Id of the collaboration set
16
16
  */
17
- collaborationId: string;
17
+ collaborationId?: string | null;
18
+ /**
19
+ * Id of the permission record
20
+ */
21
+ id?: string | null;
18
22
  }
19
23
  /**
20
24
  * Type of collaboration set. Used when associating a permission with a set of collaborators
21
25
  */
22
- export declare type CollaborationType = "user" | "group" | "group-admin" | "org" | "authenticated" | "anonymous";
26
+ export declare type CollaborationType = "user" | "group" | "group-admin" | "org" | "org-admin" | "authenticated" | "anonymous" | "owner";
27
+ /**
28
+ * A map of supported collaboration set types
29
+ */
30
+ export declare const COLLABORATION_TYPES: Record<"user" | "group" | "groupAdmin" | "org" | "orgAdmin" | "authenticated" | "anonymous" | "owner", CollaborationType>;
@@ -2,6 +2,7 @@ import { ProjectPermissions } from "../../projects/_internal/ProjectBusinessRule
2
2
  import { SitePermissions } from "../../sites/_internal/SiteBusinessRules";
3
3
  import { InitiativePermissions } from "../../initiatives/_internal/InitiativeBusinessRules";
4
4
  import { DiscussionPermissions } from "../../discussions/_internal/DiscussionBusinessRules";
5
+ import { ChannelPermissions } from "../../channels/_internal/ChannelBusinessRules";
5
6
  import { ContentPermissions } from "../../content/_internal/ContentBusinessRules";
6
7
  import { GroupPermissions } from "../../groups/_internal/GroupBusinessRules";
7
8
  import { PagePermissions } from "../../pages/_internal/PageBusinessRules";
@@ -20,7 +21,7 @@ declare const SystemPermissions: string[];
20
21
  /**
21
22
  * Defines the possible values for Permissions
22
23
  */
23
- export declare type Permission = (typeof SitePermissions)[number] | (typeof ProjectPermissions)[number] | (typeof InitiativePermissions)[number] | (typeof ContentPermissions)[number] | (typeof GroupPermissions)[number] | (typeof PagePermissions)[number] | (typeof PlatformPermissions)[number] | (typeof DiscussionPermissions)[number] | (typeof InitiativeTemplatePermissions)[number] | (typeof TemplatePermissions)[number] | (typeof SystemPermissions)[number] | (typeof SurveyPermissions)[number] | (typeof EventPermissions)[number] | (typeof UserPermissions)[number];
24
+ export declare type Permission = (typeof SitePermissions)[number] | (typeof ProjectPermissions)[number] | (typeof InitiativePermissions)[number] | (typeof ContentPermissions)[number] | (typeof GroupPermissions)[number] | (typeof PagePermissions)[number] | (typeof PlatformPermissions)[number] | (typeof DiscussionPermissions)[number] | (typeof InitiativeTemplatePermissions)[number] | (typeof TemplatePermissions)[number] | (typeof SystemPermissions)[number] | (typeof SurveyPermissions)[number] | (typeof EventPermissions)[number] | (typeof UserPermissions)[number] | (typeof ChannelPermissions)[number];
24
25
  /**
25
26
  * Validate a Permission
26
27
  * @param permission
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/hub-common",
3
- "version": "15.41.3",
3
+ "version": "15.42.0",
4
4
  "description": "Common TypeScript types and utility functions for @esri/hub.js.",
5
5
  "main": "dist/node/index.js",
6
6
  "module": "dist/esm/index.js",