@esri/hub-discussions
Advanced tools
Comparing version 14.18.1 to 14.19.0
@@ -11,2 +11,3 @@ /* Copyright (c) 2018 Environmental Systems Research Institute, Inc. | ||
export * from "./utils/platform"; | ||
export * from "./utils/constants"; | ||
//# sourceMappingURL=index.js.map |
import { Role, SharingAccess, } from "../../types"; | ||
const CANNOT_DISCUSS = "cannotDiscuss"; | ||
import { CANNOT_DISCUSS } from "../constants"; | ||
const ALLOWED_GROUP_ROLES = Object.freeze(["owner", "admin", "member"]); | ||
@@ -4,0 +4,0 @@ const ALLOWED_ROLES_FOR_POSTING = Object.freeze([ |
import { parseDatasetId } from "@esri/hub-common"; | ||
import { canModifyChannel } from "./channels"; | ||
import { CANNOT_DISCUSS, MENTION_ATTRIBUTE } from "./constants"; | ||
/** | ||
@@ -42,5 +43,2 @@ * Utility that parses a discussion URI string into its component parts | ||
* is discussable. | ||
* | ||
* NOT IMPLEMENTED | ||
* | ||
* @export | ||
@@ -51,4 +49,4 @@ * @param {IGroup|IItem|IHubContent} The subject to evaluate | ||
export function isDiscussable(subject) { | ||
// TODO: implement | ||
return true; | ||
var _a; | ||
return !((_a = subject.typeKeywords) !== null && _a !== void 0 ? _a : []).includes(CANNOT_DISCUSS); | ||
} | ||
@@ -85,3 +83,2 @@ /** | ||
} | ||
export const MENTION_ATTRIBUTE = "data-mention"; | ||
const MENTION_ATTRIBUTE_AND_VALUE_PATTERN = new RegExp(`${MENTION_ATTRIBUTE}=('|")(\\w)+('|")`, "g"); | ||
@@ -88,0 +85,0 @@ const MENTION_ATTRIBUTE_PATTERN = new RegExp(`${MENTION_ATTRIBUTE}=`, "g"); |
@@ -14,2 +14,3 @@ "use strict"; | ||
tslib_1.__exportStar(require("./utils/platform"), exports); | ||
tslib_1.__exportStar(require("./utils/constants"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -5,3 +5,3 @@ "use strict"; | ||
const types_1 = require("../../types"); | ||
const CANNOT_DISCUSS = "cannotDiscuss"; | ||
const constants_1 = require("../constants"); | ||
const ALLOWED_GROUP_ROLES = Object.freeze(["owner", "admin", "member"]); | ||
@@ -68,3 +68,3 @@ const ALLOWED_ROLES_FOR_POSTING = Object.freeze([ | ||
ALLOWED_GROUP_ROLES.includes(userMemberType) && | ||
!typeKeywords.includes(CANNOT_DISCUSS)); | ||
!typeKeywords.includes(constants_1.CANNOT_DISCUSS)); | ||
}); | ||
@@ -109,3 +109,3 @@ } | ||
ALLOWED_GROUP_ROLES.includes(userMemberType) && | ||
!typeKeywords.includes(CANNOT_DISCUSS)); | ||
!typeKeywords.includes(constants_1.CANNOT_DISCUSS)); | ||
}); | ||
@@ -112,0 +112,0 @@ }); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parseMentionedUsers = exports.MENTION_ATTRIBUTE = exports.canDeletePost = exports.canModifyPostStatus = exports.canModifyPost = exports.isDiscussable = exports.parseDiscussionURI = void 0; | ||
exports.parseMentionedUsers = exports.canDeletePost = exports.canModifyPostStatus = exports.canModifyPost = exports.isDiscussable = exports.parseDiscussionURI = void 0; | ||
const hub_common_1 = require("@esri/hub-common"); | ||
const channels_1 = require("./channels"); | ||
const constants_1 = require("./constants"); | ||
/** | ||
@@ -46,5 +47,2 @@ * Utility that parses a discussion URI string into its component parts | ||
* is discussable. | ||
* | ||
* NOT IMPLEMENTED | ||
* | ||
* @export | ||
@@ -55,4 +53,4 @@ * @param {IGroup|IItem|IHubContent} The subject to evaluate | ||
function isDiscussable(subject) { | ||
// TODO: implement | ||
return true; | ||
var _a; | ||
return !((_a = subject.typeKeywords) !== null && _a !== void 0 ? _a : []).includes(constants_1.CANNOT_DISCUSS); | ||
} | ||
@@ -93,5 +91,4 @@ exports.isDiscussable = isDiscussable; | ||
exports.canDeletePost = canDeletePost; | ||
exports.MENTION_ATTRIBUTE = "data-mention"; | ||
const MENTION_ATTRIBUTE_AND_VALUE_PATTERN = new RegExp(`${exports.MENTION_ATTRIBUTE}=('|")(\\w)+('|")`, "g"); | ||
const MENTION_ATTRIBUTE_PATTERN = new RegExp(`${exports.MENTION_ATTRIBUTE}=`, "g"); | ||
const MENTION_ATTRIBUTE_AND_VALUE_PATTERN = new RegExp(`${constants_1.MENTION_ATTRIBUTE}=('|")(\\w)+('|")`, "g"); | ||
const MENTION_ATTRIBUTE_PATTERN = new RegExp(`${constants_1.MENTION_ATTRIBUTE}=`, "g"); | ||
const NON_WORDS_PATTERN = new RegExp("[^\\w]", "g"); | ||
@@ -98,0 +95,0 @@ /** |
@@ -9,1 +9,2 @@ export * from "./posts"; | ||
export * from "./utils/platform"; | ||
export * from "./utils/constants"; |
@@ -16,5 +16,2 @@ import { IGroup, IItem } from "@esri/arcgis-rest-portal"; | ||
* is discussable. | ||
* | ||
* NOT IMPLEMENTED | ||
* | ||
* @export | ||
@@ -49,3 +46,2 @@ * @param {IGroup|IItem|IHubContent} The subject to evaluate | ||
export declare function canDeletePost(post: IPost, channel: IChannel, user: IUser): boolean; | ||
export declare const MENTION_ATTRIBUTE = "data-mention"; | ||
/** | ||
@@ -52,0 +48,0 @@ * Parses mentioned users |
{ | ||
"name": "@esri/hub-discussions", | ||
"version": "14.18.1", | ||
"version": "14.19.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
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
133638
67
3006