diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ce9c3a3..97bb9db6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 1.2.2 + +- JSDOC improvements +- New experimental endpoints +- Small improvements + ### 1.2.1 - Vulnerabilities fixes. diff --git a/package-lock.json b/package-lock.json index ac959080..73cc60e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "confluence.js", - "version": "1.2.1", + "version": "1.2.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -480,9 +480,9 @@ "dev": true }, "@eslint/eslintrc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.3.tgz", - "integrity": "sha512-DHI1wDPoKCBPoLZA3qDR91+3te/wDSc1YhKg3jR8NxKKRJq2hwHwcWv31cSwSYvIBrmbENoYMWcenW8uproQqg==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.4.tgz", + "integrity": "sha512-h8Vx6MdxwWI2WM8/zREHMoqdgLNXEL4QX3MWSVMdyNJGvXVOs+6lp+m2hc3FnuMHDc4poxFNI20vCk0OmI4G0Q==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -491,7 +491,7 @@ "globals": "^13.9.0", "ignore": "^4.0.6", "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", + "js-yaml": "^4.1.0", "minimatch": "^3.0.4", "strip-json-comments": "^3.1.1" }, @@ -510,16 +510,6 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } } } }, @@ -535,9 +525,9 @@ } }, "@humanwhocodes/object-schema": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", - "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, "@istanbuljs/load-nyc-config": { @@ -1012,9 +1002,9 @@ } }, "@types/jest": { - "version": "27.0.2", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.0.2.tgz", - "integrity": "sha512-4dRxkS/AFX0c5XW6IPMNOydLn2tEhNhJV7DnYK+0bjoJZ+QTmfucBlihX7aoEsh/ocYtkLC73UbnBXBXIxsULA==", + "version": "27.0.3", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.0.3.tgz", + "integrity": "sha512-cmmwv9t7gBYt7hNKH5Spu7Kuu/DotGa+Ff+JGRKZ4db5eh8PnKS4LuebJ3YLUoyOyIHraTGyULn23YtEAm0VSg==", "dev": true, "requires": { "jest-diff": "^27.0.0", @@ -1128,13 +1118,13 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.2.0.tgz", - "integrity": "sha512-qQwg7sqYkBF4CIQSyRQyqsYvP+g/J0To9ZPVNJpfxfekl5RmdvQnFFTVVwpRtaUDFNvjfe/34TgY/dpc3MgNTw==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.4.0.tgz", + "integrity": "sha512-9/yPSBlwzsetCsGEn9j24D8vGQgJkOTr4oMLas/w886ZtzKIs1iyoqFrwsX2fqYEeUwsdBpC21gcjRGo57u0eg==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "5.2.0", - "@typescript-eslint/scope-manager": "5.2.0", + "@typescript-eslint/experimental-utils": "5.4.0", + "@typescript-eslint/scope-manager": "5.4.0", "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", "ignore": "^5.1.8", @@ -1155,28 +1145,28 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.2.0.tgz", - "integrity": "sha512-fWyT3Agf7n7HuZZRpvUYdFYbPk3iDCq6fgu3ulia4c7yxmPnwVBovdSOX7RL+k8u6hLbrXcdAehlWUVpGh6IEw==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.4.0.tgz", + "integrity": "sha512-Nz2JDIQUdmIGd6p33A+naQmwfkU5KVTLb/5lTk+tLVTDacZKoGQisj8UCxk7onJcrgjIvr8xWqkYI+DbI3TfXg==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.2.0", - "@typescript-eslint/types": "5.2.0", - "@typescript-eslint/typescript-estree": "5.2.0", + "@typescript-eslint/scope-manager": "5.4.0", + "@typescript-eslint/types": "5.4.0", + "@typescript-eslint/typescript-estree": "5.4.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" } }, "@typescript-eslint/parser": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.2.0.tgz", - "integrity": "sha512-Uyy4TjJBlh3NuA8/4yIQptyJb95Qz5PX//6p8n7zG0QnN4o3NF9Je3JHbVU7fxf5ncSXTmnvMtd/LDQWDk0YqA==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.4.0.tgz", + "integrity": "sha512-JoB41EmxiYpaEsRwpZEYAJ9XQURPFer8hpkIW9GiaspVLX8oqbqNM8P4EP8HOZg96yaALiLEVWllA2E8vwsIKw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.2.0", - "@typescript-eslint/types": "5.2.0", - "@typescript-eslint/typescript-estree": "5.2.0", + "@typescript-eslint/scope-manager": "5.4.0", + "@typescript-eslint/types": "5.4.0", + "@typescript-eslint/typescript-estree": "5.4.0", "debug": "^4.3.2" }, "dependencies": { @@ -1192,29 +1182,29 @@ } }, "@typescript-eslint/scope-manager": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.2.0.tgz", - "integrity": "sha512-RW+wowZqPzQw8MUFltfKYZfKXqA2qgyi6oi/31J1zfXJRpOn6tCaZtd9b5u9ubnDG2n/EMvQLeZrsLNPpaUiFQ==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.4.0.tgz", + "integrity": "sha512-pRxFjYwoi8R+n+sibjgF9iUiAELU9ihPBtHzocyW8v8D8G8KeQvXTsW7+CBYIyTYsmhtNk50QPGLE3vrvhM5KA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.2.0", - "@typescript-eslint/visitor-keys": "5.2.0" + "@typescript-eslint/types": "5.4.0", + "@typescript-eslint/visitor-keys": "5.4.0" } }, "@typescript-eslint/types": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.2.0.tgz", - "integrity": "sha512-cTk6x08qqosps6sPyP2j7NxyFPlCNsJwSDasqPNjEQ8JMD5xxj2NHxcLin5AJQ8pAVwpQ8BMI3bTxR0zxmK9qQ==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.4.0.tgz", + "integrity": "sha512-GjXNpmn+n1LvnttarX+sPD6+S7giO+9LxDIGlRl4wK3a7qMWALOHYuVSZpPTfEIklYjaWuMtfKdeByx0AcaThA==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.2.0.tgz", - "integrity": "sha512-RsdXq2XmVgKbm9nLsE3mjNUM7BTr/K4DYR9WfFVMUuozHWtH5gMpiNZmtrMG8GR385EOSQ3kC9HiEMJWimxd/g==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.4.0.tgz", + "integrity": "sha512-nhlNoBdhKuwiLMx6GrybPT3SFILm5Gij2YBdPEPFlYNFAXUJWX6QRgvi/lwVoadaQEFsizohs6aFRMqsXI2ewA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.2.0", - "@typescript-eslint/visitor-keys": "5.2.0", + "@typescript-eslint/types": "5.4.0", + "@typescript-eslint/visitor-keys": "5.4.0", "debug": "^4.3.2", "globby": "^11.0.4", "is-glob": "^4.0.3", @@ -1243,12 +1233,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.2.0.tgz", - "integrity": "sha512-Nk7HizaXWWCUBfLA/rPNKMzXzWS8Wg9qHMuGtT+v2/YpPij4nVXrVJc24N/r5WrrmqK31jCrZxeHqIgqRzs0Xg==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.4.0.tgz", + "integrity": "sha512-PVbax7MeE7tdLfW5SA0fs8NGVVr+buMPrcj+CWYWPXsZCH8qZ1THufDzbXm1xrZ2b2PA1iENJ0sRq5fuUtvsJg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.2.0", + "@typescript-eslint/types": "5.4.0", "eslint-visitor-keys": "^3.0.0" } }, @@ -1383,36 +1373,6 @@ "es-abstract": "^1.19.1", "get-intrinsic": "^1.1.1", "is-string": "^1.0.7" - }, - "dependencies": { - "es-abstract": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", - "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.1.1", - "get-symbol-description": "^1.0.0", - "has": "^1.0.3", - "has-symbols": "^1.0.2", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", - "is-string": "^1.0.7", - "is-weakref": "^1.0.1", - "object-inspect": "^1.11.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.1" - } - } } }, "array-union": { @@ -1430,36 +1390,6 @@ "call-bind": "^1.0.2", "define-properties": "^1.1.3", "es-abstract": "^1.19.0" - }, - "dependencies": { - "es-abstract": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", - "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.1.1", - "get-symbol-description": "^1.0.0", - "has": "^1.0.3", - "has-symbols": "^1.0.2", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", - "is-string": "^1.0.7", - "is-weakref": "^1.0.1", - "object-inspect": "^1.11.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.1" - } - } } }, "asynckit": { @@ -1773,9 +1703,9 @@ } }, "comment-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.2.4.tgz", - "integrity": "sha512-pm0b+qv+CkWNriSTMsfnjChF9kH0kxz55y44Wo5le9qLxMj5xDQAaEd9ZN1ovSuk9CsrncWaFwgpOMg7ClJwkw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.0.tgz", + "integrity": "sha512-hRpmWIKgzd81vn0ydoWoyPoALEOnF4wt8yKD35Ib1D6XC2siLiYaiqfGkYrunuKdsXGwpBpHU3+9r+RVw2NZfA==", "dev": true }, "concat-map": { @@ -1979,9 +1909,9 @@ } }, "es-abstract": { - "version": "1.18.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.6.tgz", - "integrity": "sha512-kAeIT4cku5eNLNuUKhlmtuk1/TRZvQoYccn6TO0cSVdf1kzB0T7+dYuVK9MWM7l+/53W2Q8M7N2c6MQvhXFcUQ==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", + "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", "dev": true, "requires": { "call-bind": "^1.0.2", @@ -1995,7 +1925,9 @@ "is-callable": "^1.2.4", "is-negative-zero": "^2.0.1", "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.1", "is-string": "^1.0.7", + "is-weakref": "^1.0.1", "object-inspect": "^1.11.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", @@ -2088,12 +2020,12 @@ } }, "eslint": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.1.0.tgz", - "integrity": "sha512-JZvNneArGSUsluHWJ8g8MMs3CfIEzwaLx9KyH4tZ2i+R2/rPWzL8c0zg3rHdwYVpN/1sB9gqnjHwz9HoeJpGHw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.2.0.tgz", + "integrity": "sha512-erw7XmM+CLxTOickrimJ1SiF55jiNlVSp2qqm0NuBWPtHYQCegD5ZMaW0c3i5ytPqL+SSLaCxdvQXFPLJn+ABw==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.0.3", + "@eslint/eslintrc": "^1.0.4", "@humanwhocodes/config-array": "^0.6.0", "ajv": "^6.10.0", "chalk": "^4.0.0", @@ -2127,7 +2059,7 @@ "progress": "^2.0.0", "regexpp": "^3.2.0", "semver": "^7.2.1", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" @@ -2187,34 +2119,43 @@ } }, "eslint-config-airbnb": { - "version": "18.2.1", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-18.2.1.tgz", - "integrity": "sha512-glZNDEZ36VdlZWoxn/bUR1r/sdFKPd1mHPbqUtkctgNG4yT2DLLtJ3D+yCV+jzZCc2V1nBVkmdknOJBZ5Hc0fg==", + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-19.0.0.tgz", + "integrity": "sha512-f5FzCDw8osQJtifOGazdBtYuDOH38FVQSOwHvSU0iFjAmkdl4zQ1jG+YV6sVNt4gqVubqJwn98zZQzDoaCwDyw==", "dev": true, "requires": { - "eslint-config-airbnb-base": "^14.2.1", + "eslint-config-airbnb-base": "^15.0.0", "object.assign": "^4.1.2", - "object.entries": "^1.1.2" + "object.entries": "^1.1.5" } }, "eslint-config-airbnb-base": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz", - "integrity": "sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==", + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", + "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==", "dev": true, "requires": { "confusing-browser-globals": "^1.0.10", "object.assign": "^4.1.2", - "object.entries": "^1.1.2" + "object.entries": "^1.1.5", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, "eslint-config-airbnb-typescript": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-14.0.1.tgz", - "integrity": "sha512-tF4GwC3sRrw8kEj4/yxX8F7AcLzj/1IESBnsCiFMplzYmxre459qm2z9DFkCpqBVQFSH6j2K4+VKVteX4m0GsQ==", + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-16.0.0.tgz", + "integrity": "sha512-qDOyD0YYZo5Us1YvOnWig2Ly/+IlQKmMZpnqKnJgVtHdK8SkjaSyVBHKbD41dEaQxk8vRVGBC94PuR2ceSwbLQ==", "dev": true, "requires": { - "eslint-config-airbnb-base": "14.2.1" + "eslint-config-airbnb-base": "^15.0.0" } }, "eslint-import-resolver-node": { @@ -2290,9 +2231,9 @@ } }, "eslint-plugin-import": { - "version": "2.25.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.2.tgz", - "integrity": "sha512-qCwQr9TYfoBHOFcVGKY9C9unq05uOxxdklmBXLVvcwo68y5Hta6/GzCZEMx2zQiu0woKNEER0LE7ZgaOfBU14g==", + "version": "2.25.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.3.tgz", + "integrity": "sha512-RzAVbby+72IB3iOEL8clzPLzL3wpDrlwjsTBAQXgyp5SeTqqY+0bFubwuo+y/HLhNZcXV4XqTBO4LGsfyHIDXg==", "dev": true, "requires": { "array-includes": "^3.1.4", @@ -2300,9 +2241,9 @@ "debug": "^2.6.9", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.0", + "eslint-module-utils": "^2.7.1", "has": "^1.0.3", - "is-core-module": "^2.7.0", + "is-core-module": "^2.8.0", "is-glob": "^4.0.3", "minimatch": "^3.0.4", "object.values": "^1.1.5", @@ -2382,9 +2323,9 @@ } }, "eslint-visitor-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz", - "integrity": "sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", + "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", "dev": true }, "espree": { @@ -2582,9 +2523,9 @@ } }, "flatted": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz", - "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", + "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", "dev": true }, "follow-redirects": { @@ -2697,9 +2638,9 @@ } }, "globals": { - "version": "13.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.11.0.tgz", - "integrity": "sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g==", + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -2813,9 +2754,9 @@ } }, "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.9.tgz", + "integrity": "sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ==", "dev": true }, "import-fresh": { @@ -4076,14 +4017,14 @@ } }, "object.entries": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.4.tgz", - "integrity": "sha512-h4LWKWE+wKQGhtMjZEBud7uLGhqyLwj8fpHOarZhD2uY3C9cRtk57VQ89ke3moByLXMedqs3XCHzyb4AmA2DjA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.5.tgz", + "integrity": "sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.18.2" + "es-abstract": "^1.19.1" } }, "object.values": { @@ -4095,36 +4036,6 @@ "call-bind": "^1.0.2", "define-properties": "^1.1.3", "es-abstract": "^1.19.1" - }, - "dependencies": { - "es-abstract": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", - "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.1.1", - "get-symbol-description": "^1.0.0", - "has": "^1.0.3", - "has-symbols": "^1.0.2", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", - "is-string": "^1.0.7", - "is-weakref": "^1.0.1", - "object-inspect": "^1.11.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.1" - } - } } }, "once": { @@ -4320,9 +4231,9 @@ "dev": true }, "prettier-plugin-jsdoc": { - "version": "0.3.24", - "resolved": "https://registry.npmjs.org/prettier-plugin-jsdoc/-/prettier-plugin-jsdoc-0.3.24.tgz", - "integrity": "sha512-mgnqQFgMAj0M5Uon1qsgIKpsujkEWO3jd8IhkZ96dBNnrTxnIx2LH2qW9raWGJgiy39jzGIm0S9kK3fDkOuRRw==", + "version": "0.3.30", + "resolved": "https://registry.npmjs.org/prettier-plugin-jsdoc/-/prettier-plugin-jsdoc-0.3.30.tgz", + "integrity": "sha512-BTBojOMmrUA1qsWLpJN5whUfU/E72WBUQAB5AvrDkha+O8TxmqaAivnuW+87ItYGRPBFWWzj2r5iWELhBml1Ag==", "dev": true, "requires": { "binary-search-bounds": "^2.0.5", @@ -4540,32 +4451,26 @@ "dev": true }, "sinon": { - "version": "11.1.2", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-11.1.2.tgz", - "integrity": "sha512-59237HChms4kg7/sXhiRcUzdSkKuydDeTiamT/jesUVHshBgL8XAmhgFo0GfK6RruMDM/iRSij1EybmMog9cJw==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-12.0.1.tgz", + "integrity": "sha512-iGu29Xhym33ydkAT+aNQFBINakjq69kKO6ByPvTsm3yyIACfyQttRTP03aBP/I8GfhFmLzrnKwNNkr0ORb1udg==", "dev": true, "requires": { "@sinonjs/commons": "^1.8.3", - "@sinonjs/fake-timers": "^7.1.2", + "@sinonjs/fake-timers": "^8.1.0", "@sinonjs/samsam": "^6.0.2", "diff": "^5.0.0", "nise": "^5.1.0", "supports-color": "^7.2.0" }, "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "@sinonjs/fake-timers": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz", + "integrity": "sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg==", "dev": true, "requires": { - "has-flag": "^4.0.0" + "@sinonjs/commons": "^1.7.0" } } } @@ -4888,9 +4793,9 @@ } }, "typedoc": { - "version": "0.22.7", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.7.tgz", - "integrity": "sha512-ndxxp+tU1Wczvdxp4u2/PvT1qjD6hdFdSdehpORHjE+JXmMkl2bftXCR0upHmsnesBG7VCcr8vfgloGHIH8glQ==", + "version": "0.22.9", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.9.tgz", + "integrity": "sha512-84PjudoXVcap6bwdZFbYIUWlgdz/iLV09ZHwrCzhtHWXaDQG6mlosJ8te6DSThuRkRvQjp46HO+qY/P7Gpm78g==", "dev": true, "requires": { "glob": "^7.2.0", @@ -4907,9 +4812,9 @@ "dev": true }, "typescript": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", - "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", + "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", "dev": true }, "unbox-primitive": { diff --git a/package.json b/package.json index ce997b92..1b3d3ced 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "confluence.js", - "version": "1.2.1", + "version": "1.2.2", "description": "confluence.js is a powerful Node.JS/Browser module that allows you to interact with the Confluence API very easily", "author": "Vladislav Tupikin ", "license": "MIT", @@ -34,25 +34,25 @@ ], "devDependencies": { "@types/express": "^4.17.13", - "@types/jest": "^27.0.2", + "@types/jest": "^27.0.3", "@types/oauth": "^0.9.1", "@types/sinon": "^10.0.6", - "@typescript-eslint/eslint-plugin": "^5.2.0", - "@typescript-eslint/parser": "^5.2.0", + "@typescript-eslint/eslint-plugin": "^5.4.0", + "@typescript-eslint/parser": "^5.4.0", "dotenv": "^10.0.0", - "eslint": "^8.1.0", - "eslint-config-airbnb": "^18.2.1", - "eslint-config-airbnb-typescript": "^14.0.1", + "eslint": "^8.2.0", + "eslint-config-airbnb": "^19.0.0", + "eslint-config-airbnb-typescript": "^16.0.0", "eslint-import-resolver-typescript": "^2.5.0", - "eslint-plugin-import": "^2.25.2", + "eslint-plugin-import": "^2.25.3", "jest": "^27.3.1", "prettier": "^2.4.1", - "prettier-plugin-jsdoc": "^0.3.24", - "sinon": "^11.1.2", + "prettier-plugin-jsdoc": "^0.3.30", + "sinon": "^12.0.1", "ts-jest": "^27.0.7", - "typedoc": "^0.22.7", + "typedoc": "^0.22.9", "typedoc-plugin-extras": "^2.2.1", - "typescript": "^4.4.4" + "typescript": "^4.5.2" }, "dependencies": { "atlassian-jwt": "^2.0.2", diff --git a/src/api/contentProperties.ts b/src/api/contentProperties.ts index a602df41..360b9b0c 100644 --- a/src/api/contentProperties.ts +++ b/src/api/contentProperties.ts @@ -126,6 +126,7 @@ export class ContentProperties { method: 'GET', params: { expand: parameters.expand, + status: parameters.status, }, }; diff --git a/src/api/experimental.ts b/src/api/experimental.ts index d2b32152..8f307c94 100644 --- a/src/api/experimental.ts +++ b/src/api/experimental.ts @@ -7,6 +7,99 @@ import { RequestConfig } from '../requestConfig'; export class Experimental { constructor(private client: Client) {} + /** + * Returns a list of labels associated with a space. Can provide a prefix as well as other filters to select different + * types of labels. + */ + async getLabelsForSpace( + parameters: Parameters.GetLabelsForSpace, + callback: Callback + ): Promise; + /** + * Returns a list of labels associated with a space. Can provide a prefix as well as other filters to select different + * types of labels. + */ + async getLabelsForSpace( + parameters: Parameters.GetLabelsForSpace, + callback?: never + ): Promise; + async getLabelsForSpace( + parameters: Parameters.GetLabelsForSpace, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/api/space/${parameters.spaceKey}/label`, + method: 'GET', + params: { + prefix: parameters.prefix, + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback, { methodName: 'getLabelsForSpace' }); + } + + /** + * Adds labels to a piece of content. Does not modify the existing labels. + * + * Notes: + * + * - Labels can also be added when creating content ([Create content](#api-content-post)). + * - Labels can be updated when updating content ([Update content](#api-content-id-put)). This will delete the existing + * labels and replace them with the labels in the request. + * + * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content. + */ + async addLabelsToSpace( + parameters: Parameters.AddLabelsToSpace, + callback: Callback + ): Promise; + /** + * Adds labels to a piece of content. Does not modify the existing labels. + * + * Notes: + * + * - Labels can also be added when creating content ([Create content](#api-content-post)). + * - Labels can be updated when updating content ([Update content](#api-content-id-put)). This will delete the existing + * labels and replace them with the labels in the request. + * + * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to update the content. + */ + async addLabelsToSpace(parameters: Parameters.AddLabelsToSpace, callback?: never): Promise; + async addLabelsToSpace( + parameters: Parameters.AddLabelsToSpace, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/api/space/${parameters.spaceKey}/label`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback, { methodName: 'addLabelsToSpace' }); + } + + async deleteLabelFromSpace( + parameters: Parameters.DeleteLabelFromSpace, + callback: Callback + ): Promise; + async deleteLabelFromSpace(parameters: Parameters.DeleteLabelFromSpace, callback?: never): Promise; + async deleteLabelFromSpace( + parameters: Parameters.DeleteLabelFromSpace, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/api/space/${parameters.spaceKey}/label`, + method: 'DELETE', + params: { + name: parameters.name, + prefix: parameters.prefix, + }, + }; + + return this.client.sendRequest(config, callback, { methodName: 'deleteLabelFromSpace' }); + } + /** Get the total number of views a piece of content has. */ async getViews(parameters: Parameters.GetViews, callback: Callback): Promise; /** Get the total number of views a piece of content has. */ diff --git a/src/api/parameters/addLabelsToSpace.ts b/src/api/parameters/addLabelsToSpace.ts new file mode 100644 index 00000000..0b828390 --- /dev/null +++ b/src/api/parameters/addLabelsToSpace.ts @@ -0,0 +1,4 @@ +export interface AddLabelsToSpace { + /** The key of the space to add labels to. */ + spaceKey: string; +} diff --git a/src/api/parameters/deleteLabelFromSpace.ts b/src/api/parameters/deleteLabelFromSpace.ts new file mode 100644 index 00000000..35c875a1 --- /dev/null +++ b/src/api/parameters/deleteLabelFromSpace.ts @@ -0,0 +1,8 @@ +export interface DeleteLabelFromSpace { + /** The key of the space to remove a labels from. */ + spaceKey: string; + /** The name of the label to remove */ + name: string; + /** The prefix of the label to remove. If not provided defaults to global. */ + prefix?: string; +} diff --git a/src/api/parameters/getBulkUserLookup.ts b/src/api/parameters/getBulkUserLookup.ts index 32748fe2..30360cd4 100644 --- a/src/api/parameters/getBulkUserLookup.ts +++ b/src/api/parameters/getBulkUserLookup.ts @@ -5,12 +5,6 @@ export interface GetBulkUserLookup { * A multi-value parameter indicating which properties of the user to expand. * * - `operations` returns the operations that the user is allowed to do. - * - `details.personal` returns the 'Personal' details in the user's profile, like the 'Email' and 'Phone'. Note that - * these fields have been deprecated due to privacy changes. See the [migration - * guide](https://developer.atlassian.com/cloud/confluence/deprecation-notice-user-privacy-api-migration-guide/) for details. - * - `details.business` returns the 'Company' details in the user's profile, like the 'Position' and 'Department'. Note - * that these fields have been deprecated due to privacy changes. See the [migration - * guide](https://developer.atlassian.com/cloud/confluence/deprecation-notice-user-privacy-api-migration-guide/) for details. * - PersonalSpace returns the user's personal space, if it exists. */ expand?: string[]; diff --git a/src/api/parameters/getContentById.ts b/src/api/parameters/getContentById.ts index 4ddfa2e7..5e17c731 100644 --- a/src/api/parameters/getContentById.ts +++ b/src/api/parameters/getContentById.ts @@ -19,10 +19,95 @@ export interface GetContentById { */ embeddedContentRender?: string; /** A multi-value parameter indicating which properties of the content to expand. */ - expand?: string[]; + expand?: string | string[] | GetContentById.Expand | GetContentById.Expand[]; /** * If set to `viewed`, the request will trigger a 'viewed' event for the content. When this event is triggered, the * page/blogpost will appear on the 'Recently visited' tab of the user's Confluence dashboard. */ trigger?: string; } + +export namespace GetContentById { + export enum Expand { + /** + * Returns whether the content has attachments, comments, or child pages. Use this if you only need to check whether + * the content has children of a particular type. + */ + AllChildTypes = 'childTypes.all', + /** Returns whether the content has attachments. */ + AttachmentChildType = 'childTypes.attachment', + /** Returns whether the content has comments. */ + CommentChildType = 'childTypes.comment', + /** Returns whether the content has child pages. */ + PageChildType = 'childTypes.page', + /** + * Returns the space that the content is in. This is the same as the information returned by [Get + * space](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/). + */ + Container = 'container', + /** + * Returns information about the current user in relation to the content, including when they last viewed it, + * modified it, contributed to it, or added it as a favorite. + */ + CurrentUserMetadata = 'metadata.currentuser', + /** Returns content properties that have been set via the Confluence REST API. */ + PropertiesMetadata = 'metadata.properties', + /** Returns the labels that have been added to the content. */ + LabelsMetadata = 'metadata.labels', + /** This property is only used by Atlassian. */ + FrontendMetadata = 'metadata.frontend', + /** Returns the operations for the content, which are used when setting permissions. */ + Operations = 'operations', + /** Returns pages that are descendants at the level immediately below the content. */ + PageChildren = 'children.page', + /** Returns all attachments for the content. */ + AttachmentChildren = 'children.attachment', + /** Returns all comments on the content. */ + CommentChildren = 'children.comment', + /** Returns the users that have permission to read the content. */ + ReadUserRestriction = 'restrictions.read.restrictions.user', + /** + * Returns the groups that have permission to read the content. Note that this may return deleted groups, because + * deleting a group doesn't remove associated restrictions. + */ + ReadGroupRestriction = 'restrictions.read.restrictions.group', + /** Returns the users that have permission to update the content. */ + UpdateUserRestriction = 'restrictions.update.restrictions.user', + /** + * Returns the groups that have permission to update the content. Note that this may return deleted groups because + * deleting a group doesn't remove associated restrictions. + */ + UpdateGroupRestriction = 'restrictions.update.restrictions.group', + /** Returns the history of the content, including the date it was created. */ + History = 'history', + /** Returns information about the most recent update of the content, including who updated it and when it was updated. */ + LastUpdated = 'history.lastUpdated', + /** Returns information about the update prior to the current content update. */ + PreviousVersion = 'history.previousVersion', + /** Returns all of the users who have contributed to the content. */ + Contributors = 'history.contributors', + /** Returns information about the update after to the current content update. */ + NextVersion = 'history.nextVersion', + /** Returns the parent page, if the content is a page. */ + Ancestors = 'ancestors', + /** Returns the body of the content in different formats, including the editor format, view format, and export format. */ + Body = 'body', + /** Returns information about the most recent update of the content, including who updated it and when it was updated. */ + Version = 'version', + /** Returns pages that are descendants at any level below the content. */ + PageDescendant = 'descendants.page', + /** Returns all attachments for the content, same as `children.attachment`. */ + AttachmentDescendant = 'descendants.attachment', + /** Returns all comments on the content, same as `children.comment`. */ + CommentDescendant = 'descendants.comment', + /** + * Returns the space that the content is in. This is the same as the information returned by [Get + * space](https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/). + */ + Space = 'space', + /** Returns inline comment-specific properties. */ + InlineProperties = 'extensions.inlineProperties', + /** Returns the resolution status of each comment. */ + Resolution = 'extensions.resolution', + } +} diff --git a/src/api/parameters/getContentChildren.ts b/src/api/parameters/getContentChildren.ts index c381eb01..3f7a320c 100644 --- a/src/api/parameters/getContentChildren.ts +++ b/src/api/parameters/getContentChildren.ts @@ -7,6 +7,7 @@ export interface GetContentChildren { * - `attachment` returns all attachments for the content. * - `comments` returns all comments for the content. * - `page` returns all child pages of the content. + * - Custom content types that are provided by apps are also supported. */ expand?: string[]; /** The version of the parent content to retrieve children for. Currently, this only works for the latest version. */ diff --git a/src/api/parameters/getContentProperties.ts b/src/api/parameters/getContentProperties.ts index bfeb0c16..b35eac7d 100644 --- a/src/api/parameters/getContentProperties.ts +++ b/src/api/parameters/getContentProperties.ts @@ -1,7 +1,7 @@ export interface GetContentProperties { /** The ID of the content to be queried for its properties. */ id: string; - /**The key of the content property.*/ + /** The key of the content property. */ key?: string[]; /** * A multi-value parameter indicating which properties of the content to expand. By default, the `version` object is expanded. diff --git a/src/api/parameters/getContentProperty.ts b/src/api/parameters/getContentProperty.ts index a7f1989a..590fa5d8 100644 --- a/src/api/parameters/getContentProperty.ts +++ b/src/api/parameters/getContentProperty.ts @@ -10,4 +10,16 @@ export interface GetContentProperty { * - `version` returns information about the version of the property, such as the version number, when it was created, etc. */ expand?: string[]; + /** + * Filter the results to a set of content based on their status. If set to `any`, content with any status is returned. + * By default it will fetch current and archived statuses `?status=current&status=archived`. All supported statuses + * + * - any + * - archived + * - current + * - deleted + * - draft + * - trashed + */ + status?: string[]; } diff --git a/src/api/parameters/getContentVersions.ts b/src/api/parameters/getContentVersions.ts index 77256391..de7ffaa9 100644 --- a/src/api/parameters/getContentVersions.ts +++ b/src/api/parameters/getContentVersions.ts @@ -6,7 +6,7 @@ export interface GetContentVersions { /** The maximum number of versions to return per page. Note, this may be restricted by fixed system limits. */ limit?: number; /** - * A multi-value parameter indicating which properties of the content to expand. + * A multi-value parameter indicating which properties of the content to expand. By default, the `content` object is expanded. * * - `collaborators` returns the users that collaborated on the version. * - `content` returns the content for the version. diff --git a/src/api/parameters/getCurrentUser.ts b/src/api/parameters/getCurrentUser.ts index cffdff9e..2f1da839 100644 --- a/src/api/parameters/getCurrentUser.ts +++ b/src/api/parameters/getCurrentUser.ts @@ -3,13 +3,8 @@ export interface GetCurrentUser { * A multi-value parameter indicating which properties of the user to expand. * * - `operations` returns the operations that the user is allowed to do. - * - `details.personal` returns the 'Personal' details in the user's profile, like the 'Email' and 'Phone'. Note that - * these fields have been deprecated due to privacy changes. See the [migration - * guide](https://developer.atlassian.com/cloud/confluence/deprecation-notice-user-privacy-api-migration-guide/) for details. - * - `details.business` returns the 'Company' details in the user's profile, like the 'Position' and 'Department'. Note - * that these fields have been deprecated due to privacy changes. See the [migration - * guide](https://developer.atlassian.com/cloud/confluence/deprecation-notice-user-privacy-api-migration-guide/) for details. * - PersonalSpace returns the user's personal space, if it exists. + * - `isExternalCollaborator` returns whether the user is an external collaborator user */ expand?: string[]; } diff --git a/src/api/parameters/getHistoryForContent.ts b/src/api/parameters/getHistoryForContent.ts index e4b9aed1..7c065736 100644 --- a/src/api/parameters/getHistoryForContent.ts +++ b/src/api/parameters/getHistoryForContent.ts @@ -2,7 +2,7 @@ export interface GetHistoryForContent { /** The ID of the content to be queried for its history. */ id: string; /** - * A multi-value parameter indicating which properties of the content history to expand. + * A multi-value parameter indicating which properties of the content history to expand. Maximum sub-expansions allowed is `8`. * * - `lastUpdated` returns information about the most recent update of the content, including who updated it and when it * was updated. diff --git a/src/api/parameters/getLabelsForSpace.ts b/src/api/parameters/getLabelsForSpace.ts new file mode 100644 index 00000000..6dc68467 --- /dev/null +++ b/src/api/parameters/getLabelsForSpace.ts @@ -0,0 +1,18 @@ +export interface GetLabelsForSpace { + /** The key of the space to get labels for. */ + spaceKey: string; + /** + * Filters the results to labels with the specified prefix. If this parameter is not specified, then labels with any + * prefix will be returned. + * + * - `global` prefix is used by labels that are on content within the provided space. + * - `my` prefix can be explicitly added by a user when adding a label + * via the UI, e.g. 'my:example-label'. + * - `team` prefix is used for labels applied to the space. + */ + prefix?: string; + /** The starting index of the returned labels. */ + start?: number; + /** The maximum number of labels to return per page. Note, this may be restricted by fixed system limits. */ + limit?: number; +} diff --git a/src/api/parameters/index.ts b/src/api/parameters/index.ts index 288ab2b9..b4d99e8d 100644 --- a/src/api/parameters/index.ts +++ b/src/api/parameters/index.ts @@ -3,6 +3,7 @@ export * from './addCustomContentPermissions'; export * from './addGroupToContentRestriction'; export * from './addGroupToContentRestrictionByGroupId'; export * from './addLabelsToContent'; +export * from './addLabelsToSpace'; export * from './addLabelWatcher'; export * from './addPermission'; export * from './addPermissionToSpace'; @@ -33,6 +34,7 @@ export * from './delete'; export * from './deleteContent'; export * from './deleteContentProperty'; export * from './deleteContentVersion'; +export * from './deleteLabelFromSpace'; export * from './deleteRelationship'; export * from './deleteRestrictions'; export * from './deleteSpace'; @@ -81,6 +83,7 @@ export * from './getGroupsSearch'; export * from './getHistoryForContent'; export * from './getIndividualGroupRestrictionStatusByGroupId'; export * from './getLabelsForContent'; +export * from './getLabelsForSpace'; export * from './getLookAndFeelSettings'; export * from './getMacroBodyByMacroId'; export * from './getMembersByQueryParam'; diff --git a/src/api/parameters/restoreContentVersion.ts b/src/api/parameters/restoreContentVersion.ts index ba335432..036894c2 100644 --- a/src/api/parameters/restoreContentVersion.ts +++ b/src/api/parameters/restoreContentVersion.ts @@ -4,7 +4,7 @@ export interface RestoreContentVersion extends VersionRestore { /** The ID of the content for which the history will be restored. */ id: string; /** - * A multi-value parameter indicating which properties of the returned content to expand. + * A multi-value parameter indicating which properties of the content to expand. By default, the `content` object is expanded. * * - `collaborators` returns the users that collaborated on the version. * - `content` returns the content for the version. diff --git a/src/api/parameters/searchUser.ts b/src/api/parameters/searchUser.ts index 07bbdba5..1823531f 100644 --- a/src/api/parameters/searchUser.ts +++ b/src/api/parameters/searchUser.ts @@ -17,4 +17,11 @@ export interface SearchUser { start?: number; /** The maximum number of user objects to return per page. Note, this may be restricted by fixed system limits. */ limit?: number; + /** + * A multi-value parameter indicating which properties of the user to expand. + * + * - `operations` returns the operations for the user, which are used when setting permissions. + * - `personalSpace` returns the personal space of the user. + */ + expand?: string[]; } diff --git a/src/api/template.ts b/src/api/template.ts index 43c3ca68..7d182134 100644 --- a/src/api/template.ts +++ b/src/api/template.ts @@ -50,8 +50,8 @@ export class Template { /** * Updates a content template. Note, blueprint templates cannot be updated via the REST API. * - * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space to create a - * space template or 'Confluence Administrator' global permission to create a global template. + * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space to update a + * space template or 'Confluence Administrator' global permission to update a global template. */ async updateContentTemplate( parameters: Parameters.UpdateContentTemplate | undefined, @@ -60,8 +60,8 @@ export class Template { /** * Updates a content template. Note, blueprint templates cannot be updated via the REST API. * - * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space to create a - * space template or 'Confluence Administrator' global permission to create a global template. + * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space to update a + * space template or 'Confluence Administrator' global permission to update a global template. */ async updateContentTemplate( parameters?: Parameters.UpdateContentTemplate, @@ -95,8 +95,9 @@ export class Template { * Note, all global blueprints are inherited by each space. Space blueprints can be customised without affecting the * global blueprints. * - * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site - * ('Can use' global permission). + * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space to view + * blueprints for the space and permission to access the Confluence site ('Can use' global permission) to view global + * blueprints. */ async getBlueprintTemplates( parameters: Parameters.GetBlueprintTemplates | undefined, @@ -109,8 +110,9 @@ export class Template { * Note, all global blueprints are inherited by each space. Space blueprints can be customised without affecting the * global blueprints. * - * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: Permission to access the Confluence site - * ('Can use' global permission). + * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space to view + * blueprints for the space and permission to access the Confluence site ('Can use' global permission) to view global + * blueprints. */ async getBlueprintTemplates( parameters?: Parameters.GetBlueprintTemplates, @@ -137,8 +139,8 @@ export class Template { /** * Returns all content templates. Use this method to retrieve all global content templates or all content templates in a space. * - * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space to view - * space templates and 'Confluence Administrator' global permission to view global templates. + * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space to view + * space templates and permission to access the Confluence site ('Can use' global permission) to view global templates. */ async getContentTemplates( parameters: Parameters.GetContentTemplates | undefined, @@ -147,8 +149,8 @@ export class Template { /** * Returns all content templates. Use this method to retrieve all global content templates or all content templates in a space. * - * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space to view - * space templates and 'Confluence Administrator' global permission to view global templates. + * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space to view + * space templates and permission to access the Confluence site ('Can use' global permission) to view global templates. */ async getContentTemplates( parameters?: Parameters.GetContentTemplates, @@ -176,8 +178,8 @@ export class Template { * Returns a content template. This includes information about template, like the name, the space or blueprint that * the template is in, the body of the template, and more. * - * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space to view - * space templates and 'Confluence Administrator' global permission to view global templates. + * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space to view + * space templates and permission to access the Confluence site ('Can use' global permission) to view global templates. */ async getContentTemplate( parameters: Parameters.GetContentTemplate, @@ -187,8 +189,8 @@ export class Template { * Returns a content template. This includes information about template, like the name, the space or blueprint that * the template is in, the body of the template, and more. * - * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space to view - * space templates and 'Confluence Administrator' global permission to view global templates. + * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'View' permission for the space to view + * space templates and permission to access the Confluence site ('Can use' global permission) to view global templates. */ async getContentTemplate( parameters: Parameters.GetContentTemplate, @@ -215,6 +217,9 @@ export class Template { * - If the template is a modified global-level blueprint template, it reverts to the default global-level blueprint template. * * Note, unmodified blueprint templates cannot be deleted. + * + * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space to delete a + * space template or 'Confluence Administrator' global permission to delete a global template. */ async removeTemplate(parameters: Parameters.RemoveTemplate, callback: Callback): Promise; /** @@ -226,6 +231,9 @@ export class Template { * - If the template is a modified global-level blueprint template, it reverts to the default global-level blueprint template. * * Note, unmodified blueprint templates cannot be deleted. + * + * **[Permissions](https://confluence.atlassian.com/x/_AozKw) required**: 'Admin' permission for the space to delete a + * space template or 'Confluence Administrator' global permission to delete a global template. */ async removeTemplate(parameters: Parameters.RemoveTemplate, callback?: never): Promise; async removeTemplate(parameters: Parameters.RemoveTemplate, callback?: Callback): Promise { diff --git a/src/clients/baseClient.ts b/src/clients/baseClient.ts index ea1c7cec..e3aab117 100644 --- a/src/clients/baseClient.ts +++ b/src/clients/baseClient.ts @@ -101,8 +101,8 @@ export class BaseClient implements Client { bodyExists: !!requestConfig.data, callbackUsed: !!callback, headersExists: !!requestConfig.headers, - libVersion: '1.2.1', - libVersionHash: 'b8b1ecb4690e5543a2de14b38f2d0449', + libVersion: '1.2.2', + libVersionHash: 'bda9643ac6601722a28f238714274da4', methodName: telemetryData?.methodName || 'sendRequest', onErrorMiddlewareUsed: !!this.config.middlewares?.onError, onResponseMiddlewareUsed: !!this.config.middlewares?.onResponse, diff --git a/tsconfig.json b/tsconfig.json index 94273f00..e3623740 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,8 @@ "outDir": "out", "strict": true, "declaration": true, - "importHelpers": true + "importHelpers": true, + "forceConsistentCasingInFileNames": true }, "exclude": [ "node_modules",