@esri/hub-discussions
Advanced tools
Comparing version 24.4.0 to 25.0.0
@@ -82,15 +82,2 @@ import { __rest } from "tslib"; | ||
/** | ||
* update post channel | ||
* NOTE: this method will change the channel a post belongs to | ||
* | ||
* @export | ||
* @param {IUpdatePostSharingParams} options | ||
* @return {*} {Promise<IPost>} | ||
*/ | ||
export function updatePostSharing(options) { | ||
const url = `/posts/${options.postId}/sharing`; | ||
options.httpMethod = "PATCH"; | ||
return request(url, options); | ||
} | ||
/** | ||
* update post status | ||
@@ -97,0 +84,0 @@ * NOTE: this method will only update a post's status |
@@ -63,44 +63,2 @@ import { isOrgAdmin, reduceByGroupMembership } from "../platform"; | ||
} | ||
/** | ||
* Utility to determine whether a Channel definition (inner) is encapsulated by another Channel's definition (outer) | ||
* | ||
* @export | ||
* @param {IChannel} outer -- access and groups that should contain inner access and groups | ||
* @param {(IChannel | IPlatformSharing)} inner -- access and groups that should be contained by outer access and groups | ||
* @return {*} {boolean} | ||
*/ | ||
export function isChannelInclusive(outer, inner) { | ||
let valid; | ||
let err; | ||
if (outer.access === "private" && outer.groups.length === 1) { | ||
valid = inner.access === "private" && inner.groups[0] === outer.groups[0]; | ||
if (!valid) { | ||
err = "replies to private post must be shared to same team"; | ||
} | ||
} | ||
else if (outer.access === "private") { | ||
valid = | ||
inner.access === "private" && | ||
inner.groups.every((group) => outer.groups.indexOf(group) > -1); | ||
if (!valid) { | ||
err = "replies to shared post must be shared to subset of same teams"; | ||
} | ||
} | ||
else if (outer.access === "org" && inner.access === "org") { | ||
valid = inner.orgs.every((org) => outer.orgs.indexOf(org) > -1); | ||
if (!valid) { | ||
err = "replies to org post must be shared to subset of same orgs"; | ||
} | ||
} | ||
else if (outer.access === "org") { | ||
valid = inner.access !== "public"; | ||
if (!valid) { | ||
err = "replies to org post cannot be shared to public"; | ||
} | ||
} | ||
if (err) { | ||
throw new Error(err); | ||
} | ||
return valid; | ||
} | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.updatePostStatus = exports.updatePostSharing = exports.updatePost = exports.removePost = exports.fetchPost = exports.createReply = exports.createPost = exports.searchPosts = void 0; | ||
exports.updatePostStatus = exports.updatePost = exports.removePost = exports.fetchPost = exports.createReply = exports.createPost = exports.searchPosts = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -91,16 +91,2 @@ /* tslint:disable unified-signatures */ | ||
/** | ||
* update post channel | ||
* NOTE: this method will change the channel a post belongs to | ||
* | ||
* @export | ||
* @param {IUpdatePostSharingParams} options | ||
* @return {*} {Promise<IPost>} | ||
*/ | ||
function updatePostSharing(options) { | ||
const url = `/posts/${options.postId}/sharing`; | ||
options.httpMethod = "PATCH"; | ||
return request_1.request(url, options); | ||
} | ||
exports.updatePostSharing = updatePostSharing; | ||
/** | ||
* update post status | ||
@@ -107,0 +93,0 @@ * NOTE: this method will only update a post's status |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isChannelInclusive = exports.canModifyChannel = exports.canReadFromChannel = void 0; | ||
exports.canModifyChannel = exports.canReadFromChannel = void 0; | ||
const platform_1 = require("../platform"); | ||
@@ -70,45 +70,2 @@ var can_post_to_channel_1 = require("./can-post-to-channel"); | ||
exports.canModifyChannel = canModifyChannel; | ||
/** | ||
* Utility to determine whether a Channel definition (inner) is encapsulated by another Channel's definition (outer) | ||
* | ||
* @export | ||
* @param {IChannel} outer -- access and groups that should contain inner access and groups | ||
* @param {(IChannel | IPlatformSharing)} inner -- access and groups that should be contained by outer access and groups | ||
* @return {*} {boolean} | ||
*/ | ||
function isChannelInclusive(outer, inner) { | ||
let valid; | ||
let err; | ||
if (outer.access === "private" && outer.groups.length === 1) { | ||
valid = inner.access === "private" && inner.groups[0] === outer.groups[0]; | ||
if (!valid) { | ||
err = "replies to private post must be shared to same team"; | ||
} | ||
} | ||
else if (outer.access === "private") { | ||
valid = | ||
inner.access === "private" && | ||
inner.groups.every((group) => outer.groups.indexOf(group) > -1); | ||
if (!valid) { | ||
err = "replies to shared post must be shared to subset of same teams"; | ||
} | ||
} | ||
else if (outer.access === "org" && inner.access === "org") { | ||
valid = inner.orgs.every((org) => outer.orgs.indexOf(org) > -1); | ||
if (!valid) { | ||
err = "replies to org post must be shared to subset of same orgs"; | ||
} | ||
} | ||
else if (outer.access === "org") { | ||
valid = inner.access !== "public"; | ||
if (!valid) { | ||
err = "replies to org post cannot be shared to public"; | ||
} | ||
} | ||
if (err) { | ||
throw new Error(err); | ||
} | ||
return valid; | ||
} | ||
exports.isChannelInclusive = isChannelInclusive; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import { ICreatePostParams, ICreateReplyParams, IPost, ISearchPostsParams, IFetchPostParams, IRemovePostParams, IRemovePostResponse, IUpdatePostSharingParams, IUpdatePostParams, IUpdatePostStatusParams, IPagedResponse } from "../types"; | ||
import { ICreatePostParams, ICreateReplyParams, IPost, ISearchPostsParams, IFetchPostParams, IRemovePostParams, IRemovePostResponse, IUpdatePostParams, IUpdatePostStatusParams, IPagedResponse } from "../types"; | ||
/** | ||
@@ -53,11 +53,2 @@ * search posts | ||
/** | ||
* update post channel | ||
* NOTE: this method will change the channel a post belongs to | ||
* | ||
* @export | ||
* @param {IUpdatePostSharingParams} options | ||
* @return {*} {Promise<IPost>} | ||
*/ | ||
export declare function updatePostSharing(options: IUpdatePostSharingParams): Promise<IPost>; | ||
/** | ||
* update post status | ||
@@ -64,0 +55,0 @@ * NOTE: this method will only update a post's status |
@@ -512,12 +512,2 @@ import { IPagingParams, IPagedResponse as IRestPagedResponse, IUser } from "@esri/arcgis-rest-types"; | ||
/** | ||
* dto for updating a post's channel | ||
* | ||
* @export | ||
* @interface IUpdatePostSharing | ||
* @extends {ICreateChannelPermissions} | ||
*/ | ||
export interface IUpdatePostSharing extends ICreateChannelPermissions { | ||
channelId?: string; | ||
} | ||
/** | ||
* dto for updating a post's status | ||
@@ -579,13 +569,2 @@ * | ||
/** | ||
* request options for updating a post's channel | ||
* | ||
* @export | ||
* @interface IUpdatePostSharingParams | ||
* @extends {IHubRequestOptions} | ||
*/ | ||
export interface IUpdatePostSharingParams extends IDiscussionsRequestOptions { | ||
postId: string; | ||
data: IUpdatePostSharing; | ||
} | ||
/** | ||
* request options for updating a post's status | ||
@@ -592,0 +571,0 @@ * |
import { IUser } from "@esri/arcgis-rest-auth"; | ||
import { IChannel, IDiscussionsUser, IPlatformSharing } from "../../types"; | ||
import { IChannel, IDiscussionsUser } from "../../types"; | ||
export { canPostToChannel } from "./can-post-to-channel"; | ||
@@ -23,10 +23,1 @@ export { canCreateChannel } from "./can-create-channel"; | ||
export declare function canModifyChannel(channel: IChannel, user?: IUser | IDiscussionsUser): boolean; | ||
/** | ||
* Utility to determine whether a Channel definition (inner) is encapsulated by another Channel's definition (outer) | ||
* | ||
* @export | ||
* @param {IChannel} outer -- access and groups that should contain inner access and groups | ||
* @param {(IChannel | IPlatformSharing)} inner -- access and groups that should be contained by outer access and groups | ||
* @return {*} {boolean} | ||
*/ | ||
export declare function isChannelInclusive(outer: IChannel, inner: IChannel | IPlatformSharing): boolean; |
{ | ||
"name": "@esri/hub-discussions", | ||
"version": "24.4.0", | ||
"version": "25.0.0", | ||
"description": "Module to interact with ArcGIS Hub Discussions API in Node.js and modern browsers.", | ||
@@ -16,3 +16,3 @@ "main": "dist/node/index.js", | ||
"@esri/arcgis-rest-request": "^2.14.0 || 3", | ||
"@esri/hub-common": "^12.4.0 || 13" | ||
"@esri/hub-common": "^13.0.0" | ||
}, | ||
@@ -19,0 +19,0 @@ "devDependencies": { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
188410
3688