Socket
Socket
Sign inDemoInstall

@esri/hub-discussions

Package Overview
Dependencies
Maintainers
42
Versions
284
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@esri/hub-discussions - npm Package Compare versions

Comparing version 14.19.0 to 15.0.0

dist/esm/channels/channels.js

4

dist/esm/request.js

@@ -8,3 +8,3 @@ import { apiRequest, authenticateRequest } from "./utils/request";

* @param {string} url
* @param {IHubRequestOptions} options
* @param {IDiscussionsRequestOptions} options
* @return {*} {Promise<T>}

@@ -17,3 +17,3 @@ */

export function request(url, options) {
return authenticateRequest(options).then(token => {
return authenticateRequest(options).then((token) => {
return apiRequest(url, options, token);

@@ -20,0 +20,0 @@ });

@@ -92,12 +92,2 @@ /**

/**
* relations of channel entity
*
* @export
* @enum {string}
*/
export var ChannelRelation;
(function (ChannelRelation) {
ChannelRelation["SETTINGS"] = "settings";
})(ChannelRelation || (ChannelRelation = {}));
/**
* relations of reaction entity

@@ -135,36 +125,2 @@ *

/**
* Channel sorting fields
*
* @enum {string}
*/
export var ChannelSort;
(function (ChannelSort) {
ChannelSort["ACCESS"] = "access";
ChannelSort["CREATED_AT"] = "createdAt";
ChannelSort["CREATOR"] = "creator";
ChannelSort["EDITOR"] = "editor";
ChannelSort["ID"] = "id";
ChannelSort["LAST_ACTIVITY"] = "last_activity";
ChannelSort["UPDATED_AT"] = "updatedAt";
})(ChannelSort || (ChannelSort = {}));
/**
* Post sorting fields
*
* @enum {string}
*/
export var PostSort;
(function (PostSort) {
PostSort["BODY"] = "body";
PostSort["CHANNEL_ID"] = "channelId";
PostSort["CREATED_AT"] = "createdAt";
PostSort["CREATOR"] = "creator";
PostSort["DISCUSSION"] = "discussion";
PostSort["EDITOR"] = "editor";
PostSort["ID"] = "id";
PostSort["PARENT_ID"] = "parentId";
PostSort["STATUS"] = "status";
PostSort["TITLE"] = "title";
PostSort["UPDATED_AT"] = "updatedAt";
})(PostSort || (PostSort = {}));
/**
* Role types

@@ -171,0 +127,0 @@ *

@@ -1,2 +0,2 @@

import { Role, SharingAccess, } from "../../types";
import { Role, SharingAccess } from "../../types";
import { CANNOT_DISCUSS } from "../constants";

@@ -37,8 +37,6 @@ const ALLOWED_GROUP_ROLES = Object.freeze(["owner", "admin", "member"]);

function channelAllowsAnyUserToPost(channelAcl) {
return (channelAcl.anonymous &&
ALLOWED_ROLES_FOR_POSTING.includes(channelAcl.anonymous.role));
return isAuthorized(ALLOWED_ROLES_FOR_POSTING, channelAcl.anonymous);
}
function channelAllowsAnyAuthenticatedUserToPost(channelAcl) {
return (channelAcl.authenticated &&
ALLOWED_ROLES_FOR_POSTING.includes(channelAcl.authenticated.role));
return isAuthorized(ALLOWED_ROLES_FOR_POSTING, channelAcl.authenticated);
}

@@ -50,6 +48,3 @@ function channelAllowsThisUserToPost(user, acl) {

const userPermission = userLookup[username];
if (!userPermission) {
return false;
}
return ALLOWED_ROLES_FOR_POSTING.includes(userPermission.role);
return isAuthorized(ALLOWED_ROLES_FOR_POSTING, userPermission);
}

@@ -61,18 +56,35 @@ function channelAllowsPostsByThisUsersGroups(user, acl) {

return user.groups.some((userGroup) => {
const { id: userGroupId, userMembership: { memberType: userMemberType }, typeKeywords, } = userGroup;
const channelGroupPermission = acl.groups[userGroupId];
return (channelGroupPermission &&
ALLOWED_GROUP_ROLES.includes(userMemberType) &&
!typeKeywords.includes(CANNOT_DISCUSS));
const { id: userGroupId, userMembership: { memberType: groupMemberType }, typeKeywords, } = userGroup;
const aclGroup = acl.groups[userGroupId];
if (!aclGroup || typeKeywords.includes(CANNOT_DISCUSS)) {
return false;
}
if (canGroupMembersPost(aclGroup)) {
return true;
}
return ((groupMemberType === "admin" || groupMemberType === "owner") &&
canGroupAdminsPost(aclGroup));
});
}
function canGroupMembersPost(aclGroup) {
return isAuthorized(ALLOWED_ROLES_FOR_POSTING, aclGroup.member);
}
function canGroupAdminsPost(aclGroup) {
return isAuthorized(ALLOWED_ROLES_FOR_POSTING, aclGroup.admin);
}
function isAuthorized(allowedRoles, permission) {
return permission && allowedRoles.includes(permission.role);
}
function channelAllowsPostsByThisUsersOrg(user, acl) {
const { orgId, role: orgRole } = user;
if (!acl.orgs) {
return false;
}
const channelOrgPermission = acl.orgs[user.orgId];
const channelOrgPermission = acl.orgs[orgId];
if (!channelOrgPermission) {
return false;
}
return ALLOWED_ROLES_FOR_POSTING.includes(channelOrgPermission.role);
return ((orgRole === "org_admin" &&
isAuthorized(ALLOWED_ROLES_FOR_POSTING, channelOrgPermission.admin)) ||
isAuthorized(ALLOWED_ROLES_FOR_POSTING, channelOrgPermission.member));
}

@@ -79,0 +91,0 @@ function isAuthorizedToPostByLegacyPermissions(user, channelParams) {

@@ -12,3 +12,3 @@ import { RemoteServerError as _RemoteServerError, buildUrl, } from "@esri/hub-common";

* @export
* @param {IHubRequestOptions} options
* @param {IDiscussionsRequestOptions} options
* @return {*} {Promise<string>}

@@ -32,3 +32,3 @@ */

* @param {string} route
* @param {IHubRequestOptions} options
* @param {IDiscussionsRequestOptions} options
* @param {string} [token]

@@ -56,9 +56,9 @@ * @return {*} {Promise<T>}

});
if (options.params) {
if (options.data) {
if (options.httpMethod === "GET") {
const queryParams = new URLSearchParams(options.params).toString();
const queryParams = new URLSearchParams(options.data).toString();
route += `?${queryParams}`;
}
else {
opts.body = JSON.stringify(options.params);
opts.body = JSON.stringify(options.data);
}

@@ -65,0 +65,0 @@ }

@@ -11,3 +11,3 @@ "use strict";

* @param {string} url
* @param {IHubRequestOptions} options
* @param {IDiscussionsRequestOptions} options
* @return {*} {Promise<T>}

@@ -20,3 +20,3 @@ */

function request(url, options) {
return request_1.authenticateRequest(options).then(token => {
return request_1.authenticateRequest(options).then((token) => {
return request_1.apiRequest(url, options, token);

@@ -23,0 +23,0 @@ });

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Role = exports.PostSort = exports.ChannelSort = exports.CommonSort = exports.ChannelFilter = exports.ReactionRelation = exports.ChannelRelation = exports.PostRelation = exports.DiscussionSource = exports.DiscussionType = exports.PostStatus = exports.SharingAccess = exports.PostReaction = exports.SortOrder = void 0;
exports.Role = exports.CommonSort = exports.ChannelFilter = exports.ReactionRelation = exports.PostRelation = exports.DiscussionSource = exports.DiscussionType = exports.PostStatus = exports.SharingAccess = exports.PostReaction = exports.SortOrder = void 0;
/**

@@ -95,12 +95,2 @@ * sort orders

/**
* relations of channel entity
*
* @export
* @enum {string}
*/
var ChannelRelation;
(function (ChannelRelation) {
ChannelRelation["SETTINGS"] = "settings";
})(ChannelRelation = exports.ChannelRelation || (exports.ChannelRelation = {}));
/**
* relations of reaction entity

@@ -138,36 +128,2 @@ *

/**
* Channel sorting fields
*
* @enum {string}
*/
var ChannelSort;
(function (ChannelSort) {
ChannelSort["ACCESS"] = "access";
ChannelSort["CREATED_AT"] = "createdAt";
ChannelSort["CREATOR"] = "creator";
ChannelSort["EDITOR"] = "editor";
ChannelSort["ID"] = "id";
ChannelSort["LAST_ACTIVITY"] = "last_activity";
ChannelSort["UPDATED_AT"] = "updatedAt";
})(ChannelSort = exports.ChannelSort || (exports.ChannelSort = {}));
/**
* Post sorting fields
*
* @enum {string}
*/
var PostSort;
(function (PostSort) {
PostSort["BODY"] = "body";
PostSort["CHANNEL_ID"] = "channelId";
PostSort["CREATED_AT"] = "createdAt";
PostSort["CREATOR"] = "creator";
PostSort["DISCUSSION"] = "discussion";
PostSort["EDITOR"] = "editor";
PostSort["ID"] = "id";
PostSort["PARENT_ID"] = "parentId";
PostSort["STATUS"] = "status";
PostSort["TITLE"] = "title";
PostSort["UPDATED_AT"] = "updatedAt";
})(PostSort = exports.PostSort || (exports.PostSort = {}));
/**
* Role types

@@ -174,0 +130,0 @@ *

@@ -41,8 +41,6 @@ "use strict";

function channelAllowsAnyUserToPost(channelAcl) {
return (channelAcl.anonymous &&
ALLOWED_ROLES_FOR_POSTING.includes(channelAcl.anonymous.role));
return isAuthorized(ALLOWED_ROLES_FOR_POSTING, channelAcl.anonymous);
}
function channelAllowsAnyAuthenticatedUserToPost(channelAcl) {
return (channelAcl.authenticated &&
ALLOWED_ROLES_FOR_POSTING.includes(channelAcl.authenticated.role));
return isAuthorized(ALLOWED_ROLES_FOR_POSTING, channelAcl.authenticated);
}

@@ -54,6 +52,3 @@ function channelAllowsThisUserToPost(user, acl) {

const userPermission = userLookup[username];
if (!userPermission) {
return false;
}
return ALLOWED_ROLES_FOR_POSTING.includes(userPermission.role);
return isAuthorized(ALLOWED_ROLES_FOR_POSTING, userPermission);
}

@@ -65,18 +60,35 @@ function channelAllowsPostsByThisUsersGroups(user, acl) {

return user.groups.some((userGroup) => {
const { id: userGroupId, userMembership: { memberType: userMemberType }, typeKeywords, } = userGroup;
const channelGroupPermission = acl.groups[userGroupId];
return (channelGroupPermission &&
ALLOWED_GROUP_ROLES.includes(userMemberType) &&
!typeKeywords.includes(constants_1.CANNOT_DISCUSS));
const { id: userGroupId, userMembership: { memberType: groupMemberType }, typeKeywords, } = userGroup;
const aclGroup = acl.groups[userGroupId];
if (!aclGroup || typeKeywords.includes(constants_1.CANNOT_DISCUSS)) {
return false;
}
if (canGroupMembersPost(aclGroup)) {
return true;
}
return ((groupMemberType === "admin" || groupMemberType === "owner") &&
canGroupAdminsPost(aclGroup));
});
}
function canGroupMembersPost(aclGroup) {
return isAuthorized(ALLOWED_ROLES_FOR_POSTING, aclGroup.member);
}
function canGroupAdminsPost(aclGroup) {
return isAuthorized(ALLOWED_ROLES_FOR_POSTING, aclGroup.admin);
}
function isAuthorized(allowedRoles, permission) {
return permission && allowedRoles.includes(permission.role);
}
function channelAllowsPostsByThisUsersOrg(user, acl) {
const { orgId, role: orgRole } = user;
if (!acl.orgs) {
return false;
}
const channelOrgPermission = acl.orgs[user.orgId];
const channelOrgPermission = acl.orgs[orgId];
if (!channelOrgPermission) {
return false;
}
return ALLOWED_ROLES_FOR_POSTING.includes(channelOrgPermission.role);
return ((orgRole === "org_admin" &&
isAuthorized(ALLOWED_ROLES_FOR_POSTING, channelOrgPermission.admin)) ||
isAuthorized(ALLOWED_ROLES_FOR_POSTING, channelOrgPermission.member));
}

@@ -83,0 +95,0 @@ function isAuthorizedToPostByLegacyPermissions(user, channelParams) {

@@ -16,3 +16,3 @@ "use strict";

* @export
* @param {IHubRequestOptions} options
* @param {IDiscussionsRequestOptions} options
* @return {*} {Promise<string>}

@@ -37,3 +37,3 @@ */

* @param {string} route
* @param {IHubRequestOptions} options
* @param {IDiscussionsRequestOptions} options
* @param {string} [token]

@@ -61,9 +61,9 @@ * @return {*} {Promise<T>}

});
if (options.params) {
if (options.data) {
if (options.httpMethod === "GET") {
const queryParams = new URLSearchParams(options.params).toString();
const queryParams = new URLSearchParams(options.data).toString();
route += `?${queryParams}`;
}
else {
opts.body = JSON.stringify(options.params);
opts.body = JSON.stringify(options.data);
}

@@ -70,0 +70,0 @@ }

@@ -1,2 +0,2 @@

import { IHubRequestOptions } from "./types";
import { IDiscussionsRequestOptions } from "./types";
/**

@@ -8,5 +8,5 @@ * method that authenticates and makes requests to Discussions API

* @param {string} url
* @param {IHubRequestOptions} options
* @param {IDiscussionsRequestOptions} options
* @return {*} {Promise<T>}
*/
export declare function request<T>(url: string, options: IHubRequestOptions): Promise<T>;
export declare function request<T>(url: string, options: IDiscussionsRequestOptions): Promise<T>;

@@ -1,4 +0,3 @@

import { IHubRequestOptions as _IHubRequestOptions } from "@esri/hub-common";
import { IPagedResponse as IRestPagedResponse, IPagingParams, IUser } from "@esri/arcgis-rest-types";
import { Geometry } from "geojson";
import { IHubRequestOptions } from "@esri/hub-common";
import { IPagedResponse as IRestPagedResponse, IUser } from "@esri/arcgis-rest-types";
/**

@@ -120,11 +119,2 @@ * sort orders

/**
* relations of channel entity
*
* @export
* @enum {string}
*/
export declare enum ChannelRelation {
SETTINGS = "settings"
}
/**
* relations of reaction entity

@@ -158,34 +148,2 @@ *

/**
* Channel sorting fields
*
* @enum {string}
*/
export declare enum ChannelSort {
ACCESS = "access",
CREATED_AT = "createdAt",
CREATOR = "creator",
EDITOR = "editor",
ID = "id",
LAST_ACTIVITY = "last_activity",
UPDATED_AT = "updatedAt"
}
/**
* Post sorting fields
*
* @enum {string}
*/
export declare enum PostSort {
BODY = "body",
CHANNEL_ID = "channelId",
CREATED_AT = "createdAt",
CREATOR = "creator",
DISCUSSION = "discussion",
EDITOR = "editor",
ID = "id",
PARENT_ID = "parentId",
STATUS = "status",
TITLE = "title",
UPDATED_AT = "updatedAt"
}
/**
* creator property

@@ -209,42 +167,2 @@ *

/**
* channel settings properties
*
* @export
* @interface IWithSettings
*/
export interface IWithSettings {
allowReply: boolean;
allowAnonymous: boolean;
softDelete: boolean;
defaultPostStatus: PostStatus;
allowReaction: boolean;
allowedReactions?: PostReaction[];
blockwords?: string[];
}
export interface IChannelACL {
anonymous?: IPermission;
authenticated?: IPermission;
groups?: {
[key: string]: IPermission;
};
orgs?: {
[key: string]: IPermission;
};
users: {
[key: string]: IPermission;
};
}
/**
* channel definition properties, mirroring AGOL sharing ACL & IPlatformSharing
*
* @export
* @interface IWithSharing
*/
export interface IWithSharing {
access: SharingAccess;
groups?: string[];
orgs?: string[];
acl?: IChannelACL;
}
/**
* sorting properties

@@ -302,22 +220,2 @@ *

/**
* delete post response properties
*
* @export
* @interface IRemovePostResponse
*/
export interface IRemovePostResponse {
success: boolean;
postId: string;
}
/**
* delete channel response properties
*
* @export
* @interface IRemoveChannelResponse
*/
export interface IRemoveChannelResponse {
success: boolean;
channelId: string;
}
/**
* delete notifications opt out response properties

@@ -355,207 +253,2 @@ *

/**
* delete reaction response properties
*
* @export
* @interface IRemoveReactionResponse
*/
export interface IRemoveReactionResponse {
success: boolean;
reactionId: string;
}
/**
* representation of post entity
*
* @export
* @interface IPost
* @extends {IWithAuthor}
* @extends {IWithEditor}
* @extends {IWithTimestamps}
*/
export interface IPost extends IWithAuthor, IWithEditor, IWithTimestamps {
id: string;
title?: string;
body: string;
discussion?: string;
status: PostStatus;
geometry?: Geometry;
featureGeometry?: Geometry;
appInfo?: string;
channelId?: string;
channel?: IChannel;
parentId?: string;
parent?: IPost;
replies?: IPost[] | IPagedResponse<IPost>;
replyCount?: number;
reactions?: IReaction[];
userReactions?: IReaction[];
}
/**
* dto for creating a post in a known channel
*
* @export
* @interface ICreateChannelPost
*/
export interface ICreateChannelPost {
title?: string;
body: string;
channelId: string;
discussion?: string;
geometry?: Geometry;
featureGeometry?: Geometry;
appInfo?: string;
}
/**
* paramaters for creating a post in an unknown channel
*
* @export
* @interface ICreatePost
* @extends {Omit<ICreateChannelPost, 'channelId'>}
* @extends {IWithSharing}
*/
export interface ICreatePost extends Omit<ICreateChannelPost, "channelId">, IWithSharing {
}
/**
* dto for decorating found post with relations
*
* @export
* @interface IFetchPost
*/
export interface IFetchPost {
relations?: PostRelation[];
}
/**
* dto for querying posts in a single channel
*
* @export
* @interface ISearchChannelPosts
* @extends {Partial<IWithAuthor>}
* @extends {Partial<IWithEditor>}
* @extends {Partial<IPagingParams>}
* @extends {Partial<IWithSorting<PostSort>>}
* @extends {Partial<IWithTimeQueries>}
*/
export interface ISearchPosts extends Partial<IWithAuthor>, Partial<IWithEditor>, Partial<IPagingParams>, Partial<IWithSorting<PostSort>>, Partial<IWithTimeQueries> {
title?: string;
body?: string;
discussion?: string;
geometry?: Geometry;
featureGeometry?: Geometry;
parents?: Array<string | null>;
status?: PostStatus[];
relations?: PostRelation[];
groups?: string[];
access?: SharingAccess[];
channels?: string[];
}
/**
* dto for updating a post's channel
*
* @export
* @interface IUpdatePostSharing
* @extends {Partial<IWithSharing>}
*/
export interface IUpdatePostSharing extends Partial<IWithSharing> {
channelId?: string;
}
/**
* dto for updating a post's status
*
* @export
* @interface IUpdatePostStatus
*/
export interface IUpdatePostStatus {
status: PostStatus;
}
/**
* dto for updating a post's content
*
* @export
* @interface IUpdatePost
* @extends {Partial<Omit<ICreateChannelPost, 'channelId'>>}
*/
export interface IUpdatePost extends Partial<Omit<ICreateChannelPost, "channelId">> {
}
/**
* representation of channel entity
*
* @export
* @interface IChannel
* @extends {IWithSettings}
* @extends {IWithSharing}
* @extends {IWithAuthor}
* @extends {IWithEditor}
* @extends {IWithTimestamps}
*/
export interface IChannel extends IWithSettings, IWithSharing, IWithAuthor, IWithEditor, IWithTimestamps {
id: string;
}
/**
* dto for creating a channel
*
* @export
* @interface ICreateChannel
* @extends {IWithSettings}
* @extends {IWithSharing}
*/
export interface ICreateChannel extends Partial<IWithSettings>, IWithSharing {
}
/**
* dto for decorating found channel with relations
*
* @export
* @interface IFetchChannel
*/
export interface IFetchChannel {
relations?: ChannelRelation[];
}
/**
* dto for querying channels
*
* @export
* @interface ISearchChannels
* @extends {Partial<IPagingParams>}
* @extends {Partial<IWithSorting<ChannelSort>>}
* @extends {Partial<IWithTimeQueries>}
*/
export interface ISearchChannels extends Partial<IPagingParams>, Partial<IWithSorting<ChannelSort>>, Partial<IWithTimeQueries>, Partial<IWithFiltering<ChannelFilter>> {
groups?: string[];
access?: SharingAccess[];
relations?: ChannelRelation[];
}
/**
* dto for updating channel settings
*
* @export
* @interface IUpdateChannel
* @extends {Partial<IWithSettings>}
* @extends {Partial<IWithAuthor>}
*/
export interface IUpdateChannel extends Partial<IWithSettings>, Partial<IWithAuthor> {
}
/**
* representation of reaction entity
*
* @export
* @interface IReaction
* @extends {IWithAuthor}
* @extends {IWithEditor}
* @extends {IWithTimestamps}
*/
export interface IReaction extends IWithAuthor, IWithEditor, IWithTimestamps {
id: string;
value: PostReaction;
postId?: string;
post?: IPost;
}
/**
* dto for creating a reaction
*
* @export
* @interface ICreateReaction
*/
export interface ICreateReaction {
postId: string;
value: PostReaction;
}
/**
* options for making requests against Discussion API

@@ -567,104 +260,11 @@ *

*/
export interface IHubRequestOptions extends Omit<_IHubRequestOptions, "httpMethod" | "isPortal">, Pick<RequestInit, "mode" | "cache" | "credentials"> {
export interface IDiscussionsRequestOptions extends Omit<IHubRequestOptions, "httpMethod" | "isPortal">, Pick<RequestInit, "mode" | "cache" | "credentials"> {
httpMethod?: "GET" | "POST" | "PATCH" | "DELETE";
isPortal?: boolean;
token?: string;
data?: {
[key: string]: any;
};
}
/**
* request options for querying posts
*
* @export
* @interface ISearchPostsOptions
* @extends {IHubRequestOptions}
*/
export interface ISearchPostsOptions extends IHubRequestOptions {
params?: ISearchPosts;
}
/**
* request options for creating post
*
* @export
* @interface ICreatePostOptions
* @extends {IHubRequestOptions}
*/
export interface ICreatePostOptions extends IHubRequestOptions {
params: ICreatePost | ICreateChannelPost;
mentionUrl?: string;
}
/**
* request options for creating reply to post
*
* @export
* @interface ICreateReplyOptions
* @extends {ICreatePostOptions}
*/
export interface ICreateReplyOptions extends ICreatePostOptions {
postId: string;
}
/**
* request options for getting post
*
* @export
* @interface IFetchPostOptions
* @extends {IHubRequestOptions}
*/
export interface IFetchPostOptions extends IHubRequestOptions {
postId: string;
params?: IFetchPost;
}
/**
* request options for updating post
*
* @export
* @interface IUpdatePostOptions
* @extends {IHubRequestOptions}
*/
export interface IUpdatePostOptions extends IHubRequestOptions {
postId: string;
params: IUpdatePost;
mentionUrl?: string;
}
/**
* request options for updating a post's channel
*
* @export
* @interface IUpdatePostSharingOptions
* @extends {IHubRequestOptions}
*/
export interface IUpdatePostSharingOptions extends IHubRequestOptions {
postId: string;
params: IUpdatePostSharing;
}
/**
* request options for updating a post's status
*
* @export
* @interface IUpdatePostStatusOptions
* @extends {IHubRequestOptions}
*/
export interface IUpdatePostStatusOptions extends IHubRequestOptions {
postId: string;
params: IUpdatePostStatus;
}
/**
* request options for deleting a post
*
* @export
* @interface IRemovePostOptions
* @extends {IHubRequestOptions}
*/
export interface IRemovePostOptions extends IHubRequestOptions {
postId: string;
}
/**
* request options for searching channels
*
* @export
* @interface ISearchChannelsOptions
* @extends {IHubRequestOptions}
*/
export interface ISearchChannelsOptions extends IHubRequestOptions {
params?: ISearchChannels;
}
/**
* Role types

@@ -684,136 +284,2 @@ *

/**
* permission object that will populate ACL interface
*
* @export
* @interface IPermission
*/
export interface IPermission {
role: Role;
createdAt: string;
updatedAt: string;
accessibleAfter: string;
}
/**
* request options for creating channel with ACL
*
* @export
* @interface IWithACL
* @extends {ICreateChannelWithACL}
*/
export interface ICreateChannelWithACL extends IWithSettings {
anonymous?: IPermission;
authenticated?: IPermission;
groups?: {
[key: string]: IPermission;
};
orgs?: {
[key: string]: IPermission;
};
users: {
[key: string]: IPermission;
};
}
/**
* request options for creating a channel
*
* @export
* @interface ICreateChannelOptions
* @extends {IHubRequestOptions}
*/
export interface ICreateChannelOptions extends IHubRequestOptions {
params: ICreateChannel | ICreateChannelWithACL;
}
/**
* request options for getting a channel
*
* @export
* @interface IFetchChannelOptions
* @extends {IHubRequestOptions}
*/
export interface IFetchChannelOptions extends IHubRequestOptions {
channelId: string;
params?: IFetchChannel;
}
/**
* request options for updating a channel's settings
*
* @export
* @interface IUpdateChannelOptions
* @extends {IHubRequestOptions}
*/
export interface IUpdateChannelOptions extends IHubRequestOptions {
channelId: string;
params: IUpdateChannel;
}
/**
* request options for deleting a channel
*
* @export
* @interface IRemoveChannelOptions
* @extends {IHubRequestOptions}
*/
export interface IRemoveChannelOptions extends IHubRequestOptions {
channelId: string;
}
/**
* request options for fetching opt out status
*
* @export
* @interface IFetchChannelNotificationOptOutOptions
* @extends {IHubRequestOptions}
*/
export interface IFetchChannelNotificationOptOutOptions extends IHubRequestOptions {
channelId: string;
}
/**
* request options for opting out
*
* @export
* @interface ICreateChannelNotificationOptOutOptions
* @extends {IHubRequestOptions}
*/
export interface ICreateChannelNotificationOptOutOptions extends IHubRequestOptions {
channelId: string;
}
/**
* request options for opting back in
*
* @export
* @interface IRemoveChannelNotificationOptOutOptions
* @extends {IHubRequestOptions}
*/
export interface IRemoveChannelNotificationOptOutOptions extends IHubRequestOptions {
channelId: string;
}
/**
* request options for deleting channel activity
*
* @export
* @interface IRemoveChannelActivityOptions
* @extends {IHubRequestOptions}
*/
export interface IRemoveChannelActivityOptions extends IHubRequestOptions {
channelId: string;
}
/**
* request options for creating a reaction to a post
*
* @export
* @interface ICreateReactionOptions
* @extends {IHubRequestOptions}
*/
export interface ICreateReactionOptions extends IHubRequestOptions {
params: ICreateReaction;
}
/**
* request options for deleting a reaction
*
* @export
* @interface IRemoveReactionOptions
* @extends {IHubRequestOptions}
*/
export interface IRemoveReactionOptions extends IHubRequestOptions {
reactionId: string;
}
/**
* Interface representing the meta data associated with a discussions

@@ -820,0 +286,0 @@ * mention email

@@ -1,2 +0,3 @@

import { IChannel, IDiscussionsUser } from "../../types";
import { IChannel } from "../../channels";
import { IDiscussionsUser } from "../../types";
export declare function canPostToChannel(channel: IChannel, user: IDiscussionsUser): boolean;
import { IUser } from "@esri/arcgis-rest-auth";
import { IChannel, IPlatformSharing } from "../../types";
import { IChannel } from "../../channels";
import { IPlatformSharing } from "../../types";
/**

@@ -4,0 +5,0 @@ * Utility to determine whether User can view posts belonging to Channel

import { IGroup, IItem } from "@esri/arcgis-rest-portal";
import { IDiscussionParams, IPost, IChannel } from "../types";
import { IDiscussionParams } from "../types";
import { IHubContent } from "@esri/hub-common";
import { IUser } from "@esri/arcgis-rest-auth";
import { IPost } from "../posts";
import { IChannel } from "../channels";
/**

@@ -6,0 +8,0 @@ * Utility that parses a discussion URI string into its component parts

@@ -1,2 +0,3 @@

import { IChannel, PostReaction } from "../types";
import { IChannel } from "../channels";
import { PostReaction } from "../types";
/**

@@ -3,0 +4,0 @@ * Utility that determines whether a Channel allows a given PostReaction

@@ -1,2 +0,2 @@

import { IHubRequestOptions } from "../types";
import { IDiscussionsRequestOptions } from "../types";
import { RemoteServerError as _RemoteServerError } from "@esri/hub-common";

@@ -11,6 +11,6 @@ export declare class RemoteServerError extends _RemoteServerError {

* @export
* @param {IHubRequestOptions} options
* @param {IDiscussionsRequestOptions} options
* @return {*} {Promise<string>}
*/
export declare function authenticateRequest(options: IHubRequestOptions): Promise<string>;
export declare function authenticateRequest(options: IDiscussionsRequestOptions): Promise<string>;
/**

@@ -22,6 +22,6 @@ * parses IHubRequestOptions and makes request against Discussions API

* @param {string} route
* @param {IHubRequestOptions} options
* @param {IDiscussionsRequestOptions} options
* @param {string} [token]
* @return {*} {Promise<T>}
*/
export declare function apiRequest<T>(route: string, options: IHubRequestOptions, token?: string): Promise<T>;
export declare function apiRequest<T>(route: string, options: IDiscussionsRequestOptions, token?: string): Promise<T>;
{
"name": "@esri/hub-discussions",
"version": "14.19.0",
"version": "15.0.0",
"description": "Module to interact with ArcGIS Hub Discussions API in Node.js and modern browsers.",

@@ -5,0 +5,0 @@ "main": "dist/node/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc