@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.
- package/dist/esm/channels/HubChannel.js +173 -0
- package/dist/esm/channels/HubChannel.js.map +1 -0
- package/dist/esm/channels/_internal/ChannelBusinessRules.js +39 -0
- package/dist/esm/channels/_internal/ChannelBusinessRules.js.map +1 -0
- package/dist/esm/channels/_internal/ChannelSchema.js +198 -0
- package/dist/esm/channels/_internal/ChannelSchema.js.map +1 -0
- package/dist/esm/channels/_internal/ChannelUiSchemaCreate.js +288 -0
- package/dist/esm/channels/_internal/ChannelUiSchemaCreate.js.map +1 -0
- package/dist/esm/channels/_internal/ChannelUiSchemaEdit.js +20 -0
- package/dist/esm/channels/_internal/ChannelUiSchemaEdit.js.map +1 -0
- package/dist/esm/channels/_internal/buildDefaultChannel.js +26 -0
- package/dist/esm/channels/_internal/buildDefaultChannel.js.map +1 -0
- package/dist/esm/channels/_internal/transformAclPermissionToEntityPermissionPolicy.js +49 -0
- package/dist/esm/channels/_internal/transformAclPermissionToEntityPermissionPolicy.js.map +1 -0
- package/dist/esm/channels/_internal/transformChannelToEntity.js +61 -0
- package/dist/esm/channels/_internal/transformChannelToEntity.js.map +1 -0
- package/dist/esm/channels/_internal/transformEditorToEntity.js +22 -0
- package/dist/esm/channels/_internal/transformEditorToEntity.js.map +1 -0
- package/dist/esm/channels/_internal/transformEntityPermissionPoliciesToFormValues.js +164 -0
- package/dist/esm/channels/_internal/transformEntityPermissionPoliciesToFormValues.js.map +1 -0
- package/dist/esm/channels/_internal/transformEntityToChannelData.js +69 -0
- package/dist/esm/channels/_internal/transformEntityToChannelData.js.map +1 -0
- package/dist/esm/channels/_internal/transformEntityToEditor.js +20 -0
- package/dist/esm/channels/_internal/transformEntityToEditor.js.map +1 -0
- package/dist/esm/channels/_internal/transformFormValuesToEntityPermissionPolicies.js +68 -0
- package/dist/esm/channels/_internal/transformFormValuesToEntityPermissionPolicies.js.map +1 -0
- package/dist/esm/channels/edit.js +35 -0
- package/dist/esm/channels/edit.js.map +1 -0
- package/dist/esm/channels/fetch.js +14 -0
- package/dist/esm/channels/fetch.js.map +1 -0
- package/dist/esm/channels/index.js +4 -0
- package/dist/esm/channels/index.js.map +1 -0
- package/dist/esm/core/EntityEditor.js +4 -0
- package/dist/esm/core/EntityEditor.js.map +1 -1
- package/dist/esm/core/fetchHubEntity.js +4 -0
- package/dist/esm/core/fetchHubEntity.js.map +1 -1
- package/dist/esm/core/getTypeFromEntity.js +3 -0
- package/dist/esm/core/getTypeFromEntity.js.map +1 -1
- package/dist/esm/core/schemas/internal/getEditorSchemas.js +16 -0
- package/dist/esm/core/schemas/internal/getEditorSchemas.js.map +1 -1
- package/dist/esm/core/schemas/shared/CatalogSchema.js +2 -0
- package/dist/esm/core/schemas/shared/CatalogSchema.js.map +1 -1
- package/dist/esm/core/schemas/types.js +2 -0
- package/dist/esm/core/schemas/types.js.map +1 -1
- package/dist/esm/core/types/HubEntityType.js +1 -0
- package/dist/esm/core/types/HubEntityType.js.map +1 -1
- package/dist/esm/core/types/IHubChannel.js +1 -0
- package/dist/esm/core/types/IHubChannel.js.map +1 -0
- package/dist/esm/core/types/index.js +1 -0
- package/dist/esm/core/types/index.js.map +1 -1
- package/dist/esm/discussions/api/settings/getDefaultEntitySettings.js +1 -0
- package/dist/esm/discussions/api/settings/getDefaultEntitySettings.js.map +1 -1
- package/dist/esm/discussions/utils.js +3 -3
- package/dist/esm/discussions/utils.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/permissions/types/IEntityPermissionPolicy.js +13 -0
- package/dist/esm/permissions/types/IEntityPermissionPolicy.js.map +1 -1
- package/dist/esm/permissions/types/Permission.js +2 -0
- package/dist/esm/permissions/types/Permission.js.map +1 -1
- package/dist/esm/search/_internal/getEntityTypeFromType.js +1 -1
- package/dist/esm/search/_internal/getEntityTypeFromType.js.map +1 -1
- package/dist/esm/search/_internal/hubSearchChannels.js +5 -3
- package/dist/esm/search/_internal/hubSearchChannels.js.map +1 -1
- package/dist/node/channels/HubChannel.js +177 -0
- package/dist/node/channels/HubChannel.js.map +1 -0
- package/dist/node/channels/_internal/ChannelBusinessRules.js +42 -0
- package/dist/node/channels/_internal/ChannelBusinessRules.js.map +1 -0
- package/dist/node/channels/_internal/ChannelSchema.js +201 -0
- package/dist/node/channels/_internal/ChannelSchema.js.map +1 -0
- package/dist/node/channels/_internal/ChannelUiSchemaCreate.js +291 -0
- package/dist/node/channels/_internal/ChannelUiSchemaCreate.js.map +1 -0
- package/dist/node/channels/_internal/ChannelUiSchemaEdit.js +23 -0
- package/dist/node/channels/_internal/ChannelUiSchemaEdit.js.map +1 -0
- package/dist/node/channels/_internal/buildDefaultChannel.js +30 -0
- package/dist/node/channels/_internal/buildDefaultChannel.js.map +1 -0
- package/dist/node/channels/_internal/transformAclPermissionToEntityPermissionPolicy.js +52 -0
- package/dist/node/channels/_internal/transformAclPermissionToEntityPermissionPolicy.js.map +1 -0
- package/dist/node/channels/_internal/transformChannelToEntity.js +65 -0
- package/dist/node/channels/_internal/transformChannelToEntity.js.map +1 -0
- package/dist/node/channels/_internal/transformEditorToEntity.js +26 -0
- package/dist/node/channels/_internal/transformEditorToEntity.js.map +1 -0
- package/dist/node/channels/_internal/transformEntityPermissionPoliciesToFormValues.js +167 -0
- package/dist/node/channels/_internal/transformEntityPermissionPoliciesToFormValues.js.map +1 -0
- package/dist/node/channels/_internal/transformEntityToChannelData.js +73 -0
- package/dist/node/channels/_internal/transformEntityToChannelData.js.map +1 -0
- package/dist/node/channels/_internal/transformEntityToEditor.js +24 -0
- package/dist/node/channels/_internal/transformEntityToEditor.js.map +1 -0
- package/dist/node/channels/_internal/transformFormValuesToEntityPermissionPolicies.js +72 -0
- package/dist/node/channels/_internal/transformFormValuesToEntityPermissionPolicies.js.map +1 -0
- package/dist/node/channels/edit.js +41 -0
- package/dist/node/channels/edit.js.map +1 -0
- package/dist/node/channels/fetch.js +18 -0
- package/dist/node/channels/fetch.js.map +1 -0
- package/dist/node/channels/index.js +7 -0
- package/dist/node/channels/index.js.map +1 -0
- package/dist/node/core/EntityEditor.js +4 -0
- package/dist/node/core/EntityEditor.js.map +1 -1
- package/dist/node/core/fetchHubEntity.js +4 -0
- package/dist/node/core/fetchHubEntity.js.map +1 -1
- package/dist/node/core/getTypeFromEntity.js +3 -0
- package/dist/node/core/getTypeFromEntity.js.map +1 -1
- package/dist/node/core/schemas/internal/getEditorSchemas.js +16 -0
- package/dist/node/core/schemas/internal/getEditorSchemas.js.map +1 -1
- package/dist/node/core/schemas/shared/CatalogSchema.js +2 -0
- package/dist/node/core/schemas/shared/CatalogSchema.js.map +1 -1
- package/dist/node/core/schemas/types.js +2 -0
- package/dist/node/core/schemas/types.js.map +1 -1
- package/dist/node/core/types/HubEntityType.js +1 -0
- package/dist/node/core/types/HubEntityType.js.map +1 -1
- package/dist/node/core/types/IHubChannel.js +3 -0
- package/dist/node/core/types/IHubChannel.js.map +1 -0
- package/dist/node/core/types/index.js +1 -0
- package/dist/node/core/types/index.js.map +1 -1
- package/dist/node/discussions/api/settings/getDefaultEntitySettings.js +1 -0
- package/dist/node/discussions/api/settings/getDefaultEntitySettings.js.map +1 -1
- package/dist/node/discussions/utils.js +3 -3
- package/dist/node/discussions/utils.js.map +1 -1
- package/dist/node/index.js +1 -0
- package/dist/node/index.js.map +1 -1
- package/dist/node/permissions/types/IEntityPermissionPolicy.js +14 -0
- package/dist/node/permissions/types/IEntityPermissionPolicy.js.map +1 -1
- package/dist/node/permissions/types/Permission.js +2 -0
- package/dist/node/permissions/types/Permission.js.map +1 -1
- package/dist/node/search/_internal/getEntityTypeFromType.js +1 -1
- package/dist/node/search/_internal/getEntityTypeFromType.js.map +1 -1
- package/dist/node/search/_internal/hubSearchChannels.js +4 -2
- package/dist/node/search/_internal/hubSearchChannels.js.map +1 -1
- package/dist/types/channels/HubChannel.d.ts +105 -0
- package/dist/types/channels/_internal/ChannelBusinessRules.d.ts +19 -0
- package/dist/types/channels/_internal/ChannelSchema.d.ts +16 -0
- package/dist/types/channels/_internal/ChannelUiSchemaCreate.d.ts +10 -0
- package/dist/types/channels/_internal/ChannelUiSchemaEdit.d.ts +10 -0
- package/dist/types/channels/_internal/buildDefaultChannel.d.ts +8 -0
- package/dist/types/channels/_internal/transformAclPermissionToEntityPermissionPolicy.d.ts +11 -0
- package/dist/types/channels/_internal/transformChannelToEntity.d.ts +11 -0
- package/dist/types/channels/_internal/transformEditorToEntity.d.ts +8 -0
- package/dist/types/channels/_internal/transformEntityPermissionPoliciesToFormValues.d.ts +44 -0
- package/dist/types/channels/_internal/transformEntityToChannelData.d.ts +9 -0
- package/dist/types/channels/_internal/transformEntityToEditor.d.ts +9 -0
- package/dist/types/channels/_internal/transformFormValuesToEntityPermissionPolicies.d.ts +9 -0
- package/dist/types/channels/edit.d.ts +23 -0
- package/dist/types/channels/fetch.d.ts +9 -0
- package/dist/types/channels/index.d.ts +3 -0
- package/dist/types/content/_internal/internalContentUtils.d.ts +1 -1
- package/dist/types/content/get-family.d.ts +1 -1
- package/dist/types/core/EntityEditor.d.ts +1 -1
- package/dist/types/core/schemas/types.d.ts +2 -2
- package/dist/types/core/types/HubEntity.d.ts +3 -2
- package/dist/types/core/types/HubEntityType.d.ts +1 -1
- package/dist/types/core/types/IHubChannel.d.ts +91 -0
- package/dist/types/core/types/index.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/permissions/types/IEntityPermissionPolicy.d.ts +10 -2
- package/dist/types/permissions/types/Permission.d.ts +2 -1
- 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>;
|
|
@@ -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" | "
|
|
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" | "
|
|
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
|
-
|
|
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";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -14,9 +14,17 @@ export interface IEntityPermissionPolicy {
|
|
|
14
14
|
/**
|
|
15
15
|
* Id of the collaboration set
|
|
16
16
|
*/
|
|
17
|
-
collaborationId
|
|
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
|