diff --git a/.gitignore b/.gitignore index d933ff9d9..0be5a2cf0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .idea/ .vscode/ node_modules/ -out/ +dist/ docs/ coverage/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cb66ec3c..fc99ba339 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Jira.js changelog +### 5.0.0 + +todo +- createClient function was removed + ### 4.0.3 - **Bug Fix:** Fixed an issue with the `Users.createUser` method by adding the required `products` property. Thanks to [Appelberg-s](https://github.com/Appelberg-s) for the [fix](https://github.com/MrRefactoring/jira.js/commit/362918093c20036049db334743e2a0f5f41cbcd4#diff-6960050bc2a3d9ffad9eb5e307145969dc4a38eb5434eebf39da545fd18e01b7R12). @@ -276,7 +281,7 @@ Version 3: maxContentLength was increased for attachments upload. Thanks to [Rea - `excludeId` property added to `findGroups` method in `Groups`. - `orderBy`, `expand` and `queryString` properties added to `getAllIssueTypeSchemes` method in `IssueTypeSchemes`. - `queryString`, `orderBy` and `expand` properties added to `getIssueTypeScreenSchemes` method in `IssueTypeScreenSchemes`. - - `sanitiseJqlQueries` method added to `JQL`. + - `sanitiseJqlQueries` method added to `Jql`. - `excludeInactiveUsers` property added to `getProjectRole` method in `ProjectRoles`. - `queryString`, `scope` and `orderBy` properties added to `getScreens` method in `Screens`. - `expand`, `queryString` and `orderBy` properties added to `getScreenSchemes` method in `ScreenSchemes`. diff --git a/examples/src/addFixVersion.ts b/examples/src/addFixVersion.mts similarity index 100% rename from examples/src/addFixVersion.ts rename to examples/src/addFixVersion.mts diff --git a/examples/src/addWorklog.ts b/examples/src/addWorklog.mts similarity index 100% rename from examples/src/addWorklog.ts rename to examples/src/addWorklog.mts diff --git a/examples/src/basic.ts b/examples/src/basic.mts similarity index 100% rename from examples/src/basic.ts rename to examples/src/basic.mts diff --git a/examples/src/credentials.ts b/examples/src/credentials.mts similarity index 100% rename from examples/src/credentials.ts rename to examples/src/credentials.mts diff --git a/examples/src/getAllWorklogs.ts b/examples/src/getAllWorklogs.mts similarity index 100% rename from examples/src/getAllWorklogs.ts rename to examples/src/getAllWorklogs.mts diff --git a/examples/src/utils/addWorklog.ts b/examples/src/utils/addWorklog.mts similarity index 100% rename from examples/src/utils/addWorklog.ts rename to examples/src/utils/addWorklog.mts diff --git a/examples/src/utils/createIssue.ts b/examples/src/utils/createIssue.mts similarity index 100% rename from examples/src/utils/createIssue.ts rename to examples/src/utils/createIssue.mts diff --git a/examples/src/utils/index.ts b/examples/src/utils/index.mts similarity index 100% rename from examples/src/utils/index.ts rename to examples/src/utils/index.mts diff --git a/package-lock.json b/package-lock.json index cd7daa60f..bf9924b71 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,27 +1,113 @@ { "name": "jira.js", - "version": "4.0.3", + "version": "5.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "jira.js", - "version": "4.0.3", + "version": "5.0.0", "license": "MIT", "dependencies": { "axios": "^1.7.9", - "form-data": "^4.0.1", - "tslib": "^2.8.1" + "formdata-node": "^6.0.3" }, "devDependencies": { + "@rollup/plugin-alias": "^5.1.1", + "@rollup/plugin-commonjs": "^28.0.2", + "@rollup/plugin-node-resolve": "^16.0.0", + "@rollup/plugin-typescript": "^12.1.2", + "@types/node": "^18.19.69", "@types/sinon": "^17.0.3", "@typescript-eslint/eslint-plugin": "^8.19.0", "@typescript-eslint/parser": "^8.19.0", + "@vitest/coverage-v8": "^2.1.8", "dotenv": "^16.4.7", "eslint": "^8.57.1", "eslint-config-airbnb-base": "^15.0.0", + "eslint-import-resolver-typescript": "^3.7.0", + "eslint-plugin-import": "^2.31.0", + "prettier": "^3.4.2", + "prettier-plugin-jsdoc": "^1.3.0", + "rollup": "^4.29.1", + "sinon": "^18.0.1", + "typedoc": "^0.27.6", + "typescript": "^5.7.2", + "vite-tsconfig-paths": "^5.1.4", + "vitest": "^2.1.8" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" } }, + "node_modules/@babel/parser": { + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz", + "integrity": "sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.26.3" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz", + "integrity": "sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true, + "license": "MIT" + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", @@ -574,6 +660,98 @@ "dev": true, "license": "BSD-3-Clause" }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", @@ -581,17 +759,15 @@ "dev": true, "license": "MIT" }, - "node_modules/@napi-rs/wasm-runtime": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.5.tgz", - "integrity": "sha512-kwUxR7J9WLutBbulqg1dfOrMTwhMdXLdcGUhcbCcGwnPLt3gz19uHVdwH1syKVDbE022ZS2vZxOWflFLS0YTjw==", + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { - "@emnapi/core": "^1.1.0", - "@emnapi/runtime": "^1.1.0", - "@tybys/wasm-util": "^0.9.0" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@nodelib/fs.scandir": { @@ -642,167 +818,91 @@ "node": ">=12.4.0" } }, - "node_modules/@oxc-resolver/binding-darwin-arm64": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-arm64/-/binding-darwin-arm64-1.12.0.tgz", - "integrity": "sha512-wYe+dlF8npM7cwopOOxbdNjtmJp17e/xF5c0K2WooQXy5VOh74icydM33+Uh/SZDgwyum09/U1FVCX5GdeQk+A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@oxc-resolver/binding-darwin-x64": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-x64/-/binding-darwin-x64-1.12.0.tgz", - "integrity": "sha512-FZxxp99om+SlvBr1cjzF8A3TjYcS0BInCqjUlM+2f9m9bPTR2Bng9Zq5Q09ZQyrKJjfGKqlOEHs3akuVOnrx3Q==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@oxc-resolver/binding-freebsd-x64": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-freebsd-x64/-/binding-freebsd-x64-1.12.0.tgz", - "integrity": "sha512-BZi0iU6IEOnXGSkqt1OjTTkN9wfyaK6kTpQwL/axl8eCcNDc7wbv1vloHgILf7ozAY1TP75nsLYlASYI4B5kGA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@oxc-resolver/binding-linux-arm-gnueabihf": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.12.0.tgz", - "integrity": "sha512-L2qnMEnZAqxbG9b1J3di/w/THIm+1fMVfbbTMWIQNMMXdMeqqDN6ojnOLDtuP564rAh4TBFPdLyEfGhMz6ipNA==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@oxc-resolver/binding-linux-arm64-gnu": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.12.0.tgz", - "integrity": "sha512-otVbS4zeo3n71zgGLBYRTriDzc0zpruC0WI3ICwjpIk454cLwGV0yzh4jlGYWQJYJk0BRAmXFd3ooKIF+bKBHw==", - "cpu": [ - "arm64" - ], + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@oxc-resolver/binding-linux-arm64-musl": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.12.0.tgz", - "integrity": "sha512-IStQDjIT7Lzmqg1i9wXvPL/NsYsxF24WqaQFS8b8rxra+z0VG7saBOsEnOaa4jcEY8MVpLYabFhTV+fSsA2vnA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] + "engines": { + "node": ">=14" + } }, - "node_modules/@oxc-resolver/binding-linux-x64-gnu": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.12.0.tgz", - "integrity": "sha512-SipT7EVORz8pOQSFwemOm91TpSiBAGmOjG830/o+aLEsvQ4pEy223+SAnCfITh7+AahldYsJnVoIs519jmIlKQ==", - "cpu": [ - "x64" - ], + "node_modules/@rollup/plugin-alias": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-5.1.1.tgz", + "integrity": "sha512-PR9zDb+rOzkRb2VD+EuKB7UC41vU5DIwZ5qqCpk0KJudcWAyi8rvYOhS7+L5aZCspw1stTViLgN5v6FF1p5cgQ==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ] + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } }, - "node_modules/@oxc-resolver/binding-linux-x64-musl": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-musl/-/binding-linux-x64-musl-1.12.0.tgz", - "integrity": "sha512-mGh0XfUzKdn+WFaqPacziNraCWL5znkHRfQVxG9avGS9zb2KC/N1EBbPzFqutDwixGDP54r2gx4q54YCJEZ4iQ==", - "cpu": [ - "x64" - ], + "node_modules/@rollup/plugin-commonjs": { + "version": "28.0.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.2.tgz", + "integrity": "sha512-BEFI2EDqzl+vA1rl97IDRZ61AIwGH093d9nz8+dThxJNH8oSoB7MjWvPCX3dkaK1/RCJ/1v/R1XB15FuSs0fQw==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "linux" - ] + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "fdir": "^6.2.0", + "is-reference": "1.2.1", + "magic-string": "^0.30.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=16.0.0 || 14 >= 14.17" + }, + "peerDependencies": { + "rollup": "^2.68.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } }, - "node_modules/@oxc-resolver/binding-wasm32-wasi": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-wasm32-wasi/-/binding-wasm32-wasi-1.12.0.tgz", - "integrity": "sha512-SZN6v7apKmQf/Vwiqb6e/s3Y2Oacw8uW8V2i1AlxtyaEFvnFE0UBn89zq6swEwE3OCajNWs0yPvgAXUMddYc7Q==", - "cpu": [ - "wasm32" - ], + "node_modules/@rollup/plugin-node-resolve": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.0.tgz", + "integrity": "sha512-0FPvAeVUT/zdWoO0jnb/V5BlBsUSNfkIOtFHzMO4H9MOklrmQFY6FduVHKucNb/aTFxvnGhj4MNj/T1oNdDfNg==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { - "@napi-rs/wasm-runtime": "^0.2.4" + "@rollup/pluginutils": "^5.0.1", + "@types/resolve": "1.20.2", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.22.1" }, "engines": { "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.78.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } } }, - "node_modules/@oxc-resolver/binding-win32-arm64-msvc": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.12.0.tgz", - "integrity": "sha512-GRe4bqCfFsyghruEn5bv47s9w3EWBdO2q72xCz5kpQ0LWbw+enPHtTjw3qX5PUcFYpKykM55FaO0hFDs1yzatw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@oxc-resolver/binding-win32-x64-msvc": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.12.0.tgz", - "integrity": "sha512-Z3llHH0jfJP4mlWq3DT7bK6qV+/vYe0+xzCgfc67+Tc/U3eYndujl880bexeGdGNPh87JeYznpZAOJ44N7QVVQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, "node_modules/@rollup/plugin-typescript": { - "version": "11.1.6", - "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.6.tgz", - "integrity": "sha512-R92yOmIACgYdJ7dJ97p4K69I8gg6IEHt8M7dUBxN3W6nrO8uUxX5ixl0yU/N3aZTi8WhPuICvOHXQvF6FaykAA==", + "version": "12.1.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.2.tgz", + "integrity": "sha512-cdtSp154H5sv637uMr1a8OTWB0L1SWDSm1rDGiyfcGcvQ6cuTs4MDk2BVEBGysUWago4OJN4EQZqOTl/QY3Jgg==", "dev": true, "license": "MIT", "dependencies": { @@ -827,15 +927,15 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.2.tgz", - "integrity": "sha512-/FIdS3PyZ39bjZlwqFnWqCOVnW7o963LtKMwQOD0NhQqw22gSr2YY1afu3FxRip4ZCZNsD5jq6Aaz6QV3D/Njw==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz", + "integrity": "sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==", "dev": true, "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", - "picomatch": "^2.3.1" + "picomatch": "^4.0.2" }, "engines": { "node": ">=14.0.0" @@ -850,6 +950,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.29.1.tgz", + "integrity": "sha512-ssKhA8RNltTZLpG6/QNkCSge+7mBQGUqJRisZ2MDQcEGaK93QESEgWK2iOpIDZ7k9zPVkG5AS3ksvD5ZWxmItw==", "cpu": [ "arm" ], @@ -861,6 +964,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.29.1.tgz", + "integrity": "sha512-CaRfrV0cd+NIIcVVN/jx+hVLN+VRqnuzLRmfmlzpOzB87ajixsN/+9L5xNmkaUUvEbI5BmIKS+XTwXsHEb65Ew==", "cpu": [ "arm64" ], @@ -872,6 +978,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.29.1.tgz", + "integrity": "sha512-2ORr7T31Y0Mnk6qNuwtyNmy14MunTAMx06VAPI6/Ju52W10zk1i7i5U3vlDRWjhOI5quBcrvhkCHyF76bI7kEw==", "cpu": [ "arm64" ], @@ -883,6 +992,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.29.1.tgz", + "integrity": "sha512-j/Ej1oanzPjmN0tirRd5K2/nncAhS9W6ICzgxV+9Y5ZsP0hiGhHJXZ2JQ53iSSjj8m6cRY6oB1GMzNn2EUt6Ng==", "cpu": [ "x64" ], @@ -922,6 +1034,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.29.1.tgz", + "integrity": "sha512-Py5vFd5HWYN9zxBv3WMrLAXY3yYJ6Q/aVERoeUFwiDGiMOWsMs7FokXihSOaT/PMWUty/Pj60XDQndK3eAfE6A==", "cpu": [ "arm" ], @@ -933,6 +1048,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.29.1.tgz", + "integrity": "sha512-RiWpGgbayf7LUcuSNIbahr0ys2YnEERD4gYdISA06wa0i8RALrnzflh9Wxii7zQJEB2/Eh74dX4y/sHKLWp5uQ==", "cpu": [ "arm" ], @@ -944,6 +1062,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.29.1.tgz", + "integrity": "sha512-Z80O+taYxTQITWMjm/YqNoe9d10OX6kDh8X5/rFCMuPqsKsSyDilvfg+vd3iXIqtfmp+cnfL1UrYirkaF8SBZA==", "cpu": [ "arm64" ], @@ -955,6 +1076,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.29.1.tgz", + "integrity": "sha512-fOHRtF9gahwJk3QVp01a/GqS4hBEZCV1oKglVVq13kcK3NeVlS4BwIFzOHDbmKzt3i0OuHG4zfRP0YoG5OF/rA==", "cpu": [ "arm64" ], @@ -980,6 +1104,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.29.1.tgz", + "integrity": "sha512-9b4Mg5Yfz6mRnlSPIdROcfw1BU22FQxmfjlp/CShWwO3LilKQuMISMTtAu/bxmmrE6A902W2cZJuzx8+gJ8e9w==", "cpu": [ "ppc64" ], @@ -991,6 +1118,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.29.1.tgz", + "integrity": "sha512-G5pn0NChlbRM8OJWpJFMX4/i8OEU538uiSv0P6roZcbpe/WfhEO+AT8SHVKfp8qhDQzaz7Q+1/ixMy7hBRidnQ==", "cpu": [ "riscv64" ], @@ -1002,6 +1132,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.29.1.tgz", + "integrity": "sha512-WM9lIkNdkhVwiArmLxFXpWndFGuOka4oJOZh8EP3Vb8q5lzdSCBuhjavJsw68Q9AKDGeOOIHYzYm4ZFvmWez5g==", "cpu": [ "s390x" ], @@ -1013,6 +1146,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.29.1.tgz", + "integrity": "sha512-87xYCwb0cPGZFoGiErT1eDcssByaLX4fc0z2nRM6eMtV9njAfEE6OW3UniAoDhX4Iq5xQVpE6qO9aJbCFumKYQ==", "cpu": [ "x64" ], @@ -1024,6 +1160,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.29.1.tgz", + "integrity": "sha512-xufkSNppNOdVRCEC4WKvlR1FBDyqCSCpQeMMgv9ZyXqqtKBfkw1yfGMTUTs9Qsl6WQbJnsGboWCp7pJGkeMhKA==", "cpu": [ "x64" ], @@ -1035,414 +1174,132 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.29.1.tgz", + "integrity": "sha512-F2OiJ42m77lSkizZQLuC+jiZ2cgueWQL5YC9tjo3AgaEw+KJmVxHGSyQfDUoYR9cci0lAywv2Clmckzulcq6ig==", "cpu": [ "arm64" ], "dev": true, "license": "MIT", "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rtsao/scc": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", - "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", - "dev": true, - "license": "MIT" - }, - "@types/hast": "^3.0.4" - } - }, - "node_modules/@shikijs/vscode-textmate": { - "dev": true, - "license": "MIT" - }, - "node_modules/@sinonjs/commons": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", - "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "type-detect": "4.0.8" - } - }, - "node_modules/@sinonjs/fake-timers": { - "version": "13.0.2", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.2.tgz", - "integrity": "sha512-4Bb+oqXZTSTZ1q27Izly9lv8B9dlV61CROxPiVtywwzv5SnytJqhvYe6FclHYuXml4cd1VHPo1zd5PmTeJozvA==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.1" - } - }, - "node_modules/@sinonjs/samsam": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.2.tgz", - "integrity": "sha512-v46t/fwnhejRSFTGqbpn9u+LQ9xJDse10gNnPgAcxgdoCDMXj/G2asWAC/8Qs+BAZDicX+MNZouXT1A7c83kVw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.1", - "lodash.get": "^4.4.2", - "type-detect": "^4.1.0" - } - }, - "node_modules/@sinonjs/samsam/node_modules/type-detect": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", - "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/@sinonjs/text-encoding": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.3.tgz", - "integrity": "sha512-DE427ROAphMQzU4ENbliGYrBSYPXF+TtLg9S8vzeA+OF4ZKzoDdzfL8sxuMUGS/lgRhM6j1URSk9ghf7Xo1tyA==", - "dev": true, - "license": "(Unlicense OR Apache-2.0)" - }, - "node_modules/@swc-node/core": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/@swc-node/core/-/core-1.13.3.tgz", - "integrity": "sha512-OGsvXIid2Go21kiNqeTIn79jcaX4l0G93X2rAnas4LFoDyA9wAwVK7xZdm+QsKoMn5Mus2yFLCc4OtX2dD/PWA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - }, - "peerDependencies": { - "@swc/core": ">= 1.4.13", - "@swc/types": ">= 0.1" - } - }, - "node_modules/@swc-node/register": { - "version": "1.10.9", - "resolved": "https://registry.npmjs.org/@swc-node/register/-/register-1.10.9.tgz", - "integrity": "sha512-iXy2sjP0phPEpK2yivjRC3PAgoLaT4sjSk0LDWCTdcTBJmR4waEog0E6eJbvoOkLkOtWw37SB8vCkl/bbh4+8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@swc-node/core": "^1.13.3", - "@swc-node/sourcemap-support": "^0.5.1", - "colorette": "^2.0.20", - "debug": "^4.3.5", - "oxc-resolver": "^1.10.2", - "pirates": "^4.0.6", - "tslib": "^2.6.3" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - }, - "peerDependencies": { - "@swc/core": ">= 1.4.13", - "typescript": ">= 4.3" - } - }, - "node_modules/@swc-node/sourcemap-support": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@swc-node/sourcemap-support/-/sourcemap-support-0.5.1.tgz", - "integrity": "sha512-JxIvIo/Hrpv0JCHSyRpetAdQ6lB27oFYhv0PKCNf1g2gUXOjpeR1exrXccRxLMuAV5WAmGFBwRnNOJqN38+qtg==", - "dev": true, - "license": "MIT", - "dependencies": { - "source-map-support": "^0.5.21", - "tslib": "^2.6.3" - } - }, - "node_modules/@swc/core": { - "version": "1.7.36", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.7.36.tgz", - "integrity": "sha512-bu7ymMX+LCJOSSrKank25Jaq66ymLVA9fOUuy4ck3/6rbXdLw+pIJPnIDKQ9uNcxww8KDxOuJk9Ui9pqR+aGFw==", - "dev": true, - "hasInstallScript": true, - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@swc/counter": "^0.1.3", - "@swc/types": "^0.1.13" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/swc" - }, - "optionalDependencies": { - "@swc/core-darwin-arm64": "1.7.36", - "@swc/core-darwin-x64": "1.7.36", - "@swc/core-linux-arm-gnueabihf": "1.7.36", - "@swc/core-linux-arm64-gnu": "1.7.36", - "@swc/core-linux-arm64-musl": "1.7.36", - "@swc/core-linux-x64-gnu": "1.7.36", - "@swc/core-linux-x64-musl": "1.7.36", - "@swc/core-win32-arm64-msvc": "1.7.36", - "@swc/core-win32-ia32-msvc": "1.7.36", - "@swc/core-win32-x64-msvc": "1.7.36" - }, - "peerDependencies": { - "@swc/helpers": "*" - }, - "peerDependenciesMeta": { - "@swc/helpers": { - "optional": true - } - } - }, - "node_modules/@swc/core-darwin-arm64": { - "version": "1.7.36", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.7.36.tgz", - "integrity": "sha512-8vDczXzCgv3ceTPhEivlpGprN44YlrCK1nbfU9g2TrhV/Aiqi09W/eM5zLesdoM1Z3mJl492gc/8nlTkpDdusw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0 AND MIT", - "optional": true, - "os": [ - "darwin" - ], - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-darwin-x64": { - "version": "1.7.36", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.7.36.tgz", - "integrity": "sha512-Pa2Gao7+Wf5m3SsK4abKRtd48AtoUnJInvaC3d077swBfgZjbjUbQvcpdc2dOeQtWwo49rFqUZJonMsL0jnPgQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0 AND MIT", - "optional": true, - "os": [ - "darwin" - ], - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-linux-arm-gnueabihf": { - "version": "1.7.36", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.7.36.tgz", - "integrity": "sha512-3YsMWd7V+WZEjbfBnLkkz/olcRBa8nyoK0iIOnNARJBMcYaJxjkJSMZpmSojCnIVwvjA1N83CPAbUL+W+fCnHg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-linux-arm64-gnu": { - "version": "1.7.36", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.7.36.tgz", - "integrity": "sha512-lqM3aBB7kJazJYOwHeA5OGNLqXoQPZ/76b3dV+XcjN1GhD0CcXz6mW5PRYVin6OSN1eKrKBKJjtDA1mqADDEvw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0 AND MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-linux-arm64-musl": { - "version": "1.7.36", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.7.36.tgz", - "integrity": "sha512-bqei2YDzvUfG0pth5W2xJaj0eG4XWYk0d/NJ75vBX6bkIzK6dC8iuKQ41jOfUWonnrAs7rTDDJW0sTn/evvRdw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0 AND MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-linux-x64-gnu": { - "version": "1.7.36", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.7.36.tgz", - "integrity": "sha512-03maXTUyaBjeCxlDltmdzHje1ryQt1C4OWmmNgSSRXjLb+GNnAenwOJMSrcvHP/aNClD2pwsFCnYKDGy+sYE6w==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0 AND MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-linux-x64-musl": { - "version": "1.7.36", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.7.36.tgz", - "integrity": "sha512-XXysqLkvjtQnXm1zHqLhy00UYPv/gk5OtwR732X+piNisnEbcJBqI8Qp9O7YvLWllRcoP8IMBGDWLGdGLSpViA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0 AND MIT", - "optional": true, - "os": [ - "linux" - ], - "peer": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/@swc/core-win32-arm64-msvc": { - "version": "1.7.36", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.7.36.tgz", - "integrity": "sha512-k7+dmb13a/zPw+E4XYfPmLZFWJgcOcBRKIjYl9nQErtYsgsg3Ji6TBbsvJVETy23lNHyewZ17V5Vq6NzaG0hzg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0 AND MIT", - "optional": true, - "os": [ - "win32" - ], - "peer": true, - "engines": { - "node": ">=10" - } + "os": [ + "win32" + ] }, - "node_modules/@swc/core-win32-ia32-msvc": { - "version": "1.7.36", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.7.36.tgz", - "integrity": "sha512-ridD3ay6YM2PEYHZXXFN+edYEv0FOynaqOBP+NSnGNHA35azItIjoIe+KNi4WltGtAjpKCHSpjGCNfna12wdYQ==", + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.29.1.tgz", + "integrity": "sha512-rYRe5S0FcjlOBZQHgbTKNrqxCBUmgDJem/VQTCcTnA2KCabYSWQDrytOzX7avb79cAAweNmMUb/Zw18RNd4mng==", "cpu": [ "ia32" ], "dev": true, - "license": "Apache-2.0 AND MIT", + "license": "MIT", "optional": true, "os": [ "win32" - ], - "peer": true, - "engines": { - "node": ">=10" - } + ] }, - "node_modules/@swc/core-win32-x64-msvc": { - "version": "1.7.36", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.7.36.tgz", - "integrity": "sha512-j1z2Z1Ln9d0E3dHsPkC1K9XDh0ojhRPwV+GfRTu4D61PE+aYhYLvbJC6xPvL4/204QrStRS7eDu3m+BcDp3rgQ==", + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.29.1.tgz", + "integrity": "sha512-+10CMg9vt1MoHj6x1pxyjPSMjHTIlqs8/tBztXvPAx24SKs9jwVnKqHJumlH/IzhaPUaj3T6T6wfZr8okdXaIg==", "cpu": [ "x64" ], "dev": true, - "license": "Apache-2.0 AND MIT", + "license": "MIT", "optional": true, "os": [ "win32" - ], - "peer": true, - "engines": { - "node": ">=10" + ] + }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@shikijs/engine-oniguruma": { + "version": "1.24.4", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.24.4.tgz", + "integrity": "sha512-Do2ry6flp2HWdvpj2XOwwa0ljZBRy15HKZITzPcNIBOGSeprnA8gOooA/bLsSPuy8aJBa+Q/r34dMmC3KNL/zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "1.24.4", + "@shikijs/vscode-textmate": "^9.3.1" } }, - "node_modules/@swc/counter": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", - "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", + "node_modules/@shikijs/types": { + "version": "1.24.4", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.24.4.tgz", + "integrity": "sha512-0r0XU7Eaow0PuDxuWC1bVqmWCgm3XqizIaT7SM42K03vc69LGooT0U8ccSR44xP/hGlNx4FKhtYpV+BU6aaKAA==", "dev": true, - "license": "Apache-2.0", - "peer": true + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^9.3.1", + "@types/hast": "^3.0.4" + } + }, + "node_modules/@shikijs/vscode-textmate": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-9.3.1.tgz", + "integrity": "sha512-79QfK1393x9Ho60QFyLti+QfdJzRQCVLFb97kOIV7Eo9vQU/roINgk7m24uv0a7AUvN//RDH36FLjjK48v0s9g==", + "dev": true, + "license": "MIT" }, - "node_modules/@swc/helpers": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.13.tgz", - "integrity": "sha512-UoKGxQ3r5kYI9dALKJapMmuK+1zWM/H17Z1+iwnNmzcJRnfFuevZs375TA5rW31pu4BS4NoSy1fRsexDXfWn5w==", + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, - "license": "Apache-2.0", + "license": "BSD-3-Clause", "dependencies": { - "tslib": "^2.4.0" + "type-detect": "4.0.8" } }, - "node_modules/@swc/types": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.13.tgz", - "integrity": "sha512-JL7eeCk6zWCbiYQg2xQSdLXQJl8Qoc9rXmG2cEKvHe3CKwMHwHGpfOb8frzNLmbycOo6I51qxnLnn9ESf4I20Q==", + "node_modules/@sinonjs/fake-timers": { + "version": "11.2.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz", + "integrity": "sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==", "dev": true, - "license": "Apache-2.0", - "peer": true, + "license": "BSD-3-Clause", "dependencies": { - "@swc/counter": "^0.1.3" + "@sinonjs/commons": "^3.0.0" } }, - "node_modules/@tybys/wasm-util": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.9.0.tgz", - "integrity": "sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==", + "node_modules/@sinonjs/samsam": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.2.tgz", + "integrity": "sha512-v46t/fwnhejRSFTGqbpn9u+LQ9xJDse10gNnPgAcxgdoCDMXj/G2asWAC/8Qs+BAZDicX+MNZouXT1A7c83kVw==", "dev": true, - "license": "MIT", - "optional": true, + "license": "BSD-3-Clause", "dependencies": { - "tslib": "^2.4.0" + "@sinonjs/commons": "^3.0.1", + "lodash.get": "^4.4.2", + "type-detect": "^4.1.0" + } + }, + "node_modules/@sinonjs/samsam/node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" } }, + "node_modules/@sinonjs/text-encoding": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.3.tgz", + "integrity": "sha512-DE427ROAphMQzU4ENbliGYrBSYPXF+TtLg9S8vzeA+OF4ZKzoDdzfL8sxuMUGS/lgRhM6j1URSk9ghf7Xo1tyA==", + "dev": true, + "license": "(Unlicense OR Apache-2.0)" + }, "node_modules/@types/debug": { "version": "4.1.12", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", @@ -1495,12 +1352,22 @@ "license": "MIT" }, "node_modules/@types/node": { + "version": "18.19.69", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.69.tgz", + "integrity": "sha512-ECPdY1nlaiO/Y6GUnwgtAAhLNaQ53AyIVz+eILxpEo5OvuqE6yWkqWBIb5dU0DqhKQtMeny+FBD3PK6lm7L5xQ==", "dev": true, "license": "MIT", "dependencies": { "undici-types": "~5.26.4" } }, + "node_modules/@types/resolve": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", + "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/sinon": { "version": "17.0.3", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.3.tgz", @@ -1526,10 +1393,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.19.0.tgz", + "integrity": "sha512-NggSaEZCdSrFddbctrVjkVZvFC6KGfKfNK0CU7mNK/iKHGKbzT4Wmgm08dKpcZECBu9f5FypndoMyRHkdqfT1Q==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.19.0", + "@typescript-eslint/type-utils": "8.19.0", + "@typescript-eslint/utils": "8.19.0", + "@typescript-eslint/visitor-keys": "8.19.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1549,9 +1423,16 @@ } }, "node_modules/@typescript-eslint/parser": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.19.0.tgz", + "integrity": "sha512-6M8taKyOETY1TKHp0x8ndycipTVgmp4xtg5QpEZzXxDhNvvHOJi5rLRkLr8SK3jTgD5l4fTlvBiRdfsuWydxBw==", "dev": true, "license": "MIT", "dependencies": { + "@typescript-eslint/scope-manager": "8.19.0", + "@typescript-eslint/types": "8.19.0", + "@typescript-eslint/typescript-estree": "8.19.0", + "@typescript-eslint/visitor-keys": "8.19.0", "debug": "^4.3.4" }, "engines": { @@ -1567,6 +1448,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.19.0.tgz", + "integrity": "sha512-hkoJiKQS3GQ13TSMEiuNmSCvhz7ujyqD1x3ShbaETATHrck+9RaDdUbt+osXaUuns9OFwrDTTrjtwsU8gJyyRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.19.0", + "@typescript-eslint/visitor-keys": "8.19.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1577,6 +1466,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.19.0.tgz", + "integrity": "sha512-TZs0I0OSbd5Aza4qAMpp1cdCYVnER94IziudE3JU328YUHgWu9gwiwhag+fuLeJ2LkWLXI+F/182TbG+JaBdTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "8.19.0", + "@typescript-eslint/utils": "8.19.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1593,6 +1490,9 @@ } }, "node_modules/@typescript-eslint/types": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.19.0.tgz", + "integrity": "sha512-8XQ4Ss7G9WX8oaYvD4OOLCjIQYgRQxO+qCiR2V2s2GxI9AUpo7riNwo6jDhKtTcaJjT8PY54j2Yb33kWtSJsmA==", "dev": true, "license": "MIT", "engines": { @@ -1604,9 +1504,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.19.0.tgz", + "integrity": "sha512-WW9PpDaLIFW9LCbucMSdYUuGeFUz1OkWYS/5fwZwTA+l2RwlWFdJvReQqMUMBw4yJWJOfqd7An9uwut2Oj8sLw==", "dev": true, "license": "MIT", "dependencies": { + "@typescript-eslint/types": "8.19.0", + "@typescript-eslint/visitor-keys": "8.19.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1626,10 +1531,16 @@ } }, "node_modules/@typescript-eslint/utils": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.19.0.tgz", + "integrity": "sha512-PTBG+0oEMPH9jCZlfg07LCB2nYI0I317yyvXGfxnvGvw4SHIOuRnQ3kadyyXY6tGdChusIHIbM5zfIbp4M6tCg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.19.0", + "@typescript-eslint/types": "8.19.0", + "@typescript-eslint/typescript-estree": "8.19.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1644,6 +1555,14 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.19.0.tgz", + "integrity": "sha512-mCFtBbFBJDCNCWUl5y6sZSCHXw1DEFEk3c/M3nRK2a4XUB8StGFtmcEMizdjKuBzB6e/smJAAWYug3VrdLMr1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.19.0", + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1673,7 +1592,49 @@ "dev": true, "license": "ISC" }, + "node_modules/@vitest/coverage-v8": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.1.8.tgz", + "integrity": "sha512-2Y7BPlKH18mAZYAW1tYByudlCYrQyl5RGvnnDYJKW5tCiO5qg3KSAy3XAxcxKz900a0ZXxWtKrMuZLe3lKBpJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.3.0", + "@bcoe/v8-coverage": "^0.2.3", + "debug": "^4.3.7", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-lib-source-maps": "^5.0.6", + "istanbul-reports": "^3.1.7", + "magic-string": "^0.30.12", + "magicast": "^0.3.5", + "std-env": "^3.8.0", + "test-exclude": "^7.0.1", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@vitest/browser": "2.1.8", + "vitest": "2.1.8" + }, + "peerDependenciesMeta": { + "@vitest/browser": { + "optional": true + } + } + }, "node_modules/@vitest/expect": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.8.tgz", + "integrity": "sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", + "chai": "^5.1.2", "tinyrainbow": "^1.2.0" }, "funding": { @@ -1681,6 +1642,13 @@ } }, "node_modules/@vitest/mocker": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.8.tgz", + "integrity": "sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.8", "estree-walker": "^3.0.3", "magic-string": "^0.30.12" }, @@ -1688,6 +1656,7 @@ "url": "https://opencollective.com/vitest" }, "peerDependencies": { + "msw": "^2.4.9", "vite": "^5.0.0" }, "peerDependenciesMeta": { @@ -1710,6 +1679,9 @@ } }, "node_modules/@vitest/pretty-format": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.8.tgz", + "integrity": "sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1720,6 +1692,13 @@ } }, "node_modules/@vitest/runner": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.8.tgz", + "integrity": "sha512-17ub8vQstRnRlIU5k50bG+QOMLHRhYPAna5tw8tYbj+jzjcspnwnwtPtiOlkuKC4+ixDPTuLZiqiWWQ2PSXHVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "2.1.8", "pathe": "^1.1.2" }, "funding": { @@ -1727,6 +1706,14 @@ } }, "node_modules/@vitest/snapshot": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.8.tgz", + "integrity": "sha512-20T7xRFbmnkfcmgVEz+z3AU/3b0cEzZOt/zmnvZEctg64/QZbSDJEVm9fLnnlSi74KibmRsO9/Qabi+t0vCRPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.8", + "magic-string": "^0.30.12", "pathe": "^1.1.2" }, "funding": { @@ -1734,6 +1721,9 @@ } }, "node_modules/@vitest/spy": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.8.tgz", + "integrity": "sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg==", "dev": true, "license": "MIT", "dependencies": { @@ -1744,6 +1734,14 @@ } }, "node_modules/@vitest/utils": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.8.tgz", + "integrity": "sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.8", + "loupe": "^3.1.2", "tinyrainbow": "^1.2.0" }, "funding": { @@ -1751,6 +1749,9 @@ } }, "node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, "license": "MIT", "bin": { @@ -2019,13 +2020,6 @@ "node": ">=8" } }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "license": "MIT" - }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -2171,13 +2165,6 @@ "dev": true, "license": "MIT" }, - "node_modules/colorette": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true, - "license": "MIT" - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -2200,6 +2187,13 @@ "node": ">= 12.0.0" } }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true, + "license": "MIT" + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2332,6 +2326,16 @@ "dev": true, "license": "MIT" }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", @@ -2402,9 +2406,9 @@ } }, "node_modules/diff": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", - "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -2452,6 +2456,20 @@ "node": ">= 0.4" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, "node_modules/enhanced-resolve": { "version": "5.18.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.0.tgz", @@ -2765,19 +2783,6 @@ "semver": "bin/semver.js" } }, - "node_modules/eslint-config-prettier": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", - "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", - "dev": true, - "license": "MIT", - "bin": { - "eslint-config-prettier": "bin/cli.js" - }, - "peerDependencies": { - "eslint": ">=7.0.0" - } - }, "node_modules/eslint-import-resolver-node": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", @@ -3151,6 +3156,21 @@ "reusify": "^1.0.4" } }, + "node_modules/fdir": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz", + "integrity": "sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -3246,6 +3266,23 @@ "is-callable": "^1.1.3" } }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/form-data": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", @@ -3608,6 +3645,13 @@ "node": ">= 0.4" } }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -3846,6 +3890,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-generator-function": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", @@ -3888,6 +3942,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", + "dev": true, + "license": "MIT" + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -3925,6 +3986,16 @@ "node": ">=8" } }, + "node_modules/is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, "node_modules/is-regex": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", @@ -4084,6 +4155,76 @@ "dev": true, "license": "ISC" }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", + "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.23", + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -4209,6 +4350,13 @@ "dev": true, "license": "MIT" }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, "node_modules/lunr": { "version": "2.3.9", "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", @@ -4216,11 +4364,42 @@ "dev": true, "license": "MIT" }, - "node_modules/magic-string": { + "node_modules/magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/magicast": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.5.tgz", + "integrity": "sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.25.4", + "@babel/types": "^7.25.4", + "source-map-js": "^1.2.0" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, "license": "MIT", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/markdown-it": { @@ -4784,6 +4963,19 @@ "node": ">=8.6" } }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -4831,6 +5023,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -4878,6 +5080,16 @@ "path-to-regexp": "^8.1.0" } }, + "node_modules/nise/node_modules/@sinonjs/fake-timers": { + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", + "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1" + } + }, "node_modules/object-inspect": { "version": "1.13.3", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", @@ -5018,6 +5230,22 @@ "node": ">= 0.8.0" } }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/p-limit": { @@ -5052,6 +5280,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -5102,6 +5337,23 @@ "dev": true, "license": "MIT" }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/path-to-regexp": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", @@ -5137,28 +5389,18 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "dev": true, "license": "MIT", "engines": { - "node": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pirates": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", - "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, "node_modules/possible-typed-array-names": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", @@ -5289,10 +5531,39 @@ ], "license": "MIT" }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.9.tgz", + "integrity": "sha512-r0Ay04Snci87djAsI4U+WNRcSw5S4pOH7qFjd/veA5gC7TbqESR3tcj28ia95L/fYUDw11JKP7uqUKUAfVvV5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", "define-properties": "^1.2.1", "dunder-proto": "^1.0.1", "es-abstract": "^1.23.6", "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "gopd": "^1.2.0", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz", + "integrity": "sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", "set-function-name": "^2.0.2" }, "engines": { @@ -5372,6 +5643,9 @@ } }, "node_modules/rollup": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.29.1.tgz", + "integrity": "sha512-RaJ45M/kmJUzSWDs1Nnd5DdV4eerC98idtUOVr6FfKcgxqvjwHmxc5upLF9qZU9EpsVzzhleFahrT3shLuJzIw==", "dev": true, "license": "MIT", "dependencies": { @@ -5385,6 +5659,25 @@ "npm": ">=8.0.0" }, "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.29.1", + "@rollup/rollup-android-arm64": "4.29.1", + "@rollup/rollup-darwin-arm64": "4.29.1", + "@rollup/rollup-darwin-x64": "4.29.1", + "@rollup/rollup-freebsd-arm64": "4.29.1", + "@rollup/rollup-freebsd-x64": "4.29.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.29.1", + "@rollup/rollup-linux-arm-musleabihf": "4.29.1", + "@rollup/rollup-linux-arm64-gnu": "4.29.1", + "@rollup/rollup-linux-arm64-musl": "4.29.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.29.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.29.1", + "@rollup/rollup-linux-riscv64-gnu": "4.29.1", + "@rollup/rollup-linux-s390x-gnu": "4.29.1", + "@rollup/rollup-linux-x64-gnu": "4.29.1", + "@rollup/rollup-linux-x64-musl": "4.29.1", + "@rollup/rollup-win32-arm64-msvc": "4.29.1", + "@rollup/rollup-win32-ia32-msvc": "4.29.1", + "@rollup/rollup-win32-x64-msvc": "4.29.1", "fsevents": "~2.3.2" } }, @@ -5537,6 +5830,24 @@ "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/side-channel-list": { @@ -5602,35 +5913,38 @@ "dev": true, "license": "ISC" }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/sinon": { - "version": "19.0.2", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-19.0.2.tgz", - "integrity": "sha512-euuToqM+PjO4UgXeLETsfQiuoyPXlqFezr6YZDFwHR3t4qaX0fZUe1MfPMznTL5f8BWrVS89KduLdMUsxFCO6g==", + "version": "18.0.1", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-18.0.1.tgz", + "integrity": "sha512-a2N2TDY1uGviajJ6r4D1CyRAkzE9NNVlYOV1wX5xQDuAk0ONgzgRl0EjCQuRCPxOwp13ghsMwt9Gdldujs39qw==", "dev": true, "license": "BSD-3-Clause", "dependencies": { "@sinonjs/commons": "^3.0.1", - "@sinonjs/fake-timers": "^13.0.2", - "@sinonjs/samsam": "^8.0.1", - "diff": "^7.0.0", - "nise": "^6.1.1", - "supports-color": "^7.2.0" + "@sinonjs/fake-timers": "11.2.2", + "@sinonjs/samsam": "^8.0.0", + "diff": "^5.2.0", + "nise": "^6.0.0", + "supports-color": "^7" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/sinon" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", @@ -5641,6 +5955,10 @@ "node": ">=0.10.0" } }, + "node_modules/stable-hash": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.4.tgz", + "integrity": "sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==", "dev": true, "license": "MIT" }, @@ -5658,6 +5976,76 @@ "dev": true, "license": "MIT" }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/string.prototype.trim": { "version": "1.2.10", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", @@ -5730,6 +6118,20 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -5789,6 +6191,42 @@ "node": ">=6" } }, + "node_modules/test-exclude": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz", + "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^10.4.1", + "minimatch": "^9.0.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -5804,6 +6242,9 @@ "license": "MIT" }, "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", "dev": true, "license": "MIT" }, @@ -5898,7 +6339,13 @@ } }, "node_modules/tslib": { - "license": "0BSD" + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true, + "peer": true }, "node_modules/type-check": { "version": "0.4.0", @@ -6015,6 +6462,9 @@ } }, "node_modules/typedoc": { + "version": "0.27.6", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.6.tgz", + "integrity": "sha512-oBFRoh2Px6jFx366db0lLlihcalq/JzyCVp7Vaq1yphL/tbgx2e+bkpkCgJPunaPvPwoTOXSwasfklWHm7GfAw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -6035,6 +6485,9 @@ } }, "node_modules/typescript": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, "license": "Apache-2.0", "bin": { @@ -6103,6 +6556,9 @@ } }, "node_modules/vite": { + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", "dev": true, "license": "MIT", "dependencies": { @@ -6160,6 +6616,9 @@ } }, "node_modules/vite-node": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.8.tgz", + "integrity": "sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==", "dev": true, "license": "MIT", "dependencies": { @@ -6200,6 +6659,23 @@ } }, "node_modules/vitest": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.8.tgz", + "integrity": "sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "2.1.8", + "@vitest/mocker": "2.1.8", + "@vitest/pretty-format": "^2.1.8", + "@vitest/runner": "2.1.8", + "@vitest/snapshot": "2.1.8", + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", + "chai": "^5.1.2", + "debug": "^4.3.7", + "expect-type": "^1.1.0", + "magic-string": "^0.30.12", "pathe": "^1.1.2", "std-env": "^3.8.0", "tinybench": "^2.9.0", @@ -6207,6 +6683,7 @@ "tinypool": "^1.0.1", "tinyrainbow": "^1.2.0", "vite": "^5.0.0", + "vite-node": "2.1.8", "why-is-node-running": "^2.3.0" }, "bin": { @@ -6221,6 +6698,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "2.1.8", + "@vitest/ui": "2.1.8", "happy-dom": "*", "jsdom": "*" }, @@ -6376,6 +6855,107 @@ "node": ">=0.10.0" } }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -6384,6 +6964,9 @@ "license": "ISC" }, "node_modules/yaml": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", "dev": true, "license": "ISC", "bin": { diff --git a/package.json b/package.json index 2ddff0a33..b47182203 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,14 @@ { "name": "jira.js", - "version": "4.0.3", + "version": "5.0.0", "description": "A comprehensive JavaScript/TypeScript library designed for both Node.JS and browsers, facilitating seamless interaction with the Atlassian Jira API.", - "main": "out/index.cjs", - "types": "out/index.d.ts", - "module": "out/index.mjs", + "main": "dist/index.cjs.js", + "types": "dist/index.d.ts", + "module": "dist/index.esm.js", "repository": "https://github.com/MrRefactoring/jira.js.git", "author": "Vladislav Tupikin ", "license": "MIT", + "type": "module", "keywords": [ "jira", "javascript", @@ -19,8 +20,14 @@ "client", "library" ], + "exports": { + ".": { + "require": "./dist/index.cjs.js", + "import": "./dist/index.esm.js" + } + }, "scripts": { - "build": "rollup --config rollup.config.ts --configPlugin typescript", + "build": "rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript", "prettier": "prettier --write src", "lint": "npm run lint:tests && npm run lint:examples && npm run lint:src:agile && npm run lint:src:clients && npm run lint:src:services && npm run lint:src:version2 && npm run lint:src:version3 && npm run lint:src:files", "lint:tests": "npm run lint:base -- tests", @@ -37,7 +44,8 @@ "doc": "typedoc --name \"Jira.js - Jira Cloud API library\" --out docs ./src/index.ts --favicon ./assets/favicon.svg", "test": "npm run test:unit && npm run test:integration", "test:unit": "vitest run tests/unit --maxWorkers=8 --sequence.concurrent", - "test:integration": "vitest run tests/integration --bail=1 --no-file-parallelism --max-concurrency 1 -c vitest.config.mts --hookTimeout 100000 --testTimeout 100000", + "test:unit:coverage": "npm run test:unit -- --coverage", + "test:integration": "vitest run tests/integration --bail=1 --no-file-parallelism --max-concurrency 1 -c vitest.config.mjs --hookTimeout 100000 --testTimeout 100000", "replace:all": "npm run replace:permissions:version2 && npm run replace:permissions:version3 && npm run replace:pagination:version2 && npm run replace:pagination:version3 && npm run replace:async:version2 && npm run replace:async:version3 && npm run replace:expansion:version2 && npm run replace:expansion:version3 && npm run replace:ordering:version2 && npm run replace:ordering:version3 && npm run replace:groupMember:version2 && npm run replace:workflowPaginated:version2", "replace:permissions:version2": "grep -rl \"(#permissions)\" ./src/version2 | xargs sed -i '' 's/(#permissions)/(https:\\/\\/developer.atlassian.com\\/cloud\\/jira\\/platform\\/rest\\/v2\\/intro\\/#permissions)/g'", "replace:permissions:version3": "grep -rl \"(#permissions)\" ./src/version3 | xargs sed -i '' 's/(#permissions)/(https:\\/\\/developer.atlassian.com\\/cloud\\/jira\\/platform\\/rest\\/v3\\/intro\\/#permissions)/g'", @@ -54,17 +62,31 @@ "code:formatting": "npm run replace:all && npm run prettier && npm run lint:fix" }, "devDependencies": { + "@rollup/plugin-alias": "^5.1.1", + "@rollup/plugin-commonjs": "^28.0.2", + "@rollup/plugin-node-resolve": "^16.0.0", + "@rollup/plugin-typescript": "^12.1.2", + "@types/node": "^18.19.69", "@types/sinon": "^17.0.3", "@typescript-eslint/eslint-plugin": "^8.19.0", "@typescript-eslint/parser": "^8.19.0", + "@vitest/coverage-v8": "^2.1.8", "dotenv": "^16.4.7", "eslint": "^8.57.1", "eslint-config-airbnb-base": "^15.0.0", + "eslint-import-resolver-typescript": "^3.7.0", + "eslint-plugin-import": "^2.31.0", + "prettier": "^3.4.2", + "prettier-plugin-jsdoc": "^1.3.0", + "rollup": "^4.29.1", + "sinon": "^18.0.1", + "typedoc": "^0.27.6", + "typescript": "^5.7.2", + "vite-tsconfig-paths": "^5.1.4", + "vitest": "^2.1.8" }, "dependencies": { - "axios": "^1.7.7", - "formdata-node": "^6.0.3", - "tslib": "^2.7.0" - }, - "type": "module" + "axios": "^1.7.9", + "formdata-node": "^6.0.3" + } } diff --git a/rollup.config.ts b/rollup.config.ts index 128d858d5..d605747ac 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -1,24 +1,37 @@ -/* eslint-disable import/no-extraneous-dependencies */ +import alias from '@rollup/plugin-alias'; +import resolve from '@rollup/plugin-node-resolve'; +import commonjs from '@rollup/plugin-commonjs'; import typescript from '@rollup/plugin-typescript'; import { defineConfig } from 'rollup'; +import { dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; -const config = defineConfig([ - { - input: 'src/index.ts', - output: [ - { - file: './out/index.cjs', - format: 'cjs', - sourcemap: true, - }, - { - file: './out/index.mjs', - format: 'es', - sourcemap: true, - }, - ], - plugins: [typescript()], - }, -]); +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); -export default config; +export default defineConfig({ + input: 'src/index.mts', + output: [ + { file: 'dist/index.cjs.js', format: 'cjs', sourcemap: true }, + { file: 'dist/index.esm.js', format: 'esm', sourcemap: true }, + ], + plugins: [ + alias({ + entries: [ + { find: '@', replacement: join(__dirname, 'src') }, + ], + }), + resolve({ + preferBuiltins: true, + }), + commonjs(), + typescript({ + tsconfig: './tsconfig.json', + }), + ], + external: [ + 'axios', + 'tslib', + 'form-data' + ], // todo +}); diff --git a/src/agile/backlog.mts b/src/agile/backlog.mts new file mode 100644 index 000000000..47728b788 --- /dev/null +++ b/src/agile/backlog.mts @@ -0,0 +1,73 @@ +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '@/clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Backlog { + constructor(private client: Client) {} + + /** + * Move issues to the backlog.\ + * This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may + * be moved at once. + */ + async moveIssuesToBacklog(parameters: Parameters.MoveIssuesToBacklog, callback: Callback): Promise; + /** + * Move issues to the backlog.\ + * This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may + * be moved at once. + */ + async moveIssuesToBacklog(parameters: Parameters.MoveIssuesToBacklog, callback?: never): Promise; + async moveIssuesToBacklog( + parameters: Parameters.MoveIssuesToBacklog, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/agile/1.0/backlog/issue', + method: 'POST', + data: { + issues: parameters.issues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Move issues to the backlog of a particular board (if they are already on that board).\ + * This operation is equivalent to remove future and active sprints from a given set of issues if the board has + * sprints If the board does not have sprints this will put the issues back into the backlog from the board. At most + * 50 issues may be moved at once. + */ + async moveIssuesToBacklogForBoard( + parameters: Parameters.MoveIssuesToBacklogForBoard, + callback: Callback, + ): Promise; + /** + * Move issues to the backlog of a particular board (if they are already on that board).\ + * This operation is equivalent to remove future and active sprints from a given set of issues if the board has + * sprints If the board does not have sprints this will put the issues back into the backlog from the board. At most + * 50 issues may be moved at once. + */ + async moveIssuesToBacklogForBoard( + parameters: Parameters.MoveIssuesToBacklogForBoard, + callback?: never, + ): Promise; + async moveIssuesToBacklogForBoard( + parameters: Parameters.MoveIssuesToBacklogForBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/backlog/${parameters.boardId}/issue`, + method: 'POST', + data: { + issues: parameters.issues, + rankAfterIssue: parameters.rankAfterIssue, + rankBeforeIssue: parameters.rankBeforeIssue, + rankCustomFieldId: parameters.rankCustomFieldId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/backlog.ts b/src/agile/backlog.ts deleted file mode 100644 index b96b694ea..000000000 --- a/src/agile/backlog.ts +++ /dev/null @@ -1,73 +0,0 @@ -import * as Parameters from './parameters/index.js'; -import type { Client } from '../clients/index.js'; -import type { Callback } from '../callback.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Backlog { - constructor(private client: Client) {} - - /** - * Move issues to the backlog.\ - * This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may - * be moved at once. - */ - async moveIssuesToBacklog(parameters: Parameters.MoveIssuesToBacklog, callback: Callback): Promise; - /** - * Move issues to the backlog.\ - * This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may - * be moved at once. - */ - async moveIssuesToBacklog(parameters: Parameters.MoveIssuesToBacklog, callback?: never): Promise; - async moveIssuesToBacklog( - parameters: Parameters.MoveIssuesToBacklog, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/agile/1.0/backlog/issue', - method: 'POST', - data: { - issues: parameters.issues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Move issues to the backlog of a particular board (if they are already on that board).\ - * This operation is equivalent to remove future and active sprints from a given set of issues if the board has - * sprints If the board does not have sprints this will put the issues back into the backlog from the board. At most - * 50 issues may be moved at once. - */ - async moveIssuesToBacklogForBoard( - parameters: Parameters.MoveIssuesToBacklogForBoard, - callback: Callback, - ): Promise; - /** - * Move issues to the backlog of a particular board (if they are already on that board).\ - * This operation is equivalent to remove future and active sprints from a given set of issues if the board has - * sprints If the board does not have sprints this will put the issues back into the backlog from the board. At most - * 50 issues may be moved at once. - */ - async moveIssuesToBacklogForBoard( - parameters: Parameters.MoveIssuesToBacklogForBoard, - callback?: never, - ): Promise; - async moveIssuesToBacklogForBoard( - parameters: Parameters.MoveIssuesToBacklogForBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/backlog/${parameters.boardId}/issue`, - method: 'POST', - data: { - issues: parameters.issues, - rankAfterIssue: parameters.rankAfterIssue, - rankBeforeIssue: parameters.rankBeforeIssue, - rankCustomFieldId: parameters.rankCustomFieldId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/board.mts b/src/agile/board.mts new file mode 100644 index 000000000..edf5f0450 --- /dev/null +++ b/src/agile/board.mts @@ -0,0 +1,872 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Paginated } from '@/paginated.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Board { + constructor(private client: Client) {} + + /** + * Returns all boards. This only includes boards that the user has permission to view. + * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on February 15, 2024. + * + * - `read:board-scope:jira-software`, `read:project:jira` + */ + async getAllBoards( + parameters: Parameters.GetAllBoards | undefined, + callback: Callback, + ): Promise; + /** + * Returns all boards. This only includes boards that the user has permission to view. + * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on February 15, 2024. + * + * - `read:board-scope:jira-software`, `read:project:jira` + */ + async getAllBoards(parameters?: Parameters.GetAllBoards, callback?: never): Promise; + async getAllBoards( + parameters?: Parameters.GetAllBoards, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/agile/1.0/board', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + type: parameters?.type, + name: parameters?.name, + projectKeyOrId: parameters?.projectKeyOrId, + accountIdLocation: parameters?.accountIdLocation, + projectLocation: parameters?.projectLocation, + includePrivate: parameters?.includePrivate, + negateLocationFiltering: parameters?.negateLocationFiltering, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + projectTypeLocation: parameters?.projectTypeLocation, + filterId: parameters?.filterId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a new board. Board name, type and filter ID is required. + * + * - `name` - Must be less than 255 characters. + * - `type` - Valid values: scrum, kanban + * - `filterId` - ID of a filter that the user has permissions to view. Note, if the user does not have the 'Create + * shared objects' permission and tries to create a shared board, a private board will be created instead (remember + * that board sharing depends on the filter sharing). + * - `location` - The container that the board will be located in. `location` must include the `type` property (Valid + * values: project, user). If choosing 'project', then a project must be specified by a `projectKeyOrId` property in + * `location`. If choosing 'user', the current user is chosen by default. The `projectKeyOrId` property should not + * be provided. + * + * Note: + * + * - If you want to create a new project with an associated board, use the [Jira platform REST + * API](https://docs.atlassian.com/jira/REST/latest). For more information, see the [Create + * project](#api-rest-api-3-project-post) method. The `projectTypeKey` for software boards must be 'software' and + * the `projectTemplateKey` must be either `com.pyxis.greenhopper.jira:gh-kanban-template` or + * `com.pyxis.greenhopper.jira:gh-scrum-template`. + * - You can create a filter using the [Jira REST API](https://docs.atlassian.com/jira/REST/latest). For more + * information, see the [Create filter](#api-rest-api-3-filter-post) method. + * - If you do not ORDER BY the Rank field for the filter of your board, you will not be able to reorder issues on the + * board. + */ + async createBoard(parameters: Parameters.CreateBoard, callback: Callback): Promise; + /** + * Creates a new board. Board name, type and filter ID is required. + * + * - `name` - Must be less than 255 characters. + * - `type` - Valid values: scrum, kanban + * - `filterId` - ID of a filter that the user has permissions to view. Note, if the user does not have the 'Create + * shared objects' permission and tries to create a shared board, a private board will be created instead (remember + * that board sharing depends on the filter sharing). + * - `location` - The container that the board will be located in. `location` must include the `type` property (Valid + * values: project, user). If choosing 'project', then a project must be specified by a `projectKeyOrId` property in + * `location`. If choosing 'user', the current user is chosen by default. The `projectKeyOrId` property should not + * be provided. + * + * Note: + * + * - If you want to create a new project with an associated board, use the [Jira platform REST + * API](https://docs.atlassian.com/jira/REST/latest). For more information, see the [Create + * project](#api-rest-api-3-project-post) method. The `projectTypeKey` for software boards must be 'software' and + * the `projectTemplateKey` must be either `com.pyxis.greenhopper.jira:gh-kanban-template` or + * `com.pyxis.greenhopper.jira:gh-scrum-template`. + * - You can create a filter using the [Jira REST API](https://docs.atlassian.com/jira/REST/latest). For more + * information, see the [Create filter](#api-rest-api-3-filter-post) method. + * - If you do not ORDER BY the Rank field for the filter of your board, you will not be able to reorder issues on the + * board. + */ + async createBoard(parameters: Parameters.CreateBoard, callback?: never): Promise; + async createBoard( + parameters: Parameters.CreateBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/agile/1.0/board', + method: 'POST', + data: { + filterId: parameters.filterId, + location: parameters.location, + name: parameters.name, + type: parameters.type, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns any boards which use the provided filter id. This method can be executed by users without a valid software + * license in order to find which boards are using a particular filter. + */ + async getBoardByFilterId( + parameters: Parameters.GetBoardByFilterId, + callback: Callback, + ): Promise; + /** + * Returns any boards which use the provided filter id. This method can be executed by users without a valid software + * license in order to find which boards are using a particular filter. + */ + async getBoardByFilterId( + parameters: Parameters.GetBoardByFilterId, + callback?: never, + ): Promise; + async getBoardByFilterId( + parameters: Parameters.GetBoardByFilterId, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/filter/${parameters.filterId}`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the board for the given board ID. This board will only be returned if the user has permission to view it. + * Admins without the view permission will see the board as a private one, so will see only a subset of the board's + * data (board location for instance). + */ + async getBoard(parameters: Parameters.GetBoard, callback: Callback): Promise; + /** + * Returns the board for the given board ID. This board will only be returned if the user has permission to view it. + * Admins without the view permission will see the board as a private one, so will see only a subset of the board's + * data (board location for instance). + */ + async getBoard(parameters: Parameters.GetBoard, callback?: never): Promise; + async getBoard(parameters: Parameters.GetBoard, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** Deletes the board. Admin without the view permission can still remove the board. */ + async deleteBoard(parameters: Parameters.DeleteBoard, callback: Callback): Promise; + /** Deletes the board. Admin without the view permission can still remove the board. */ + async deleteBoard(parameters: Parameters.DeleteBoard, callback?: never): Promise; + async deleteBoard(parameters: Parameters.DeleteBoard, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all issues from the board's backlog, for the given board ID. This only includes issues that the user has + * permission to view. The backlog contains incomplete issues that are not assigned to any future or active sprint. + * Note, if the user does not have permission to view the board, no issues will be returned at all. Issues returned + * from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, the returned + * issues are ordered by rank. + */ + async getIssuesForBacklog( + parameters: Parameters.GetIssuesForBacklog, + callback: Callback, + ): Promise; + /** + * Returns all issues from the board's backlog, for the given board ID. This only includes issues that the user has + * permission to view. The backlog contains incomplete issues that are not assigned to any future or active sprint. + * Note, if the user does not have permission to view the board, no issues will be returned at all. Issues returned + * from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, the returned + * issues are ordered by rank. + */ + async getIssuesForBacklog( + parameters: Parameters.GetIssuesForBacklog, + callback?: never, + ): Promise; + async getIssuesForBacklog( + parameters: Parameters.GetIssuesForBacklog, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/backlog`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + jql: parameters.jql, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Get the board configuration. The response contains the following fields: + * + * - `id` - ID of the board. + * - `name` - Name of the board. + * - `filter` - Reference to the filter used by the given board. + * - `location` - Reference to the container that the board is located in. Includes the container type (Valid values: + * project, user). + * - `subQuery` (Kanban only) - Jql subquery used by the given board. + * - `columnConfig` - The column configuration lists the columns for the board, in the order defined in the column + * configuration. For each column, it shows the issue status mapping as well as the constraint type (Valid values: + * none, issueCount, issueCountExclSubs) for the min/max number of issues. Note, the last column with statuses + * mapped to it is treated as the "Done" column, which means that issues in that column will be marked as already + * completed. + * - `estimation` (Scrum only) - Contains information about type of estimation used for the board. Valid values: none, + * issueCount, field. If the estimation type is "field", the ID and display name of the field used for estimation is + * also returned. Note, estimates for an issue can be updated by a PUT /rest/api/3/issue/{issueIdOrKey} request, + * however the fields must be on the screen. "timeoriginalestimate" field will never be on the screen, so in order + * to update it "originalEstimate" in "timetracking" field should be updated. + * - `ranking` - Contains information about custom field used for ranking in the given board. + */ + async getConfiguration( + parameters: Parameters.GetConfiguration, + callback: Callback, + ): Promise; + /** + * Get the board configuration. The response contains the following fields: + * + * - `id` - ID of the board. + * - `name` - Name of the board. + * - `filter` - Reference to the filter used by the given board. + * - `location` - Reference to the container that the board is located in. Includes the container type (Valid values: + * project, user). + * - `subQuery` (Kanban only) - Jql subquery used by the given board. + * - `columnConfig` - The column configuration lists the columns for the board, in the order defined in the column + * configuration. For each column, it shows the issue status mapping as well as the constraint type (Valid values: + * none, issueCount, issueCountExclSubs) for the min/max number of issues. Note, the last column with statuses + * mapped to it is treated as the "Done" column, which means that issues in that column will be marked as already + * completed. + * - `estimation` (Scrum only) - Contains information about type of estimation used for the board. Valid values: none, + * issueCount, field. If the estimation type is "field", the ID and display name of the field used for estimation is + * also returned. Note, estimates for an issue can be updated by a PUT /rest/api/3/issue/{issueIdOrKey} request, + * however the fields must be on the screen. "timeoriginalestimate" field will never be on the screen, so in order + * to update it "originalEstimate" in "timetracking" field should be updated. + * - `ranking` - Contains information about custom field used for ranking in the given board. + */ + async getConfiguration( + parameters: Parameters.GetConfiguration, + callback?: never, + ): Promise; + async getConfiguration( + parameters: Parameters.GetConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/configuration`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all epics from the board, for the given board ID. This only includes epics that the user has permission to + * view. Note, if the user does not have permission to view the board, no epics will be returned at all. + */ + async getEpics>(parameters: Parameters.GetEpics, callback: Callback): Promise; + /** + * Returns all epics from the board, for the given board ID. This only includes epics that the user has permission to + * view. Note, if the user does not have permission to view the board, no epics will be returned at all. + */ + async getEpics>(parameters: Parameters.GetEpics, callback?: never): Promise; + async getEpics>( + parameters: Parameters.GetEpics, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/epic`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + done: parameters.done, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all issues that do not belong to any epic on a board, for a given board ID. This only includes issues that + * the user has permission to view. Issues returned from this resource include Agile fields, like sprint, + * closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. + */ + async getIssuesWithoutEpicForBoard( + parameters: Parameters.GetIssuesWithoutEpicForBoard, + callback: Callback, + ): Promise; + /** + * Returns all issues that do not belong to any epic on a board, for a given board ID. This only includes issues that + * the user has permission to view. Issues returned from this resource include Agile fields, like sprint, + * closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. + */ + async getIssuesWithoutEpicForBoard( + parameters: Parameters.GetIssuesWithoutEpicForBoard, + callback?: never, + ): Promise; + async getIssuesWithoutEpicForBoard( + parameters: Parameters.GetIssuesWithoutEpicForBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/epic/none/issue`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + jql: parameters.jql, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all issues that belong to an epic on the board, for the given epic ID and the board ID. This only includes + * issues that the user has permission to view. Issues returned from this resource include Agile fields, like sprint, + * closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. + */ + async getBoardIssuesForEpic( + parameters: Parameters.GetBoardIssuesForEpic, + callback: Callback, + ): Promise; + /** + * Returns all issues that belong to an epic on the board, for the given epic ID and the board ID. This only includes + * issues that the user has permission to view. Issues returned from this resource include Agile fields, like sprint, + * closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. + */ + async getBoardIssuesForEpic( + parameters: Parameters.GetBoardIssuesForEpic, + callback?: never, + ): Promise; + async getBoardIssuesForEpic( + parameters: Parameters.GetBoardIssuesForEpic, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/epic/${parameters.epicId}/issue`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + jql: parameters.jql, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + async getFeaturesForBoard( + parameters: Parameters.GetFeaturesForBoard, + callback: Callback, + ): Promise; + async getFeaturesForBoard( + parameters: Parameters.GetFeaturesForBoard, + callback?: never, + ): Promise; + async getFeaturesForBoard( + parameters: Parameters.GetFeaturesForBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/features`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + async toggleFeatures( + parameters: Parameters.ToggleFeatures, + callback: Callback, + ): Promise; + async toggleFeatures(parameters: Parameters.ToggleFeatures, callback?: never): Promise; + async toggleFeatures( + parameters: Parameters.ToggleFeatures, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/features`, + method: 'PUT', + data: parameters.body, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all issues from a board, for a given board ID. This only includes issues that the user has permission to + * view. An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to + * the scrum boards. Note, if the user does not have permission to view the board, no issues will be returned at all. + * Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, + * the returned issues are ordered by rank. + */ + async getIssuesForBoard( + parameters: Parameters.GetIssuesForBoard, + callback: Callback, + ): Promise; + /** + * Returns all issues from a board, for a given board ID. This only includes issues that the user has permission to + * view. An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to + * the scrum boards. Note, if the user does not have permission to view the board, no issues will be returned at all. + * Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, + * the returned issues are ordered by rank. + */ + async getIssuesForBoard( + parameters: Parameters.GetIssuesForBoard, + callback?: never, + ): Promise; + async getIssuesForBoard( + parameters: Parameters.GetIssuesForBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/issue`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + jql: parameters.jql, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Move issues from the backlog to the board (if they are already in the backlog of that board).\ + * This operation either moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) + * Or transitions the issue(s) to the first column for a kanban board with backlog. At most 50 issues may be moved at + * once. + */ + async moveIssuesToBoard(parameters: Parameters.MoveIssuesToBoard, callback: Callback): Promise; + /** + * Move issues from the backlog to the board (if they are already in the backlog of that board).\ + * This operation either moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) + * Or transitions the issue(s) to the first column for a kanban board with backlog. At most 50 issues may be moved at + * once. + */ + async moveIssuesToBoard(parameters: Parameters.MoveIssuesToBoard, callback?: never): Promise; + async moveIssuesToBoard( + parameters: Parameters.MoveIssuesToBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/issue`, + method: 'POST', + data: { + issues: parameters.issues, + rankAfterIssue: parameters.rankAfterIssue, + rankBeforeIssue: parameters.rankBeforeIssue, + rankCustomFieldId: parameters.rankCustomFieldId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all projects that are associated with the board, for the given board ID. If the user does not have + * permission to view the board, no projects will be returned at all. Returned projects are ordered by the name. + * + * A project is associated with a board if the board filter contains reference the project or there is an issue from + * the project that belongs to the board. + * + * The board filter contains reference the project only if Jql query guarantees that returned issues will be returned + * from the project set defined in Jql. For instance the query `project in (ABC, BCD) AND reporter = admin` have + * reference to ABC and BCD projects but query `project in (ABC, BCD) OR reporter = admin` doesn't have reference to + * any project. + * + * An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to the + * scrum boards. + */ + async getProjects>( + parameters: Parameters.GetProjects, + callback: Callback, + ): Promise; + /** + * Returns all projects that are associated with the board, for the given board ID. If the user does not have + * permission to view the board, no projects will be returned at all. Returned projects are ordered by the name. + * + * A project is associated with a board if the board filter contains reference the project or there is an issue from + * the project that belongs to the board. + * + * The board filter contains reference the project only if Jql query guarantees that returned issues will be returned + * from the project set defined in Jql. For instance the query `project in (ABC, BCD) AND reporter = admin` have + * reference to ABC and BCD projects but query `project in (ABC, BCD) OR reporter = admin` doesn't have reference to + * any project. + * + * An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to the + * scrum boards. + */ + async getProjects>(parameters: Parameters.GetProjects, callback?: never): Promise; + async getProjects>( + parameters: Parameters.GetProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/project`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all projects that are statically associated with the board, for the given board ID. Returned projects are + * ordered by the name. + * + * A project is associated with a board if the board filter contains reference the project. + * + * The board filter contains reference the project only if Jql query guarantees that returned issues will be returned + * from the project set defined in Jql. For instance the query `project in (ABC, BCD) AND reporter = admin` have + * reference to ABC and BCD projects but query `project in (ABC, BCD) OR reporter = admin` doesn't have reference to + * any project. + */ + async getProjectsFull( + parameters: Parameters.GetProjectsFull, + callback: Callback, + ): Promise; + /** + * Returns all projects that are statically associated with the board, for the given board ID. Returned projects are + * ordered by the name. + * + * A project is associated with a board if the board filter contains reference the project. + * + * The board filter contains reference the project only if Jql query guarantees that returned issues will be returned + * from the project set defined in Jql. For instance the query `project in (ABC, BCD) AND reporter = admin` have + * reference to ABC and BCD projects but query `project in (ABC, BCD) OR reporter = admin` doesn't have reference to + * any project. + */ + async getProjectsFull(parameters: Parameters.GetProjectsFull, callback?: never): Promise; + async getProjectsFull( + parameters: Parameters.GetProjectsFull, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/project/full`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the keys of all properties for the board identified by the id. The user who retrieves the property keys is + * required to have permissions to view the board. + */ + async getBoardPropertyKeys( + parameters: Parameters.GetBoardPropertyKeys, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for the board identified by the id. The user who retrieves the property keys is + * required to have permissions to view the board. + */ + async getBoardPropertyKeys(parameters: Parameters.GetBoardPropertyKeys, callback?: never): Promise; + async getBoardPropertyKeys( + parameters: Parameters.GetBoardPropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of the property with a given key from the board identified by the provided id. The user who + * retrieves the property is required to have permissions to view the board. + */ + async getBoardProperty(parameters: Parameters.GetBoardProperty, callback: Callback): Promise; + /** + * Returns the value of the property with a given key from the board identified by the provided id. The user who + * retrieves the property is required to have permissions to view the board. + */ + async getBoardProperty(parameters: Parameters.GetBoardProperty, callback?: never): Promise; + async getBoardProperty( + parameters: Parameters.GetBoardProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of the specified board's property. + * + * You can use this resource to store a custom data against the board identified by the id. The user who stores the + * data is required to have permissions to modify the board. + */ + async setBoardProperty(parameters: Parameters.SetBoardProperty, callback: Callback): Promise; + /** + * Sets the value of the specified board's property. + * + * You can use this resource to store a custom data against the board identified by the id. The user who stores the + * data is required to have permissions to modify the board. + */ + async setBoardProperty(parameters: Parameters.SetBoardProperty, callback?: never): Promise; + async setBoardProperty( + parameters: Parameters.SetBoardProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/properties/${parameters.propertyKey}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes the property from the board identified by the id. Ths user removing the property is required to have + * permissions to modify the board. + */ + async deleteBoardProperty(parameters: Parameters.DeleteBoardProperty, callback: Callback): Promise; + /** + * Removes the property from the board identified by the id. Ths user removing the property is required to have + * permissions to modify the board. + */ + async deleteBoardProperty(parameters: Parameters.DeleteBoardProperty, callback?: never): Promise; + async deleteBoardProperty( + parameters: Parameters.DeleteBoardProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns all quick filters from a board, for a given board ID. */ + async getAllQuickFilters( + parameters: Parameters.GetAllQuickFilters, + callback: Callback, + ): Promise; + /** Returns all quick filters from a board, for a given board ID. */ + async getAllQuickFilters( + parameters: Parameters.GetAllQuickFilters, + callback?: never, + ): Promise; + async getAllQuickFilters( + parameters: Parameters.GetAllQuickFilters, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/quickfilter`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the quick filter for a given quick filter ID. The quick filter will only be returned if the user can view + * the board that the quick filter belongs to. + */ + async getQuickFilter( + parameters: Parameters.GetQuickFilter, + callback: Callback, + ): Promise; + /** + * Returns the quick filter for a given quick filter ID. The quick filter will only be returned if the user can view + * the board that the quick filter belongs to. + */ + async getQuickFilter(parameters: Parameters.GetQuickFilter, callback?: never): Promise; + async getQuickFilter( + parameters: Parameters.GetQuickFilter, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/quickfilter/${parameters.quickFilterId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + async getReportsForBoard( + parameters: Parameters.GetReportsForBoard, + callback: Callback, + ): Promise; + async getReportsForBoard( + parameters: Parameters.GetReportsForBoard, + callback?: never, + ): Promise; + async getReportsForBoard( + parameters: Parameters.GetReportsForBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/reports`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all sprints from a board, for a given board ID. This only includes sprints that the user has permission to + * view. + */ + async getAllSprints>( + parameters: Parameters.GetAllSprints, + callback: Callback, + ): Promise; + /** + * Returns all sprints from a board, for a given board ID. This only includes sprints that the user has permission to + * view. + */ + async getAllSprints>(parameters: Parameters.GetAllSprints, callback?: never): Promise; + async getAllSprints>( + parameters: Parameters.GetAllSprints, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/sprint`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + state: parameters.state, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Get all issues you have access to that belong to the sprint from the board. Issue returned from this resource + * contains additional fields like: sprint, closedSprints, flagged and epic. Issues are returned ordered by rank. Jql + * order has higher priority than default rank. + */ + async getBoardIssuesForSprint( + parameters: Parameters.GetBoardIssuesForSprint, + callback: Callback, + ): Promise; + /** + * Get all issues you have access to that belong to the sprint from the board. Issue returned from this resource + * contains additional fields like: sprint, closedSprints, flagged and epic. Issues are returned ordered by rank. Jql + * order has higher priority than default rank. + */ + async getBoardIssuesForSprint( + parameters: Parameters.GetBoardIssuesForSprint, + callback?: never, + ): Promise; + async getBoardIssuesForSprint( + parameters: Parameters.GetBoardIssuesForSprint, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/sprint/${parameters.sprintId}/issue`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + jql: parameters.jql, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all versions from a board, for a given board ID. This only includes versions that the user has permission + * to view. Note, if the user does not have permission to view the board, no versions will be returned at all. + * Returned versions are ordered by the name of the project from which they belong and then by sequence defined by + * user. + */ + async getAllVersions>( + parameters: Parameters.GetAllVersions, + callback: Callback, + ): Promise; + /** + * Returns all versions from a board, for a given board ID. This only includes versions that the user has permission + * to view. Note, if the user does not have permission to view the board, no versions will be returned at all. + * Returned versions are ordered by the name of the project from which they belong and then by sequence defined by + * user. + */ + async getAllVersions>( + parameters: Parameters.GetAllVersions, + callback?: never, + ): Promise; + async getAllVersions>( + parameters: Parameters.GetAllVersions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/version`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + released: parameters.released, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/board.ts b/src/agile/board.ts deleted file mode 100644 index 588d21bd6..000000000 --- a/src/agile/board.ts +++ /dev/null @@ -1,872 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Client } from '../clients/index.js'; -import type { Callback } from '../callback.js'; -import type { Paginated } from '../paginated.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Board { - constructor(private client: Client) {} - - /** - * Returns all boards. This only includes boards that the user has permission to view. - * - * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on February 15, 2024. - * - * - `read:board-scope:jira-software`, `read:project:jira` - */ - async getAllBoards( - parameters: Parameters.GetAllBoards | undefined, - callback: Callback, - ): Promise; - /** - * Returns all boards. This only includes boards that the user has permission to view. - * - * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on February 15, 2024. - * - * - `read:board-scope:jira-software`, `read:project:jira` - */ - async getAllBoards(parameters?: Parameters.GetAllBoards, callback?: never): Promise; - async getAllBoards( - parameters?: Parameters.GetAllBoards, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/agile/1.0/board', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - type: parameters?.type, - name: parameters?.name, - projectKeyOrId: parameters?.projectKeyOrId, - accountIdLocation: parameters?.accountIdLocation, - projectLocation: parameters?.projectLocation, - includePrivate: parameters?.includePrivate, - negateLocationFiltering: parameters?.negateLocationFiltering, - orderBy: parameters?.orderBy, - expand: parameters?.expand, - projectTypeLocation: parameters?.projectTypeLocation, - filterId: parameters?.filterId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a new board. Board name, type and filter ID is required. - * - * - `name` - Must be less than 255 characters. - * - `type` - Valid values: scrum, kanban - * - `filterId` - ID of a filter that the user has permissions to view. Note, if the user does not have the 'Create - * shared objects' permission and tries to create a shared board, a private board will be created instead (remember - * that board sharing depends on the filter sharing). - * - `location` - The container that the board will be located in. `location` must include the `type` property (Valid - * values: project, user). If choosing 'project', then a project must be specified by a `projectKeyOrId` property in - * `location`. If choosing 'user', the current user is chosen by default. The `projectKeyOrId` property should not - * be provided. - * - * Note: - * - * - If you want to create a new project with an associated board, use the [Jira platform REST - * API](https://docs.atlassian.com/jira/REST/latest). For more information, see the [Create - * project](#api-rest-api-3-project-post) method. The `projectTypeKey` for software boards must be 'software' and - * the `projectTemplateKey` must be either `com.pyxis.greenhopper.jira:gh-kanban-template` or - * `com.pyxis.greenhopper.jira:gh-scrum-template`. - * - You can create a filter using the [Jira REST API](https://docs.atlassian.com/jira/REST/latest). For more - * information, see the [Create filter](#api-rest-api-3-filter-post) method. - * - If you do not ORDER BY the Rank field for the filter of your board, you will not be able to reorder issues on the - * board. - */ - async createBoard(parameters: Parameters.CreateBoard, callback: Callback): Promise; - /** - * Creates a new board. Board name, type and filter ID is required. - * - * - `name` - Must be less than 255 characters. - * - `type` - Valid values: scrum, kanban - * - `filterId` - ID of a filter that the user has permissions to view. Note, if the user does not have the 'Create - * shared objects' permission and tries to create a shared board, a private board will be created instead (remember - * that board sharing depends on the filter sharing). - * - `location` - The container that the board will be located in. `location` must include the `type` property (Valid - * values: project, user). If choosing 'project', then a project must be specified by a `projectKeyOrId` property in - * `location`. If choosing 'user', the current user is chosen by default. The `projectKeyOrId` property should not - * be provided. - * - * Note: - * - * - If you want to create a new project with an associated board, use the [Jira platform REST - * API](https://docs.atlassian.com/jira/REST/latest). For more information, see the [Create - * project](#api-rest-api-3-project-post) method. The `projectTypeKey` for software boards must be 'software' and - * the `projectTemplateKey` must be either `com.pyxis.greenhopper.jira:gh-kanban-template` or - * `com.pyxis.greenhopper.jira:gh-scrum-template`. - * - You can create a filter using the [Jira REST API](https://docs.atlassian.com/jira/REST/latest). For more - * information, see the [Create filter](#api-rest-api-3-filter-post) method. - * - If you do not ORDER BY the Rank field for the filter of your board, you will not be able to reorder issues on the - * board. - */ - async createBoard(parameters: Parameters.CreateBoard, callback?: never): Promise; - async createBoard( - parameters: Parameters.CreateBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/agile/1.0/board', - method: 'POST', - data: { - filterId: parameters.filterId, - location: parameters.location, - name: parameters.name, - type: parameters.type, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns any boards which use the provided filter id. This method can be executed by users without a valid software - * license in order to find which boards are using a particular filter. - */ - async getBoardByFilterId( - parameters: Parameters.GetBoardByFilterId, - callback: Callback, - ): Promise; - /** - * Returns any boards which use the provided filter id. This method can be executed by users without a valid software - * license in order to find which boards are using a particular filter. - */ - async getBoardByFilterId( - parameters: Parameters.GetBoardByFilterId, - callback?: never, - ): Promise; - async getBoardByFilterId( - parameters: Parameters.GetBoardByFilterId, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/filter/${parameters.filterId}`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the board for the given board ID. This board will only be returned if the user has permission to view it. - * Admins without the view permission will see the board as a private one, so will see only a subset of the board's - * data (board location for instance). - */ - async getBoard(parameters: Parameters.GetBoard, callback: Callback): Promise; - /** - * Returns the board for the given board ID. This board will only be returned if the user has permission to view it. - * Admins without the view permission will see the board as a private one, so will see only a subset of the board's - * data (board location for instance). - */ - async getBoard(parameters: Parameters.GetBoard, callback?: never): Promise; - async getBoard(parameters: Parameters.GetBoard, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** Deletes the board. Admin without the view permission can still remove the board. */ - async deleteBoard(parameters: Parameters.DeleteBoard, callback: Callback): Promise; - /** Deletes the board. Admin without the view permission can still remove the board. */ - async deleteBoard(parameters: Parameters.DeleteBoard, callback?: never): Promise; - async deleteBoard(parameters: Parameters.DeleteBoard, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all issues from the board's backlog, for the given board ID. This only includes issues that the user has - * permission to view. The backlog contains incomplete issues that are not assigned to any future or active sprint. - * Note, if the user does not have permission to view the board, no issues will be returned at all. Issues returned - * from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, the returned - * issues are ordered by rank. - */ - async getIssuesForBacklog( - parameters: Parameters.GetIssuesForBacklog, - callback: Callback, - ): Promise; - /** - * Returns all issues from the board's backlog, for the given board ID. This only includes issues that the user has - * permission to view. The backlog contains incomplete issues that are not assigned to any future or active sprint. - * Note, if the user does not have permission to view the board, no issues will be returned at all. Issues returned - * from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, the returned - * issues are ordered by rank. - */ - async getIssuesForBacklog( - parameters: Parameters.GetIssuesForBacklog, - callback?: never, - ): Promise; - async getIssuesForBacklog( - parameters: Parameters.GetIssuesForBacklog, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/backlog`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - jql: parameters.jql, - validateQuery: parameters.validateQuery, - fields: parameters.fields, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Get the board configuration. The response contains the following fields: - * - * - `id` - ID of the board. - * - `name` - Name of the board. - * - `filter` - Reference to the filter used by the given board. - * - `location` - Reference to the container that the board is located in. Includes the container type (Valid values: - * project, user). - * - `subQuery` (Kanban only) - JQL subquery used by the given board. - * - `columnConfig` - The column configuration lists the columns for the board, in the order defined in the column - * configuration. For each column, it shows the issue status mapping as well as the constraint type (Valid values: - * none, issueCount, issueCountExclSubs) for the min/max number of issues. Note, the last column with statuses - * mapped to it is treated as the "Done" column, which means that issues in that column will be marked as already - * completed. - * - `estimation` (Scrum only) - Contains information about type of estimation used for the board. Valid values: none, - * issueCount, field. If the estimation type is "field", the ID and display name of the field used for estimation is - * also returned. Note, estimates for an issue can be updated by a PUT /rest/api/3/issue/{issueIdOrKey} request, - * however the fields must be on the screen. "timeoriginalestimate" field will never be on the screen, so in order - * to update it "originalEstimate" in "timetracking" field should be updated. - * - `ranking` - Contains information about custom field used for ranking in the given board. - */ - async getConfiguration( - parameters: Parameters.GetConfiguration, - callback: Callback, - ): Promise; - /** - * Get the board configuration. The response contains the following fields: - * - * - `id` - ID of the board. - * - `name` - Name of the board. - * - `filter` - Reference to the filter used by the given board. - * - `location` - Reference to the container that the board is located in. Includes the container type (Valid values: - * project, user). - * - `subQuery` (Kanban only) - JQL subquery used by the given board. - * - `columnConfig` - The column configuration lists the columns for the board, in the order defined in the column - * configuration. For each column, it shows the issue status mapping as well as the constraint type (Valid values: - * none, issueCount, issueCountExclSubs) for the min/max number of issues. Note, the last column with statuses - * mapped to it is treated as the "Done" column, which means that issues in that column will be marked as already - * completed. - * - `estimation` (Scrum only) - Contains information about type of estimation used for the board. Valid values: none, - * issueCount, field. If the estimation type is "field", the ID and display name of the field used for estimation is - * also returned. Note, estimates for an issue can be updated by a PUT /rest/api/3/issue/{issueIdOrKey} request, - * however the fields must be on the screen. "timeoriginalestimate" field will never be on the screen, so in order - * to update it "originalEstimate" in "timetracking" field should be updated. - * - `ranking` - Contains information about custom field used for ranking in the given board. - */ - async getConfiguration( - parameters: Parameters.GetConfiguration, - callback?: never, - ): Promise; - async getConfiguration( - parameters: Parameters.GetConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/configuration`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all epics from the board, for the given board ID. This only includes epics that the user has permission to - * view. Note, if the user does not have permission to view the board, no epics will be returned at all. - */ - async getEpics>(parameters: Parameters.GetEpics, callback: Callback): Promise; - /** - * Returns all epics from the board, for the given board ID. This only includes epics that the user has permission to - * view. Note, if the user does not have permission to view the board, no epics will be returned at all. - */ - async getEpics>(parameters: Parameters.GetEpics, callback?: never): Promise; - async getEpics>( - parameters: Parameters.GetEpics, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/epic`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - done: parameters.done, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all issues that do not belong to any epic on a board, for a given board ID. This only includes issues that - * the user has permission to view. Issues returned from this resource include Agile fields, like sprint, - * closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. - */ - async getIssuesWithoutEpicForBoard( - parameters: Parameters.GetIssuesWithoutEpicForBoard, - callback: Callback, - ): Promise; - /** - * Returns all issues that do not belong to any epic on a board, for a given board ID. This only includes issues that - * the user has permission to view. Issues returned from this resource include Agile fields, like sprint, - * closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. - */ - async getIssuesWithoutEpicForBoard( - parameters: Parameters.GetIssuesWithoutEpicForBoard, - callback?: never, - ): Promise; - async getIssuesWithoutEpicForBoard( - parameters: Parameters.GetIssuesWithoutEpicForBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/epic/none/issue`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - jql: parameters.jql, - validateQuery: parameters.validateQuery, - fields: parameters.fields, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all issues that belong to an epic on the board, for the given epic ID and the board ID. This only includes - * issues that the user has permission to view. Issues returned from this resource include Agile fields, like sprint, - * closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. - */ - async getBoardIssuesForEpic( - parameters: Parameters.GetBoardIssuesForEpic, - callback: Callback, - ): Promise; - /** - * Returns all issues that belong to an epic on the board, for the given epic ID and the board ID. This only includes - * issues that the user has permission to view. Issues returned from this resource include Agile fields, like sprint, - * closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. - */ - async getBoardIssuesForEpic( - parameters: Parameters.GetBoardIssuesForEpic, - callback?: never, - ): Promise; - async getBoardIssuesForEpic( - parameters: Parameters.GetBoardIssuesForEpic, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/epic/${parameters.epicId}/issue`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - jql: parameters.jql, - validateQuery: parameters.validateQuery, - fields: parameters.fields, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - async getFeaturesForBoard( - parameters: Parameters.GetFeaturesForBoard, - callback: Callback, - ): Promise; - async getFeaturesForBoard( - parameters: Parameters.GetFeaturesForBoard, - callback?: never, - ): Promise; - async getFeaturesForBoard( - parameters: Parameters.GetFeaturesForBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/features`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - async toggleFeatures( - parameters: Parameters.ToggleFeatures, - callback: Callback, - ): Promise; - async toggleFeatures(parameters: Parameters.ToggleFeatures, callback?: never): Promise; - async toggleFeatures( - parameters: Parameters.ToggleFeatures, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/features`, - method: 'PUT', - data: parameters.body, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all issues from a board, for a given board ID. This only includes issues that the user has permission to - * view. An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to - * the scrum boards. Note, if the user does not have permission to view the board, no issues will be returned at all. - * Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, - * the returned issues are ordered by rank. - */ - async getIssuesForBoard( - parameters: Parameters.GetIssuesForBoard, - callback: Callback, - ): Promise; - /** - * Returns all issues from a board, for a given board ID. This only includes issues that the user has permission to - * view. An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to - * the scrum boards. Note, if the user does not have permission to view the board, no issues will be returned at all. - * Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, - * the returned issues are ordered by rank. - */ - async getIssuesForBoard( - parameters: Parameters.GetIssuesForBoard, - callback?: never, - ): Promise; - async getIssuesForBoard( - parameters: Parameters.GetIssuesForBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/issue`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - jql: parameters.jql, - validateQuery: parameters.validateQuery, - fields: parameters.fields, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Move issues from the backlog to the board (if they are already in the backlog of that board).\ - * This operation either moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) - * Or transitions the issue(s) to the first column for a kanban board with backlog. At most 50 issues may be moved at - * once. - */ - async moveIssuesToBoard(parameters: Parameters.MoveIssuesToBoard, callback: Callback): Promise; - /** - * Move issues from the backlog to the board (if they are already in the backlog of that board).\ - * This operation either moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) - * Or transitions the issue(s) to the first column for a kanban board with backlog. At most 50 issues may be moved at - * once. - */ - async moveIssuesToBoard(parameters: Parameters.MoveIssuesToBoard, callback?: never): Promise; - async moveIssuesToBoard( - parameters: Parameters.MoveIssuesToBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/issue`, - method: 'POST', - data: { - issues: parameters.issues, - rankAfterIssue: parameters.rankAfterIssue, - rankBeforeIssue: parameters.rankBeforeIssue, - rankCustomFieldId: parameters.rankCustomFieldId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all projects that are associated with the board, for the given board ID. If the user does not have - * permission to view the board, no projects will be returned at all. Returned projects are ordered by the name. - * - * A project is associated with a board if the board filter contains reference the project or there is an issue from - * the project that belongs to the board. - * - * The board filter contains reference the project only if JQL query guarantees that returned issues will be returned - * from the project set defined in JQL. For instance the query `project in (ABC, BCD) AND reporter = admin` have - * reference to ABC and BCD projects but query `project in (ABC, BCD) OR reporter = admin` doesn't have reference to - * any project. - * - * An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to the - * scrum boards. - */ - async getProjects>( - parameters: Parameters.GetProjects, - callback: Callback, - ): Promise; - /** - * Returns all projects that are associated with the board, for the given board ID. If the user does not have - * permission to view the board, no projects will be returned at all. Returned projects are ordered by the name. - * - * A project is associated with a board if the board filter contains reference the project or there is an issue from - * the project that belongs to the board. - * - * The board filter contains reference the project only if JQL query guarantees that returned issues will be returned - * from the project set defined in JQL. For instance the query `project in (ABC, BCD) AND reporter = admin` have - * reference to ABC and BCD projects but query `project in (ABC, BCD) OR reporter = admin` doesn't have reference to - * any project. - * - * An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to the - * scrum boards. - */ - async getProjects>(parameters: Parameters.GetProjects, callback?: never): Promise; - async getProjects>( - parameters: Parameters.GetProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/project`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all projects that are statically associated with the board, for the given board ID. Returned projects are - * ordered by the name. - * - * A project is associated with a board if the board filter contains reference the project. - * - * The board filter contains reference the project only if JQL query guarantees that returned issues will be returned - * from the project set defined in JQL. For instance the query `project in (ABC, BCD) AND reporter = admin` have - * reference to ABC and BCD projects but query `project in (ABC, BCD) OR reporter = admin` doesn't have reference to - * any project. - */ - async getProjectsFull( - parameters: Parameters.GetProjectsFull, - callback: Callback, - ): Promise; - /** - * Returns all projects that are statically associated with the board, for the given board ID. Returned projects are - * ordered by the name. - * - * A project is associated with a board if the board filter contains reference the project. - * - * The board filter contains reference the project only if JQL query guarantees that returned issues will be returned - * from the project set defined in JQL. For instance the query `project in (ABC, BCD) AND reporter = admin` have - * reference to ABC and BCD projects but query `project in (ABC, BCD) OR reporter = admin` doesn't have reference to - * any project. - */ - async getProjectsFull(parameters: Parameters.GetProjectsFull, callback?: never): Promise; - async getProjectsFull( - parameters: Parameters.GetProjectsFull, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/project/full`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the keys of all properties for the board identified by the id. The user who retrieves the property keys is - * required to have permissions to view the board. - */ - async getBoardPropertyKeys( - parameters: Parameters.GetBoardPropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for the board identified by the id. The user who retrieves the property keys is - * required to have permissions to view the board. - */ - async getBoardPropertyKeys(parameters: Parameters.GetBoardPropertyKeys, callback?: never): Promise; - async getBoardPropertyKeys( - parameters: Parameters.GetBoardPropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of the property with a given key from the board identified by the provided id. The user who - * retrieves the property is required to have permissions to view the board. - */ - async getBoardProperty(parameters: Parameters.GetBoardProperty, callback: Callback): Promise; - /** - * Returns the value of the property with a given key from the board identified by the provided id. The user who - * retrieves the property is required to have permissions to view the board. - */ - async getBoardProperty(parameters: Parameters.GetBoardProperty, callback?: never): Promise; - async getBoardProperty( - parameters: Parameters.GetBoardProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of the specified board's property. - * - * You can use this resource to store a custom data against the board identified by the id. The user who stores the - * data is required to have permissions to modify the board. - */ - async setBoardProperty(parameters: Parameters.SetBoardProperty, callback: Callback): Promise; - /** - * Sets the value of the specified board's property. - * - * You can use this resource to store a custom data against the board identified by the id. The user who stores the - * data is required to have permissions to modify the board. - */ - async setBoardProperty(parameters: Parameters.SetBoardProperty, callback?: never): Promise; - async setBoardProperty( - parameters: Parameters.SetBoardProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/properties/${parameters.propertyKey}`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes the property from the board identified by the id. Ths user removing the property is required to have - * permissions to modify the board. - */ - async deleteBoardProperty(parameters: Parameters.DeleteBoardProperty, callback: Callback): Promise; - /** - * Removes the property from the board identified by the id. Ths user removing the property is required to have - * permissions to modify the board. - */ - async deleteBoardProperty(parameters: Parameters.DeleteBoardProperty, callback?: never): Promise; - async deleteBoardProperty( - parameters: Parameters.DeleteBoardProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** Returns all quick filters from a board, for a given board ID. */ - async getAllQuickFilters( - parameters: Parameters.GetAllQuickFilters, - callback: Callback, - ): Promise; - /** Returns all quick filters from a board, for a given board ID. */ - async getAllQuickFilters( - parameters: Parameters.GetAllQuickFilters, - callback?: never, - ): Promise; - async getAllQuickFilters( - parameters: Parameters.GetAllQuickFilters, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/quickfilter`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the quick filter for a given quick filter ID. The quick filter will only be returned if the user can view - * the board that the quick filter belongs to. - */ - async getQuickFilter( - parameters: Parameters.GetQuickFilter, - callback: Callback, - ): Promise; - /** - * Returns the quick filter for a given quick filter ID. The quick filter will only be returned if the user can view - * the board that the quick filter belongs to. - */ - async getQuickFilter(parameters: Parameters.GetQuickFilter, callback?: never): Promise; - async getQuickFilter( - parameters: Parameters.GetQuickFilter, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/quickfilter/${parameters.quickFilterId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - async getReportsForBoard( - parameters: Parameters.GetReportsForBoard, - callback: Callback, - ): Promise; - async getReportsForBoard( - parameters: Parameters.GetReportsForBoard, - callback?: never, - ): Promise; - async getReportsForBoard( - parameters: Parameters.GetReportsForBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/reports`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all sprints from a board, for a given board ID. This only includes sprints that the user has permission to - * view. - */ - async getAllSprints>( - parameters: Parameters.GetAllSprints, - callback: Callback, - ): Promise; - /** - * Returns all sprints from a board, for a given board ID. This only includes sprints that the user has permission to - * view. - */ - async getAllSprints>(parameters: Parameters.GetAllSprints, callback?: never): Promise; - async getAllSprints>( - parameters: Parameters.GetAllSprints, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/sprint`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - state: parameters.state, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Get all issues you have access to that belong to the sprint from the board. Issue returned from this resource - * contains additional fields like: sprint, closedSprints, flagged and epic. Issues are returned ordered by rank. JQL - * order has higher priority than default rank. - */ - async getBoardIssuesForSprint( - parameters: Parameters.GetBoardIssuesForSprint, - callback: Callback, - ): Promise; - /** - * Get all issues you have access to that belong to the sprint from the board. Issue returned from this resource - * contains additional fields like: sprint, closedSprints, flagged and epic. Issues are returned ordered by rank. JQL - * order has higher priority than default rank. - */ - async getBoardIssuesForSprint( - parameters: Parameters.GetBoardIssuesForSprint, - callback?: never, - ): Promise; - async getBoardIssuesForSprint( - parameters: Parameters.GetBoardIssuesForSprint, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/sprint/${parameters.sprintId}/issue`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - jql: parameters.jql, - validateQuery: parameters.validateQuery, - fields: parameters.fields, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all versions from a board, for a given board ID. This only includes versions that the user has permission - * to view. Note, if the user does not have permission to view the board, no versions will be returned at all. - * Returned versions are ordered by the name of the project from which they belong and then by sequence defined by - * user. - */ - async getAllVersions>( - parameters: Parameters.GetAllVersions, - callback: Callback, - ): Promise; - /** - * Returns all versions from a board, for a given board ID. This only includes versions that the user has permission - * to view. Note, if the user does not have permission to view the board, no versions will be returned at all. - * Returned versions are ordered by the name of the project from which they belong and then by sequence defined by - * user. - */ - async getAllVersions>( - parameters: Parameters.GetAllVersions, - callback?: never, - ): Promise; - async getAllVersions>( - parameters: Parameters.GetAllVersions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/version`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - released: parameters.released, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/builds.mts b/src/agile/builds.mts new file mode 100644 index 000000000..14dbb67e4 --- /dev/null +++ b/src/agile/builds.mts @@ -0,0 +1,190 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Builds { + constructor(private client: Client) {} + + /** + * Update / insert builds data. + * + * Builds are identified by the combination of `pipelineId` and `buildNumber`, and existing build data for the same + * build will be replaced if it exists and the `updateSequenceNumber` of the existing data is less than the incoming + * data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * `getBuildByKey` operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple builds being submitted in one request, each is validated individually prior to submission. + * Details of which build failed submission (if any) are available in the response object. + * + * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'WRITE' scope for Connect apps. + */ + async submitBuilds( + parameters: Parameters.SubmitBuilds, + callback: Callback, + ): Promise; + /** + * Update / insert builds data. + * + * Builds are identified by the combination of `pipelineId` and `buildNumber`, and existing build data for the same + * build will be replaced if it exists and the `updateSequenceNumber` of the existing data is less than the incoming + * data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * `getBuildByKey` operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple builds being submitted in one request, each is validated individually prior to submission. + * Details of which build failed submission (if any) are available in the response object. + * + * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'WRITE' scope for Connect apps. + */ + async submitBuilds(parameters: Parameters.SubmitBuilds, callback?: never): Promise; + async submitBuilds( + parameters: Parameters.SubmitBuilds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/builds/0.1/bulk', + method: 'POST', + data: { + properties: parameters.properties, + builds: parameters.builds, + providerMetadata: parameters.providerMetadata, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all builds data that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. Optional param + * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that + * matches ALL of the Properties (e.g. treated as an AND). + * + * See the documentation for the `submitBuilds` operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345 + * + * Deletion is performed asynchronously. The `getBuildByKey` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteBuildsByProperty( + parameters: Parameters.DeleteBuildsByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all builds data that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. Optional param + * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that + * matches ALL of the Properties (e.g. treated as an AND). + * + * See the documentation for the `submitBuilds` operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345 + * + * Deletion is performed asynchronously. The `getBuildByKey` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteBuildsByProperty( + parameters: Parameters.DeleteBuildsByProperty, + callback?: never, + ): Promise; + async deleteBuildsByProperty( + parameters: Parameters.DeleteBuildsByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/builds/0.1/bulkByProperties', + method: 'DELETE', + params: { + _updateSequenceNumber: parameters.updateSequenceNumber, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored build data for the given `pipelineId` and `buildNumber` combination. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'READ' scope for Connect apps. + */ + async getBuildByKey( + parameters: Parameters.GetBuildByKey, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored build data for the given `pipelineId` and `buildNumber` combination. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'READ' scope for Connect apps. + */ + async getBuildByKey(parameters: Parameters.GetBuildByKey, callback?: never): Promise; + async getBuildByKey( + parameters: Parameters.GetBuildByKey, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/builds/0.1/pipelines/${parameters.pipelineId}/builds/${parameters.buildNumber}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the build data currently stored for the given `pipelineId` and `buildNumber` combination. + * + * Deletion is performed asynchronously. The `getBuildByKey` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteBuildByKey(parameters: Parameters.DeleteBuildByKey, callback: Callback): Promise; + /** + * Delete the build data currently stored for the given `pipelineId` and `buildNumber` combination. + * + * Deletion is performed asynchronously. The `getBuildByKey` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteBuildByKey(parameters: Parameters.DeleteBuildByKey, callback?: never): Promise; + async deleteBuildByKey( + parameters: Parameters.DeleteBuildByKey, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/builds/0.1/pipelines/${parameters.pipelineId}/builds/${parameters.buildNumber}`, + method: 'DELETE', + params: { + _updateSequenceNumber: parameters.updateSequenceNumber, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/builds.ts b/src/agile/builds.ts deleted file mode 100644 index 32e6f6540..000000000 --- a/src/agile/builds.ts +++ /dev/null @@ -1,190 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Client } from '../clients/index.js'; -import type { Callback } from '../callback.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Builds { - constructor(private client: Client) {} - - /** - * Update / insert builds data. - * - * Builds are identified by the combination of `pipelineId` and `buildNumber`, and existing build data for the same - * build will be replaced if it exists and the `updateSequenceNumber` of the existing data is less than the incoming - * data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * `getBuildByKey` operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple builds being submitted in one request, each is validated individually prior to submission. - * Details of which build failed submission (if any) are available in the response object. - * - * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'WRITE' scope for Connect apps. - */ - async submitBuilds( - parameters: Parameters.SubmitBuilds, - callback: Callback, - ): Promise; - /** - * Update / insert builds data. - * - * Builds are identified by the combination of `pipelineId` and `buildNumber`, and existing build data for the same - * build will be replaced if it exists and the `updateSequenceNumber` of the existing data is less than the incoming - * data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * `getBuildByKey` operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple builds being submitted in one request, each is validated individually prior to submission. - * Details of which build failed submission (if any) are available in the response object. - * - * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'WRITE' scope for Connect apps. - */ - async submitBuilds(parameters: Parameters.SubmitBuilds, callback?: never): Promise; - async submitBuilds( - parameters: Parameters.SubmitBuilds, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/builds/0.1/bulk', - method: 'POST', - data: { - properties: parameters.properties, - builds: parameters.builds, - providerMetadata: parameters.providerMetadata, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all builds data that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. Optional param - * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that - * matches ALL of the Properties (e.g. treated as an AND). - * - * See the documentation for the `submitBuilds` operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345 - * - * Deletion is performed asynchronously. The `getBuildByKey` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteBuildsByProperty( - parameters: Parameters.DeleteBuildsByProperty, - callback: Callback, - ): Promise; - /** - * Bulk delete all builds data that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. Optional param - * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that - * matches ALL of the Properties (e.g. treated as an AND). - * - * See the documentation for the `submitBuilds` operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345 - * - * Deletion is performed asynchronously. The `getBuildByKey` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteBuildsByProperty( - parameters: Parameters.DeleteBuildsByProperty, - callback?: never, - ): Promise; - async deleteBuildsByProperty( - parameters: Parameters.DeleteBuildsByProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/builds/0.1/bulkByProperties', - method: 'DELETE', - params: { - _updateSequenceNumber: parameters.updateSequenceNumber, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the currently stored build data for the given `pipelineId` and `buildNumber` combination. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'READ' scope for Connect apps. - */ - async getBuildByKey( - parameters: Parameters.GetBuildByKey, - callback: Callback, - ): Promise; - /** - * Retrieve the currently stored build data for the given `pipelineId` and `buildNumber` combination. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'READ' scope for Connect apps. - */ - async getBuildByKey(parameters: Parameters.GetBuildByKey, callback?: never): Promise; - async getBuildByKey( - parameters: Parameters.GetBuildByKey, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/builds/0.1/pipelines/${parameters.pipelineId}/builds/${parameters.buildNumber}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete the build data currently stored for the given `pipelineId` and `buildNumber` combination. - * - * Deletion is performed asynchronously. The `getBuildByKey` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteBuildByKey(parameters: Parameters.DeleteBuildByKey, callback: Callback): Promise; - /** - * Delete the build data currently stored for the given `pipelineId` and `buildNumber` combination. - * - * Deletion is performed asynchronously. The `getBuildByKey` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteBuildByKey(parameters: Parameters.DeleteBuildByKey, callback?: never): Promise; - async deleteBuildByKey( - parameters: Parameters.DeleteBuildByKey, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/builds/0.1/pipelines/${parameters.pipelineId}/builds/${parameters.buildNumber}`, - method: 'DELETE', - params: { - _updateSequenceNumber: parameters.updateSequenceNumber, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/client/agileClient.mts b/src/agile/client/agileClient.mts new file mode 100644 index 000000000..36a329b01 --- /dev/null +++ b/src/agile/client/agileClient.mts @@ -0,0 +1,30 @@ +import { BaseClient } from '@/clients/baseClient.mjs'; +import { Backlog } from '@/agile/backlog.mjs'; +import { Board } from '@/agile/board.mjs'; +import { Builds } from '@/agile/builds.mjs'; +import { Deployments } from '@/agile/deployments.mjs'; +import { DevelopmentInformation } from '@/agile/developmentInformation.mjs'; +import { DevopsComponents } from '@/agile/devopsComponents.mjs'; +import { Epic } from '@/agile/epic.mjs'; +import { FeatureFlags } from '@/agile/featureFlags.mjs'; +import { Issue } from '@/agile/issue.mjs'; +import { Operations } from '@/agile/operations.mjs'; +import { RemoteLinks } from '@/agile/remoteLinks.mjs'; +import { SecurityInformation } from '@/agile/securityInformation.mjs'; +import { Sprint } from '@/agile/sprint.mjs'; + +export class AgileClient extends BaseClient { + backlog = new Backlog(this); + board = new Board(this); + builds = new Builds(this); + deployments = new Deployments(this); + developmentInformation = new DevelopmentInformation(this); + devopsComponents = new DevopsComponents(this); + epic = new Epic(this); + featureFlags = new FeatureFlags(this); + issue = new Issue(this); + operations = new Operations(this); + remoteLinks = new RemoteLinks(this); + securityInformation = new SecurityInformation(this); + sprint = new Sprint(this); +} diff --git a/src/agile/client/agileClient.ts b/src/agile/client/agileClient.ts deleted file mode 100644 index ebadc852a..000000000 --- a/src/agile/client/agileClient.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { BaseClient } from '../../clients/index.js'; -import { - Backlog, - Board, - Builds, - Deployments, - DevelopmentInformation, - DevopsComponents, - Epic, - FeatureFlags, - Issue, - Operations, - RemoteLinks, - SecurityInformation, - Sprint, -} from '../index.js'; - -export class AgileClient extends BaseClient { - backlog = new Backlog(this); - board = new Board(this); - builds = new Builds(this); - deployments = new Deployments(this); - developmentInformation = new DevelopmentInformation(this); - devopsComponents = new DevopsComponents(this); - epic = new Epic(this); - featureFlags = new FeatureFlags(this); - issue = new Issue(this); - operations = new Operations(this); - remoteLinks = new RemoteLinks(this); - securityInformation = new SecurityInformation(this); - sprint = new Sprint(this); -} diff --git a/src/agile/client/index.ts b/src/agile/client/index.ts deleted file mode 100644 index 1fbf9ab18..000000000 --- a/src/agile/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './agileClient.js'; diff --git a/src/agile/deployments.mts b/src/agile/deployments.mts new file mode 100644 index 000000000..d93505cb9 --- /dev/null +++ b/src/agile/deployments.mts @@ -0,0 +1,231 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Deployments { + constructor(private client: Client) {} + + /** + * Update / insert deployment data. + * + * Deployments are identified by the combination of `pipelineId`, `environmentId` and `deploymentSequenceNumber`, and + * existing deployment data for the same deployment will be replaced if it exists and the `updateSequenceNumber` of + * existing data is less than the incoming data. + * + * Submissions are processed asynchronously. Submitted data will eventually be available in Jira. Most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * `getDeploymentByKey` operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple deployments being submitted in one request, each is validated individually prior to + * submission. Details of which deployments failed submission (if any) are available in the response object. + * + * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'WRITE' scope for Connect apps. + */ + async submitDeployments( + parameters: Parameters.SubmitDeployments, + callback: Callback, + ): Promise; + /** + * Update / insert deployment data. + * + * Deployments are identified by the combination of `pipelineId`, `environmentId` and `deploymentSequenceNumber`, and + * existing deployment data for the same deployment will be replaced if it exists and the `updateSequenceNumber` of + * existing data is less than the incoming data. + * + * Submissions are processed asynchronously. Submitted data will eventually be available in Jira. Most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * `getDeploymentByKey` operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple deployments being submitted in one request, each is validated individually prior to + * submission. Details of which deployments failed submission (if any) are available in the response object. + * + * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'WRITE' scope for Connect apps. + */ + async submitDeployments( + parameters: Parameters.SubmitDeployments, + callback?: never, + ): Promise; + async submitDeployments( + parameters: Parameters.SubmitDeployments, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/deployments/0.1/bulk', + method: 'POST', + data: { + properties: parameters.properties, + deployments: parameters.deployments, + providerMetadata: parameters.providerMetadata, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all deployments that match the given request. + * + * One or more query params must be supplied to specify the Properties to delete by. Optional param + * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that + * matches ALL of the Properties (i.e. treated as AND). See the documentation for the `submitDeployments` operation + * for more details. + * + * Example operation: DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The `getDeploymentByKey` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteDeploymentsByProperty( + parameters: Parameters.DeleteDeploymentsByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all deployments that match the given request. + * + * One or more query params must be supplied to specify the Properties to delete by. Optional param + * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that + * matches ALL of the Properties (i.e. treated as AND). See the documentation for the `submitDeployments` operation + * for more details. + * + * Example operation: DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The `getDeploymentByKey` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteDeploymentsByProperty( + parameters: Parameters.DeleteDeploymentsByProperty, + callback?: never, + ): Promise; + async deleteDeploymentsByProperty( + parameters: Parameters.DeleteDeploymentsByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/deployments/0.1/bulkByProperties', + method: 'DELETE', + params: { + _updateSequenceNumber: parameters.updateSequenceNumber, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored deployment data for the given `pipelineId`, `environmentId` and + * `deploymentSequenceNumber` combination. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'READ' scope for Connect apps. + */ + async getDeploymentByKey( + parameters: Parameters.GetDeploymentByKey, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored deployment data for the given `pipelineId`, `environmentId` and + * `deploymentSequenceNumber` combination. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'READ' scope for Connect apps. + */ + async getDeploymentByKey( + parameters: Parameters.GetDeploymentByKey, + callback?: never, + ): Promise; + async getDeploymentByKey( + parameters: Parameters.GetDeploymentByKey, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/deployments/0.1/pipelines/${parameters.pipelineId}/environments/${parameters.environmentId}/deployments/${parameters.deploymentSequenceNumber}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the currently stored deployment data for the given `pipelineId`, `environmentId` and + * `deploymentSequenceNumber` combination. + * + * Deletion is performed asynchronously. The `getDeploymentByKey` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteDeploymentByKey( + parameters: Parameters.DeleteDeploymentByKey, + callback: Callback, + ): Promise; + /** + * Delete the currently stored deployment data for the given `pipelineId`, `environmentId` and + * `deploymentSequenceNumber` combination. + * + * Deletion is performed asynchronously. The `getDeploymentByKey` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteDeploymentByKey(parameters: Parameters.DeleteDeploymentByKey, callback?: never): Promise; + async deleteDeploymentByKey( + parameters: Parameters.DeleteDeploymentByKey, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/deployments/0.1/pipelines/${parameters.pipelineId}/environments/${parameters.environmentId}/deployments/${parameters.deploymentSequenceNumber}`, + method: 'DELETE', + params: { + _updateSequenceNumber: parameters.updateSequenceNumber, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the Deployment gating status for the given `pipelineId + environmentId + deploymentSequenceNumber` + * combination. Only apps that define the `jiraDeploymentInfoProvider` module can access this resource. This resource + * requires the 'READ' scope. + */ + async getDeploymentGatingStatusByKey( + parameters: Parameters.GetDeploymentGatingStatusByKey, + callback: Callback, + ): Promise; + /** + * Retrieve the Deployment gating status for the given `pipelineId + environmentId + deploymentSequenceNumber` + * combination. Only apps that define the `jiraDeploymentInfoProvider` module can access this resource. This resource + * requires the 'READ' scope. + */ + async getDeploymentGatingStatusByKey( + parameters: Parameters.GetDeploymentGatingStatusByKey, + callback?: never, + ): Promise; + async getDeploymentGatingStatusByKey( + parameters: Parameters.GetDeploymentGatingStatusByKey, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/deployments/0.1/pipelines/${parameters.pipelineId}/environments/${parameters.environmentId}/deployments/${parameters.deploymentSequenceNumber}/gating-status`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/deployments.ts b/src/agile/deployments.ts deleted file mode 100644 index fefe8a52e..000000000 --- a/src/agile/deployments.ts +++ /dev/null @@ -1,231 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Client } from '../clients/index.js'; -import type { Callback } from '../callback.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Deployments { - constructor(private client: Client) {} - - /** - * Update / insert deployment data. - * - * Deployments are identified by the combination of `pipelineId`, `environmentId` and `deploymentSequenceNumber`, and - * existing deployment data for the same deployment will be replaced if it exists and the `updateSequenceNumber` of - * existing data is less than the incoming data. - * - * Submissions are processed asynchronously. Submitted data will eventually be available in Jira. Most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * `getDeploymentByKey` operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple deployments being submitted in one request, each is validated individually prior to - * submission. Details of which deployments failed submission (if any) are available in the response object. - * - * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'WRITE' scope for Connect apps. - */ - async submitDeployments( - parameters: Parameters.SubmitDeployments, - callback: Callback, - ): Promise; - /** - * Update / insert deployment data. - * - * Deployments are identified by the combination of `pipelineId`, `environmentId` and `deploymentSequenceNumber`, and - * existing deployment data for the same deployment will be replaced if it exists and the `updateSequenceNumber` of - * existing data is less than the incoming data. - * - * Submissions are processed asynchronously. Submitted data will eventually be available in Jira. Most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * `getDeploymentByKey` operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple deployments being submitted in one request, each is validated individually prior to - * submission. Details of which deployments failed submission (if any) are available in the response object. - * - * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'WRITE' scope for Connect apps. - */ - async submitDeployments( - parameters: Parameters.SubmitDeployments, - callback?: never, - ): Promise; - async submitDeployments( - parameters: Parameters.SubmitDeployments, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/deployments/0.1/bulk', - method: 'POST', - data: { - properties: parameters.properties, - deployments: parameters.deployments, - providerMetadata: parameters.providerMetadata, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all deployments that match the given request. - * - * One or more query params must be supplied to specify the Properties to delete by. Optional param - * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that - * matches ALL of the Properties (i.e. treated as AND). See the documentation for the `submitDeployments` operation - * for more details. - * - * Example operation: DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The `getDeploymentByKey` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteDeploymentsByProperty( - parameters: Parameters.DeleteDeploymentsByProperty, - callback: Callback, - ): Promise; - /** - * Bulk delete all deployments that match the given request. - * - * One or more query params must be supplied to specify the Properties to delete by. Optional param - * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that - * matches ALL of the Properties (i.e. treated as AND). See the documentation for the `submitDeployments` operation - * for more details. - * - * Example operation: DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The `getDeploymentByKey` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteDeploymentsByProperty( - parameters: Parameters.DeleteDeploymentsByProperty, - callback?: never, - ): Promise; - async deleteDeploymentsByProperty( - parameters: Parameters.DeleteDeploymentsByProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/deployments/0.1/bulkByProperties', - method: 'DELETE', - params: { - _updateSequenceNumber: parameters.updateSequenceNumber, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the currently stored deployment data for the given `pipelineId`, `environmentId` and - * `deploymentSequenceNumber` combination. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'READ' scope for Connect apps. - */ - async getDeploymentByKey( - parameters: Parameters.GetDeploymentByKey, - callback: Callback, - ): Promise; - /** - * Retrieve the currently stored deployment data for the given `pipelineId`, `environmentId` and - * `deploymentSequenceNumber` combination. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'READ' scope for Connect apps. - */ - async getDeploymentByKey( - parameters: Parameters.GetDeploymentByKey, - callback?: never, - ): Promise; - async getDeploymentByKey( - parameters: Parameters.GetDeploymentByKey, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/deployments/0.1/pipelines/${parameters.pipelineId}/environments/${parameters.environmentId}/deployments/${parameters.deploymentSequenceNumber}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete the currently stored deployment data for the given `pipelineId`, `environmentId` and - * `deploymentSequenceNumber` combination. - * - * Deletion is performed asynchronously. The `getDeploymentByKey` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteDeploymentByKey( - parameters: Parameters.DeleteDeploymentByKey, - callback: Callback, - ): Promise; - /** - * Delete the currently stored deployment data for the given `pipelineId`, `environmentId` and - * `deploymentSequenceNumber` combination. - * - * Deletion is performed asynchronously. The `getDeploymentByKey` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteDeploymentByKey(parameters: Parameters.DeleteDeploymentByKey, callback?: never): Promise; - async deleteDeploymentByKey( - parameters: Parameters.DeleteDeploymentByKey, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/deployments/0.1/pipelines/${parameters.pipelineId}/environments/${parameters.environmentId}/deployments/${parameters.deploymentSequenceNumber}`, - method: 'DELETE', - params: { - _updateSequenceNumber: parameters.updateSequenceNumber, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the Deployment gating status for the given `pipelineId + environmentId + deploymentSequenceNumber` - * combination. Only apps that define the `jiraDeploymentInfoProvider` module can access this resource. This resource - * requires the 'READ' scope. - */ - async getDeploymentGatingStatusByKey( - parameters: Parameters.GetDeploymentGatingStatusByKey, - callback: Callback, - ): Promise; - /** - * Retrieve the Deployment gating status for the given `pipelineId + environmentId + deploymentSequenceNumber` - * combination. Only apps that define the `jiraDeploymentInfoProvider` module can access this resource. This resource - * requires the 'READ' scope. - */ - async getDeploymentGatingStatusByKey( - parameters: Parameters.GetDeploymentGatingStatusByKey, - callback?: never, - ): Promise; - async getDeploymentGatingStatusByKey( - parameters: Parameters.GetDeploymentGatingStatusByKey, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/deployments/0.1/pipelines/${parameters.pipelineId}/environments/${parameters.environmentId}/deployments/${parameters.deploymentSequenceNumber}/gating-status`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/developmentInformation.mts b/src/agile/developmentInformation.mts new file mode 100644 index 000000000..0a184af68 --- /dev/null +++ b/src/agile/developmentInformation.mts @@ -0,0 +1,189 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class DevelopmentInformation { + constructor(private client: Client) {} + + /** + * Stores development information provided in the request to make it available when viewing issues in Jira. Existing + * repository and entity data for the same ID will be replaced if the updateSequenceId of existing data is less than + * the incoming data. Submissions are performed asynchronously. Submitted data will eventually be available in Jira; + * most updates are available within a short period of time, but may take some time during peak load and/or + * maintenance times. + */ + async storeDevelopmentInformation( + parameters: Parameters.StoreDevelopmentInformation, + callback: Callback, + ): Promise; + /** + * Stores development information provided in the request to make it available when viewing issues in Jira. Existing + * repository and entity data for the same ID will be replaced if the updateSequenceId of existing data is less than + * the incoming data. Submissions are performed asynchronously. Submitted data will eventually be available in Jira; + * most updates are available within a short period of time, but may take some time during peak load and/or + * maintenance times. + */ + async storeDevelopmentInformation( + parameters: Parameters.StoreDevelopmentInformation, + callback?: never, + ): Promise; + async storeDevelopmentInformation( + parameters: Parameters.StoreDevelopmentInformation, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/devinfo/0.10/bulk', + method: 'POST', + data: { + repositories: parameters.repositories, + preventTransitions: parameters.preventTransitions, + operationType: parameters.operationType, + properties: parameters.properties, + providerMetadata: parameters.providerMetadata, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * For the specified repository ID, retrieves the repository and the most recent 400 development information entities. + * The result will be what is currently stored, ignoring any pending updates or deletes. + */ + async getRepository( + parameters: Parameters.GetRepository, + callback: Callback, + ): Promise; + /** + * For the specified repository ID, retrieves the repository and the most recent 400 development information entities. + * The result will be what is currently stored, ignoring any pending updates or deletes. + */ + async getRepository(parameters: Parameters.GetRepository, callback?: never): Promise; + async getRepository( + parameters: Parameters.GetRepository, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/devinfo/0.10/repository/${parameters.repositoryId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the repository data stored by the given ID and all related development information entities. Deletion is + * performed asynchronously. + */ + async deleteRepository(parameters: Parameters.DeleteRepository, callback: Callback): Promise; + /** + * Deletes the repository data stored by the given ID and all related development information entities. Deletion is + * performed asynchronously. + */ + async deleteRepository(parameters: Parameters.DeleteRepository, callback?: never): Promise; + async deleteRepository( + parameters: Parameters.DeleteRepository, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/devinfo/0.10/repository/${parameters.repositoryId}`, + method: 'DELETE', + params: { + _updateSequenceId: parameters.updateSequenceId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes development information entities which have all the provided properties. Repositories which have properties + * that match ALL of the properties (i.e. treated as an AND), and all their related development information (such as + * commits, branches and pull requests), will be deleted. For example if request is `DELETE + * bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be + * deleted. Optional param `_updateSequenceId` is no longer supported. Deletion is performed asynchronously: specified + * entities will eventually be removed from Jira. + */ + async deleteByProperties( + parameters: Parameters.DeleteByProperties, + callback: Callback, + ): Promise; + /** + * Deletes development information entities which have all the provided properties. Repositories which have properties + * that match ALL of the properties (i.e. treated as an AND), and all their related development information (such as + * commits, branches and pull requests), will be deleted. For example if request is `DELETE + * bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be + * deleted. Optional param `_updateSequenceId` is no longer supported. Deletion is performed asynchronously: specified + * entities will eventually be removed from Jira. + */ + async deleteByProperties(parameters: Parameters.DeleteByProperties, callback?: never): Promise; + async deleteByProperties( + parameters: Parameters.DeleteByProperties, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/devinfo/0.10/bulkByProperties', + method: 'DELETE', + params: { + _updateSequenceId: parameters.updateSequenceId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Checks if repositories which have all the provided properties exists. For example, if request is `GET + * existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one + * repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be + * used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the + * optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by. + */ + async existsByProperties( + parameters: Parameters.ExistsByProperties, + callback: Callback, + ): Promise; + /** + * Checks if repositories which have all the provided properties exists. For example, if request is `GET + * existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one + * repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be + * used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the + * optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by. + */ + async existsByProperties( + parameters: Parameters.ExistsByProperties, + callback?: never, + ): Promise; + async existsByProperties( + parameters: Parameters.ExistsByProperties, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/devinfo/0.10/existsByProperties', + method: 'GET', + params: { + _updateSequenceId: parameters.updateSequenceId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Deletes particular development information entity. Deletion is performed asynchronously. */ + async deleteEntity(parameters: Parameters.DeleteEntity, callback: Callback): Promise; + /** Deletes particular development information entity. Deletion is performed asynchronously. */ + async deleteEntity(parameters: Parameters.DeleteEntity, callback?: never): Promise; + async deleteEntity(parameters: Parameters.DeleteEntity, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/devinfo/0.10/repository/${parameters.repositoryId}/${parameters.entityType}/${parameters.entityId}`, + method: 'DELETE', + params: { + _updateSequenceId: parameters.updateSequenceId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/developmentInformation.ts b/src/agile/developmentInformation.ts deleted file mode 100644 index fc2a25d71..000000000 --- a/src/agile/developmentInformation.ts +++ /dev/null @@ -1,189 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Client } from '../clients/index.js'; -import type { Callback } from '../callback.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class DevelopmentInformation { - constructor(private client: Client) {} - - /** - * Stores development information provided in the request to make it available when viewing issues in Jira. Existing - * repository and entity data for the same ID will be replaced if the updateSequenceId of existing data is less than - * the incoming data. Submissions are performed asynchronously. Submitted data will eventually be available in Jira; - * most updates are available within a short period of time, but may take some time during peak load and/or - * maintenance times. - */ - async storeDevelopmentInformation( - parameters: Parameters.StoreDevelopmentInformation, - callback: Callback, - ): Promise; - /** - * Stores development information provided in the request to make it available when viewing issues in Jira. Existing - * repository and entity data for the same ID will be replaced if the updateSequenceId of existing data is less than - * the incoming data. Submissions are performed asynchronously. Submitted data will eventually be available in Jira; - * most updates are available within a short period of time, but may take some time during peak load and/or - * maintenance times. - */ - async storeDevelopmentInformation( - parameters: Parameters.StoreDevelopmentInformation, - callback?: never, - ): Promise; - async storeDevelopmentInformation( - parameters: Parameters.StoreDevelopmentInformation, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/devinfo/0.10/bulk', - method: 'POST', - data: { - repositories: parameters.repositories, - preventTransitions: parameters.preventTransitions, - operationType: parameters.operationType, - properties: parameters.properties, - providerMetadata: parameters.providerMetadata, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * For the specified repository ID, retrieves the repository and the most recent 400 development information entities. - * The result will be what is currently stored, ignoring any pending updates or deletes. - */ - async getRepository( - parameters: Parameters.GetRepository, - callback: Callback, - ): Promise; - /** - * For the specified repository ID, retrieves the repository and the most recent 400 development information entities. - * The result will be what is currently stored, ignoring any pending updates or deletes. - */ - async getRepository(parameters: Parameters.GetRepository, callback?: never): Promise; - async getRepository( - parameters: Parameters.GetRepository, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/devinfo/0.10/repository/${parameters.repositoryId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the repository data stored by the given ID and all related development information entities. Deletion is - * performed asynchronously. - */ - async deleteRepository(parameters: Parameters.DeleteRepository, callback: Callback): Promise; - /** - * Deletes the repository data stored by the given ID and all related development information entities. Deletion is - * performed asynchronously. - */ - async deleteRepository(parameters: Parameters.DeleteRepository, callback?: never): Promise; - async deleteRepository( - parameters: Parameters.DeleteRepository, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/devinfo/0.10/repository/${parameters.repositoryId}`, - method: 'DELETE', - params: { - _updateSequenceId: parameters.updateSequenceId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes development information entities which have all the provided properties. Repositories which have properties - * that match ALL of the properties (i.e. treated as an AND), and all their related development information (such as - * commits, branches and pull requests), will be deleted. For example if request is `DELETE - * bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be - * deleted. Optional param `_updateSequenceId` is no longer supported. Deletion is performed asynchronously: specified - * entities will eventually be removed from Jira. - */ - async deleteByProperties( - parameters: Parameters.DeleteByProperties, - callback: Callback, - ): Promise; - /** - * Deletes development information entities which have all the provided properties. Repositories which have properties - * that match ALL of the properties (i.e. treated as an AND), and all their related development information (such as - * commits, branches and pull requests), will be deleted. For example if request is `DELETE - * bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be - * deleted. Optional param `_updateSequenceId` is no longer supported. Deletion is performed asynchronously: specified - * entities will eventually be removed from Jira. - */ - async deleteByProperties(parameters: Parameters.DeleteByProperties, callback?: never): Promise; - async deleteByProperties( - parameters: Parameters.DeleteByProperties, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/devinfo/0.10/bulkByProperties', - method: 'DELETE', - params: { - _updateSequenceId: parameters.updateSequenceId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Checks if repositories which have all the provided properties exists. For example, if request is `GET - * existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one - * repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be - * used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the - * optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by. - */ - async existsByProperties( - parameters: Parameters.ExistsByProperties, - callback: Callback, - ): Promise; - /** - * Checks if repositories which have all the provided properties exists. For example, if request is `GET - * existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one - * repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be - * used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the - * optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by. - */ - async existsByProperties( - parameters: Parameters.ExistsByProperties, - callback?: never, - ): Promise; - async existsByProperties( - parameters: Parameters.ExistsByProperties, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/devinfo/0.10/existsByProperties', - method: 'GET', - params: { - _updateSequenceId: parameters.updateSequenceId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** Deletes particular development information entity. Deletion is performed asynchronously. */ - async deleteEntity(parameters: Parameters.DeleteEntity, callback: Callback): Promise; - /** Deletes particular development information entity. Deletion is performed asynchronously. */ - async deleteEntity(parameters: Parameters.DeleteEntity, callback?: never): Promise; - async deleteEntity(parameters: Parameters.DeleteEntity, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/devinfo/0.10/repository/${parameters.repositoryId}/${parameters.entityType}/${parameters.entityId}`, - method: 'DELETE', - params: { - _updateSequenceId: parameters.updateSequenceId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/devopsComponents.mts b/src/agile/devopsComponents.mts new file mode 100644 index 000000000..d755abe37 --- /dev/null +++ b/src/agile/devopsComponents.mts @@ -0,0 +1,189 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class DevopsComponents { + constructor(private client: Client) {} + + /** + * Update / insert DevOps Component data. + * + * Components are identified by their ID, and existing Component data for the same ID will be replaced if it exists + * and the updateSequenceNumber of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getComponentById operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple Components being submitted in one request, each is validated individually prior to + * submission. Details of which Components failed submission (if any) are available in the response object. + * + * A maximum of 1000 components can be submitted in one request. + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitComponents( + parameters: Parameters.SubmitComponents, + callback: Callback, + ): Promise; + /** + * Update / insert DevOps Component data. + * + * Components are identified by their ID, and existing Component data for the same ID will be replaced if it exists + * and the updateSequenceNumber of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getComponentById operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple Components being submitted in one request, each is validated individually prior to + * submission. Details of which Components failed submission (if any) are available in the response object. + * + * A maximum of 1000 components can be submitted in one request. + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitComponents( + parameters: Parameters.SubmitComponents, + callback?: never, + ): Promise; + async submitComponents( + parameters: Parameters.SubmitComponents, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/devopscomponents/1.0/bulk', + method: 'POST', + data: { + properties: parameters.properties, + components: parameters.components, + providerMetadata: parameters.providerMetadata, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Components that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation + * for the submitComponents operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteComponentsByProperty( + parameters: Parameters.DeleteComponentsByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all Components that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation + * for the submitComponents operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteComponentsByProperty( + parameters: Parameters.DeleteComponentsByProperty, + callback?: never, + ): Promise; + async deleteComponentsByProperty( + parameters: Parameters.DeleteComponentsByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/devopscomponents/1.0/bulkByProperties', + method: 'DELETE', + params: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Component data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getComponentById( + parameters: Parameters.GetComponentById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Component data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getComponentById( + parameters: Parameters.GetComponentById, + callback?: never, + ): Promise; + async getComponentById( + parameters: Parameters.GetComponentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/devopscomponents/1.0/${parameters.componentId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Component data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteComponentById(parameters: Parameters.DeleteComponentById, callback: Callback): Promise; + /** + * Delete the Component data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteComponentById(parameters: Parameters.DeleteComponentById, callback?: never): Promise; + async deleteComponentById( + parameters: Parameters.DeleteComponentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/devopscomponents/1.0/${parameters.componentId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/devopsComponents.ts b/src/agile/devopsComponents.ts deleted file mode 100644 index fd30d9161..000000000 --- a/src/agile/devopsComponents.ts +++ /dev/null @@ -1,189 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Client } from '../clients/index.js'; -import type { Callback } from '../callback.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class DevopsComponents { - constructor(private client: Client) {} - - /** - * Update / insert DevOps Component data. - * - * Components are identified by their ID, and existing Component data for the same ID will be replaced if it exists - * and the updateSequenceNumber of existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * getComponentById operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple Components being submitted in one request, each is validated individually prior to - * submission. Details of which Components failed submission (if any) are available in the response object. - * - * A maximum of 1000 components can be submitted in one request. - * - * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitComponents( - parameters: Parameters.SubmitComponents, - callback: Callback, - ): Promise; - /** - * Update / insert DevOps Component data. - * - * Components are identified by their ID, and existing Component data for the same ID will be replaced if it exists - * and the updateSequenceNumber of existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * getComponentById operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple Components being submitted in one request, each is validated individually prior to - * submission. Details of which Components failed submission (if any) are available in the response object. - * - * A maximum of 1000 components can be submitted in one request. - * - * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitComponents( - parameters: Parameters.SubmitComponents, - callback?: never, - ): Promise; - async submitComponents( - parameters: Parameters.SubmitComponents, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/devopscomponents/1.0/bulk', - method: 'POST', - data: { - properties: parameters.properties, - components: parameters.components, - providerMetadata: parameters.providerMetadata, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all Components that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. If more than one Property is - * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation - * for the submitComponents operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteComponentsByProperty( - parameters: Parameters.DeleteComponentsByProperty, - callback: Callback, - ): Promise; - /** - * Bulk delete all Components that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. If more than one Property is - * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation - * for the submitComponents operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteComponentsByProperty( - parameters: Parameters.DeleteComponentsByProperty, - callback?: never, - ): Promise; - async deleteComponentsByProperty( - parameters: Parameters.DeleteComponentsByProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/devopscomponents/1.0/bulkByProperties', - method: 'DELETE', - params: parameters, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the currently stored Component data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getComponentById( - parameters: Parameters.GetComponentById, - callback: Callback, - ): Promise; - /** - * Retrieve the currently stored Component data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getComponentById( - parameters: Parameters.GetComponentById, - callback?: never, - ): Promise; - async getComponentById( - parameters: Parameters.GetComponentById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/devopscomponents/1.0/${parameters.componentId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete the Component data currently stored for the given ID. - * - * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteComponentById(parameters: Parameters.DeleteComponentById, callback: Callback): Promise; - /** - * Delete the Component data currently stored for the given ID. - * - * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteComponentById(parameters: Parameters.DeleteComponentById, callback?: never): Promise; - async deleteComponentById( - parameters: Parameters.DeleteComponentById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/devopscomponents/1.0/${parameters.componentId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/epic.mts b/src/agile/epic.mts new file mode 100644 index 000000000..7a47d2e96 --- /dev/null +++ b/src/agile/epic.mts @@ -0,0 +1,232 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Epic { + constructor(private client: Client) {} + + /** + * Returns all issues that do not belong to any epic. This only includes issues that the user has permission to view. + * Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, + * the returned issues are ordered by rank. **Note:** If you are querying a next-gen project, do not use this + * operation. Instead, search for issues that don't belong to an epic by using the [Search for issues using + * Jql](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-search-get) operation in the Jira + * platform REST API. Build your Jql query using the `parent is empty` clause. For more information on the `parent` + * Jql field, see [Advanced + * searching](https://confluence.atlassian.com/x/dAiiLQ#Advancedsearching-fieldsreference-Parent). + */ + async getIssuesWithoutEpic( + parameters: Parameters.GetIssuesWithoutEpic | undefined, + callback: Callback, + ): Promise; + /** + * Returns all issues that do not belong to any epic. This only includes issues that the user has permission to view. + * Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, + * the returned issues are ordered by rank. **Note:** If you are querying a next-gen project, do not use this + * operation. Instead, search for issues that don't belong to an epic by using the [Search for issues using + * Jql](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-search-get) operation in the Jira + * platform REST API. Build your Jql query using the `parent is empty` clause. For more information on the `parent` + * Jql field, see [Advanced + * searching](https://confluence.atlassian.com/x/dAiiLQ#Advancedsearching-fieldsreference-Parent). + */ + async getIssuesWithoutEpic(parameters?: Parameters.GetIssuesWithoutEpic, callback?: never): Promise; + async getIssuesWithoutEpic( + parameters?: Parameters.GetIssuesWithoutEpic, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/agile/1.0/epic/none/issue', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + jql: parameters?.jql, + validateQuery: parameters?.validateQuery, + fields: parameters?.fields, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes issues from epics. The user needs to have the edit issue permission for all issue they want to remove from + * epics. The maximum number of issues that can be moved in one operation is 50. **Note:** This operation does not + * work for epics in next-gen projects. Instead, update the issue using `\{ fields: \{ parent: \{\} \} \}` + */ + async removeIssuesFromEpic( + parameters: Parameters.RemoveIssuesFromEpic | undefined, + callback: Callback, + ): Promise; + /** + * Removes issues from epics. The user needs to have the edit issue permission for all issue they want to remove from + * epics. The maximum number of issues that can be moved in one operation is 50. **Note:** This operation does not + * work for epics in next-gen projects. Instead, update the issue using `\{ fields: \{ parent: \{\} \} \}` + */ + async removeIssuesFromEpic(parameters?: Parameters.RemoveIssuesFromEpic, callback?: never): Promise; + async removeIssuesFromEpic( + parameters?: Parameters.RemoveIssuesFromEpic, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/agile/1.0/epic/none/issue', + method: 'POST', + data: { + issues: parameters?.issues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the epic for a given epic ID. This epic will only be returned if the user has permission to view it. + * **Note:** This operation does not work for epics in next-gen projects. + */ + async getEpic(parameters: Parameters.GetEpic, callback: Callback): Promise; + /** + * Returns the epic for a given epic ID. This epic will only be returned if the user has permission to view it. + * **Note:** This operation does not work for epics in next-gen projects. + */ + async getEpic(parameters: Parameters.GetEpic, callback?: never): Promise; + async getEpic(parameters: Parameters.GetEpic, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Performs a partial update of the epic. A partial update means that fields not present in the request JSON will not + * be updated. Valid values for color are `color_1` to `color_9`. **Note:** This operation does not work for epics in + * next-gen projects. + */ + async partiallyUpdateEpic( + parameters: Parameters.PartiallyUpdateEpic, + callback: Callback, + ): Promise; + /** + * Performs a partial update of the epic. A partial update means that fields not present in the request JSON will not + * be updated. Valid values for color are `color_1` to `color_9`. **Note:** This operation does not work for epics in + * next-gen projects. + */ + async partiallyUpdateEpic(parameters: Parameters.PartiallyUpdateEpic, callback?: never): Promise; + async partiallyUpdateEpic( + parameters: Parameters.PartiallyUpdateEpic, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}`, + method: 'POST', + data: { + color: parameters.color, + done: parameters.done, + name: parameters.name, + summary: parameters.summary, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all issues that belong to the epic, for the given epic ID. This only includes issues that the user has + * permission to view. Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, + * and epic. By default, the returned issues are ordered by rank. **Note:** If you are querying a next-gen project, do + * not use this operation. Instead, search for issues that belong to an epic by using the [Search for issues using + * Jql](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-search-get) operation in the Jira + * platform REST API. Build your Jql query using the `parent` clause. For more information on the `parent` Jql field, + * see [Advanced searching](https://confluence.atlassian.com/x/dAiiLQ#Advancedsearching-fieldsreference-Parent). + */ + async getIssuesForEpic(parameters: Parameters.GetIssuesForEpic, callback: Callback): Promise; + /** + * Returns all issues that belong to the epic, for the given epic ID. This only includes issues that the user has + * permission to view. Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, + * and epic. By default, the returned issues are ordered by rank. **Note:** If you are querying a next-gen project, do + * not use this operation. Instead, search for issues that belong to an epic by using the [Search for issues using + * Jql](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-search-get) operation in the Jira + * platform REST API. Build your Jql query using the `parent` clause. For more information on the `parent` Jql field, + * see [Advanced searching](https://confluence.atlassian.com/x/dAiiLQ#Advancedsearching-fieldsreference-Parent). + */ + async getIssuesForEpic(parameters: Parameters.GetIssuesForEpic, callback?: never): Promise; + async getIssuesForEpic( + parameters: Parameters.GetIssuesForEpic, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}/issue`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + jql: parameters.jql, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves issues to an epic, for a given epic id. Issues can be only in a single epic at the same time. That means that + * already assigned issues to an epic, will not be assigned to the previous epic anymore. The user needs to have the + * edit issue permission for all issue they want to move and to the epic. The maximum number of issues that can be + * moved in one operation is 50. **Note:** This operation does not work for epics in next-gen projects. + */ + async moveIssuesToEpic(parameters: Parameters.MoveIssuesToEpic, callback: Callback): Promise; + /** + * Moves issues to an epic, for a given epic id. Issues can be only in a single epic at the same time. That means that + * already assigned issues to an epic, will not be assigned to the previous epic anymore. The user needs to have the + * edit issue permission for all issue they want to move and to the epic. The maximum number of issues that can be + * moved in one operation is 50. **Note:** This operation does not work for epics in next-gen projects. + */ + async moveIssuesToEpic(parameters: Parameters.MoveIssuesToEpic, callback?: never): Promise; + async moveIssuesToEpic(parameters: Parameters.MoveIssuesToEpic, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}/issue`, + method: 'POST', + data: { + issues: parameters.issues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves (ranks) an epic before or after a given epic. + * + * If rankCustomFieldId is not defined, the default rank field will be used. + * + * **Note:** This operation does not work for epics in next-gen projects. + */ + async rankEpics(parameters: Parameters.RankEpics, callback: Callback): Promise; + /** + * Moves (ranks) an epic before or after a given epic. + * + * If rankCustomFieldId is not defined, the default rank field will be used. + * + * **Note:** This operation does not work for epics in next-gen projects. + */ + async rankEpics(parameters: Parameters.RankEpics, callback?: never): Promise; + async rankEpics(parameters: Parameters.RankEpics, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}/rank`, + method: 'PUT', + data: { + rankAfterEpic: parameters.rankAfterEpic, + rankBeforeEpic: parameters.rankBeforeEpic, + rankCustomFieldId: parameters.rankCustomFieldId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/epic.ts b/src/agile/epic.ts deleted file mode 100644 index cbfb4567d..000000000 --- a/src/agile/epic.ts +++ /dev/null @@ -1,232 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Client } from '../clients/index.js'; -import type { Callback } from '../callback.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Epic { - constructor(private client: Client) {} - - /** - * Returns all issues that do not belong to any epic. This only includes issues that the user has permission to view. - * Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, - * the returned issues are ordered by rank. **Note:** If you are querying a next-gen project, do not use this - * operation. Instead, search for issues that don't belong to an epic by using the [Search for issues using - * JQL](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-search-get) operation in the Jira - * platform REST API. Build your JQL query using the `parent is empty` clause. For more information on the `parent` - * JQL field, see [Advanced - * searching](https://confluence.atlassian.com/x/dAiiLQ#Advancedsearching-fieldsreference-Parent). - */ - async getIssuesWithoutEpic( - parameters: Parameters.GetIssuesWithoutEpic | undefined, - callback: Callback, - ): Promise; - /** - * Returns all issues that do not belong to any epic. This only includes issues that the user has permission to view. - * Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, - * the returned issues are ordered by rank. **Note:** If you are querying a next-gen project, do not use this - * operation. Instead, search for issues that don't belong to an epic by using the [Search for issues using - * JQL](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-search-get) operation in the Jira - * platform REST API. Build your JQL query using the `parent is empty` clause. For more information on the `parent` - * JQL field, see [Advanced - * searching](https://confluence.atlassian.com/x/dAiiLQ#Advancedsearching-fieldsreference-Parent). - */ - async getIssuesWithoutEpic(parameters?: Parameters.GetIssuesWithoutEpic, callback?: never): Promise; - async getIssuesWithoutEpic( - parameters?: Parameters.GetIssuesWithoutEpic, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/agile/1.0/epic/none/issue', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - jql: parameters?.jql, - validateQuery: parameters?.validateQuery, - fields: parameters?.fields, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes issues from epics. The user needs to have the edit issue permission for all issue they want to remove from - * epics. The maximum number of issues that can be moved in one operation is 50. **Note:** This operation does not - * work for epics in next-gen projects. Instead, update the issue using `\{ fields: \{ parent: \{\} \} \}` - */ - async removeIssuesFromEpic( - parameters: Parameters.RemoveIssuesFromEpic | undefined, - callback: Callback, - ): Promise; - /** - * Removes issues from epics. The user needs to have the edit issue permission for all issue they want to remove from - * epics. The maximum number of issues that can be moved in one operation is 50. **Note:** This operation does not - * work for epics in next-gen projects. Instead, update the issue using `\{ fields: \{ parent: \{\} \} \}` - */ - async removeIssuesFromEpic(parameters?: Parameters.RemoveIssuesFromEpic, callback?: never): Promise; - async removeIssuesFromEpic( - parameters?: Parameters.RemoveIssuesFromEpic, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/agile/1.0/epic/none/issue', - method: 'POST', - data: { - issues: parameters?.issues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the epic for a given epic ID. This epic will only be returned if the user has permission to view it. - * **Note:** This operation does not work for epics in next-gen projects. - */ - async getEpic(parameters: Parameters.GetEpic, callback: Callback): Promise; - /** - * Returns the epic for a given epic ID. This epic will only be returned if the user has permission to view it. - * **Note:** This operation does not work for epics in next-gen projects. - */ - async getEpic(parameters: Parameters.GetEpic, callback?: never): Promise; - async getEpic(parameters: Parameters.GetEpic, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Performs a partial update of the epic. A partial update means that fields not present in the request JSON will not - * be updated. Valid values for color are `color_1` to `color_9`. **Note:** This operation does not work for epics in - * next-gen projects. - */ - async partiallyUpdateEpic( - parameters: Parameters.PartiallyUpdateEpic, - callback: Callback, - ): Promise; - /** - * Performs a partial update of the epic. A partial update means that fields not present in the request JSON will not - * be updated. Valid values for color are `color_1` to `color_9`. **Note:** This operation does not work for epics in - * next-gen projects. - */ - async partiallyUpdateEpic(parameters: Parameters.PartiallyUpdateEpic, callback?: never): Promise; - async partiallyUpdateEpic( - parameters: Parameters.PartiallyUpdateEpic, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}`, - method: 'POST', - data: { - color: parameters.color, - done: parameters.done, - name: parameters.name, - summary: parameters.summary, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all issues that belong to the epic, for the given epic ID. This only includes issues that the user has - * permission to view. Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, - * and epic. By default, the returned issues are ordered by rank. **Note:** If you are querying a next-gen project, do - * not use this operation. Instead, search for issues that belong to an epic by using the [Search for issues using - * JQL](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-search-get) operation in the Jira - * platform REST API. Build your JQL query using the `parent` clause. For more information on the `parent` JQL field, - * see [Advanced searching](https://confluence.atlassian.com/x/dAiiLQ#Advancedsearching-fieldsreference-Parent). - */ - async getIssuesForEpic(parameters: Parameters.GetIssuesForEpic, callback: Callback): Promise; - /** - * Returns all issues that belong to the epic, for the given epic ID. This only includes issues that the user has - * permission to view. Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, - * and epic. By default, the returned issues are ordered by rank. **Note:** If you are querying a next-gen project, do - * not use this operation. Instead, search for issues that belong to an epic by using the [Search for issues using - * JQL](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-search-get) operation in the Jira - * platform REST API. Build your JQL query using the `parent` clause. For more information on the `parent` JQL field, - * see [Advanced searching](https://confluence.atlassian.com/x/dAiiLQ#Advancedsearching-fieldsreference-Parent). - */ - async getIssuesForEpic(parameters: Parameters.GetIssuesForEpic, callback?: never): Promise; - async getIssuesForEpic( - parameters: Parameters.GetIssuesForEpic, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}/issue`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - jql: parameters.jql, - validateQuery: parameters.validateQuery, - fields: parameters.fields, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves issues to an epic, for a given epic id. Issues can be only in a single epic at the same time. That means that - * already assigned issues to an epic, will not be assigned to the previous epic anymore. The user needs to have the - * edit issue permission for all issue they want to move and to the epic. The maximum number of issues that can be - * moved in one operation is 50. **Note:** This operation does not work for epics in next-gen projects. - */ - async moveIssuesToEpic(parameters: Parameters.MoveIssuesToEpic, callback: Callback): Promise; - /** - * Moves issues to an epic, for a given epic id. Issues can be only in a single epic at the same time. That means that - * already assigned issues to an epic, will not be assigned to the previous epic anymore. The user needs to have the - * edit issue permission for all issue they want to move and to the epic. The maximum number of issues that can be - * moved in one operation is 50. **Note:** This operation does not work for epics in next-gen projects. - */ - async moveIssuesToEpic(parameters: Parameters.MoveIssuesToEpic, callback?: never): Promise; - async moveIssuesToEpic(parameters: Parameters.MoveIssuesToEpic, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}/issue`, - method: 'POST', - data: { - issues: parameters.issues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves (ranks) an epic before or after a given epic. - * - * If rankCustomFieldId is not defined, the default rank field will be used. - * - * **Note:** This operation does not work for epics in next-gen projects. - */ - async rankEpics(parameters: Parameters.RankEpics, callback: Callback): Promise; - /** - * Moves (ranks) an epic before or after a given epic. - * - * If rankCustomFieldId is not defined, the default rank field will be used. - * - * **Note:** This operation does not work for epics in next-gen projects. - */ - async rankEpics(parameters: Parameters.RankEpics, callback?: never): Promise; - async rankEpics(parameters: Parameters.RankEpics, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}/rank`, - method: 'PUT', - data: { - rankAfterEpic: parameters.rankAfterEpic, - rankBeforeEpic: parameters.rankBeforeEpic, - rankCustomFieldId: parameters.rankCustomFieldId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/featureFlags.mts b/src/agile/featureFlags.mts new file mode 100644 index 000000000..3d5e5d497 --- /dev/null +++ b/src/agile/featureFlags.mts @@ -0,0 +1,193 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class FeatureFlags { + constructor(private client: Client) {} + + /** + * Update / insert Feature Flag data. + * + * Feature Flags are identified by their ID, and existing Feature Flag data for the same ID will be replaced if it + * exists and the updateSequenceId of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getFeatureFlagById operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple Feature Flags being submitted in one request, each is validated individually prior to + * submission. Details of which Feature Flags failed submission (if any) are available in the response object. + * + * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitFeatureFlags( + parameters: Parameters.SubmitFeatureFlags, + callback: Callback, + ): Promise; + /** + * Update / insert Feature Flag data. + * + * Feature Flags are identified by their ID, and existing Feature Flag data for the same ID will be replaced if it + * exists and the updateSequenceId of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getFeatureFlagById operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple Feature Flags being submitted in one request, each is validated individually prior to + * submission. Details of which Feature Flags failed submission (if any) are available in the response object. + * + * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitFeatureFlags( + parameters: Parameters.SubmitFeatureFlags, + callback?: never, + ): Promise; + async submitFeatureFlags( + parameters: Parameters.SubmitFeatureFlags, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/featureflags/0.1/bulk', + method: 'POST', + data: { + properties: parameters.properties, + flags: parameters.flags, + providerMetadata: parameters.providerMetadata, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Feature Flags that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. Optional param `_updateSequenceId` is + * no longer supported. If more than one Property is provided, data will be deleted that matches ALL of the Properties + * (e.g. treated as an AND). See the documentation for the submitFeatureFlags operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteFeatureFlagsByProperty( + parameters: Parameters.DeleteFeatureFlagsByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all Feature Flags that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. Optional param `_updateSequenceId` is + * no longer supported. If more than one Property is provided, data will be deleted that matches ALL of the Properties + * (e.g. treated as an AND). See the documentation for the submitFeatureFlags operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteFeatureFlagsByProperty( + parameters: Parameters.DeleteFeatureFlagsByProperty, + callback?: never, + ): Promise; + async deleteFeatureFlagsByProperty( + parameters: Parameters.DeleteFeatureFlagsByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/featureflags/0.1/bulkByProperties', + method: 'DELETE', + params: { + _updateSequenceId: parameters.updateSequenceId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Feature Flag data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getFeatureFlagById( + parameters: Parameters.GetFeatureFlagById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Feature Flag data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getFeatureFlagById( + parameters: Parameters.GetFeatureFlagById, + callback?: never, + ): Promise; + async getFeatureFlagById( + parameters: Parameters.GetFeatureFlagById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/featureflags/0.1/flag/${parameters.featureFlagId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Feature Flag data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteFeatureFlagById( + parameters: Parameters.DeleteFeatureFlagById, + callback: Callback, + ): Promise; + /** + * Delete the Feature Flag data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteFeatureFlagById(parameters: Parameters.DeleteFeatureFlagById, callback?: never): Promise; + async deleteFeatureFlagById( + parameters: Parameters.DeleteFeatureFlagById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/featureflags/0.1/flag/${parameters.featureFlagId}`, + method: 'DELETE', + params: { + _updateSequenceId: parameters.updateSequenceId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/featureFlags.ts b/src/agile/featureFlags.ts deleted file mode 100644 index 71f3b2613..000000000 --- a/src/agile/featureFlags.ts +++ /dev/null @@ -1,193 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Client } from '../clients/index.js'; -import type { Callback } from '../callback.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class FeatureFlags { - constructor(private client: Client) {} - - /** - * Update / insert Feature Flag data. - * - * Feature Flags are identified by their ID, and existing Feature Flag data for the same ID will be replaced if it - * exists and the updateSequenceId of existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * getFeatureFlagById operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple Feature Flags being submitted in one request, each is validated individually prior to - * submission. Details of which Feature Flags failed submission (if any) are available in the response object. - * - * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitFeatureFlags( - parameters: Parameters.SubmitFeatureFlags, - callback: Callback, - ): Promise; - /** - * Update / insert Feature Flag data. - * - * Feature Flags are identified by their ID, and existing Feature Flag data for the same ID will be replaced if it - * exists and the updateSequenceId of existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * getFeatureFlagById operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple Feature Flags being submitted in one request, each is validated individually prior to - * submission. Details of which Feature Flags failed submission (if any) are available in the response object. - * - * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitFeatureFlags( - parameters: Parameters.SubmitFeatureFlags, - callback?: never, - ): Promise; - async submitFeatureFlags( - parameters: Parameters.SubmitFeatureFlags, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/featureflags/0.1/bulk', - method: 'POST', - data: { - properties: parameters.properties, - flags: parameters.flags, - providerMetadata: parameters.providerMetadata, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all Feature Flags that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. Optional param `_updateSequenceId` is - * no longer supported. If more than one Property is provided, data will be deleted that matches ALL of the Properties - * (e.g. treated as an AND). See the documentation for the submitFeatureFlags operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteFeatureFlagsByProperty( - parameters: Parameters.DeleteFeatureFlagsByProperty, - callback: Callback, - ): Promise; - /** - * Bulk delete all Feature Flags that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. Optional param `_updateSequenceId` is - * no longer supported. If more than one Property is provided, data will be deleted that matches ALL of the Properties - * (e.g. treated as an AND). See the documentation for the submitFeatureFlags operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteFeatureFlagsByProperty( - parameters: Parameters.DeleteFeatureFlagsByProperty, - callback?: never, - ): Promise; - async deleteFeatureFlagsByProperty( - parameters: Parameters.DeleteFeatureFlagsByProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/featureflags/0.1/bulkByProperties', - method: 'DELETE', - params: { - _updateSequenceId: parameters.updateSequenceId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the currently stored Feature Flag data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getFeatureFlagById( - parameters: Parameters.GetFeatureFlagById, - callback: Callback, - ): Promise; - /** - * Retrieve the currently stored Feature Flag data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getFeatureFlagById( - parameters: Parameters.GetFeatureFlagById, - callback?: never, - ): Promise; - async getFeatureFlagById( - parameters: Parameters.GetFeatureFlagById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/featureflags/0.1/flag/${parameters.featureFlagId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete the Feature Flag data currently stored for the given ID. - * - * Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteFeatureFlagById( - parameters: Parameters.DeleteFeatureFlagById, - callback: Callback, - ): Promise; - /** - * Delete the Feature Flag data currently stored for the given ID. - * - * Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteFeatureFlagById(parameters: Parameters.DeleteFeatureFlagById, callback?: never): Promise; - async deleteFeatureFlagById( - parameters: Parameters.DeleteFeatureFlagById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/featureflags/0.1/flag/${parameters.featureFlagId}`, - method: 'DELETE', - params: { - _updateSequenceId: parameters.updateSequenceId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/index.mts b/src/agile/index.mts new file mode 100644 index 000000000..23649722e --- /dev/null +++ b/src/agile/index.mts @@ -0,0 +1,17 @@ +export * from './backlog.mjs'; +export * from './board.mjs'; +export * from './builds.mjs'; +export * from './deployments.mjs'; +export * from './developmentInformation.mjs'; +export * from './devopsComponents.mjs'; +export * from './epic.mjs'; +export * from './featureFlags.mjs'; +export * from './issue.mjs'; +export * from './operations.mjs'; +export * from './remoteLinks.mjs'; +export * from './securityInformation.mjs'; +export * from './sprint.mjs'; + +export * as AgileModels from './models/index.mjs'; +export * as AgileParameters from './parameters/index.mjs'; +export * from './client/agileClient.mjs'; diff --git a/src/agile/index.ts b/src/agile/index.ts deleted file mode 100644 index bdfbecf09..000000000 --- a/src/agile/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -export * from './backlog.js'; -export * from './board.js'; -export * from './builds.js'; -export * from './deployments.js'; -export * from './developmentInformation.js'; -export * from './devopsComponents.js'; -export * from './epic.js'; -export * from './featureFlags.js'; -export * from './issue.js'; -export * from './operations.js'; -export * from './remoteLinks.js'; -export * from './securityInformation.js'; -export * from './sprint.js'; - -export * as AgileModels from './models/index.js'; -export * as AgileParameters from './parameters/index.js'; -export * from './client/index.js'; diff --git a/src/agile/issue.mts b/src/agile/issue.mts new file mode 100644 index 000000000..9441778df --- /dev/null +++ b/src/agile/issue.mts @@ -0,0 +1,160 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Issue { + constructor(private client: Client) {} + + /** + * Moves (ranks) issues before or after a given issue. At most 50 issues may be ranked at once. + * + * This operation may fail for some issues, although this will be rare. In that case the 207 status code is returned + * for the whole response and detailed information regarding each issue is available in the response body. + * + * If rankCustomFieldId is not defined, the default rank field will be used. + */ + async rankIssues(parameters: Parameters.RankIssues, callback: Callback): Promise; + /** + * Moves (ranks) issues before or after a given issue. At most 50 issues may be ranked at once. + * + * This operation may fail for some issues, although this will be rare. In that case the 207 status code is returned + * for the whole response and detailed information regarding each issue is available in the response body. + * + * If rankCustomFieldId is not defined, the default rank field will be used. + */ + async rankIssues(parameters: Parameters.RankIssues, callback?: never): Promise; + async rankIssues(parameters: Parameters.RankIssues, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/agile/1.0/issue/rank', + method: 'PUT', + data: { + issues: parameters.issues, + rankAfterIssue: parameters.rankAfterIssue, + rankBeforeIssue: parameters.rankBeforeIssue, + rankCustomFieldId: parameters.rankCustomFieldId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a single issue, for a given issue ID or issue key. Issues returned from this resource include Agile fields, + * like sprint, closedSprints, flagged, and epic. + */ + async getIssue(parameters: Parameters.GetIssue, callback: Callback): Promise; + /** + * Returns a single issue, for a given issue ID or issue key. Issues returned from this resource include Agile fields, + * like sprint, closedSprints, flagged, and epic. + */ + async getIssue(parameters: Parameters.GetIssue, callback?: never): Promise; + async getIssue(parameters: Parameters.GetIssue, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/issue/${parameters.issueIdOrKey}`, + method: 'GET', + params: { + fields: parameters.fields, + expand: parameters.expand, + updateHistory: parameters.updateHistory, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the estimation of the issue and a fieldId of the field that is used for it. `boardId` param is required. + * This param determines which field will be updated on a issue. + * + * Original time internally stores and returns the estimation as a number of seconds. + * + * The field used for estimation on the given board can be obtained from [board configuration + * resource](#agile/1.0/board-getConfiguration). More information about the field are returned by [edit meta + * resource](#api-rest-api-3-issue-getEditIssueMeta) or [field resource](#api-rest-api-3-field-get). + */ + async getIssueEstimationForBoard( + parameters: Parameters.GetIssueEstimationForBoard, + callback: Callback, + ): Promise; + /** + * Returns the estimation of the issue and a fieldId of the field that is used for it. `boardId` param is required. + * This param determines which field will be updated on a issue. + * + * Original time internally stores and returns the estimation as a number of seconds. + * + * The field used for estimation on the given board can be obtained from [board configuration + * resource](#agile/1.0/board-getConfiguration). More information about the field are returned by [edit meta + * resource](#api-rest-api-3-issue-getEditIssueMeta) or [field resource](#api-rest-api-3-field-get). + */ + async getIssueEstimationForBoard( + parameters: Parameters.GetIssueEstimationForBoard, + callback?: never, + ): Promise; + async getIssueEstimationForBoard( + parameters: Parameters.GetIssueEstimationForBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/issue/${parameters.issueIdOrKey}/estimation`, + method: 'GET', + params: { + boardId: parameters.boardId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the estimation of the issue. boardId param is required. This param determines which field will be updated + * on an issue. + * + * Note that this resource changes the estimation field of the issue regardless of appearance the field on the screen. + * + * Original time tracking estimation field accepts estimation in formats like "1w", "2d", "3h", "20m" or number which + * represent number of minutes. However, internally the field stores and returns the estimation as a number of + * seconds. + * + * The field used for estimation on the given board can be obtained from [board configuration + * resource](#agile/1.0/board-getConfiguration). More information about the field are returned by [edit meta + * resource](#api-rest-api-3-issue-issueIdOrKey-editmeta-get) or [field resource](#api-rest-api-3-field-get). + */ + async estimateIssueForBoard( + parameters: Parameters.EstimateIssueForBoard, + callback: Callback, + ): Promise; + /** + * Updates the estimation of the issue. boardId param is required. This param determines which field will be updated + * on an issue. + * + * Note that this resource changes the estimation field of the issue regardless of appearance the field on the screen. + * + * Original time tracking estimation field accepts estimation in formats like "1w", "2d", "3h", "20m" or number which + * represent number of minutes. However, internally the field stores and returns the estimation as a number of + * seconds. + * + * The field used for estimation on the given board can be obtained from [board configuration + * resource](#agile/1.0/board-getConfiguration). More information about the field are returned by [edit meta + * resource](#api-rest-api-3-issue-issueIdOrKey-editmeta-get) or [field resource](#api-rest-api-3-field-get). + */ + async estimateIssueForBoard(parameters: Parameters.EstimateIssueForBoard, callback?: never): Promise; + async estimateIssueForBoard( + parameters: Parameters.EstimateIssueForBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/issue/${parameters.issueIdOrKey}/estimation`, + method: 'PUT', + params: { + boardId: parameters.boardId, + }, + data: { + value: parameters.value, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/issue.ts b/src/agile/issue.ts deleted file mode 100644 index f60315a6b..000000000 --- a/src/agile/issue.ts +++ /dev/null @@ -1,160 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Client } from '../clients/index.js'; -import type { Callback } from '../callback.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Issue { - constructor(private client: Client) {} - - /** - * Moves (ranks) issues before or after a given issue. At most 50 issues may be ranked at once. - * - * This operation may fail for some issues, although this will be rare. In that case the 207 status code is returned - * for the whole response and detailed information regarding each issue is available in the response body. - * - * If rankCustomFieldId is not defined, the default rank field will be used. - */ - async rankIssues(parameters: Parameters.RankIssues, callback: Callback): Promise; - /** - * Moves (ranks) issues before or after a given issue. At most 50 issues may be ranked at once. - * - * This operation may fail for some issues, although this will be rare. In that case the 207 status code is returned - * for the whole response and detailed information regarding each issue is available in the response body. - * - * If rankCustomFieldId is not defined, the default rank field will be used. - */ - async rankIssues(parameters: Parameters.RankIssues, callback?: never): Promise; - async rankIssues(parameters: Parameters.RankIssues, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/agile/1.0/issue/rank', - method: 'PUT', - data: { - issues: parameters.issues, - rankAfterIssue: parameters.rankAfterIssue, - rankBeforeIssue: parameters.rankBeforeIssue, - rankCustomFieldId: parameters.rankCustomFieldId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a single issue, for a given issue ID or issue key. Issues returned from this resource include Agile fields, - * like sprint, closedSprints, flagged, and epic. - */ - async getIssue(parameters: Parameters.GetIssue, callback: Callback): Promise; - /** - * Returns a single issue, for a given issue ID or issue key. Issues returned from this resource include Agile fields, - * like sprint, closedSprints, flagged, and epic. - */ - async getIssue(parameters: Parameters.GetIssue, callback?: never): Promise; - async getIssue(parameters: Parameters.GetIssue, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/issue/${parameters.issueIdOrKey}`, - method: 'GET', - params: { - fields: parameters.fields, - expand: parameters.expand, - updateHistory: parameters.updateHistory, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the estimation of the issue and a fieldId of the field that is used for it. `boardId` param is required. - * This param determines which field will be updated on a issue. - * - * Original time internally stores and returns the estimation as a number of seconds. - * - * The field used for estimation on the given board can be obtained from [board configuration - * resource](#agile/1.0/board-getConfiguration). More information about the field are returned by [edit meta - * resource](#api-rest-api-3-issue-getEditIssueMeta) or [field resource](#api-rest-api-3-field-get). - */ - async getIssueEstimationForBoard( - parameters: Parameters.GetIssueEstimationForBoard, - callback: Callback, - ): Promise; - /** - * Returns the estimation of the issue and a fieldId of the field that is used for it. `boardId` param is required. - * This param determines which field will be updated on a issue. - * - * Original time internally stores and returns the estimation as a number of seconds. - * - * The field used for estimation on the given board can be obtained from [board configuration - * resource](#agile/1.0/board-getConfiguration). More information about the field are returned by [edit meta - * resource](#api-rest-api-3-issue-getEditIssueMeta) or [field resource](#api-rest-api-3-field-get). - */ - async getIssueEstimationForBoard( - parameters: Parameters.GetIssueEstimationForBoard, - callback?: never, - ): Promise; - async getIssueEstimationForBoard( - parameters: Parameters.GetIssueEstimationForBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/issue/${parameters.issueIdOrKey}/estimation`, - method: 'GET', - params: { - boardId: parameters.boardId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the estimation of the issue. boardId param is required. This param determines which field will be updated - * on an issue. - * - * Note that this resource changes the estimation field of the issue regardless of appearance the field on the screen. - * - * Original time tracking estimation field accepts estimation in formats like "1w", "2d", "3h", "20m" or number which - * represent number of minutes. However, internally the field stores and returns the estimation as a number of - * seconds. - * - * The field used for estimation on the given board can be obtained from [board configuration - * resource](#agile/1.0/board-getConfiguration). More information about the field are returned by [edit meta - * resource](#api-rest-api-3-issue-issueIdOrKey-editmeta-get) or [field resource](#api-rest-api-3-field-get). - */ - async estimateIssueForBoard( - parameters: Parameters.EstimateIssueForBoard, - callback: Callback, - ): Promise; - /** - * Updates the estimation of the issue. boardId param is required. This param determines which field will be updated - * on an issue. - * - * Note that this resource changes the estimation field of the issue regardless of appearance the field on the screen. - * - * Original time tracking estimation field accepts estimation in formats like "1w", "2d", "3h", "20m" or number which - * represent number of minutes. However, internally the field stores and returns the estimation as a number of - * seconds. - * - * The field used for estimation on the given board can be obtained from [board configuration - * resource](#agile/1.0/board-getConfiguration). More information about the field are returned by [edit meta - * resource](#api-rest-api-3-issue-issueIdOrKey-editmeta-get) or [field resource](#api-rest-api-3-field-get). - */ - async estimateIssueForBoard(parameters: Parameters.EstimateIssueForBoard, callback?: never): Promise; - async estimateIssueForBoard( - parameters: Parameters.EstimateIssueForBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/issue/${parameters.issueIdOrKey}/estimation`, - method: 'PUT', - params: { - boardId: parameters.boardId, - }, - data: { - value: parameters.value, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/models/avatarUrls.ts b/src/agile/models/avatarUrls.mts similarity index 100% rename from src/agile/models/avatarUrls.ts rename to src/agile/models/avatarUrls.mts diff --git a/src/agile/models/board.mts b/src/agile/models/board.mts new file mode 100644 index 000000000..d9d643877 --- /dev/null +++ b/src/agile/models/board.mts @@ -0,0 +1,52 @@ +import { AvatarUrls } from './avatarUrls.mjs'; + +/** Details about a board. */ +export interface Board { + /** The users and groups who own the board. */ + admins?: { + groups?: { + name?: string; + self?: string; + }[]; + users?: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** Whether the user is active. */ + active?: boolean; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** The URL of the user. */ + self?: string; + }[]; + }; + /** Whether the board can be edited. */ + canEdit?: boolean; + /** Whether the board is selected as a favorite. */ + favourite?: boolean; + /** The ID of the board. */ + id?: number; + /** Whether the board is private. */ + isPrivate?: boolean; + /** The container that the board is located in. */ + location?: { + avatarURI?: string; + displayName?: string; + name?: string; + projectId?: number; + projectKey?: string; + projectName?: string; + projectTypeKey?: string; + userAccountId?: string; + userId?: number; + }; + /** The name of the board. */ + name?: string; + /** The URL of the board. */ + self?: string; + /** The type the board. */ + type?: string; +} diff --git a/src/agile/models/board.ts b/src/agile/models/board.ts deleted file mode 100644 index fb36c19d6..000000000 --- a/src/agile/models/board.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; - -/** Details about a board. */ -export interface Board { - /** The users and groups who own the board. */ - admins?: { - groups?: { - name?: string; - self?: string; - }[]; - users?: { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** Whether the user is active. */ - active?: boolean; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** The URL of the user. */ - self?: string; - }[]; - }; - /** Whether the board can be edited. */ - canEdit?: boolean; - /** Whether the board is selected as a favorite. */ - favourite?: boolean; - /** The ID of the board. */ - id?: number; - /** Whether the board is private. */ - isPrivate?: boolean; - /** The container that the board is located in. */ - location?: { - avatarURI?: string; - displayName?: string; - name?: string; - projectId?: number; - projectKey?: string; - projectName?: string; - projectTypeKey?: string; - userAccountId?: string; - userId?: number; - }; - /** The name of the board. */ - name?: string; - /** The URL of the board. */ - self?: string; - /** The type the board. */ - type?: string; -} diff --git a/src/agile/models/createBoard.mts b/src/agile/models/createBoard.mts new file mode 100644 index 000000000..39bece3ca --- /dev/null +++ b/src/agile/models/createBoard.mts @@ -0,0 +1,52 @@ +import { AvatarUrls } from './avatarUrls.mjs'; + +/** Details about a board. */ +export interface CreateBoard { + /** The users and groups who own the board. */ + admins?: { + groups?: { + name?: string; + self?: string; + }[]; + users?: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** Whether the user is active. */ + active?: boolean; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** The URL of the user. */ + self?: string; + }[]; + }; + /** Whether the board can be edited. */ + canEdit?: boolean; + /** Whether the board is selected as a favorite. */ + favourite?: boolean; + /** The ID of the board. */ + id?: number; + /** Whether the board is private. */ + isPrivate?: boolean; + /** The container that the board is located in. */ + location?: { + avatarURI?: string; + displayName?: string; + name?: string; + projectId?: number; + projectKey?: string; + projectName?: string; + projectTypeKey?: string; + userAccountId?: string; + userId?: number; + }; + /** The name of the board. */ + name?: string; + /** The URL of the board. */ + self?: string; + /** The type the board. */ + type?: string; +} diff --git a/src/agile/models/createBoard.ts b/src/agile/models/createBoard.ts deleted file mode 100644 index 61e3697bf..000000000 --- a/src/agile/models/createBoard.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; - -/** Details about a board. */ -export interface CreateBoard { - /** The users and groups who own the board. */ - admins?: { - groups?: { - name?: string; - self?: string; - }[]; - users?: { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** Whether the user is active. */ - active?: boolean; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** The URL of the user. */ - self?: string; - }[]; - }; - /** Whether the board can be edited. */ - canEdit?: boolean; - /** Whether the board is selected as a favorite. */ - favourite?: boolean; - /** The ID of the board. */ - id?: number; - /** Whether the board is private. */ - isPrivate?: boolean; - /** The container that the board is located in. */ - location?: { - avatarURI?: string; - displayName?: string; - name?: string; - projectId?: number; - projectKey?: string; - projectName?: string; - projectTypeKey?: string; - userAccountId?: string; - userId?: number; - }; - /** The name of the board. */ - name?: string; - /** The URL of the board. */ - self?: string; - /** The type the board. */ - type?: string; -} diff --git a/src/agile/models/epic.ts b/src/agile/models/epic.mts similarity index 100% rename from src/agile/models/epic.ts rename to src/agile/models/epic.mts diff --git a/src/agile/models/existsByProperties.ts b/src/agile/models/existsByProperties.mts similarity index 100% rename from src/agile/models/existsByProperties.ts rename to src/agile/models/existsByProperties.mts diff --git a/src/agile/models/fields.mts b/src/agile/models/fields.mts new file mode 100644 index 000000000..c57facb2c --- /dev/null +++ b/src/agile/models/fields.mts @@ -0,0 +1,85 @@ +import { Attachment } from '@/version3/models/index.mjs'; // todo why? +import { Epic } from './epic.mjs'; +import type { FixVersion } from './fixVersion.mjs'; +import type { Issue } from './issue.mjs'; +import { IssueType } from './issueType.mjs'; +import { Progress } from './progress.mjs'; +import type { Project } from './project.mjs'; +import { Sprint } from './sprint.mjs'; +import type { Status } from './status.mjs'; +import { User } from './user.mjs'; +import type { Version } from './version.mjs'; +import { + Comment, + IssueLink, + Priority, + ProjectComponent, + Resolution, + RichText, + TimeTrackingDetails, + Votes, + Watchers, + Worklog, +} from '@/version2/models/index.mjs'; + +export interface Fields { + [key: string]: any; + + aggregateprogress: Progress; + aggregatetimeestimate: number | null; + aggregatetimeoriginalestimate: number | null; + aggregatetimespent: number | null; + assignee: User; + attachment: Attachment[]; + comment: { + comments: Comment[]; + self: string; + maxResults: number; + total: number; + startAt: number; + }; + components: ProjectComponent[]; + created: string; + creator: User; + description: string | null; + duedate: string | null; + environment: RichText | null; + epic: Epic | null; + fixVersions: FixVersion[]; + flagged: boolean; + issuelinks: IssueLink[]; + issuerestriction: { + issuerestrictions: any; + shouldDisplay: boolean; + }; + issuetype: IssueType; + labels: string[]; + lastViewed: string | null; + priority: Priority; + progress: Progress; + project: Project; + reporter: User; + resolution: Resolution | null; + resolutiondate: string | null; + security: any | null; + sprint: Sprint; + status: Status; + statuscategorychangedate: string; + subtasks: Issue[]; + summary: string; + timeestimate: number | null; + timeoriginalestimate: any | null; + timespent: number | null; + timetracking: TimeTrackingDetails; + updated: string; + versions: Version[]; + votes: Votes; + watches: Watchers; + worklog: { + startAt: number; + maxResults: number; + total: number; + worklogs: Worklog[]; + }; + workratio: number; +} diff --git a/src/agile/models/fields.ts b/src/agile/models/fields.ts deleted file mode 100644 index 37df5b0a9..000000000 --- a/src/agile/models/fields.ts +++ /dev/null @@ -1,85 +0,0 @@ -import type { Attachment } from '../../version3/models/index.js'; -import type { Epic } from './epic.js'; -import type { FixVersion } from './fixVersion.js'; -import type { Issue } from './issue.js'; -import type { IssueType } from './issueType.js'; -import type { Progress } from './progress.js'; -import type { Project } from './project.js'; -import type { Sprint } from './sprint.js'; -import type { Status } from './status.js'; -import type { User } from './user.js'; -import type { Version } from './version.js'; -import type { - Comment, - IssueLink, - Priority, - ProjectComponent, - Resolution, - RichText, - TimeTrackingDetails, - Votes, - Watchers, - Worklog, -} from '../../version2/models/index.js'; - -export interface Fields { - [key: string]: any; - - aggregateprogress: Progress; - aggregatetimeestimate: number | null; - aggregatetimeoriginalestimate: number | null; - aggregatetimespent: number | null; - assignee: User; - attachment: Attachment[]; - comment: { - comments: Comment[]; - self: string; - maxResults: number; - total: number; - startAt: number; - }; - components: ProjectComponent[]; - created: string; - creator: User; - description: string | null; - duedate: string | null; - environment: RichText | null; - epic: Epic | null; - fixVersions: FixVersion[]; - flagged: boolean; - issuelinks: IssueLink[]; - issuerestriction: { - issuerestrictions: any; - shouldDisplay: boolean; - }; - issuetype: IssueType; - labels: string[]; - lastViewed: string | null; - priority: Priority; - progress: Progress; - project: Project; - reporter: User; - resolution: Resolution | null; - resolutiondate: string | null; - security: any | null; - sprint: Sprint; - status: Status; - statuscategorychangedate: string; - subtasks: Issue[]; - summary: string; - timeestimate: number | null; - timeoriginalestimate: any | null; - timespent: number | null; - timetracking: TimeTrackingDetails; - updated: string; - versions: Version[]; - votes: Votes; - watches: Watchers; - worklog: { - startAt: number; - maxResults: number; - total: number; - worklogs: Worklog[]; - }; - workratio: number; -} diff --git a/src/agile/models/fixVersion.ts b/src/agile/models/fixVersion.mts similarity index 100% rename from src/agile/models/fixVersion.ts rename to src/agile/models/fixVersion.mts diff --git a/src/agile/models/getAllBoards.mts b/src/agile/models/getAllBoards.mts new file mode 100644 index 000000000..c71fb9ee1 --- /dev/null +++ b/src/agile/models/getAllBoards.mts @@ -0,0 +1,9 @@ +import { Board } from './board.mjs'; + +export interface GetAllBoards { + isLast?: boolean; + maxResults?: number; + startAt?: number; + total?: number; + values: Board[]; +} diff --git a/src/agile/models/getAllBoards.ts b/src/agile/models/getAllBoards.ts deleted file mode 100644 index 5c13ab939..000000000 --- a/src/agile/models/getAllBoards.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Board } from './board.js'; - -export interface GetAllBoards { - isLast?: boolean; - maxResults?: number; - startAt?: number; - total?: number; - values: Board[]; -} diff --git a/src/agile/models/getAllQuickFilters.ts b/src/agile/models/getAllQuickFilters.mts similarity index 100% rename from src/agile/models/getAllQuickFilters.ts rename to src/agile/models/getAllQuickFilters.mts diff --git a/src/agile/models/getBoard.mts b/src/agile/models/getBoard.mts new file mode 100644 index 000000000..219c381f3 --- /dev/null +++ b/src/agile/models/getBoard.mts @@ -0,0 +1,52 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; + +/** Details about a board. */ +export interface GetBoard { + /** The users and groups who own the board. */ + admins?: { + groups?: { + name?: string; + self?: string; + }[]; + users?: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** Whether the user is active. */ + active?: boolean; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** The URL of the user. */ + self?: string; + }[]; + }; + /** Whether the board can be edited. */ + canEdit?: boolean; + /** Whether the board is selected as a favorite. */ + favourite?: boolean; + /** The ID of the board. */ + id?: number; + /** Whether the board is private. */ + isPrivate?: boolean; + /** The container that the board is located in. */ + location?: { + avatarURI?: string; + displayName?: string; + name?: string; + projectId?: number; + projectKey?: string; + projectName?: string; + projectTypeKey?: string; + userAccountId?: string; + userId?: number; + }; + /** The name of the board. */ + name?: string; + /** The URL of the board. */ + self?: string; + /** The type the board. */ + type?: string; +} diff --git a/src/agile/models/getBoard.ts b/src/agile/models/getBoard.ts deleted file mode 100644 index 39f4e98e1..000000000 --- a/src/agile/models/getBoard.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; - -/** Details about a board. */ -export interface GetBoard { - /** The users and groups who own the board. */ - admins?: { - groups?: { - name?: string; - self?: string; - }[]; - users?: { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** Whether the user is active. */ - active?: boolean; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** The URL of the user. */ - self?: string; - }[]; - }; - /** Whether the board can be edited. */ - canEdit?: boolean; - /** Whether the board is selected as a favorite. */ - favourite?: boolean; - /** The ID of the board. */ - id?: number; - /** Whether the board is private. */ - isPrivate?: boolean; - /** The container that the board is located in. */ - location?: { - avatarURI?: string; - displayName?: string; - name?: string; - projectId?: number; - projectKey?: string; - projectName?: string; - projectTypeKey?: string; - userAccountId?: string; - userId?: number; - }; - /** The name of the board. */ - name?: string; - /** The URL of the board. */ - self?: string; - /** The type the board. */ - type?: string; -} diff --git a/src/agile/models/getBoardByFilterId.ts b/src/agile/models/getBoardByFilterId.mts similarity index 100% rename from src/agile/models/getBoardByFilterId.ts rename to src/agile/models/getBoardByFilterId.mts diff --git a/src/agile/models/getBuildByKey.ts b/src/agile/models/getBuildByKey.mts similarity index 100% rename from src/agile/models/getBuildByKey.ts rename to src/agile/models/getBuildByKey.mts diff --git a/src/agile/models/getComponentById.ts b/src/agile/models/getComponentById.mts similarity index 100% rename from src/agile/models/getComponentById.ts rename to src/agile/models/getComponentById.mts diff --git a/src/agile/models/getConfiguration.ts b/src/agile/models/getConfiguration.mts similarity index 100% rename from src/agile/models/getConfiguration.ts rename to src/agile/models/getConfiguration.mts diff --git a/src/agile/models/getDeploymentByKey.ts b/src/agile/models/getDeploymentByKey.mts similarity index 100% rename from src/agile/models/getDeploymentByKey.ts rename to src/agile/models/getDeploymentByKey.mts diff --git a/src/agile/models/getDeploymentGatingStatusByKey.ts b/src/agile/models/getDeploymentGatingStatusByKey.mts similarity index 100% rename from src/agile/models/getDeploymentGatingStatusByKey.ts rename to src/agile/models/getDeploymentGatingStatusByKey.mts diff --git a/src/agile/models/getFeatureFlagById.ts b/src/agile/models/getFeatureFlagById.mts similarity index 100% rename from src/agile/models/getFeatureFlagById.ts rename to src/agile/models/getFeatureFlagById.mts diff --git a/src/agile/models/getFeaturesForBoard.ts b/src/agile/models/getFeaturesForBoard.mts similarity index 100% rename from src/agile/models/getFeaturesForBoard.ts rename to src/agile/models/getFeaturesForBoard.mts diff --git a/src/agile/models/getIncidentById.ts b/src/agile/models/getIncidentById.mts similarity index 100% rename from src/agile/models/getIncidentById.ts rename to src/agile/models/getIncidentById.mts diff --git a/src/agile/models/getLinkedWorkspaceById.ts b/src/agile/models/getLinkedWorkspaceById.mts similarity index 100% rename from src/agile/models/getLinkedWorkspaceById.ts rename to src/agile/models/getLinkedWorkspaceById.mts diff --git a/src/agile/models/getLinkedWorkspaces.ts b/src/agile/models/getLinkedWorkspaces.mts similarity index 100% rename from src/agile/models/getLinkedWorkspaces.ts rename to src/agile/models/getLinkedWorkspaces.mts diff --git a/src/agile/models/getQuickFilter.ts b/src/agile/models/getQuickFilter.mts similarity index 100% rename from src/agile/models/getQuickFilter.ts rename to src/agile/models/getQuickFilter.mts diff --git a/src/agile/models/getRemoteLinkById.ts b/src/agile/models/getRemoteLinkById.mts similarity index 100% rename from src/agile/models/getRemoteLinkById.ts rename to src/agile/models/getRemoteLinkById.mts diff --git a/src/agile/models/getReportsForBoard.ts b/src/agile/models/getReportsForBoard.mts similarity index 100% rename from src/agile/models/getReportsForBoard.ts rename to src/agile/models/getReportsForBoard.mts diff --git a/src/agile/models/getRepository.ts b/src/agile/models/getRepository.mts similarity index 100% rename from src/agile/models/getRepository.ts rename to src/agile/models/getRepository.mts diff --git a/src/agile/models/getReviewById.ts b/src/agile/models/getReviewById.mts similarity index 100% rename from src/agile/models/getReviewById.ts rename to src/agile/models/getReviewById.mts diff --git a/src/agile/models/getVulnerabilityById.ts b/src/agile/models/getVulnerabilityById.mts similarity index 100% rename from src/agile/models/getVulnerabilityById.ts rename to src/agile/models/getVulnerabilityById.mts diff --git a/src/agile/models/getWorkspaces.ts b/src/agile/models/getWorkspaces.mts similarity index 100% rename from src/agile/models/getWorkspaces.ts rename to src/agile/models/getWorkspaces.mts diff --git a/src/agile/models/group.ts b/src/agile/models/group.mts similarity index 100% rename from src/agile/models/group.ts rename to src/agile/models/group.mts diff --git a/src/agile/models/index.mts b/src/agile/models/index.mts new file mode 100644 index 000000000..cbb368903 --- /dev/null +++ b/src/agile/models/index.mts @@ -0,0 +1,58 @@ +export * from './avatarUrls.mjs'; +export * from './board.mjs'; +export * from './createBoard.mjs'; +export * from './epic.mjs'; +export * from './existsByProperties.mjs'; +export * from './fields.mjs'; +export * from './fixVersion.mjs'; +export * from './getAllBoards.mjs'; +export * from './getAllQuickFilters.mjs'; +export * from './getBoard.mjs'; +export * from './getBoardByFilterId.mjs'; +export * from './getBuildByKey.mjs'; +export * from './getComponentById.mjs'; +export * from './getConfiguration.mjs'; +export * from './getDeploymentByKey.mjs'; +export * from './getDeploymentGatingStatusByKey.mjs'; +export * from './getFeatureFlagById.mjs'; +export * from './getFeaturesForBoard.mjs'; +export * from './getIncidentById.mjs'; +export * from './getLinkedWorkspaceById.mjs'; +export * from './getLinkedWorkspaces.mjs'; +export * from './getQuickFilter.mjs'; +export * from './getRemoteLinkById.mjs'; +export * from './getReportsForBoard.mjs'; +export * from './getRepository.mjs'; +export * from './getReviewById.mjs'; +export * from './getVulnerabilityById.mjs'; +export * from './getWorkspaces.mjs'; +export * from './group.mjs'; +export * from './issue.mjs'; +export * from './issueTransition.mjs'; +export * from './issueType.mjs'; +export * from './jsonType.mjs'; +export * from './linkedSecurityWorkspaceIds.mjs'; +export * from './linkedWorkspace.mjs'; +export * from './linkGroup.mjs'; +export * from './operations.mjs'; +export * from './scope.mjs'; +export * from './progress.mjs'; +export * from './project.mjs'; +export * from './projects.mjs'; +export * from './searchResults.mjs'; +export * from './sprint.mjs'; +export * from './status.mjs'; +export * from './statusCategory.mjs'; +export * from './storeDevelopmentInformation.mjs'; +export * from './submitBuilds.mjs'; +export * from './submitComponents.mjs'; +export * from './submitDeployments.mjs'; +export * from './submitEntity.mjs'; +export * from './submitFeatureFlags.mjs'; +export * from './submitOperationsWorkspaces.mjs'; +export * from './submitRemoteLinks.mjs'; +export * from './submitVulnerabilities.mjs'; +export * from './toggleFeatures.mjs'; +export * from './user.mjs'; +export * from './version.mjs'; +export * from './vulnerability.mjs'; diff --git a/src/agile/models/index.ts b/src/agile/models/index.ts deleted file mode 100644 index 71ff233f5..000000000 --- a/src/agile/models/index.ts +++ /dev/null @@ -1,58 +0,0 @@ -export * from './avatarUrls.js'; -export * from './board.js'; -export * from './createBoard.js'; -export * from './epic.js'; -export * from './existsByProperties.js'; -export * from './fields.js'; -export * from './fixVersion.js'; -export * from './getAllBoards.js'; -export * from './getAllQuickFilters.js'; -export * from './getBoard.js'; -export * from './getBoardByFilterId.js'; -export * from './getBuildByKey.js'; -export * from './getComponentById.js'; -export * from './getConfiguration.js'; -export * from './getDeploymentByKey.js'; -export * from './getDeploymentGatingStatusByKey.js'; -export * from './getFeatureFlagById.js'; -export * from './getFeaturesForBoard.js'; -export * from './getIncidentById.js'; -export * from './getLinkedWorkspaceById.js'; -export * from './getLinkedWorkspaces.js'; -export * from './getQuickFilter.js'; -export * from './getRemoteLinkById.js'; -export * from './getReportsForBoard.js'; -export * from './getRepository.js'; -export * from './getReviewById.js'; -export * from './getVulnerabilityById.js'; -export * from './getWorkspaces.js'; -export * from './group.js'; -export * from './issue.js'; -export * from './issueTransition.js'; -export * from './issueType.js'; -export * from './jsonType.js'; -export * from './linkedSecurityWorkspaceIds.js'; -export * from './linkedWorkspace.js'; -export * from './linkGroup.js'; -export * from './operations.js'; -export * from './scope.js'; -export * from './progress.js'; -export * from './project.js'; -export * from './projects.js'; -export * from './searchResults.js'; -export * from './sprint.js'; -export * from './status.js'; -export * from './statusCategory.js'; -export * from './storeDevelopmentInformation.js'; -export * from './submitBuilds.js'; -export * from './submitComponents.js'; -export * from './submitDeployments.js'; -export * from './submitEntity.js'; -export * from './submitFeatureFlags.js'; -export * from './submitOperationsWorkspaces.js'; -export * from './submitRemoteLinks.js'; -export * from './submitVulnerabilities.js'; -export * from './toggleFeatures.js'; -export * from './user.js'; -export * from './version.js'; -export * from './vulnerability.js'; diff --git a/src/agile/models/issue.mts b/src/agile/models/issue.mts new file mode 100644 index 000000000..02778b773 --- /dev/null +++ b/src/agile/models/issue.mts @@ -0,0 +1,216 @@ +import { Operations } from './operations.mjs'; +import { Fields } from './fields.mjs'; +import type { Scope } from './scope.mjs'; +import type { StatusCategory } from './statusCategory.mjs'; +import type { AvatarUrls } from './avatarUrls.mjs'; + +/** Details about an issue. */ +export interface Issue { + /** A page of changelogs. */ + changelog?: { + /** The list of changelogs. */ + histories?: { + /** + * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions: + * + * User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, + * `displayName` provides an indication and other parameters have default values or are blank (for example, email + * is blank). User record corrupted: This occurs as a results of events such as a server import and can only + * happen to deleted users. In this case, `accountId` returns _unknown_ and all other parameters have fallback + * values. User record unavailable: This usually occurs due to an internal service outage. In this case, all + * parameters have fallback values. + */ + author?: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** + * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' + * (application user) or 'customer' (Jira Service Desk customer user) + */ + accountType?: string; + /** Whether the user is active. */ + active?: boolean; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ + displayName?: string; + /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ + emailAddress?: string; + /** The URL of the user. */ + self?: string; + /** + * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned + * as null. + */ + timeZone?: string; + }; + /** The date on which the change took place. */ + created?: string; + /** Details of issue history metadata. */ + historyMetadata?: { + /** The activity described in the history record. */ + activityDescription?: string; + /** The key of the activity described in the history record. */ + activityDescriptionKey?: string; + /** Details of user or system associated with a issue history metadata item. */ + actor?: { + /** The URL to an avatar for the user or system associated with a history record. */ + avatarUrl?: string; + /** The display name of the user or system associated with a history record. */ + displayName?: string; + /** The key of the display name of the user or system associated with a history record. */ + displayNameKey?: string; + /** The ID of the user or system associated with a history record. */ + id?: string; + /** The type of the user or system associated with a history record. */ + type?: string; + /** The URL of the user or system associated with a history record. */ + url?: string; + }; + /** Details of user or system associated with a issue history metadata item. */ + cause?: { + /** The URL to an avatar for the user or system associated with a history record. */ + avatarUrl?: string; + /** The display name of the user or system associated with a history record. */ + displayName?: string; + /** The key of the display name of the user or system associated with a history record. */ + displayNameKey?: string; + /** The ID of the user or system associated with a history record. */ + id?: string; + /** The type of the user or system associated with a history record. */ + type?: string; + /** The URL of the user or system associated with a history record. */ + url?: string; + }; + /** The description of the history record. */ + description?: string; + /** The description key of the history record. */ + descriptionKey?: string; + /** The description of the email address associated the history record. */ + emailDescription?: string; + /** The description key of the email address associated the history record. */ + emailDescriptionKey?: string; + /** Additional arbitrary information about the history record. */ + extraData?: {}; + /** Details of user or system associated with a issue history metadata item. */ + generator?: { + /** The URL to an avatar for the user or system associated with a history record. */ + avatarUrl?: string; + /** The display name of the user or system associated with a history record. */ + displayName?: string; + /** The key of the display name of the user or system associated with a history record. */ + displayNameKey?: string; + /** The ID of the user or system associated with a history record. */ + id?: string; + /** The type of the user or system associated with a history record. */ + type?: string; + /** The URL of the user or system associated with a history record. */ + url?: string; + }; + /** The type of the history record. */ + type?: string; + }; + /** The ID of the changelog. */ + id?: string; + /** The list of items changed. */ + items?: { + /** The name of the field changed. */ + field?: string; + /** The ID of the field changed. */ + fieldId?: string; + /** The type of the field changed. */ + fieldtype?: string; + /** The details of the original value. */ + from?: string; + /** The details of the original value as a string. */ + fromString?: string; + /** The details of the new value. */ + to?: string; + /** The details of the new value as a string. */ + toString?: string; + }[]; + }[]; + /** The maximum number of results that could be on the page. */ + maxResults?: number; + /** The index of the first item returned on the page. */ + startAt?: number; + /** The number of results on the page. */ + total?: number; + }; + /** A list of editable field details. */ + editmeta?: { + fields?: {}; + }; + /** Expand options that include additional issue details in the response. */ + expand?: string; + fields?: Fields; + fieldsToInclude?: { + actuallyIncluded?: string[]; + excluded?: string[]; + included?: string[]; + }; + /** The ID of the issue. */ + id?: string; + /** The key of the issue. */ + key?: string; + /** The ID and name of each field present on the issue. */ + names?: {}; + operations?: Operations; + /** Details of the issue properties identified in the request. */ + properties?: {}; + /** The rendered value of each field present on the issue. */ + renderedFields?: {}; + /** The schema describing each field present on the issue. */ + schema?: {}; + /** The URL of the issue details. */ + self?: string; + /** The transitions that can be performed on the issue. */ + transitions?: { + /** Expand options that include additional transition details in the response. */ + expand?: string; + /** + * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and + * `update` in a transition request. + */ + fields?: {}; + /** Whether there is a screen associated with the issue transition. */ + hasScreen?: boolean; + /** The ID of the issue transition. Required when specifying a transition to undertake. */ + id?: string; + /** Whether the transition is available to be performed. */ + isAvailable?: boolean; + /** Whether the issue has to meet criteria before the issue transition is applied. */ + isConditional?: boolean; + /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ + isGlobal?: boolean; + /** Whether this is the initial issue transition for the workflow. */ + isInitial?: boolean; + looped?: boolean; + /** The name of the issue transition. */ + name?: string; + /** A status. */ + to?: { + /** The description of the status. */ + description?: string; + /** The URL of the icon used to represent the status. */ + iconUrl?: string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; + /** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ + scope?: Scope; + /** The URL of the status. */ + self?: string; + /** A status category. */ + statusCategory?: StatusCategory; + }; + }[]; + /** The versions of each field on the issue. */ + versionedRepresentations?: {}; +} diff --git a/src/agile/models/issue.ts b/src/agile/models/issue.ts deleted file mode 100644 index c0691f81f..000000000 --- a/src/agile/models/issue.ts +++ /dev/null @@ -1,216 +0,0 @@ -import type { Operations } from './operations.js'; -import type { Fields } from './fields.js'; -import type { Scope } from './scope.js'; -import type { StatusCategory } from './statusCategory.js'; -import type { AvatarUrls } from './avatarUrls.js'; - -/** Details about an issue. */ -export interface Issue { - /** A page of changelogs. */ - changelog?: { - /** The list of changelogs. */ - histories?: { - /** - * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions: - * - * User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, - * `displayName` provides an indication and other parameters have default values or are blank (for example, email - * is blank). User record corrupted: This occurs as a results of events such as a server import and can only - * happen to deleted users. In this case, `accountId` returns _unknown_ and all other parameters have fallback - * values. User record unavailable: This usually occurs due to an internal service outage. In this case, all - * parameters have fallback values. - */ - author?: { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** - * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' - * (application user) or 'customer' (Jira Service Desk customer user) - */ - accountType?: string; - /** Whether the user is active. */ - active?: boolean; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ - displayName?: string; - /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ - emailAddress?: string; - /** The URL of the user. */ - self?: string; - /** - * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned - * as null. - */ - timeZone?: string; - }; - /** The date on which the change took place. */ - created?: string; - /** Details of issue history metadata. */ - historyMetadata?: { - /** The activity described in the history record. */ - activityDescription?: string; - /** The key of the activity described in the history record. */ - activityDescriptionKey?: string; - /** Details of user or system associated with a issue history metadata item. */ - actor?: { - /** The URL to an avatar for the user or system associated with a history record. */ - avatarUrl?: string; - /** The display name of the user or system associated with a history record. */ - displayName?: string; - /** The key of the display name of the user or system associated with a history record. */ - displayNameKey?: string; - /** The ID of the user or system associated with a history record. */ - id?: string; - /** The type of the user or system associated with a history record. */ - type?: string; - /** The URL of the user or system associated with a history record. */ - url?: string; - }; - /** Details of user or system associated with a issue history metadata item. */ - cause?: { - /** The URL to an avatar for the user or system associated with a history record. */ - avatarUrl?: string; - /** The display name of the user or system associated with a history record. */ - displayName?: string; - /** The key of the display name of the user or system associated with a history record. */ - displayNameKey?: string; - /** The ID of the user or system associated with a history record. */ - id?: string; - /** The type of the user or system associated with a history record. */ - type?: string; - /** The URL of the user or system associated with a history record. */ - url?: string; - }; - /** The description of the history record. */ - description?: string; - /** The description key of the history record. */ - descriptionKey?: string; - /** The description of the email address associated the history record. */ - emailDescription?: string; - /** The description key of the email address associated the history record. */ - emailDescriptionKey?: string; - /** Additional arbitrary information about the history record. */ - extraData?: {}; - /** Details of user or system associated with a issue history metadata item. */ - generator?: { - /** The URL to an avatar for the user or system associated with a history record. */ - avatarUrl?: string; - /** The display name of the user or system associated with a history record. */ - displayName?: string; - /** The key of the display name of the user or system associated with a history record. */ - displayNameKey?: string; - /** The ID of the user or system associated with a history record. */ - id?: string; - /** The type of the user or system associated with a history record. */ - type?: string; - /** The URL of the user or system associated with a history record. */ - url?: string; - }; - /** The type of the history record. */ - type?: string; - }; - /** The ID of the changelog. */ - id?: string; - /** The list of items changed. */ - items?: { - /** The name of the field changed. */ - field?: string; - /** The ID of the field changed. */ - fieldId?: string; - /** The type of the field changed. */ - fieldtype?: string; - /** The details of the original value. */ - from?: string; - /** The details of the original value as a string. */ - fromString?: string; - /** The details of the new value. */ - to?: string; - /** The details of the new value as a string. */ - toString?: string; - }[]; - }[]; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The index of the first item returned on the page. */ - startAt?: number; - /** The number of results on the page. */ - total?: number; - }; - /** A list of editable field details. */ - editmeta?: { - fields?: {}; - }; - /** Expand options that include additional issue details in the response. */ - expand?: string; - fields?: Fields; - fieldsToInclude?: { - actuallyIncluded?: string[]; - excluded?: string[]; - included?: string[]; - }; - /** The ID of the issue. */ - id?: string; - /** The key of the issue. */ - key?: string; - /** The ID and name of each field present on the issue. */ - names?: {}; - operations?: Operations; - /** Details of the issue properties identified in the request. */ - properties?: {}; - /** The rendered value of each field present on the issue. */ - renderedFields?: {}; - /** The schema describing each field present on the issue. */ - schema?: {}; - /** The URL of the issue details. */ - self?: string; - /** The transitions that can be performed on the issue. */ - transitions?: { - /** Expand options that include additional transition details in the response. */ - expand?: string; - /** - * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and - * `update` in a transition request. - */ - fields?: {}; - /** Whether there is a screen associated with the issue transition. */ - hasScreen?: boolean; - /** The ID of the issue transition. Required when specifying a transition to undertake. */ - id?: string; - /** Whether the transition is available to be performed. */ - isAvailable?: boolean; - /** Whether the issue has to meet criteria before the issue transition is applied. */ - isConditional?: boolean; - /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ - isGlobal?: boolean; - /** Whether this is the initial issue transition for the workflow. */ - isInitial?: boolean; - looped?: boolean; - /** The name of the issue transition. */ - name?: string; - /** A status. */ - to?: { - /** The description of the status. */ - description?: string; - /** The URL of the icon used to represent the status. */ - iconUrl?: string; - /** The ID of the status. */ - id?: string; - /** The name of the status. */ - name?: string; - /** - * The projects the item is associated with. Indicated for items associated with [next-gen - * projects](https://confluence.atlassian.com/x/loMyO). - */ - scope?: Scope; - /** The URL of the status. */ - self?: string; - /** A status category. */ - statusCategory?: StatusCategory; - }; - }[]; - /** The versions of each field on the issue. */ - versionedRepresentations?: {}; -} diff --git a/src/agile/models/issueTransition.mts b/src/agile/models/issueTransition.mts new file mode 100644 index 000000000..8dcad2d14 --- /dev/null +++ b/src/agile/models/issueTransition.mts @@ -0,0 +1,58 @@ +import type { Scope } from './scope.mjs'; + +/** Details of an issue transition. */ +export interface IssueTransition { + /** Expand options that include additional transition details in the response. */ + expand?: string; + /** + * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and + * `update` in a transition request. + */ + fields?: {}; + /** Whether there is a screen associated with the issue transition. */ + hasScreen?: boolean; + /** The ID of the issue transition. Required when specifying a transition to undertake. */ + id?: string; + /** Whether the transition is available to be performed. */ + isAvailable?: boolean; + /** Whether the issue has to meet criteria before the issue transition is applied. */ + isConditional?: boolean; + /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ + isGlobal?: boolean; + /** Whether this is the initial issue transition for the workflow. */ + isInitial?: boolean; + looped?: boolean; + /** The name of the issue transition. */ + name?: string; + /** A status. */ + to?: { + /** The description of the status. */ + description?: string; + /** The URL of the icon used to represent the status. */ + iconUrl?: string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; + /** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ + scope?: Scope; + /** The URL of the status. */ + self?: string; + /** A status category. */ + statusCategory?: { + /** The name of the color used to represent the status category. */ + colorName?: string; + /** The ID of the status category. */ + id?: number; + /** The key of the status category. */ + key?: string; + /** The name of the status category. */ + name?: string; + /** The URL of the status category. */ + self: string; + }; + }; +} diff --git a/src/agile/models/issueTransition.ts b/src/agile/models/issueTransition.ts deleted file mode 100644 index 4528c36da..000000000 --- a/src/agile/models/issueTransition.ts +++ /dev/null @@ -1,58 +0,0 @@ -import type { Scope } from './scope.js'; - -/** Details of an issue transition. */ -export interface IssueTransition { - /** Expand options that include additional transition details in the response. */ - expand?: string; - /** - * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and - * `update` in a transition request. - */ - fields?: {}; - /** Whether there is a screen associated with the issue transition. */ - hasScreen?: boolean; - /** The ID of the issue transition. Required when specifying a transition to undertake. */ - id?: string; - /** Whether the transition is available to be performed. */ - isAvailable?: boolean; - /** Whether the issue has to meet criteria before the issue transition is applied. */ - isConditional?: boolean; - /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ - isGlobal?: boolean; - /** Whether this is the initial issue transition for the workflow. */ - isInitial?: boolean; - looped?: boolean; - /** The name of the issue transition. */ - name?: string; - /** A status. */ - to?: { - /** The description of the status. */ - description?: string; - /** The URL of the icon used to represent the status. */ - iconUrl?: string; - /** The ID of the status. */ - id?: string; - /** The name of the status. */ - name?: string; - /** - * The projects the item is associated with. Indicated for items associated with [next-gen - * projects](https://confluence.atlassian.com/x/loMyO). - */ - scope?: Scope; - /** The URL of the status. */ - self?: string; - /** A status category. */ - statusCategory?: { - /** The name of the color used to represent the status category. */ - colorName?: string; - /** The ID of the status category. */ - id?: number; - /** The key of the status category. */ - key?: string; - /** The name of the status category. */ - name?: string; - /** The URL of the status category. */ - self: string; - }; - }; -} diff --git a/src/agile/models/issueType.ts b/src/agile/models/issueType.mts similarity index 100% rename from src/agile/models/issueType.ts rename to src/agile/models/issueType.mts diff --git a/src/agile/models/jsonType.ts b/src/agile/models/jsonType.mts similarity index 100% rename from src/agile/models/jsonType.ts rename to src/agile/models/jsonType.mts diff --git a/src/agile/models/linkGroup.ts b/src/agile/models/linkGroup.mts similarity index 100% rename from src/agile/models/linkGroup.ts rename to src/agile/models/linkGroup.mts diff --git a/src/agile/models/linkedSecurityWorkspaceIds.ts b/src/agile/models/linkedSecurityWorkspaceIds.mts similarity index 100% rename from src/agile/models/linkedSecurityWorkspaceIds.ts rename to src/agile/models/linkedSecurityWorkspaceIds.mts diff --git a/src/agile/models/linkedWorkspace.ts b/src/agile/models/linkedWorkspace.mts similarity index 100% rename from src/agile/models/linkedWorkspace.ts rename to src/agile/models/linkedWorkspace.mts diff --git a/src/agile/models/operations.mts b/src/agile/models/operations.mts new file mode 100644 index 000000000..abc4e9bf0 --- /dev/null +++ b/src/agile/models/operations.mts @@ -0,0 +1,7 @@ +import { LinkGroup } from './linkGroup.mjs'; + +/** Details of the operations that can be performed on the issue. */ +export interface Operations { + /** Details of the link groups defining issue operations. */ + linkGroups?: LinkGroup[]; +} diff --git a/src/agile/models/operations.ts b/src/agile/models/operations.ts deleted file mode 100644 index 8102a00ec..000000000 --- a/src/agile/models/operations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { LinkGroup } from './linkGroup.js'; - -/** Details of the operations that can be performed on the issue. */ -export interface Operations { - /** Details of the link groups defining issue operations. */ - linkGroups?: LinkGroup[]; -} diff --git a/src/agile/models/progress.ts b/src/agile/models/progress.mts similarity index 100% rename from src/agile/models/progress.ts rename to src/agile/models/progress.mts diff --git a/src/agile/models/project.mts b/src/agile/models/project.mts new file mode 100644 index 000000000..edb6e2721 --- /dev/null +++ b/src/agile/models/project.mts @@ -0,0 +1,33 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; + +/** Details about a project. */ +export interface Project { + avatarUrls: AvatarUrls; + /** The ID of the project. */ + id: string; + /** The key of the project. */ + key: string; + /** The name of the project. */ + name: string; + /** A project category. */ + projectCategory: { + /** The name of the project category. */ + description?: string; + /** The ID of the project category. */ + id: string; + /** The description of the project category. */ + name: string; + /** The URL of the project category. */ + self: string; + }; + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the + * project. + */ + projectTypeKey: 'software' | 'service_desk' | 'business' | string; + /** The URL of the project details. */ + self: string; + /** Whether or not the project is simplified. */ + simplified: boolean; +} diff --git a/src/agile/models/project.ts b/src/agile/models/project.ts deleted file mode 100644 index b3040cf94..000000000 --- a/src/agile/models/project.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; - -/** Details about a project. */ -export interface Project { - avatarUrls: AvatarUrls; - /** The ID of the project. */ - id: string; - /** The key of the project. */ - key: string; - /** The name of the project. */ - name: string; - /** A project category. */ - projectCategory: { - /** The name of the project category. */ - description?: string; - /** The ID of the project category. */ - id: string; - /** The description of the project category. */ - name: string; - /** The URL of the project category. */ - self: string; - }; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the - * project. - */ - projectTypeKey: 'software' | 'service_desk' | 'business' | string; - /** The URL of the project details. */ - self: string; - /** Whether or not the project is simplified. */ - simplified: boolean; -} diff --git a/src/agile/models/projects.mts b/src/agile/models/projects.mts new file mode 100644 index 000000000..bded7f344 --- /dev/null +++ b/src/agile/models/projects.mts @@ -0,0 +1,21 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; + +export interface Projects { + self: string; + id: string; + key: string; + name: string; + avatarUrls: AvatarUrls; + projectCategory: { + self: string; + id: string; + name: string; + description: string; + }; + simplified: boolean; + style: string; + insight: { + totalIssueCount: number; + lastIssueUpdateTime: string; + }; +} diff --git a/src/agile/models/projects.ts b/src/agile/models/projects.ts deleted file mode 100644 index 6b4222578..000000000 --- a/src/agile/models/projects.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; - -export interface Projects { - self: string; - id: string; - key: string; - name: string; - avatarUrls: AvatarUrls; - projectCategory: { - self: string; - id: string; - name: string; - description: string; - }; - simplified: boolean; - style: string; - insight: { - totalIssueCount: number; - lastIssueUpdateTime: string; - }; -} diff --git a/src/agile/models/scope.mts b/src/agile/models/scope.mts new file mode 100644 index 000000000..66b29393d --- /dev/null +++ b/src/agile/models/scope.mts @@ -0,0 +1,41 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; + +/** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ +export interface Scope { + /** Details about a project. */ + project?: { + avatarUrls?: AvatarUrls; + /** The ID of the project. */ + id?: string; + /** The key of the project. */ + key?: string; + /** The name of the project. */ + name?: string; + /** A project category. */ + projectCategory?: { + /** The name of the project category. */ + description?: string; + /** The ID of the project category. */ + id?: string; + /** The description of the project category. */ + name?: string; + /** The URL of the project category. */ + self?: string; + }; + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the + * project. + */ + projectTypeKey?: 'software' | 'service_desk' | 'business' | string; + /** The URL of the project details. */ + self?: string; + /** Whether or not the project is simplified. */ + simplified?: boolean; + }; + /** The type of scope. */ + type?: 'PROJECT' | 'TEMPLATE' | string; +} diff --git a/src/agile/models/scope.ts b/src/agile/models/scope.ts deleted file mode 100644 index c1dda7b11..000000000 --- a/src/agile/models/scope.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; - -/** - * The projects the item is associated with. Indicated for items associated with [next-gen - * projects](https://confluence.atlassian.com/x/loMyO). - */ -export interface Scope { - /** Details about a project. */ - project?: { - avatarUrls?: AvatarUrls; - /** The ID of the project. */ - id?: string; - /** The key of the project. */ - key?: string; - /** The name of the project. */ - name?: string; - /** A project category. */ - projectCategory?: { - /** The name of the project category. */ - description?: string; - /** The ID of the project category. */ - id?: string; - /** The description of the project category. */ - name?: string; - /** The URL of the project category. */ - self?: string; - }; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the - * project. - */ - projectTypeKey?: 'software' | 'service_desk' | 'business' | string; - /** The URL of the project details. */ - self?: string; - /** Whether or not the project is simplified. */ - simplified?: boolean; - }; - /** The type of scope. */ - type?: 'PROJECT' | 'TEMPLATE' | string; -} diff --git a/src/agile/models/searchResults.mts b/src/agile/models/searchResults.mts new file mode 100644 index 000000000..eb6182fe0 --- /dev/null +++ b/src/agile/models/searchResults.mts @@ -0,0 +1,21 @@ +import type { Issue } from './issue.mjs'; + +/** The result of a Jql search. */ +export interface SearchResults { + /** Expand options that include additional search result details in the response. */ + expand?: string; + /** The list of issues found by the search. */ + issues: Issue[]; + /** The maximum number of results that could be on the page. */ + maxResults: number; + /** The ID and name of each field in the search results. */ + names?: {}; + /** The schema describing the field types in the search results. */ + schema?: {}; + /** The index of the first item returned on the page. */ + startAt: number; + /** The number of results on the page. */ + total: number; + /** Any warnings related to the Jql query. */ + warningMessages?: string[]; +} diff --git a/src/agile/models/searchResults.ts b/src/agile/models/searchResults.ts deleted file mode 100644 index 957a35d25..000000000 --- a/src/agile/models/searchResults.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Issue } from './issue.js'; - -/** The result of a JQL search. */ -export interface SearchResults { - /** Expand options that include additional search result details in the response. */ - expand?: string; - /** The list of issues found by the search. */ - issues: Issue[]; - /** The maximum number of results that could be on the page. */ - maxResults: number; - /** The ID and name of each field in the search results. */ - names?: {}; - /** The schema describing the field types in the search results. */ - schema?: {}; - /** The index of the first item returned on the page. */ - startAt: number; - /** The number of results on the page. */ - total: number; - /** Any warnings related to the JQL query. */ - warningMessages?: string[]; -} diff --git a/src/agile/models/sprint.ts b/src/agile/models/sprint.mts similarity index 100% rename from src/agile/models/sprint.ts rename to src/agile/models/sprint.mts diff --git a/src/agile/models/status.mts b/src/agile/models/status.mts new file mode 100644 index 000000000..4f4e246b9 --- /dev/null +++ b/src/agile/models/status.mts @@ -0,0 +1,10 @@ +import type { StatusCategory } from './statusCategory.mjs'; + +export interface Status { + self: string; + description: string; + iconUrl: string; + name: string; + id: string; + statusCategory: StatusCategory; +} diff --git a/src/agile/models/status.ts b/src/agile/models/status.ts deleted file mode 100644 index aba22c946..000000000 --- a/src/agile/models/status.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { StatusCategory } from './statusCategory.js'; - -export interface Status { - self: string; - description: string; - iconUrl: string; - name: string; - id: string; - statusCategory: StatusCategory; -} diff --git a/src/agile/models/statusCategory.ts b/src/agile/models/statusCategory.mts similarity index 100% rename from src/agile/models/statusCategory.ts rename to src/agile/models/statusCategory.mts diff --git a/src/agile/models/storeDevelopmentInformation.ts b/src/agile/models/storeDevelopmentInformation.mts similarity index 100% rename from src/agile/models/storeDevelopmentInformation.ts rename to src/agile/models/storeDevelopmentInformation.mts diff --git a/src/agile/models/submitBuilds.ts b/src/agile/models/submitBuilds.mts similarity index 100% rename from src/agile/models/submitBuilds.ts rename to src/agile/models/submitBuilds.mts diff --git a/src/agile/models/submitComponents.ts b/src/agile/models/submitComponents.mts similarity index 100% rename from src/agile/models/submitComponents.ts rename to src/agile/models/submitComponents.mts diff --git a/src/agile/models/submitDeployments.ts b/src/agile/models/submitDeployments.mts similarity index 100% rename from src/agile/models/submitDeployments.ts rename to src/agile/models/submitDeployments.mts diff --git a/src/agile/models/submitEntity.ts b/src/agile/models/submitEntity.mts similarity index 100% rename from src/agile/models/submitEntity.ts rename to src/agile/models/submitEntity.mts diff --git a/src/agile/models/submitFeatureFlags.ts b/src/agile/models/submitFeatureFlags.mts similarity index 100% rename from src/agile/models/submitFeatureFlags.ts rename to src/agile/models/submitFeatureFlags.mts diff --git a/src/agile/models/submitOperationsWorkspaces.ts b/src/agile/models/submitOperationsWorkspaces.mts similarity index 100% rename from src/agile/models/submitOperationsWorkspaces.ts rename to src/agile/models/submitOperationsWorkspaces.mts diff --git a/src/agile/models/submitRemoteLinks.ts b/src/agile/models/submitRemoteLinks.mts similarity index 100% rename from src/agile/models/submitRemoteLinks.ts rename to src/agile/models/submitRemoteLinks.mts diff --git a/src/agile/models/submitVulnerabilities.ts b/src/agile/models/submitVulnerabilities.mts similarity index 100% rename from src/agile/models/submitVulnerabilities.ts rename to src/agile/models/submitVulnerabilities.mts diff --git a/src/agile/models/submittedVulnerabilitiesResult.ts b/src/agile/models/submittedVulnerabilitiesResult.mts similarity index 100% rename from src/agile/models/submittedVulnerabilitiesResult.ts rename to src/agile/models/submittedVulnerabilitiesResult.mts diff --git a/src/agile/models/toggleFeatures.ts b/src/agile/models/toggleFeatures.mts similarity index 100% rename from src/agile/models/toggleFeatures.ts rename to src/agile/models/toggleFeatures.mts diff --git a/src/agile/models/user.mts b/src/agile/models/user.mts new file mode 100644 index 000000000..6a6aa8b9f --- /dev/null +++ b/src/agile/models/user.mts @@ -0,0 +1,39 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; + +/** + * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* + * + * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, + * `displayName` provides an indication and other parameters have default values or are blank (for example, email is + * blank). + * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted + * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. + * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have + * fallback values. + */ +export interface User { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: string; + /** + * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application + * user) or 'customer' (Jira Service Desk customer user) + */ + accountType: string; + /** Whether the user is active. */ + active: boolean; + avatarUrls: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ + displayName: string; + /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ + emailAddress: string; + /** The URL of the user. */ + self: string; + /** + * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as + * null. + */ + timeZone: string | null; +} diff --git a/src/agile/models/user.ts b/src/agile/models/user.ts deleted file mode 100644 index 678c87d51..000000000 --- a/src/agile/models/user.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; - -/** - * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* - * - * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, - * `displayName` provides an indication and other parameters have default values or are blank (for example, email is - * blank). - * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted - * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. - * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have - * fallback values. - */ -export interface User { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId: string; - /** - * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application - * user) or 'customer' (Jira Service Desk customer user) - */ - accountType: string; - /** Whether the user is active. */ - active: boolean; - avatarUrls: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ - displayName: string; - /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ - emailAddress: string; - /** The URL of the user. */ - self: string; - /** - * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as - * null. - */ - timeZone: string | null; -} diff --git a/src/agile/models/version.ts b/src/agile/models/version.mts similarity index 100% rename from src/agile/models/version.ts rename to src/agile/models/version.mts diff --git a/src/agile/models/vulnerability.ts b/src/agile/models/vulnerability.mts similarity index 100% rename from src/agile/models/vulnerability.ts rename to src/agile/models/vulnerability.mts diff --git a/src/agile/operations.mts b/src/agile/operations.mts new file mode 100644 index 000000000..bf0be7177 --- /dev/null +++ b/src/agile/operations.mts @@ -0,0 +1,357 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Operations { + constructor(private client: Client) {} + + /** + * Insert Operations Workspace IDs to establish a relationship between them and the Jira site the app is installed in. + * If a relationship between the Workspace ID and Jira already exists then the workspace ID will be ignored and Jira + * will process the rest of the entries. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitOperationsWorkspaces( + parameters: Parameters.SubmitOperationsWorkspaces, + callback: Callback, + ): Promise; + /** + * Insert Operations Workspace IDs to establish a relationship between them and the Jira site the app is installed in. + * If a relationship between the Workspace ID and Jira already exists then the workspace ID will be ignored and Jira + * will process the rest of the entries. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitOperationsWorkspaces( + parameters: Parameters.SubmitOperationsWorkspaces, + callback?: never, + ): Promise; + async submitOperationsWorkspaces( + parameters: Parameters.SubmitOperationsWorkspaces, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/linkedWorkspaces/bulk', + method: 'POST', + data: { + workspaceIds: parameters.workspaceIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Operations Workspaces that match the given request. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + * + * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 + */ + async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback: Callback): Promise; + /** + * Bulk delete all Operations Workspaces that match the given request. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + * + * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 + */ + async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback?: never): Promise; + async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/linkedWorkspaces/bulk', + method: 'DELETE', + params: { + workspaceIds: parameters.workspaceIds.join(','), + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the either all Operations Workspace IDs associated with the Jira site or a specific Operations Workspace + * ID for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * E.g. GET /workspace?workspaceId=111-222-333 + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getWorkspaces( + parameters: Parameters.GetWorkspaces, + callback: Callback, + ): Promise; + /** + * Retrieve the either all Operations Workspace IDs associated with the Jira site or a specific Operations Workspace + * ID for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * E.g. GET /workspace?workspaceId=111-222-333 + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getWorkspaces(parameters: Parameters.GetWorkspaces, callback?: never): Promise; + async getWorkspaces( + parameters: Parameters.GetWorkspaces, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/linkedWorkspaces', + method: 'GET', + params: { + workspaceId: parameters.workspaceId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update / insert Incident or Review data. + * + * Incidents and reviews are identified by their ID, and existing Incident and Review data for the same ID will be + * replaced if it exists and the updateSequenceNumber of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getIncidentById or getReviewById operation can be used to confirm that data has been stored successfully (if + * needed). + * + * In the case of multiple Incidents and Reviews being submitted in one request, each is validated individually prior + * to submission. Details of which entities failed submission (if any) are available in the response object. + * + * A maximum of 1000 incidents can be submitted in one request. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitEntity( + parameters: Parameters.SubmitEntity, + callback: Callback, + ): Promise; + /** + * Update / insert Incident or Review data. + * + * Incidents and reviews are identified by their ID, and existing Incident and Review data for the same ID will be + * replaced if it exists and the updateSequenceNumber of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getIncidentById or getReviewById operation can be used to confirm that data has been stored successfully (if + * needed). + * + * In the case of multiple Incidents and Reviews being submitted in one request, each is validated individually prior + * to submission. Details of which entities failed submission (if any) are available in the response object. + * + * A maximum of 1000 incidents can be submitted in one request. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitEntity(parameters: Parameters.SubmitEntity, callback?: never): Promise; + async submitEntity( + parameters: Parameters.SubmitEntity, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/bulk', + method: 'POST', + data: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Entries that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation + * for the submitEntity operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteEntityByProperty( + parameters: Parameters.DeleteEntityByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all Entries that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation + * for the submitEntity operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteEntityByProperty( + parameters: Parameters.DeleteEntityByProperty, + callback?: never, + ): Promise; + async deleteEntityByProperty( + parameters: Parameters.DeleteEntityByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/bulkByProperties', + method: 'DELETE', + params: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Incident data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getIncidentById( + parameters: Parameters.GetIncidentById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Incident data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getIncidentById( + parameters: Parameters.GetIncidentById, + callback?: never, + ): Promise; + async getIncidentById( + parameters: Parameters.GetIncidentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/operations/1.0/incidents/${parameters.incidentId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Incident data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteIncidentById(parameters: Parameters.DeleteIncidentById, callback: Callback): Promise; + /** + * Delete the Incident data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteIncidentById(parameters: Parameters.DeleteIncidentById, callback?: never): Promise; + async deleteIncidentById( + parameters: Parameters.DeleteIncidentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/operations/1.0/incidents/${parameters.incidentId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Review data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getReviewById( + parameters: Parameters.GetReviewById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Review data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getReviewById(parameters: Parameters.GetReviewById, callback?: never): Promise; + async getReviewById( + parameters: Parameters.GetReviewById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/operations/1.0/post-incident-reviews/${parameters.reviewId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Review data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getReviewById operation can be used to confirm that data has been deleted + * successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteReviewById(parameters: Parameters.DeleteReviewById, callback: Callback): Promise; + /** + * Delete the Review data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getReviewById operation can be used to confirm that data has been deleted + * successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteReviewById(parameters: Parameters.DeleteReviewById, callback?: never): Promise; + async deleteReviewById(parameters: Parameters.DeleteReviewById, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/operations/1.0/post-incident-reviews/${parameters.reviewId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/operations.ts b/src/agile/operations.ts deleted file mode 100644 index 5e9bc641e..000000000 --- a/src/agile/operations.ts +++ /dev/null @@ -1,357 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Client } from '../clients/index.js'; -import type { Callback } from '../callback.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Operations { - constructor(private client: Client) {} - - /** - * Insert Operations Workspace IDs to establish a relationship between them and the Jira site the app is installed in. - * If a relationship between the Workspace ID and Jira already exists then the workspace ID will be ignored and Jira - * will process the rest of the entries. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitOperationsWorkspaces( - parameters: Parameters.SubmitOperationsWorkspaces, - callback: Callback, - ): Promise; - /** - * Insert Operations Workspace IDs to establish a relationship between them and the Jira site the app is installed in. - * If a relationship between the Workspace ID and Jira already exists then the workspace ID will be ignored and Jira - * will process the rest of the entries. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitOperationsWorkspaces( - parameters: Parameters.SubmitOperationsWorkspaces, - callback?: never, - ): Promise; - async submitOperationsWorkspaces( - parameters: Parameters.SubmitOperationsWorkspaces, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/operations/1.0/linkedWorkspaces/bulk', - method: 'POST', - data: { - workspaceIds: parameters.workspaceIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all Operations Workspaces that match the given request. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - * - * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 - */ - async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback: Callback): Promise; - /** - * Bulk delete all Operations Workspaces that match the given request. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - * - * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 - */ - async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback?: never): Promise; - async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/operations/1.0/linkedWorkspaces/bulk', - method: 'DELETE', - params: { - workspaceIds: parameters.workspaceIds.join(','), - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the either all Operations Workspace IDs associated with the Jira site or a specific Operations Workspace - * ID for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * E.g. GET /workspace?workspaceId=111-222-333 - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getWorkspaces( - parameters: Parameters.GetWorkspaces, - callback: Callback, - ): Promise; - /** - * Retrieve the either all Operations Workspace IDs associated with the Jira site or a specific Operations Workspace - * ID for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * E.g. GET /workspace?workspaceId=111-222-333 - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getWorkspaces(parameters: Parameters.GetWorkspaces, callback?: never): Promise; - async getWorkspaces( - parameters: Parameters.GetWorkspaces, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/operations/1.0/linkedWorkspaces', - method: 'GET', - params: { - workspaceId: parameters.workspaceId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Update / insert Incident or Review data. - * - * Incidents and reviews are identified by their ID, and existing Incident and Review data for the same ID will be - * replaced if it exists and the updateSequenceNumber of existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * getIncidentById or getReviewById operation can be used to confirm that data has been stored successfully (if - * needed). - * - * In the case of multiple Incidents and Reviews being submitted in one request, each is validated individually prior - * to submission. Details of which entities failed submission (if any) are available in the response object. - * - * A maximum of 1000 incidents can be submitted in one request. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitEntity( - parameters: Parameters.SubmitEntity, - callback: Callback, - ): Promise; - /** - * Update / insert Incident or Review data. - * - * Incidents and reviews are identified by their ID, and existing Incident and Review data for the same ID will be - * replaced if it exists and the updateSequenceNumber of existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * getIncidentById or getReviewById operation can be used to confirm that data has been stored successfully (if - * needed). - * - * In the case of multiple Incidents and Reviews being submitted in one request, each is validated individually prior - * to submission. Details of which entities failed submission (if any) are available in the response object. - * - * A maximum of 1000 incidents can be submitted in one request. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitEntity(parameters: Parameters.SubmitEntity, callback?: never): Promise; - async submitEntity( - parameters: Parameters.SubmitEntity, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/operations/1.0/bulk', - method: 'POST', - data: parameters, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all Entries that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. If more than one Property is - * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation - * for the submitEntity operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteEntityByProperty( - parameters: Parameters.DeleteEntityByProperty, - callback: Callback, - ): Promise; - /** - * Bulk delete all Entries that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. If more than one Property is - * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation - * for the submitEntity operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteEntityByProperty( - parameters: Parameters.DeleteEntityByProperty, - callback?: never, - ): Promise; - async deleteEntityByProperty( - parameters: Parameters.DeleteEntityByProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/operations/1.0/bulkByProperties', - method: 'DELETE', - params: parameters, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the currently stored Incident data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getIncidentById( - parameters: Parameters.GetIncidentById, - callback: Callback, - ): Promise; - /** - * Retrieve the currently stored Incident data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getIncidentById( - parameters: Parameters.GetIncidentById, - callback?: never, - ): Promise; - async getIncidentById( - parameters: Parameters.GetIncidentById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/operations/1.0/incidents/${parameters.incidentId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete the Incident data currently stored for the given ID. - * - * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteIncidentById(parameters: Parameters.DeleteIncidentById, callback: Callback): Promise; - /** - * Delete the Incident data currently stored for the given ID. - * - * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteIncidentById(parameters: Parameters.DeleteIncidentById, callback?: never): Promise; - async deleteIncidentById( - parameters: Parameters.DeleteIncidentById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/operations/1.0/incidents/${parameters.incidentId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the currently stored Review data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getReviewById( - parameters: Parameters.GetReviewById, - callback: Callback, - ): Promise; - /** - * Retrieve the currently stored Review data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getReviewById(parameters: Parameters.GetReviewById, callback?: never): Promise; - async getReviewById( - parameters: Parameters.GetReviewById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/operations/1.0/post-incident-reviews/${parameters.reviewId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete the Review data currently stored for the given ID. - * - * Deletion is performed asynchronously. The getReviewById operation can be used to confirm that data has been deleted - * successfully (if needed). - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteReviewById(parameters: Parameters.DeleteReviewById, callback: Callback): Promise; - /** - * Delete the Review data currently stored for the given ID. - * - * Deletion is performed asynchronously. The getReviewById operation can be used to confirm that data has been deleted - * successfully (if needed). - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteReviewById(parameters: Parameters.DeleteReviewById, callback?: never): Promise; - async deleteReviewById(parameters: Parameters.DeleteReviewById, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/operations/1.0/post-incident-reviews/${parameters.reviewId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/parameters/createBoard.ts b/src/agile/parameters/createBoard.mts similarity index 100% rename from src/agile/parameters/createBoard.ts rename to src/agile/parameters/createBoard.mts diff --git a/src/agile/parameters/createSprint.ts b/src/agile/parameters/createSprint.mts similarity index 100% rename from src/agile/parameters/createSprint.ts rename to src/agile/parameters/createSprint.mts diff --git a/src/agile/parameters/deleteBoard.ts b/src/agile/parameters/deleteBoard.mts similarity index 100% rename from src/agile/parameters/deleteBoard.ts rename to src/agile/parameters/deleteBoard.mts diff --git a/src/agile/parameters/deleteBoardProperty.ts b/src/agile/parameters/deleteBoardProperty.mts similarity index 100% rename from src/agile/parameters/deleteBoardProperty.ts rename to src/agile/parameters/deleteBoardProperty.mts diff --git a/src/agile/parameters/deleteBuildByKey.ts b/src/agile/parameters/deleteBuildByKey.mts similarity index 100% rename from src/agile/parameters/deleteBuildByKey.ts rename to src/agile/parameters/deleteBuildByKey.mts diff --git a/src/agile/parameters/deleteBuildsByProperty.ts b/src/agile/parameters/deleteBuildsByProperty.mts similarity index 100% rename from src/agile/parameters/deleteBuildsByProperty.ts rename to src/agile/parameters/deleteBuildsByProperty.mts diff --git a/src/agile/parameters/deleteByProperties.ts b/src/agile/parameters/deleteByProperties.mts similarity index 100% rename from src/agile/parameters/deleteByProperties.ts rename to src/agile/parameters/deleteByProperties.mts diff --git a/src/agile/parameters/deleteComponentById.ts b/src/agile/parameters/deleteComponentById.mts similarity index 100% rename from src/agile/parameters/deleteComponentById.ts rename to src/agile/parameters/deleteComponentById.mts diff --git a/src/agile/parameters/deleteComponentsByProperty.ts b/src/agile/parameters/deleteComponentsByProperty.mts similarity index 100% rename from src/agile/parameters/deleteComponentsByProperty.ts rename to src/agile/parameters/deleteComponentsByProperty.mts diff --git a/src/agile/parameters/deleteDeploymentByKey.ts b/src/agile/parameters/deleteDeploymentByKey.mts similarity index 100% rename from src/agile/parameters/deleteDeploymentByKey.ts rename to src/agile/parameters/deleteDeploymentByKey.mts diff --git a/src/agile/parameters/deleteDeploymentsByProperty.ts b/src/agile/parameters/deleteDeploymentsByProperty.mts similarity index 100% rename from src/agile/parameters/deleteDeploymentsByProperty.ts rename to src/agile/parameters/deleteDeploymentsByProperty.mts diff --git a/src/agile/parameters/deleteEntity.ts b/src/agile/parameters/deleteEntity.mts similarity index 100% rename from src/agile/parameters/deleteEntity.ts rename to src/agile/parameters/deleteEntity.mts diff --git a/src/agile/parameters/deleteEntityByProperty.ts b/src/agile/parameters/deleteEntityByProperty.mts similarity index 100% rename from src/agile/parameters/deleteEntityByProperty.ts rename to src/agile/parameters/deleteEntityByProperty.mts diff --git a/src/agile/parameters/deleteFeatureFlagById.ts b/src/agile/parameters/deleteFeatureFlagById.mts similarity index 100% rename from src/agile/parameters/deleteFeatureFlagById.ts rename to src/agile/parameters/deleteFeatureFlagById.mts diff --git a/src/agile/parameters/deleteFeatureFlagsByProperty.ts b/src/agile/parameters/deleteFeatureFlagsByProperty.mts similarity index 100% rename from src/agile/parameters/deleteFeatureFlagsByProperty.ts rename to src/agile/parameters/deleteFeatureFlagsByProperty.mts diff --git a/src/agile/parameters/deleteIncidentById.ts b/src/agile/parameters/deleteIncidentById.mts similarity index 100% rename from src/agile/parameters/deleteIncidentById.ts rename to src/agile/parameters/deleteIncidentById.mts diff --git a/src/agile/parameters/deleteLinkedWorkspaces.ts b/src/agile/parameters/deleteLinkedWorkspaces.mts similarity index 100% rename from src/agile/parameters/deleteLinkedWorkspaces.ts rename to src/agile/parameters/deleteLinkedWorkspaces.mts diff --git a/src/agile/parameters/deleteProperty.ts b/src/agile/parameters/deleteProperty.mts similarity index 100% rename from src/agile/parameters/deleteProperty.ts rename to src/agile/parameters/deleteProperty.mts diff --git a/src/agile/parameters/deleteRemoteLinkById.ts b/src/agile/parameters/deleteRemoteLinkById.mts similarity index 100% rename from src/agile/parameters/deleteRemoteLinkById.ts rename to src/agile/parameters/deleteRemoteLinkById.mts diff --git a/src/agile/parameters/deleteRemoteLinksByProperty.ts b/src/agile/parameters/deleteRemoteLinksByProperty.mts similarity index 100% rename from src/agile/parameters/deleteRemoteLinksByProperty.ts rename to src/agile/parameters/deleteRemoteLinksByProperty.mts diff --git a/src/agile/parameters/deleteRepository.ts b/src/agile/parameters/deleteRepository.mts similarity index 100% rename from src/agile/parameters/deleteRepository.ts rename to src/agile/parameters/deleteRepository.mts diff --git a/src/agile/parameters/deleteReviewById.ts b/src/agile/parameters/deleteReviewById.mts similarity index 100% rename from src/agile/parameters/deleteReviewById.ts rename to src/agile/parameters/deleteReviewById.mts diff --git a/src/agile/parameters/deleteSprint.ts b/src/agile/parameters/deleteSprint.mts similarity index 100% rename from src/agile/parameters/deleteSprint.ts rename to src/agile/parameters/deleteSprint.mts diff --git a/src/agile/parameters/deleteVulnerabilitiesByProperty.ts b/src/agile/parameters/deleteVulnerabilitiesByProperty.mts similarity index 100% rename from src/agile/parameters/deleteVulnerabilitiesByProperty.ts rename to src/agile/parameters/deleteVulnerabilitiesByProperty.mts diff --git a/src/agile/parameters/deleteVulnerabilityById.ts b/src/agile/parameters/deleteVulnerabilityById.mts similarity index 100% rename from src/agile/parameters/deleteVulnerabilityById.ts rename to src/agile/parameters/deleteVulnerabilityById.mts diff --git a/src/agile/parameters/deleteWorkspaces.ts b/src/agile/parameters/deleteWorkspaces.mts similarity index 100% rename from src/agile/parameters/deleteWorkspaces.ts rename to src/agile/parameters/deleteWorkspaces.mts diff --git a/src/agile/parameters/estimateIssueForBoard.ts b/src/agile/parameters/estimateIssueForBoard.mts similarity index 100% rename from src/agile/parameters/estimateIssueForBoard.ts rename to src/agile/parameters/estimateIssueForBoard.mts diff --git a/src/agile/parameters/existsByProperties.ts b/src/agile/parameters/existsByProperties.mts similarity index 100% rename from src/agile/parameters/existsByProperties.ts rename to src/agile/parameters/existsByProperties.mts diff --git a/src/agile/parameters/getAllBoards.ts b/src/agile/parameters/getAllBoards.mts similarity index 100% rename from src/agile/parameters/getAllBoards.ts rename to src/agile/parameters/getAllBoards.mts diff --git a/src/agile/parameters/getAllQuickFilters.ts b/src/agile/parameters/getAllQuickFilters.mts similarity index 100% rename from src/agile/parameters/getAllQuickFilters.ts rename to src/agile/parameters/getAllQuickFilters.mts diff --git a/src/agile/parameters/getAllSprints.ts b/src/agile/parameters/getAllSprints.mts similarity index 100% rename from src/agile/parameters/getAllSprints.ts rename to src/agile/parameters/getAllSprints.mts diff --git a/src/agile/parameters/getAllVersions.ts b/src/agile/parameters/getAllVersions.mts similarity index 100% rename from src/agile/parameters/getAllVersions.ts rename to src/agile/parameters/getAllVersions.mts diff --git a/src/agile/parameters/getBoard.ts b/src/agile/parameters/getBoard.mts similarity index 100% rename from src/agile/parameters/getBoard.ts rename to src/agile/parameters/getBoard.mts diff --git a/src/agile/parameters/getBoardByFilterId.ts b/src/agile/parameters/getBoardByFilterId.mts similarity index 100% rename from src/agile/parameters/getBoardByFilterId.ts rename to src/agile/parameters/getBoardByFilterId.mts diff --git a/src/agile/parameters/getBoardIssuesForEpic.mts b/src/agile/parameters/getBoardIssuesForEpic.mts new file mode 100644 index 000000000..554fbfd1f --- /dev/null +++ b/src/agile/parameters/getBoardIssuesForEpic.mts @@ -0,0 +1,28 @@ +export interface GetBoardIssuesForEpic { + /** The ID of the board that contains the requested issues. */ + boardId: number; + /** The ID of the epic that contains the requested issues. */ + epicId: number; + /** + * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for + * more details. + */ + startAt?: number; + /** + * The maximum number of issues to return per page. Default: 50. See the 'Pagination' section at the top of this page + * for more details. Note, the total number of issues returned is limited by the property + * 'jira.search.views.default.max' in your Jira instance. If you exceed this limit, your results will be truncated. + */ + maxResults?: number; + /** + * Filters results using a Jql query. If you define an order in your Jql query, it will override the default order of + * the returned issues. + */ + jql?: string; + /** Specifies whether to validate the Jql query or not. Default: true. */ + validateQuery?: boolean; + /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ + fields?: string[]; + /** A comma-separated list of the parameters to expand. */ + expand?: string; +} diff --git a/src/agile/parameters/getBoardIssuesForEpic.ts b/src/agile/parameters/getBoardIssuesForEpic.ts deleted file mode 100644 index 9fed90d9e..000000000 --- a/src/agile/parameters/getBoardIssuesForEpic.ts +++ /dev/null @@ -1,28 +0,0 @@ -export interface GetBoardIssuesForEpic { - /** The ID of the board that contains the requested issues. */ - boardId: number; - /** The ID of the epic that contains the requested issues. */ - epicId: number; - /** - * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for - * more details. - */ - startAt?: number; - /** - * The maximum number of issues to return per page. Default: 50. See the 'Pagination' section at the top of this page - * for more details. Note, the total number of issues returned is limited by the property - * 'jira.search.views.default.max' in your Jira instance. If you exceed this limit, your results will be truncated. - */ - maxResults?: number; - /** - * Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of - * the returned issues. - */ - jql?: string; - /** Specifies whether to validate the JQL query or not. Default: true. */ - validateQuery?: boolean; - /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ - fields?: string[]; - /** A comma-separated list of the parameters to expand. */ - expand?: string; -} diff --git a/src/agile/parameters/getBoardIssuesForSprint.mts b/src/agile/parameters/getBoardIssuesForSprint.mts new file mode 100644 index 000000000..bcf31125f --- /dev/null +++ b/src/agile/parameters/getBoardIssuesForSprint.mts @@ -0,0 +1,29 @@ +export interface GetBoardIssuesForSprint { + /** The ID of the board that contains requested issues. */ + boardId: number; + /** The ID of the sprint that contains requested issues. */ + sprintId: number; + /** + * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for + * more details. + */ + startAt?: number; + /** + * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more + * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in + * your Jira instance. If you exceed this limit, your results will be truncated. + */ + maxResults?: number; + /** + * Filters results using a Jql query. If you define an order in your Jql query, it will override the default order of + * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to + * privacy reasons. Use `accountId` instead. + */ + jql?: string; + /** Specifies whether to validate the Jql query or not. Default: true. */ + validateQuery?: boolean; + /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ + fields?: string[]; + /** A comma-separated list of the parameters to expand. */ + expand?: string; +} diff --git a/src/agile/parameters/getBoardIssuesForSprint.ts b/src/agile/parameters/getBoardIssuesForSprint.ts deleted file mode 100644 index 953fc47a6..000000000 --- a/src/agile/parameters/getBoardIssuesForSprint.ts +++ /dev/null @@ -1,29 +0,0 @@ -export interface GetBoardIssuesForSprint { - /** The ID of the board that contains requested issues. */ - boardId: number; - /** The ID of the sprint that contains requested issues. */ - sprintId: number; - /** - * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for - * more details. - */ - startAt?: number; - /** - * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more - * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in - * your Jira instance. If you exceed this limit, your results will be truncated. - */ - maxResults?: number; - /** - * Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of - * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to - * privacy reasons. Use `accountId` instead. - */ - jql?: string; - /** Specifies whether to validate the JQL query or not. Default: true. */ - validateQuery?: boolean; - /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ - fields?: string[]; - /** A comma-separated list of the parameters to expand. */ - expand?: string; -} diff --git a/src/agile/parameters/getBoardProperty.ts b/src/agile/parameters/getBoardProperty.mts similarity index 100% rename from src/agile/parameters/getBoardProperty.ts rename to src/agile/parameters/getBoardProperty.mts diff --git a/src/agile/parameters/getBoardPropertyKeys.ts b/src/agile/parameters/getBoardPropertyKeys.mts similarity index 100% rename from src/agile/parameters/getBoardPropertyKeys.ts rename to src/agile/parameters/getBoardPropertyKeys.mts diff --git a/src/agile/parameters/getBuildByKey.ts b/src/agile/parameters/getBuildByKey.mts similarity index 100% rename from src/agile/parameters/getBuildByKey.ts rename to src/agile/parameters/getBuildByKey.mts diff --git a/src/agile/parameters/getComponentById.ts b/src/agile/parameters/getComponentById.mts similarity index 100% rename from src/agile/parameters/getComponentById.ts rename to src/agile/parameters/getComponentById.mts diff --git a/src/agile/parameters/getConfiguration.ts b/src/agile/parameters/getConfiguration.mts similarity index 100% rename from src/agile/parameters/getConfiguration.ts rename to src/agile/parameters/getConfiguration.mts diff --git a/src/agile/parameters/getDeploymentByKey.ts b/src/agile/parameters/getDeploymentByKey.mts similarity index 100% rename from src/agile/parameters/getDeploymentByKey.ts rename to src/agile/parameters/getDeploymentByKey.mts diff --git a/src/agile/parameters/getDeploymentGatingStatusByKey.ts b/src/agile/parameters/getDeploymentGatingStatusByKey.mts similarity index 100% rename from src/agile/parameters/getDeploymentGatingStatusByKey.ts rename to src/agile/parameters/getDeploymentGatingStatusByKey.mts diff --git a/src/agile/parameters/getEpic.ts b/src/agile/parameters/getEpic.mts similarity index 100% rename from src/agile/parameters/getEpic.ts rename to src/agile/parameters/getEpic.mts diff --git a/src/agile/parameters/getEpics.ts b/src/agile/parameters/getEpics.mts similarity index 100% rename from src/agile/parameters/getEpics.ts rename to src/agile/parameters/getEpics.mts diff --git a/src/agile/parameters/getFeatureFlagById.ts b/src/agile/parameters/getFeatureFlagById.mts similarity index 100% rename from src/agile/parameters/getFeatureFlagById.ts rename to src/agile/parameters/getFeatureFlagById.mts diff --git a/src/agile/parameters/getFeaturesForBoard.ts b/src/agile/parameters/getFeaturesForBoard.mts similarity index 100% rename from src/agile/parameters/getFeaturesForBoard.ts rename to src/agile/parameters/getFeaturesForBoard.mts diff --git a/src/agile/parameters/getIncidentById.ts b/src/agile/parameters/getIncidentById.mts similarity index 100% rename from src/agile/parameters/getIncidentById.ts rename to src/agile/parameters/getIncidentById.mts diff --git a/src/agile/parameters/getIssue.ts b/src/agile/parameters/getIssue.mts similarity index 100% rename from src/agile/parameters/getIssue.ts rename to src/agile/parameters/getIssue.mts diff --git a/src/agile/parameters/getIssueEstimationForBoard.ts b/src/agile/parameters/getIssueEstimationForBoard.mts similarity index 100% rename from src/agile/parameters/getIssueEstimationForBoard.ts rename to src/agile/parameters/getIssueEstimationForBoard.mts diff --git a/src/agile/parameters/getIssuesForBacklog.mts b/src/agile/parameters/getIssuesForBacklog.mts new file mode 100644 index 000000000..9259b2b12 --- /dev/null +++ b/src/agile/parameters/getIssuesForBacklog.mts @@ -0,0 +1,27 @@ +export interface GetIssuesForBacklog { + /** The ID of the board that has the backlog containing the requested issues. */ + boardId: number; + /** + * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for + * more details. + */ + startAt?: number; + /** + * The maximum number of issues to return per page. Default: 50. See the 'Pagination' section at the top of this page + * for more details. Note, the total number of issues returned is limited by the property + * 'jira.search.views.default.max' in your Jira instance. If you exceed this limit, your results will be truncated. + */ + maxResults?: number; + /** + * Filters results using a Jql query. If you define an order in your Jql query, it will override the default order of + * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to + * privacy reasons. Use `accountId` instead. + */ + jql?: string; + /** Specifies whether to validate the Jql query or not. Default: true. */ + validateQuery?: boolean; + /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ + fields?: string[]; + /** This parameter is currently not used. */ + expand?: string; +} diff --git a/src/agile/parameters/getIssuesForBacklog.ts b/src/agile/parameters/getIssuesForBacklog.ts deleted file mode 100644 index 4c2bc7bc4..000000000 --- a/src/agile/parameters/getIssuesForBacklog.ts +++ /dev/null @@ -1,27 +0,0 @@ -export interface GetIssuesForBacklog { - /** The ID of the board that has the backlog containing the requested issues. */ - boardId: number; - /** - * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for - * more details. - */ - startAt?: number; - /** - * The maximum number of issues to return per page. Default: 50. See the 'Pagination' section at the top of this page - * for more details. Note, the total number of issues returned is limited by the property - * 'jira.search.views.default.max' in your Jira instance. If you exceed this limit, your results will be truncated. - */ - maxResults?: number; - /** - * Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of - * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to - * privacy reasons. Use `accountId` instead. - */ - jql?: string; - /** Specifies whether to validate the JQL query or not. Default: true. */ - validateQuery?: boolean; - /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ - fields?: string[]; - /** This parameter is currently not used. */ - expand?: string; -} diff --git a/src/agile/parameters/getIssuesForBoard.mts b/src/agile/parameters/getIssuesForBoard.mts new file mode 100644 index 000000000..95ada27af --- /dev/null +++ b/src/agile/parameters/getIssuesForBoard.mts @@ -0,0 +1,27 @@ +export interface GetIssuesForBoard { + /** The ID of the board that contains the requested issues. */ + boardId: number; + /** + * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for + * more details. + */ + startAt?: number; + /** + * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more + * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in + * your Jira instance. If you exceed this limit, your results will be truncated. + */ + maxResults?: number; + /** + * Filters results using a Jql query. If you define an order in your Jql query, it will override the default order of + * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to + * privacy reasons. Use `accountId` instead. + */ + jql?: string; + /** Specifies whether to validate the Jql query or not. Default: true. */ + validateQuery?: boolean; + /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ + fields?: string[]; + /** This parameter is currently not used. */ + expand?: string; +} diff --git a/src/agile/parameters/getIssuesForBoard.ts b/src/agile/parameters/getIssuesForBoard.ts deleted file mode 100644 index 3a0a2418f..000000000 --- a/src/agile/parameters/getIssuesForBoard.ts +++ /dev/null @@ -1,27 +0,0 @@ -export interface GetIssuesForBoard { - /** The ID of the board that contains the requested issues. */ - boardId: number; - /** - * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for - * more details. - */ - startAt?: number; - /** - * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more - * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in - * your Jira instance. If you exceed this limit, your results will be truncated. - */ - maxResults?: number; - /** - * Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of - * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to - * privacy reasons. Use `accountId` instead. - */ - jql?: string; - /** Specifies whether to validate the JQL query or not. Default: true. */ - validateQuery?: boolean; - /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ - fields?: string[]; - /** This parameter is currently not used. */ - expand?: string; -} diff --git a/src/agile/parameters/getIssuesForEpic.mts b/src/agile/parameters/getIssuesForEpic.mts new file mode 100644 index 000000000..d1b4a4e1e --- /dev/null +++ b/src/agile/parameters/getIssuesForEpic.mts @@ -0,0 +1,27 @@ +export interface GetIssuesForEpic { + /** The id or key of the epic that contains the requested issues. */ + epicIdOrKey: string; + /** + * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for + * more details. + */ + startAt?: number; + /** + * The maximum number of issues to return per page. Default: 50. See the 'Pagination' section at the top of this page + * for more details. Note, the total number of issues returned is limited by the property + * 'jira.search.views.default.max' in your Jira instance. If you exceed this limit, your results will be truncated. + */ + maxResults?: number; + /** + * Filters results using a Jql query. If you define an order in your Jql query, it will override the default order of + * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to + * privacy reasons. Use `accountId` instead. + */ + jql?: string; + /** Specifies whether to validate the Jql query or not. Default: true. */ + validateQuery?: boolean; + /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ + fields?: string[]; + /** A comma-separated list of the parameters to expand. */ + expand?: string; +} diff --git a/src/agile/parameters/getIssuesForEpic.ts b/src/agile/parameters/getIssuesForEpic.ts deleted file mode 100644 index 9becca9b7..000000000 --- a/src/agile/parameters/getIssuesForEpic.ts +++ /dev/null @@ -1,27 +0,0 @@ -export interface GetIssuesForEpic { - /** The id or key of the epic that contains the requested issues. */ - epicIdOrKey: string; - /** - * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for - * more details. - */ - startAt?: number; - /** - * The maximum number of issues to return per page. Default: 50. See the 'Pagination' section at the top of this page - * for more details. Note, the total number of issues returned is limited by the property - * 'jira.search.views.default.max' in your Jira instance. If you exceed this limit, your results will be truncated. - */ - maxResults?: number; - /** - * Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of - * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to - * privacy reasons. Use `accountId` instead. - */ - jql?: string; - /** Specifies whether to validate the JQL query or not. Default: true. */ - validateQuery?: boolean; - /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ - fields?: string[]; - /** A comma-separated list of the parameters to expand. */ - expand?: string; -} diff --git a/src/agile/parameters/getIssuesForSprint.mts b/src/agile/parameters/getIssuesForSprint.mts new file mode 100644 index 000000000..0b2b386e2 --- /dev/null +++ b/src/agile/parameters/getIssuesForSprint.mts @@ -0,0 +1,27 @@ +export interface GetIssuesForSprint { + /** The ID of the sprint that contains the requested issues. */ + sprintId: number; + /** + * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for + * more details. + */ + startAt?: number; + /** + * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more + * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in + * your Jira instance. If you exceed this limit, your results will be truncated. + */ + maxResults?: number; + /** + * Filters results using a Jql query. If you define an order in your Jql query, it will override the default order of + * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to + * privacy reasons. Use `accountId` instead. + */ + jql?: string; + /** Specifies whether to validate the Jql query or not. Default: true. */ + validateQuery?: boolean; + /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ + fields?: string[]; + /** A comma-separated list of the parameters to expand. */ + expand?: string; +} diff --git a/src/agile/parameters/getIssuesForSprint.ts b/src/agile/parameters/getIssuesForSprint.ts deleted file mode 100644 index 3abdb543b..000000000 --- a/src/agile/parameters/getIssuesForSprint.ts +++ /dev/null @@ -1,27 +0,0 @@ -export interface GetIssuesForSprint { - /** The ID of the sprint that contains the requested issues. */ - sprintId: number; - /** - * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for - * more details. - */ - startAt?: number; - /** - * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more - * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in - * your Jira instance. If you exceed this limit, your results will be truncated. - */ - maxResults?: number; - /** - * Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of - * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to - * privacy reasons. Use `accountId` instead. - */ - jql?: string; - /** Specifies whether to validate the JQL query or not. Default: true. */ - validateQuery?: boolean; - /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ - fields?: string[]; - /** A comma-separated list of the parameters to expand. */ - expand?: string; -} diff --git a/src/agile/parameters/getIssuesWithoutEpic.mts b/src/agile/parameters/getIssuesWithoutEpic.mts new file mode 100644 index 000000000..d2d59c575 --- /dev/null +++ b/src/agile/parameters/getIssuesWithoutEpic.mts @@ -0,0 +1,24 @@ +export interface GetIssuesWithoutEpic { + /** + * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for + * more details. + */ + startAt?: number; + /** + * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more + * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in + * your Jira instance. If you exceed this limit, your results will be truncated. + */ + maxResults?: number; + /** + * Filters results using a Jql query. If you define an order in your Jql query, it will override the default order of + * the returned issues. + */ + jql?: string; + /** Specifies whether to validate the Jql query or not. Default: true. */ + validateQuery?: boolean; + /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ + fields?: string[]; + /** A comma-separated list of the parameters to expand. */ + expand?: string; +} diff --git a/src/agile/parameters/getIssuesWithoutEpic.ts b/src/agile/parameters/getIssuesWithoutEpic.ts deleted file mode 100644 index 4b0eba147..000000000 --- a/src/agile/parameters/getIssuesWithoutEpic.ts +++ /dev/null @@ -1,24 +0,0 @@ -export interface GetIssuesWithoutEpic { - /** - * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for - * more details. - */ - startAt?: number; - /** - * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more - * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in - * your Jira instance. If you exceed this limit, your results will be truncated. - */ - maxResults?: number; - /** - * Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of - * the returned issues. - */ - jql?: string; - /** Specifies whether to validate the JQL query or not. Default: true. */ - validateQuery?: boolean; - /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ - fields?: string[]; - /** A comma-separated list of the parameters to expand. */ - expand?: string; -} diff --git a/src/agile/parameters/getIssuesWithoutEpicForBoard.mts b/src/agile/parameters/getIssuesWithoutEpicForBoard.mts new file mode 100644 index 000000000..9e25b658c --- /dev/null +++ b/src/agile/parameters/getIssuesWithoutEpicForBoard.mts @@ -0,0 +1,27 @@ +export interface GetIssuesWithoutEpicForBoard { + /** The ID of the board that contains the requested issues. */ + boardId: number; + /** + * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for + * more details. + */ + startAt?: number; + /** + * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more + * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in + * your Jira instance. If you exceed this limit, your results will be truncated. + */ + maxResults?: number; + /** + * Filters results using a Jql query. If you define an order in your Jql query, it will override the default order of + * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to + * privacy reasons. Use `accountId` instead. + */ + jql?: string; + /** Specifies whether to validate the Jql query or not. Default: true. */ + validateQuery?: boolean; + /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ + fields?: string[]; + /** A comma-separated list of the parameters to expand. */ + expand?: string; +} diff --git a/src/agile/parameters/getIssuesWithoutEpicForBoard.ts b/src/agile/parameters/getIssuesWithoutEpicForBoard.ts deleted file mode 100644 index 9dfb1bd3b..000000000 --- a/src/agile/parameters/getIssuesWithoutEpicForBoard.ts +++ /dev/null @@ -1,27 +0,0 @@ -export interface GetIssuesWithoutEpicForBoard { - /** The ID of the board that contains the requested issues. */ - boardId: number; - /** - * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for - * more details. - */ - startAt?: number; - /** - * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more - * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in - * your Jira instance. If you exceed this limit, your results will be truncated. - */ - maxResults?: number; - /** - * Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of - * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to - * privacy reasons. Use `accountId` instead. - */ - jql?: string; - /** Specifies whether to validate the JQL query or not. Default: true. */ - validateQuery?: boolean; - /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ - fields?: string[]; - /** A comma-separated list of the parameters to expand. */ - expand?: string; -} diff --git a/src/agile/parameters/getLinkedWorkspaceById.ts b/src/agile/parameters/getLinkedWorkspaceById.mts similarity index 100% rename from src/agile/parameters/getLinkedWorkspaceById.ts rename to src/agile/parameters/getLinkedWorkspaceById.mts diff --git a/src/agile/parameters/getProjects.ts b/src/agile/parameters/getProjects.mts similarity index 100% rename from src/agile/parameters/getProjects.ts rename to src/agile/parameters/getProjects.mts diff --git a/src/agile/parameters/getProjectsFull.ts b/src/agile/parameters/getProjectsFull.mts similarity index 100% rename from src/agile/parameters/getProjectsFull.ts rename to src/agile/parameters/getProjectsFull.mts diff --git a/src/agile/parameters/getPropertiesKeys.ts b/src/agile/parameters/getPropertiesKeys.mts similarity index 100% rename from src/agile/parameters/getPropertiesKeys.ts rename to src/agile/parameters/getPropertiesKeys.mts diff --git a/src/agile/parameters/getProperty.ts b/src/agile/parameters/getProperty.mts similarity index 100% rename from src/agile/parameters/getProperty.ts rename to src/agile/parameters/getProperty.mts diff --git a/src/agile/parameters/getQuickFilter.ts b/src/agile/parameters/getQuickFilter.mts similarity index 100% rename from src/agile/parameters/getQuickFilter.ts rename to src/agile/parameters/getQuickFilter.mts diff --git a/src/agile/parameters/getRemoteLinkById.ts b/src/agile/parameters/getRemoteLinkById.mts similarity index 100% rename from src/agile/parameters/getRemoteLinkById.ts rename to src/agile/parameters/getRemoteLinkById.mts diff --git a/src/agile/parameters/getReportsForBoard.ts b/src/agile/parameters/getReportsForBoard.mts similarity index 100% rename from src/agile/parameters/getReportsForBoard.ts rename to src/agile/parameters/getReportsForBoard.mts diff --git a/src/agile/parameters/getRepository.ts b/src/agile/parameters/getRepository.mts similarity index 100% rename from src/agile/parameters/getRepository.ts rename to src/agile/parameters/getRepository.mts diff --git a/src/agile/parameters/getReviewById.ts b/src/agile/parameters/getReviewById.mts similarity index 100% rename from src/agile/parameters/getReviewById.ts rename to src/agile/parameters/getReviewById.mts diff --git a/src/agile/parameters/getSprint.ts b/src/agile/parameters/getSprint.mts similarity index 100% rename from src/agile/parameters/getSprint.ts rename to src/agile/parameters/getSprint.mts diff --git a/src/agile/parameters/getVulnerabilityById.ts b/src/agile/parameters/getVulnerabilityById.mts similarity index 100% rename from src/agile/parameters/getVulnerabilityById.ts rename to src/agile/parameters/getVulnerabilityById.mts diff --git a/src/agile/parameters/getWorkspaces.ts b/src/agile/parameters/getWorkspaces.mts similarity index 100% rename from src/agile/parameters/getWorkspaces.ts rename to src/agile/parameters/getWorkspaces.mts diff --git a/src/agile/parameters/index.mts b/src/agile/parameters/index.mts new file mode 100644 index 000000000..c4f7a7269 --- /dev/null +++ b/src/agile/parameters/index.mts @@ -0,0 +1,95 @@ +export * from './createBoard.mjs'; +export * from './createSprint.mjs'; +export * from './deleteBoard.mjs'; +export * from './deleteBoardProperty.mjs'; +export * from './deleteBuildByKey.mjs'; +export * from './deleteBuildsByProperty.mjs'; +export * from './deleteByProperties.mjs'; +export * from './deleteDeploymentByKey.mjs'; +export * from './deleteDeploymentsByProperty.mjs'; +export * from './deleteEntity.mjs'; +export * from './deleteFeatureFlagById.mjs'; +export * from './deleteFeatureFlagsByProperty.mjs'; +export * from './deleteLinkedWorkspaces.mjs'; +export * from './deleteProperty.mjs'; +export * from './deleteRemoteLinkById.mjs'; +export * from './deleteRemoteLinksByProperty.mjs'; +export * from './deleteRepository.mjs'; +export * from './deleteSprint.mjs'; +export * from './deleteVulnerabilitiesByProperty.mjs'; +export * from './deleteVulnerabilityById.mjs'; +export * from './estimateIssueForBoard.mjs'; +export * from './existsByProperties.mjs'; +export * from './getAllBoards.mjs'; +export * from './getAllQuickFilters.mjs'; +export * from './getAllSprints.mjs'; +export * from './getAllVersions.mjs'; +export * from './getBoard.mjs'; +export * from './getBoardByFilterId.mjs'; +export * from './getBoardIssuesForEpic.mjs'; +export * from './getBoardIssuesForSprint.mjs'; +export * from './getBoardProperty.mjs'; +export * from './getBoardPropertyKeys.mjs'; +export * from './getBuildByKey.mjs'; +export * from './getConfiguration.mjs'; +export * from './getDeploymentByKey.mjs'; +export * from './getDeploymentGatingStatusByKey.mjs'; +export * from './getEpic.mjs'; +export * from './getEpics.mjs'; +export * from './getFeatureFlagById.mjs'; +export * from './getFeaturesForBoard.mjs'; +export * from './getIssue.mjs'; +export * from './getIssueEstimationForBoard.mjs'; +export * from './getIssuesForBacklog.mjs'; +export * from './getIssuesForBoard.mjs'; +export * from './getIssuesForEpic.mjs'; +export * from './getIssuesForSprint.mjs'; +export * from './getIssuesWithoutEpic.mjs'; +export * from './getIssuesWithoutEpicForBoard.mjs'; +export * from './getLinkedWorkspaceById.mjs'; +export * from './getProjects.mjs'; +export * from './getProjectsFull.mjs'; +export * from './getPropertiesKeys.mjs'; +export * from './getProperty.mjs'; +export * from './getQuickFilter.mjs'; +export * from './getRemoteLinkById.mjs'; +export * from './getReportsForBoard.mjs'; +export * from './getRepository.mjs'; +export * from './getSprint.mjs'; +export * from './getVulnerabilityById.mjs'; +export * from './moveIssuesToBacklog.mjs'; +export * from './moveIssuesToBacklogForBoard.mjs'; +export * from './moveIssuesToBoard.mjs'; +export * from './moveIssuesToEpic.mjs'; +export * from './moveIssuesToSprintAndRank.mjs'; +export * from './partiallyUpdateEpic.mjs'; +export * from './partiallyUpdateSprint.mjs'; +export * from './rankEpics.mjs'; +export * from './rankIssues.mjs'; +export * from './removeIssuesFromEpic.mjs'; +export * from './searchEpics.mjs'; +export * from './setBoardProperty.mjs'; +export * from './setProperty.mjs'; +export * from './storeDevelopmentInformation.mjs'; +export * from './submitBuilds.mjs'; +export * from './submitDeployments.mjs'; +export * from './submitFeatureFlags.mjs'; +export * from './submitRemoteLinks.mjs'; +export * from './submitVulnerabilities.mjs'; +export * from './submitWorkspaces.mjs'; +export * from './swapSprint.mjs'; +export * from './toggleFeatures.mjs'; +export * from './updateSprint.mjs'; +export * from './getIncidentById.mjs'; +export * from './deleteIncidentById.mjs'; +export * from './deleteReviewById.mjs'; +export * from './getReviewById.mjs'; +export * from './deleteEntityByProperty.mjs'; +export * from './submitEntity.mjs'; +export * from './getWorkspaces.mjs'; +export * from './deleteWorkspaces.mjs'; +export * from './submitOperationsWorkspaces.mjs'; +export * from './submitComponents.mjs'; +export * from './deleteComponentById.mjs'; +export * from './deleteComponentsByProperty.mjs'; +export * from './getComponentById.mjs'; diff --git a/src/agile/parameters/index.ts b/src/agile/parameters/index.ts deleted file mode 100644 index b36ef556c..000000000 --- a/src/agile/parameters/index.ts +++ /dev/null @@ -1,95 +0,0 @@ -export * from './createBoard.js'; -export * from './createSprint.js'; -export * from './deleteBoard.js'; -export * from './deleteBoardProperty.js'; -export * from './deleteBuildByKey.js'; -export * from './deleteBuildsByProperty.js'; -export * from './deleteByProperties.js'; -export * from './deleteDeploymentByKey.js'; -export * from './deleteDeploymentsByProperty.js'; -export * from './deleteEntity.js'; -export * from './deleteFeatureFlagById.js'; -export * from './deleteFeatureFlagsByProperty.js'; -export * from './deleteLinkedWorkspaces.js'; -export * from './deleteProperty.js'; -export * from './deleteRemoteLinkById.js'; -export * from './deleteRemoteLinksByProperty.js'; -export * from './deleteRepository.js'; -export * from './deleteSprint.js'; -export * from './deleteVulnerabilitiesByProperty.js'; -export * from './deleteVulnerabilityById.js'; -export * from './estimateIssueForBoard.js'; -export * from './existsByProperties.js'; -export * from './getAllBoards.js'; -export * from './getAllQuickFilters.js'; -export * from './getAllSprints.js'; -export * from './getAllVersions.js'; -export * from './getBoard.js'; -export * from './getBoardByFilterId.js'; -export * from './getBoardIssuesForEpic.js'; -export * from './getBoardIssuesForSprint.js'; -export * from './getBoardProperty.js'; -export * from './getBoardPropertyKeys.js'; -export * from './getBuildByKey.js'; -export * from './getConfiguration.js'; -export * from './getDeploymentByKey.js'; -export * from './getDeploymentGatingStatusByKey.js'; -export * from './getEpic.js'; -export * from './getEpics.js'; -export * from './getFeatureFlagById.js'; -export * from './getFeaturesForBoard.js'; -export * from './getIssue.js'; -export * from './getIssueEstimationForBoard.js'; -export * from './getIssuesForBacklog.js'; -export * from './getIssuesForBoard.js'; -export * from './getIssuesForEpic.js'; -export * from './getIssuesForSprint.js'; -export * from './getIssuesWithoutEpic.js'; -export * from './getIssuesWithoutEpicForBoard.js'; -export * from './getLinkedWorkspaceById.js'; -export * from './getProjects.js'; -export * from './getProjectsFull.js'; -export * from './getPropertiesKeys.js'; -export * from './getProperty.js'; -export * from './getQuickFilter.js'; -export * from './getRemoteLinkById.js'; -export * from './getReportsForBoard.js'; -export * from './getRepository.js'; -export * from './getSprint.js'; -export * from './getVulnerabilityById.js'; -export * from './moveIssuesToBacklog.js'; -export * from './moveIssuesToBacklogForBoard.js'; -export * from './moveIssuesToBoard.js'; -export * from './moveIssuesToEpic.js'; -export * from './moveIssuesToSprintAndRank.js'; -export * from './partiallyUpdateEpic.js'; -export * from './partiallyUpdateSprint.js'; -export * from './rankEpics.js'; -export * from './rankIssues.js'; -export * from './removeIssuesFromEpic.js'; -export * from './searchEpics.js'; -export * from './setBoardProperty.js'; -export * from './setProperty.js'; -export * from './storeDevelopmentInformation.js'; -export * from './submitBuilds.js'; -export * from './submitDeployments.js'; -export * from './submitFeatureFlags.js'; -export * from './submitRemoteLinks.js'; -export * from './submitVulnerabilities.js'; -export * from './submitWorkspaces.js'; -export * from './swapSprint.js'; -export * from './toggleFeatures.js'; -export * from './updateSprint.js'; -export * from './getIncidentById.js'; -export * from './deleteIncidentById.js'; -export * from './deleteReviewById.js'; -export * from './getReviewById.js'; -export * from './deleteEntityByProperty.js'; -export * from './submitEntity.js'; -export * from './getWorkspaces.js'; -export * from './deleteWorkspaces.js'; -export * from './submitOperationsWorkspaces.js'; -export * from './submitComponents.js'; -export * from './deleteComponentById.js'; -export * from './deleteComponentsByProperty.js'; -export * from './getComponentById.js'; diff --git a/src/agile/parameters/moveIssuesToBacklog.ts b/src/agile/parameters/moveIssuesToBacklog.mts similarity index 100% rename from src/agile/parameters/moveIssuesToBacklog.ts rename to src/agile/parameters/moveIssuesToBacklog.mts diff --git a/src/agile/parameters/moveIssuesToBacklogForBoard.ts b/src/agile/parameters/moveIssuesToBacklogForBoard.mts similarity index 100% rename from src/agile/parameters/moveIssuesToBacklogForBoard.ts rename to src/agile/parameters/moveIssuesToBacklogForBoard.mts diff --git a/src/agile/parameters/moveIssuesToBoard.ts b/src/agile/parameters/moveIssuesToBoard.mts similarity index 100% rename from src/agile/parameters/moveIssuesToBoard.ts rename to src/agile/parameters/moveIssuesToBoard.mts diff --git a/src/agile/parameters/moveIssuesToEpic.ts b/src/agile/parameters/moveIssuesToEpic.mts similarity index 100% rename from src/agile/parameters/moveIssuesToEpic.ts rename to src/agile/parameters/moveIssuesToEpic.mts diff --git a/src/agile/parameters/moveIssuesToSprintAndRank.ts b/src/agile/parameters/moveIssuesToSprintAndRank.mts similarity index 100% rename from src/agile/parameters/moveIssuesToSprintAndRank.ts rename to src/agile/parameters/moveIssuesToSprintAndRank.mts diff --git a/src/agile/parameters/partiallyUpdateEpic.ts b/src/agile/parameters/partiallyUpdateEpic.mts similarity index 100% rename from src/agile/parameters/partiallyUpdateEpic.ts rename to src/agile/parameters/partiallyUpdateEpic.mts diff --git a/src/agile/parameters/partiallyUpdateSprint.ts b/src/agile/parameters/partiallyUpdateSprint.mts similarity index 100% rename from src/agile/parameters/partiallyUpdateSprint.ts rename to src/agile/parameters/partiallyUpdateSprint.mts diff --git a/src/agile/parameters/rankEpics.ts b/src/agile/parameters/rankEpics.mts similarity index 100% rename from src/agile/parameters/rankEpics.ts rename to src/agile/parameters/rankEpics.mts diff --git a/src/agile/parameters/rankIssues.ts b/src/agile/parameters/rankIssues.mts similarity index 100% rename from src/agile/parameters/rankIssues.ts rename to src/agile/parameters/rankIssues.mts diff --git a/src/agile/parameters/removeIssuesFromEpic.ts b/src/agile/parameters/removeIssuesFromEpic.mts similarity index 100% rename from src/agile/parameters/removeIssuesFromEpic.ts rename to src/agile/parameters/removeIssuesFromEpic.mts diff --git a/src/agile/parameters/searchEpics.ts b/src/agile/parameters/searchEpics.mts similarity index 100% rename from src/agile/parameters/searchEpics.ts rename to src/agile/parameters/searchEpics.mts diff --git a/src/agile/parameters/setBoardProperty.ts b/src/agile/parameters/setBoardProperty.mts similarity index 100% rename from src/agile/parameters/setBoardProperty.ts rename to src/agile/parameters/setBoardProperty.mts diff --git a/src/agile/parameters/setProperty.ts b/src/agile/parameters/setProperty.mts similarity index 100% rename from src/agile/parameters/setProperty.ts rename to src/agile/parameters/setProperty.mts diff --git a/src/agile/parameters/storeDevelopmentInformation.ts b/src/agile/parameters/storeDevelopmentInformation.mts similarity index 100% rename from src/agile/parameters/storeDevelopmentInformation.ts rename to src/agile/parameters/storeDevelopmentInformation.mts diff --git a/src/agile/parameters/submitBuilds.ts b/src/agile/parameters/submitBuilds.mts similarity index 100% rename from src/agile/parameters/submitBuilds.ts rename to src/agile/parameters/submitBuilds.mts diff --git a/src/agile/parameters/submitComponents.ts b/src/agile/parameters/submitComponents.mts similarity index 100% rename from src/agile/parameters/submitComponents.ts rename to src/agile/parameters/submitComponents.mts diff --git a/src/agile/parameters/submitDeployments.ts b/src/agile/parameters/submitDeployments.mts similarity index 100% rename from src/agile/parameters/submitDeployments.ts rename to src/agile/parameters/submitDeployments.mts diff --git a/src/agile/parameters/submitEntity.ts b/src/agile/parameters/submitEntity.mts similarity index 100% rename from src/agile/parameters/submitEntity.ts rename to src/agile/parameters/submitEntity.mts diff --git a/src/agile/parameters/submitFeatureFlags.ts b/src/agile/parameters/submitFeatureFlags.mts similarity index 100% rename from src/agile/parameters/submitFeatureFlags.ts rename to src/agile/parameters/submitFeatureFlags.mts diff --git a/src/agile/parameters/submitOperationsWorkspaces.ts b/src/agile/parameters/submitOperationsWorkspaces.mts similarity index 100% rename from src/agile/parameters/submitOperationsWorkspaces.ts rename to src/agile/parameters/submitOperationsWorkspaces.mts diff --git a/src/agile/parameters/submitRemoteLinks.ts b/src/agile/parameters/submitRemoteLinks.mts similarity index 100% rename from src/agile/parameters/submitRemoteLinks.ts rename to src/agile/parameters/submitRemoteLinks.mts diff --git a/src/agile/parameters/submitVulnerabilities.ts b/src/agile/parameters/submitVulnerabilities.mts similarity index 100% rename from src/agile/parameters/submitVulnerabilities.ts rename to src/agile/parameters/submitVulnerabilities.mts diff --git a/src/agile/parameters/submitWorkspaces.ts b/src/agile/parameters/submitWorkspaces.mts similarity index 100% rename from src/agile/parameters/submitWorkspaces.ts rename to src/agile/parameters/submitWorkspaces.mts diff --git a/src/agile/parameters/swapSprint.ts b/src/agile/parameters/swapSprint.mts similarity index 100% rename from src/agile/parameters/swapSprint.ts rename to src/agile/parameters/swapSprint.mts diff --git a/src/agile/parameters/toggleFeatures.ts b/src/agile/parameters/toggleFeatures.mts similarity index 100% rename from src/agile/parameters/toggleFeatures.ts rename to src/agile/parameters/toggleFeatures.mts diff --git a/src/agile/parameters/updateSprint.ts b/src/agile/parameters/updateSprint.mts similarity index 100% rename from src/agile/parameters/updateSprint.ts rename to src/agile/parameters/updateSprint.mts diff --git a/src/agile/remoteLinks.mts b/src/agile/remoteLinks.mts new file mode 100644 index 000000000..1577551e9 --- /dev/null +++ b/src/agile/remoteLinks.mts @@ -0,0 +1,198 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class RemoteLinks { + constructor(private client: Client) {} + + /** + * Update / insert Remote Link data. + * + * Remote Links are identified by their ID, existing Remote Link data for the same ID will be replaced if it exists + * and the updateSequenceId of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * `getRemoteLinkById` operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple Remote Links being submitted in one request, each is validated individually prior to + * submission. Details of which Remote LInk failed submission (if any) are available in the response object. + * + * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitRemoteLinks( + parameters: Parameters.SubmitRemoteLinks, + callback: Callback, + ): Promise; + /** + * Update / insert Remote Link data. + * + * Remote Links are identified by their ID, existing Remote Link data for the same ID will be replaced if it exists + * and the updateSequenceId of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * `getRemoteLinkById` operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple Remote Links being submitted in one request, each is validated individually prior to + * submission. Details of which Remote LInk failed submission (if any) are available in the response object. + * + * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitRemoteLinks( + parameters: Parameters.SubmitRemoteLinks, + callback?: never, + ): Promise; + async submitRemoteLinks( + parameters: Parameters.SubmitRemoteLinks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/remotelinks/1.0/bulk', + method: 'POST', + data: { + properties: parameters.properties, + remoteLinks: parameters.remoteLinks, + providerMetadata: parameters.providerMetadata, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Remote Links data that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. Optional param + * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that + * matches ALL of the Properties (e.g. treated as an AND). + * + * See the documentation for the `submitRemoteLinks` operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345 + * + * Deletion is performed asynchronously. The `getRemoteLinkById` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteRemoteLinksByProperty( + parameters: Parameters.DeleteRemoteLinksByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all Remote Links data that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. Optional param + * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that + * matches ALL of the Properties (e.g. treated as an AND). + * + * See the documentation for the `submitRemoteLinks` operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345 + * + * Deletion is performed asynchronously. The `getRemoteLinkById` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteRemoteLinksByProperty( + parameters: Parameters.DeleteRemoteLinksByProperty, + callback?: never, + ): Promise; + async deleteRemoteLinksByProperty( + parameters: Parameters.DeleteRemoteLinksByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/remotelinks/1.0/bulkByProperties', + method: 'DELETE', + params: { + _updateSequenceNumber: parameters.updateSequenceNumber, + params: parameters.params, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Remote Link data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'READ' scope for Connect apps. + */ + async getRemoteLinkById( + parameters: Parameters.GetRemoteLinkById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Remote Link data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'READ' scope for Connect apps. + */ + async getRemoteLinkById( + parameters: Parameters.GetRemoteLinkById, + callback?: never, + ): Promise; + async getRemoteLinkById( + parameters: Parameters.GetRemoteLinkById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/remotelinks/1.0/remotelink/${parameters.remoteLinkId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Remote Link data currently stored for the given ID. + * + * Deletion is performed asynchronously. The `getRemoteLinkById` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteRemoteLinkById( + parameters: Parameters.DeleteRemoteLinkById, + callback: Callback, + ): Promise; + /** + * Delete the Remote Link data currently stored for the given ID. + * + * Deletion is performed asynchronously. The `getRemoteLinkById` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteRemoteLinkById(parameters: Parameters.DeleteRemoteLinkById, callback?: never): Promise; + async deleteRemoteLinkById( + parameters: Parameters.DeleteRemoteLinkById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/remotelinks/1.0/remotelink/${parameters.remoteLinkId}`, + method: 'DELETE', + params: { + _updateSequenceNumber: parameters.updateSequenceNumber, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/remoteLinks.ts b/src/agile/remoteLinks.ts deleted file mode 100644 index c037b4fb4..000000000 --- a/src/agile/remoteLinks.ts +++ /dev/null @@ -1,198 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Client } from '../clients/index.js'; -import type { Callback } from '../callback.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class RemoteLinks { - constructor(private client: Client) {} - - /** - * Update / insert Remote Link data. - * - * Remote Links are identified by their ID, existing Remote Link data for the same ID will be replaced if it exists - * and the updateSequenceId of existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * `getRemoteLinkById` operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple Remote Links being submitted in one request, each is validated individually prior to - * submission. Details of which Remote LInk failed submission (if any) are available in the response object. - * - * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitRemoteLinks( - parameters: Parameters.SubmitRemoteLinks, - callback: Callback, - ): Promise; - /** - * Update / insert Remote Link data. - * - * Remote Links are identified by their ID, existing Remote Link data for the same ID will be replaced if it exists - * and the updateSequenceId of existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * `getRemoteLinkById` operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple Remote Links being submitted in one request, each is validated individually prior to - * submission. Details of which Remote LInk failed submission (if any) are available in the response object. - * - * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitRemoteLinks( - parameters: Parameters.SubmitRemoteLinks, - callback?: never, - ): Promise; - async submitRemoteLinks( - parameters: Parameters.SubmitRemoteLinks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/remotelinks/1.0/bulk', - method: 'POST', - data: { - properties: parameters.properties, - remoteLinks: parameters.remoteLinks, - providerMetadata: parameters.providerMetadata, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all Remote Links data that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. Optional param - * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that - * matches ALL of the Properties (e.g. treated as an AND). - * - * See the documentation for the `submitRemoteLinks` operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345 - * - * Deletion is performed asynchronously. The `getRemoteLinkById` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteRemoteLinksByProperty( - parameters: Parameters.DeleteRemoteLinksByProperty, - callback: Callback, - ): Promise; - /** - * Bulk delete all Remote Links data that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. Optional param - * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that - * matches ALL of the Properties (e.g. treated as an AND). - * - * See the documentation for the `submitRemoteLinks` operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345 - * - * Deletion is performed asynchronously. The `getRemoteLinkById` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteRemoteLinksByProperty( - parameters: Parameters.DeleteRemoteLinksByProperty, - callback?: never, - ): Promise; - async deleteRemoteLinksByProperty( - parameters: Parameters.DeleteRemoteLinksByProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/remotelinks/1.0/bulkByProperties', - method: 'DELETE', - params: { - _updateSequenceNumber: parameters.updateSequenceNumber, - params: parameters.params, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the currently stored Remote Link data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'READ' scope for Connect apps. - */ - async getRemoteLinkById( - parameters: Parameters.GetRemoteLinkById, - callback: Callback, - ): Promise; - /** - * Retrieve the currently stored Remote Link data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'READ' scope for Connect apps. - */ - async getRemoteLinkById( - parameters: Parameters.GetRemoteLinkById, - callback?: never, - ): Promise; - async getRemoteLinkById( - parameters: Parameters.GetRemoteLinkById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/remotelinks/1.0/remotelink/${parameters.remoteLinkId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete the Remote Link data currently stored for the given ID. - * - * Deletion is performed asynchronously. The `getRemoteLinkById` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteRemoteLinkById( - parameters: Parameters.DeleteRemoteLinkById, - callback: Callback, - ): Promise; - /** - * Delete the Remote Link data currently stored for the given ID. - * - * Deletion is performed asynchronously. The `getRemoteLinkById` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteRemoteLinkById(parameters: Parameters.DeleteRemoteLinkById, callback?: never): Promise; - async deleteRemoteLinkById( - parameters: Parameters.DeleteRemoteLinkById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/remotelinks/1.0/remotelink/${parameters.remoteLinkId}`, - method: 'DELETE', - params: { - _updateSequenceNumber: parameters.updateSequenceNumber, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/securityInformation.mts b/src/agile/securityInformation.mts new file mode 100644 index 000000000..3737c19e4 --- /dev/null +++ b/src/agile/securityInformation.mts @@ -0,0 +1,322 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class SecurityInformation { + constructor(private client: Client) {} + + /** + * Insert Security Workspace IDs to establish a relationship between them and the Jira site the app is installed on. + * If a relationship between the workspace ID and Jira already exists then the workspace ID will be ignored and Jira + * will process the rest of the entries. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitWorkspaces(parameters: Parameters.SubmitWorkspaces, callback: Callback): Promise; + /** + * Insert Security Workspace IDs to establish a relationship between them and the Jira site the app is installed on. + * If a relationship between the workspace ID and Jira already exists then the workspace ID will be ignored and Jira + * will process the rest of the entries. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitWorkspaces(parameters: Parameters.SubmitWorkspaces, callback?: never): Promise; + async submitWorkspaces(parameters: Parameters.SubmitWorkspaces, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/security/1.0/linkedWorkspaces/bulk', + method: 'POST', + data: { + workspaceIds: parameters.workspaceIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all linked Security Workspaces that match the given request. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + * + * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 + */ + async deleteLinkedWorkspaces( + parameters: Parameters.DeleteLinkedWorkspaces, + callback: Callback, + ): Promise; + /** + * Bulk delete all linked Security Workspaces that match the given request. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + * + * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 + */ + async deleteLinkedWorkspaces(parameters: Parameters.DeleteLinkedWorkspaces, callback?: never): Promise; + async deleteLinkedWorkspaces( + parameters: Parameters.DeleteLinkedWorkspaces, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/security/1.0/linkedWorkspaces/bulk', + method: 'DELETE', + params: { + workspaceIds: parameters.workspaceIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve all Security Workspaces linked with the Jira site. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getLinkedWorkspaces(callback: Callback): Promise; + /** + * Retrieve all Security Workspaces linked with the Jira site. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getLinkedWorkspaces(callback?: never): Promise; + async getLinkedWorkspaces(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/security/1.0/linkedWorkspaces', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve a specific Security Workspace linked to the Jira site for the given workspace ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getLinkedWorkspaceById( + parameters: Parameters.GetLinkedWorkspaceById, + callback: Callback, + ): Promise; + /** + * Retrieve a specific Security Workspace linked to the Jira site for the given workspace ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getLinkedWorkspaceById( + parameters: Parameters.GetLinkedWorkspaceById, + callback?: never, + ): Promise; + async getLinkedWorkspaceById( + parameters: Parameters.GetLinkedWorkspaceById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/security/1.0/linkedWorkspaces/${parameters.workspaceId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update / Insert Vulnerability data. + * + * Vulnerabilities are identified by their ID, any existing Vulnerability data with the same ID will be replaced if it + * exists and the updateSequenceNumber of the existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Most updates are available within a short period of time but may take + * some time during peak load and/or maintenance times. The GET vulnerability endpoint can be used to confirm that + * data has been stored successfully (if needed). + * + * In the case of multiple Vulnerabilities being submitted in one request, each is validated individually prior to + * submission. Details of Vulnerabilities that failed submission (if any) are available in the response object. + * + * A maximum of 1000 vulnerabilities can be submitted in one request. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitVulnerabilities( + parameters: Parameters.SubmitVulnerabilities, + callback: Callback, + ): Promise; + /** + * Update / Insert Vulnerability data. + * + * Vulnerabilities are identified by their ID, any existing Vulnerability data with the same ID will be replaced if it + * exists and the updateSequenceNumber of the existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Most updates are available within a short period of time but may take + * some time during peak load and/or maintenance times. The GET vulnerability endpoint can be used to confirm that + * data has been stored successfully (if needed). + * + * In the case of multiple Vulnerabilities being submitted in one request, each is validated individually prior to + * submission. Details of Vulnerabilities that failed submission (if any) are available in the response object. + * + * A maximum of 1000 vulnerabilities can be submitted in one request. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitVulnerabilities( + parameters: Parameters.SubmitVulnerabilities, + callback?: never, + ): Promise; + async submitVulnerabilities( + parameters: Parameters.SubmitVulnerabilities, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/security/1.0/bulk', + method: 'POST', + data: { + operationType: parameters.operationType, + properties: parameters.properties, + vulnerabilities: parameters.vulnerabilities, + providerMetadata: parameters.providerMetadata, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Vulnerabilities that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). Read the POST bulk + * endpoint documentation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The GET vulnerability endpoint can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteVulnerabilitiesByProperty( + parameters: Parameters.DeleteVulnerabilitiesByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all Vulnerabilities that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). Read the POST bulk + * endpoint documentation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The GET vulnerability endpoint can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteVulnerabilitiesByProperty( + parameters: Parameters.DeleteVulnerabilitiesByProperty, + callback?: never, + ): Promise; + async deleteVulnerabilitiesByProperty( + parameters: Parameters.DeleteVulnerabilitiesByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/security/1.0/bulkByProperties', + method: 'DELETE', + params: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Vulnerability data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getVulnerabilityById( + parameters: Parameters.GetVulnerabilityById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Vulnerability data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getVulnerabilityById( + parameters: Parameters.GetVulnerabilityById, + callback?: never, + ): Promise; + async getVulnerabilityById( + parameters: Parameters.GetVulnerabilityById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/security/1.0/vulnerability/${parameters.vulnerabilityId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Vulnerability data currently stored for the given ID. + * + * Deletion is performed asynchronously. The GET vulnerability endpoint can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteVulnerabilityById( + parameters: Parameters.DeleteVulnerabilityById, + callback: Callback, + ): Promise; + /** + * Delete the Vulnerability data currently stored for the given ID. + * + * Deletion is performed asynchronously. The GET vulnerability endpoint can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteVulnerabilityById(parameters: Parameters.DeleteVulnerabilityById, callback?: never): Promise; + async deleteVulnerabilityById( + parameters: Parameters.DeleteVulnerabilityById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/security/1.0/vulnerability/${parameters.vulnerabilityId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/securityInformation.ts b/src/agile/securityInformation.ts deleted file mode 100644 index 373251d17..000000000 --- a/src/agile/securityInformation.ts +++ /dev/null @@ -1,322 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Client } from '../clients/index.js'; -import type { Callback } from '../callback.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class SecurityInformation { - constructor(private client: Client) {} - - /** - * Insert Security Workspace IDs to establish a relationship between them and the Jira site the app is installed on. - * If a relationship between the workspace ID and Jira already exists then the workspace ID will be ignored and Jira - * will process the rest of the entries. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitWorkspaces(parameters: Parameters.SubmitWorkspaces, callback: Callback): Promise; - /** - * Insert Security Workspace IDs to establish a relationship between them and the Jira site the app is installed on. - * If a relationship between the workspace ID and Jira already exists then the workspace ID will be ignored and Jira - * will process the rest of the entries. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitWorkspaces(parameters: Parameters.SubmitWorkspaces, callback?: never): Promise; - async submitWorkspaces(parameters: Parameters.SubmitWorkspaces, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/security/1.0/linkedWorkspaces/bulk', - method: 'POST', - data: { - workspaceIds: parameters.workspaceIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all linked Security Workspaces that match the given request. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - * - * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 - */ - async deleteLinkedWorkspaces( - parameters: Parameters.DeleteLinkedWorkspaces, - callback: Callback, - ): Promise; - /** - * Bulk delete all linked Security Workspaces that match the given request. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - * - * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 - */ - async deleteLinkedWorkspaces(parameters: Parameters.DeleteLinkedWorkspaces, callback?: never): Promise; - async deleteLinkedWorkspaces( - parameters: Parameters.DeleteLinkedWorkspaces, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/security/1.0/linkedWorkspaces/bulk', - method: 'DELETE', - params: { - workspaceIds: parameters.workspaceIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve all Security Workspaces linked with the Jira site. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getLinkedWorkspaces(callback: Callback): Promise; - /** - * Retrieve all Security Workspaces linked with the Jira site. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getLinkedWorkspaces(callback?: never): Promise; - async getLinkedWorkspaces(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/security/1.0/linkedWorkspaces', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve a specific Security Workspace linked to the Jira site for the given workspace ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getLinkedWorkspaceById( - parameters: Parameters.GetLinkedWorkspaceById, - callback: Callback, - ): Promise; - /** - * Retrieve a specific Security Workspace linked to the Jira site for the given workspace ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getLinkedWorkspaceById( - parameters: Parameters.GetLinkedWorkspaceById, - callback?: never, - ): Promise; - async getLinkedWorkspaceById( - parameters: Parameters.GetLinkedWorkspaceById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/security/1.0/linkedWorkspaces/${parameters.workspaceId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Update / Insert Vulnerability data. - * - * Vulnerabilities are identified by their ID, any existing Vulnerability data with the same ID will be replaced if it - * exists and the updateSequenceNumber of the existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Most updates are available within a short period of time but may take - * some time during peak load and/or maintenance times. The GET vulnerability endpoint can be used to confirm that - * data has been stored successfully (if needed). - * - * In the case of multiple Vulnerabilities being submitted in one request, each is validated individually prior to - * submission. Details of Vulnerabilities that failed submission (if any) are available in the response object. - * - * A maximum of 1000 vulnerabilities can be submitted in one request. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitVulnerabilities( - parameters: Parameters.SubmitVulnerabilities, - callback: Callback, - ): Promise; - /** - * Update / Insert Vulnerability data. - * - * Vulnerabilities are identified by their ID, any existing Vulnerability data with the same ID will be replaced if it - * exists and the updateSequenceNumber of the existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Most updates are available within a short period of time but may take - * some time during peak load and/or maintenance times. The GET vulnerability endpoint can be used to confirm that - * data has been stored successfully (if needed). - * - * In the case of multiple Vulnerabilities being submitted in one request, each is validated individually prior to - * submission. Details of Vulnerabilities that failed submission (if any) are available in the response object. - * - * A maximum of 1000 vulnerabilities can be submitted in one request. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitVulnerabilities( - parameters: Parameters.SubmitVulnerabilities, - callback?: never, - ): Promise; - async submitVulnerabilities( - parameters: Parameters.SubmitVulnerabilities, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/security/1.0/bulk', - method: 'POST', - data: { - operationType: parameters.operationType, - properties: parameters.properties, - vulnerabilities: parameters.vulnerabilities, - providerMetadata: parameters.providerMetadata, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all Vulnerabilities that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. If more than one Property is - * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). Read the POST bulk - * endpoint documentation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The GET vulnerability endpoint can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteVulnerabilitiesByProperty( - parameters: Parameters.DeleteVulnerabilitiesByProperty, - callback: Callback, - ): Promise; - /** - * Bulk delete all Vulnerabilities that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. If more than one Property is - * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). Read the POST bulk - * endpoint documentation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The GET vulnerability endpoint can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteVulnerabilitiesByProperty( - parameters: Parameters.DeleteVulnerabilitiesByProperty, - callback?: never, - ): Promise; - async deleteVulnerabilitiesByProperty( - parameters: Parameters.DeleteVulnerabilitiesByProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/security/1.0/bulkByProperties', - method: 'DELETE', - params: parameters, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the currently stored Vulnerability data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getVulnerabilityById( - parameters: Parameters.GetVulnerabilityById, - callback: Callback, - ): Promise; - /** - * Retrieve the currently stored Vulnerability data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getVulnerabilityById( - parameters: Parameters.GetVulnerabilityById, - callback?: never, - ): Promise; - async getVulnerabilityById( - parameters: Parameters.GetVulnerabilityById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/security/1.0/vulnerability/${parameters.vulnerabilityId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete the Vulnerability data currently stored for the given ID. - * - * Deletion is performed asynchronously. The GET vulnerability endpoint can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteVulnerabilityById( - parameters: Parameters.DeleteVulnerabilityById, - callback: Callback, - ): Promise; - /** - * Delete the Vulnerability data currently stored for the given ID. - * - * Deletion is performed asynchronously. The GET vulnerability endpoint can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteVulnerabilityById(parameters: Parameters.DeleteVulnerabilityById, callback?: never): Promise; - async deleteVulnerabilityById( - parameters: Parameters.DeleteVulnerabilityById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/security/1.0/vulnerability/${parameters.vulnerabilityId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/sprint.mts b/src/agile/sprint.mts new file mode 100644 index 000000000..894fc372b --- /dev/null +++ b/src/agile/sprint.mts @@ -0,0 +1,357 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Sprint { + constructor(private client: Client) {} + + /** + * Creates a future sprint. Sprint name and origin board id are required. Start date, end date, and goal are optional. + * + * Note that the sprint name is trimmed. Also, when starting sprints from the UI, the "endDate" set through this call + * is ignored and instead the last sprint's duration is used to fill the form. + */ + async createSprint(parameters: Parameters.CreateSprint, callback: Callback): Promise; + /** + * Creates a future sprint. Sprint name and origin board id are required. Start date, end date, and goal are optional. + * + * Note that the sprint name is trimmed. Also, when starting sprints from the UI, the "endDate" set through this call + * is ignored and instead the last sprint's duration is used to fill the form. + */ + async createSprint(parameters: Parameters.CreateSprint, callback?: never): Promise; + async createSprint( + parameters: Parameters.CreateSprint, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/agile/1.0/sprint', + method: 'POST', + data: { + endDate: parameters.endDate, + goal: parameters.goal, + name: parameters.name, + originBoardId: parameters.originBoardId, + startDate: parameters.startDate, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the sprint for a given sprint ID. The sprint will only be returned if the user can view the board that the + * sprint was created on, or view at least one of the issues in the sprint. + */ + async getSprint(parameters: Parameters.GetSprint, callback: Callback): Promise; + /** + * Returns the sprint for a given sprint ID. The sprint will only be returned if the user can view the board that the + * sprint was created on, or view at least one of the issues in the sprint. + */ + async getSprint(parameters: Parameters.GetSprint, callback?: never): Promise; + async getSprint(parameters: Parameters.GetSprint, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Performs a partial update of a sprint. A partial update means that fields not present in the request JSON will not + * be updated. + * + * Notes: + * + * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. + * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and + * have a startDate and endDate set. + * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' + * state. This sets the completeDate to the time of the request. + * - Other changes to state are not allowed. + * - The completeDate field cannot be updated manually. + */ + async partiallyUpdateSprint( + parameters: Parameters.PartiallyUpdateSprint, + callback: Callback, + ): Promise; + /** + * Performs a partial update of a sprint. A partial update means that fields not present in the request JSON will not + * be updated. + * + * Notes: + * + * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. + * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and + * have a startDate and endDate set. + * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' + * state. This sets the completeDate to the time of the request. + * - Other changes to state are not allowed. + * - The completeDate field cannot be updated manually. + */ + async partiallyUpdateSprint( + parameters: Parameters.PartiallyUpdateSprint, + callback?: never, + ): Promise; + async partiallyUpdateSprint( + parameters: Parameters.PartiallyUpdateSprint, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, + method: 'POST', + data: { + completeDate: parameters.completeDate, + createdDate: parameters.createdDate, + endDate: parameters.endDate, + goal: parameters.goal, + id: parameters.id, + name: parameters.name, + originBoardId: parameters.originBoardId, + self: parameters.self, + startDate: parameters.startDate, + state: parameters.state, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Performs a full update of a sprint. A full update means that the result will be exactly the same as the request + * body. Any fields not present in the request JSON will be set to null. + * + * Notes: + * + * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. + * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and + * have a startDate and endDate set. + * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' + * state. This sets the completeDate to the time of the request. + * - Other changes to state are not allowed. + * - The completeDate field cannot be updated manually. + */ + async updateSprint(parameters: Parameters.UpdateSprint, callback: Callback): Promise; + /** + * Performs a full update of a sprint. A full update means that the result will be exactly the same as the request + * body. Any fields not present in the request JSON will be set to null. + * + * Notes: + * + * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. + * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and + * have a startDate and endDate set. + * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' + * state. This sets the completeDate to the time of the request. + * - Other changes to state are not allowed. + * - The completeDate field cannot be updated manually. + */ + async updateSprint(parameters: Parameters.UpdateSprint, callback?: never): Promise; + async updateSprint( + parameters: Parameters.UpdateSprint, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, + method: 'PUT', + data: { + completeDate: parameters.completeDate, + createdDate: parameters.createdDate, + endDate: parameters.endDate, + goal: parameters.goal, + id: parameters.id, + name: parameters.name, + originBoardId: parameters.originBoardId, + self: parameters.self, + startDate: parameters.startDate, + state: parameters.state, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Deletes a sprint. Once a sprint is deleted, all open issues in the sprint will be moved to the backlog. */ + async deleteSprint(parameters: Parameters.DeleteSprint, callback: Callback): Promise; + /** Deletes a sprint. Once a sprint is deleted, all open issues in the sprint will be moved to the backlog. */ + async deleteSprint(parameters: Parameters.DeleteSprint, callback?: never): Promise; + async deleteSprint(parameters: Parameters.DeleteSprint, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all issues in a sprint, for a given sprint ID. This only includes issues that the user has permission to + * view. By default, the returned issues are ordered by rank. + */ + async getIssuesForSprint( + parameters: Parameters.GetIssuesForSprint, + callback: Callback, + ): Promise; + /** + * Returns all issues in a sprint, for a given sprint ID. This only includes issues that the user has permission to + * view. By default, the returned issues are ordered by rank. + */ + async getIssuesForSprint( + parameters: Parameters.GetIssuesForSprint, + callback?: never, + ): Promise; + async getIssuesForSprint( + parameters: Parameters.GetIssuesForSprint, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}/issue`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + jql: parameters.jql, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves issues to a sprint, for a given sprint ID. Issues can only be moved to open or active sprints. The maximum + * number of issues that can be moved in one operation is 50. + */ + async moveIssuesToSprintAndRank( + parameters: Parameters.MoveIssuesToSprintAndRank, + callback: Callback, + ): Promise; + /** + * Moves issues to a sprint, for a given sprint ID. Issues can only be moved to open or active sprints. The maximum + * number of issues that can be moved in one operation is 50. + */ + async moveIssuesToSprintAndRank( + parameters: Parameters.MoveIssuesToSprintAndRank, + callback?: never, + ): Promise; + async moveIssuesToSprintAndRank( + parameters: Parameters.MoveIssuesToSprintAndRank, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}/issue`, + method: 'POST', + data: { + issues: parameters.issues, + rankAfterIssue: parameters.rankAfterIssue, + rankBeforeIssue: parameters.rankBeforeIssue, + rankCustomFieldId: parameters.rankCustomFieldId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the keys of all properties for the sprint identified by the id. The user who retrieves the property keys is + * required to have permissions to view the sprint. + */ + async getPropertiesKeys(parameters: Parameters.GetPropertiesKeys, callback: Callback): Promise; + /** + * Returns the keys of all properties for the sprint identified by the id. The user who retrieves the property keys is + * required to have permissions to view the sprint. + */ + async getPropertiesKeys(parameters: Parameters.GetPropertiesKeys, callback?: never): Promise; + async getPropertiesKeys( + parameters: Parameters.GetPropertiesKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of the property with a given key from the sprint identified by the provided id. The user who + * retrieves the property is required to have permissions to view the sprint. + */ + async getProperty(parameters: Parameters.GetProperty, callback: Callback): Promise; + /** + * Returns the value of the property with a given key from the sprint identified by the provided id. The user who + * retrieves the property is required to have permissions to view the sprint. + */ + async getProperty(parameters: Parameters.GetProperty, callback?: never): Promise; + async getProperty(parameters: Parameters.GetProperty, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of the specified sprint's property. + * + * You can use this resource to store a custom data against the sprint identified by the id. The user who stores the + * data is required to have permissions to modify the sprint. + */ + async setProperty(parameters: Parameters.SetProperty, callback: Callback): Promise; + /** + * Sets the value of the specified sprint's property. + * + * You can use this resource to store a custom data against the sprint identified by the id. The user who stores the + * data is required to have permissions to modify the sprint. + */ + async setProperty(parameters: Parameters.SetProperty, callback?: never): Promise; + async setProperty(parameters: Parameters.SetProperty, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}/properties/${parameters.propertyKey}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes the property from the sprint identified by the id. Ths user removing the property is required to have + * permissions to modify the sprint. + */ + async deleteProperty(parameters: Parameters.DeleteProperty, callback: Callback): Promise; + /** + * Removes the property from the sprint identified by the id. Ths user removing the property is required to have + * permissions to modify the sprint. + */ + async deleteProperty(parameters: Parameters.DeleteProperty, callback?: never): Promise; + async deleteProperty(parameters: Parameters.DeleteProperty, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** Swap the position of the sprint with the second sprint. */ + async swapSprint(parameters: Parameters.SwapSprint, callback: Callback): Promise; + /** Swap the position of the sprint with the second sprint. */ + async swapSprint(parameters: Parameters.SwapSprint, callback?: never): Promise; + async swapSprint(parameters: Parameters.SwapSprint, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}/swap`, + method: 'POST', + data: { + sprintToSwapWith: parameters.sprintToSwapWith, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/sprint.ts b/src/agile/sprint.ts deleted file mode 100644 index a3f6416d6..000000000 --- a/src/agile/sprint.ts +++ /dev/null @@ -1,357 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Client } from '../clients/index.js'; -import type { Callback } from '../callback.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Sprint { - constructor(private client: Client) {} - - /** - * Creates a future sprint. Sprint name and origin board id are required. Start date, end date, and goal are optional. - * - * Note that the sprint name is trimmed. Also, when starting sprints from the UI, the "endDate" set through this call - * is ignored and instead the last sprint's duration is used to fill the form. - */ - async createSprint(parameters: Parameters.CreateSprint, callback: Callback): Promise; - /** - * Creates a future sprint. Sprint name and origin board id are required. Start date, end date, and goal are optional. - * - * Note that the sprint name is trimmed. Also, when starting sprints from the UI, the "endDate" set through this call - * is ignored and instead the last sprint's duration is used to fill the form. - */ - async createSprint(parameters: Parameters.CreateSprint, callback?: never): Promise; - async createSprint( - parameters: Parameters.CreateSprint, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/agile/1.0/sprint', - method: 'POST', - data: { - endDate: parameters.endDate, - goal: parameters.goal, - name: parameters.name, - originBoardId: parameters.originBoardId, - startDate: parameters.startDate, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the sprint for a given sprint ID. The sprint will only be returned if the user can view the board that the - * sprint was created on, or view at least one of the issues in the sprint. - */ - async getSprint(parameters: Parameters.GetSprint, callback: Callback): Promise; - /** - * Returns the sprint for a given sprint ID. The sprint will only be returned if the user can view the board that the - * sprint was created on, or view at least one of the issues in the sprint. - */ - async getSprint(parameters: Parameters.GetSprint, callback?: never): Promise; - async getSprint(parameters: Parameters.GetSprint, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Performs a partial update of a sprint. A partial update means that fields not present in the request JSON will not - * be updated. - * - * Notes: - * - * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. - * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and - * have a startDate and endDate set. - * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' - * state. This sets the completeDate to the time of the request. - * - Other changes to state are not allowed. - * - The completeDate field cannot be updated manually. - */ - async partiallyUpdateSprint( - parameters: Parameters.PartiallyUpdateSprint, - callback: Callback, - ): Promise; - /** - * Performs a partial update of a sprint. A partial update means that fields not present in the request JSON will not - * be updated. - * - * Notes: - * - * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. - * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and - * have a startDate and endDate set. - * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' - * state. This sets the completeDate to the time of the request. - * - Other changes to state are not allowed. - * - The completeDate field cannot be updated manually. - */ - async partiallyUpdateSprint( - parameters: Parameters.PartiallyUpdateSprint, - callback?: never, - ): Promise; - async partiallyUpdateSprint( - parameters: Parameters.PartiallyUpdateSprint, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, - method: 'POST', - data: { - completeDate: parameters.completeDate, - createdDate: parameters.createdDate, - endDate: parameters.endDate, - goal: parameters.goal, - id: parameters.id, - name: parameters.name, - originBoardId: parameters.originBoardId, - self: parameters.self, - startDate: parameters.startDate, - state: parameters.state, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Performs a full update of a sprint. A full update means that the result will be exactly the same as the request - * body. Any fields not present in the request JSON will be set to null. - * - * Notes: - * - * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. - * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and - * have a startDate and endDate set. - * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' - * state. This sets the completeDate to the time of the request. - * - Other changes to state are not allowed. - * - The completeDate field cannot be updated manually. - */ - async updateSprint(parameters: Parameters.UpdateSprint, callback: Callback): Promise; - /** - * Performs a full update of a sprint. A full update means that the result will be exactly the same as the request - * body. Any fields not present in the request JSON will be set to null. - * - * Notes: - * - * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. - * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and - * have a startDate and endDate set. - * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' - * state. This sets the completeDate to the time of the request. - * - Other changes to state are not allowed. - * - The completeDate field cannot be updated manually. - */ - async updateSprint(parameters: Parameters.UpdateSprint, callback?: never): Promise; - async updateSprint( - parameters: Parameters.UpdateSprint, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, - method: 'PUT', - data: { - completeDate: parameters.completeDate, - createdDate: parameters.createdDate, - endDate: parameters.endDate, - goal: parameters.goal, - id: parameters.id, - name: parameters.name, - originBoardId: parameters.originBoardId, - self: parameters.self, - startDate: parameters.startDate, - state: parameters.state, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** Deletes a sprint. Once a sprint is deleted, all open issues in the sprint will be moved to the backlog. */ - async deleteSprint(parameters: Parameters.DeleteSprint, callback: Callback): Promise; - /** Deletes a sprint. Once a sprint is deleted, all open issues in the sprint will be moved to the backlog. */ - async deleteSprint(parameters: Parameters.DeleteSprint, callback?: never): Promise; - async deleteSprint(parameters: Parameters.DeleteSprint, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all issues in a sprint, for a given sprint ID. This only includes issues that the user has permission to - * view. By default, the returned issues are ordered by rank. - */ - async getIssuesForSprint( - parameters: Parameters.GetIssuesForSprint, - callback: Callback, - ): Promise; - /** - * Returns all issues in a sprint, for a given sprint ID. This only includes issues that the user has permission to - * view. By default, the returned issues are ordered by rank. - */ - async getIssuesForSprint( - parameters: Parameters.GetIssuesForSprint, - callback?: never, - ): Promise; - async getIssuesForSprint( - parameters: Parameters.GetIssuesForSprint, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}/issue`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - jql: parameters.jql, - validateQuery: parameters.validateQuery, - fields: parameters.fields, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves issues to a sprint, for a given sprint ID. Issues can only be moved to open or active sprints. The maximum - * number of issues that can be moved in one operation is 50. - */ - async moveIssuesToSprintAndRank( - parameters: Parameters.MoveIssuesToSprintAndRank, - callback: Callback, - ): Promise; - /** - * Moves issues to a sprint, for a given sprint ID. Issues can only be moved to open or active sprints. The maximum - * number of issues that can be moved in one operation is 50. - */ - async moveIssuesToSprintAndRank( - parameters: Parameters.MoveIssuesToSprintAndRank, - callback?: never, - ): Promise; - async moveIssuesToSprintAndRank( - parameters: Parameters.MoveIssuesToSprintAndRank, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}/issue`, - method: 'POST', - data: { - issues: parameters.issues, - rankAfterIssue: parameters.rankAfterIssue, - rankBeforeIssue: parameters.rankBeforeIssue, - rankCustomFieldId: parameters.rankCustomFieldId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the keys of all properties for the sprint identified by the id. The user who retrieves the property keys is - * required to have permissions to view the sprint. - */ - async getPropertiesKeys(parameters: Parameters.GetPropertiesKeys, callback: Callback): Promise; - /** - * Returns the keys of all properties for the sprint identified by the id. The user who retrieves the property keys is - * required to have permissions to view the sprint. - */ - async getPropertiesKeys(parameters: Parameters.GetPropertiesKeys, callback?: never): Promise; - async getPropertiesKeys( - parameters: Parameters.GetPropertiesKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of the property with a given key from the sprint identified by the provided id. The user who - * retrieves the property is required to have permissions to view the sprint. - */ - async getProperty(parameters: Parameters.GetProperty, callback: Callback): Promise; - /** - * Returns the value of the property with a given key from the sprint identified by the provided id. The user who - * retrieves the property is required to have permissions to view the sprint. - */ - async getProperty(parameters: Parameters.GetProperty, callback?: never): Promise; - async getProperty(parameters: Parameters.GetProperty, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of the specified sprint's property. - * - * You can use this resource to store a custom data against the sprint identified by the id. The user who stores the - * data is required to have permissions to modify the sprint. - */ - async setProperty(parameters: Parameters.SetProperty, callback: Callback): Promise; - /** - * Sets the value of the specified sprint's property. - * - * You can use this resource to store a custom data against the sprint identified by the id. The user who stores the - * data is required to have permissions to modify the sprint. - */ - async setProperty(parameters: Parameters.SetProperty, callback?: never): Promise; - async setProperty(parameters: Parameters.SetProperty, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}/properties/${parameters.propertyKey}`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes the property from the sprint identified by the id. Ths user removing the property is required to have - * permissions to modify the sprint. - */ - async deleteProperty(parameters: Parameters.DeleteProperty, callback: Callback): Promise; - /** - * Removes the property from the sprint identified by the id. Ths user removing the property is required to have - * permissions to modify the sprint. - */ - async deleteProperty(parameters: Parameters.DeleteProperty, callback?: never): Promise; - async deleteProperty(parameters: Parameters.DeleteProperty, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** Swap the position of the sprint with the second sprint. */ - async swapSprint(parameters: Parameters.SwapSprint, callback: Callback): Promise; - /** Swap the position of the sprint with the second sprint. */ - async swapSprint(parameters: Parameters.SwapSprint, callback?: never): Promise; - async swapSprint(parameters: Parameters.SwapSprint, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}/swap`, - method: 'POST', - data: { - sprintToSwapWith: parameters.sprintToSwapWith, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/callback.mts b/src/callback.mts new file mode 100644 index 000000000..7b25091c0 --- /dev/null +++ b/src/callback.mts @@ -0,0 +1,3 @@ +import type { Config } from '@/config.mjs'; + +export type Callback = (err: Config.Error | null, data?: T) => void; diff --git a/src/callback.ts b/src/callback.ts deleted file mode 100644 index 6fbb06b1b..000000000 --- a/src/callback.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Config } from './config.js'; - -export type Callback = (err: Config.Error | null, data?: T) => void; diff --git a/src/clients/baseClient.mts b/src/clients/baseClient.mts new file mode 100644 index 000000000..db75c86dc --- /dev/null +++ b/src/clients/baseClient.mts @@ -0,0 +1,165 @@ +import axios, { AxiosInstance, AxiosResponse } from 'axios'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from './client.mjs'; +import type { Config } from '@/config.mjs'; +import { getAuthenticationToken } from '@/services/authenticationService/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; +import { HttpException, isObject } from './httpException.mjs'; + +const STRICT_GDPR_FLAG = 'x-atlassian-force-account-id'; +const ATLASSIAN_TOKEN_CHECK_FLAG = 'X-Atlassian-Token'; +const ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE = 'no-check'; + +export class BaseClient implements Client { + private instance: AxiosInstance; + + constructor(protected readonly config: Config) { + try { + // eslint-disable-next-line no-new + new URL(config.host); + } catch (e) { + throw new Error( + "Couldn't parse the host URL. Perhaps you forgot to add 'http://' or 'https://' at the beginning of the URL?", + ); + } + + this.instance = axios.create({ + paramsSerializer: this.paramSerializer.bind(this), + ...config.baseRequestConfig, + baseURL: config.host, + headers: this.removeUndefinedProperties({ + [STRICT_GDPR_FLAG]: config.strictGDPR, + [ATLASSIAN_TOKEN_CHECK_FLAG]: config.noCheckAtlassianToken ? ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE : undefined, + ...config.baseRequestConfig?.headers, + }), + }); + } + + protected paramSerializer(parameters: Record): string { + const parts: string[] = []; + + Object.entries(parameters).forEach(([key, value]) => { + if (value === null || typeof value === 'undefined') { + return; + } + + if (Array.isArray(value)) { + // eslint-disable-next-line no-param-reassign + value = value.join(','); + } + + if (value instanceof Date) { + // eslint-disable-next-line no-param-reassign + value = value.toISOString(); + } else if (value !== null && typeof value === 'object') { + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if (value instanceof Function) { + const part = value(); + + // eslint-disable-next-line consistent-return + return part && parts.push(part); + } + + parts.push(`${this.encode(key)}=${this.encode(value)}`); + }); + + return parts.join('&'); + } + + protected encode(value: string) { + return encodeURIComponent(value) + .replace(/%3A/gi, ':') + .replace(/%24/g, '$') + .replace(/%2C/gi, ',') + .replace(/%20/g, '+') + .replace(/%5B/gi, '[') + .replace(/%5D/gi, ']'); + } + + protected removeUndefinedProperties(obj: Record): Record { + return Object.entries(obj) + .filter(([, value]) => typeof value !== 'undefined') + .reduce((accumulator, [key, value]) => ({ ...accumulator, [key]: value }), {}); + } + + async sendRequest(requestConfig: RequestConfig, callback: never, telemetryData?: any): Promise; + async sendRequest(requestConfig: RequestConfig, callback: Callback, telemetryData?: any): Promise; + async sendRequest(requestConfig: RequestConfig, callback: Callback | never): Promise { + try { + const response = await this.sendRequestFullResponse(requestConfig); + + return this.handleSuccessResponse(response.data, callback); + } catch (e: unknown) { + return this.handleFailedResponse(e, callback); + } + } + + async sendRequestFullResponse(requestConfig: RequestConfig): Promise> { + const modifiedRequestConfig = { + ...requestConfig, + headers: this.removeUndefinedProperties({ + Authorization: await getAuthenticationToken(this.config.authentication), + ...requestConfig.headers, + }), + }; + + return this.instance.request(modifiedRequestConfig); + } + + handleSuccessResponse(response: any, callback?: Callback | never): T | void { + const callbackResponseHandler = callback && ((data: T): void => callback(null, data)); + const defaultResponseHandler = (data: T): T => data; + + const responseHandler = callbackResponseHandler ?? defaultResponseHandler; + + this.config.middlewares?.onResponse?.(response.data); + + return responseHandler(response); + } + + handleFailedResponse(e: unknown, callback?: Callback | never): void { + const err = this.buildErrorHandlingResponse(e); + + const callbackErrorHandler = callback && ((error: Config.Error) => callback(error)); + const defaultErrorHandler = (error: Config.Error) => { + throw error; + }; + + const errorHandler = callbackErrorHandler ?? defaultErrorHandler; + + this.config.middlewares?.onError?.(err); + + return errorHandler(err); + } + + private buildErrorHandlingResponse(e: unknown): Config.Error { + if (axios.isAxiosError(e) && e.response) { + return new HttpException( + { + code: e.code, + message: e.message, + data: e.response.data, + status: e.response?.status, + statusText: e.response?.statusText, + }, + e.response.status, + { cause: e }, + ); + } + + if (axios.isAxiosError(e)) { + return e; + } + + if (isObject(e) && isObject((e as Record).response)) { + return new HttpException((e as Record).response); + } + + if (e instanceof Error) { + return new HttpException(e); + } + + return new HttpException('Unknown error occurred.', 500, { cause: e }); + } +} diff --git a/src/clients/baseClient.ts b/src/clients/baseClient.ts deleted file mode 100644 index 439386d4b..000000000 --- a/src/clients/baseClient.ts +++ /dev/null @@ -1,165 +0,0 @@ -import axios, { type AxiosInstance, type AxiosResponse } from 'axios'; -import type { Callback } from '../callback.js'; -import type { Client } from './client.js'; -import type { Config } from '../config.js'; -import { getAuthenticationToken } from '../services/authenticationService/index.js'; -import type { RequestConfig } from '../requestConfig.js'; -import { HttpException, isObject } from './httpException.js'; - -const STRICT_GDPR_FLAG = 'x-atlassian-force-account-id'; -const ATLASSIAN_TOKEN_CHECK_FLAG = 'X-Atlassian-Token'; -const ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE = 'no-check'; - -export class BaseClient implements Client { - private instance: AxiosInstance; - - constructor(protected readonly config: Config) { - try { - // eslint-disable-next-line no-new - new URL(config.host); - } catch (e) { - throw new Error( - "Couldn't parse the host URL. Perhaps you forgot to add 'http://' or 'https://' at the beginning of the URL?", - ); - } - - this.instance = axios.create({ - paramsSerializer: this.paramSerializer.bind(this), - ...config.baseRequestConfig, - baseURL: config.host, - headers: this.removeUndefinedProperties({ - [STRICT_GDPR_FLAG]: config.strictGDPR, - [ATLASSIAN_TOKEN_CHECK_FLAG]: config.noCheckAtlassianToken ? ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE : undefined, - ...config.baseRequestConfig?.headers, - }), - }); - } - - protected paramSerializer(parameters: Record): string { - const parts: string[] = []; - - Object.entries(parameters).forEach(([key, value]) => { - if (value === null || typeof value === 'undefined') { - return; - } - - if (Array.isArray(value)) { - // eslint-disable-next-line no-param-reassign - value = value.join(','); - } - - if (value instanceof Date) { - // eslint-disable-next-line no-param-reassign - value = value.toISOString(); - } else if (value !== null && typeof value === 'object') { - // eslint-disable-next-line no-param-reassign - value = JSON.stringify(value); - } else if (value instanceof Function) { - const part = value(); - - // eslint-disable-next-line consistent-return - return part && parts.push(part); - } - - parts.push(`${this.encode(key)}=${this.encode(value)}`); - }); - - return parts.join('&'); - } - - protected encode(value: string) { - return encodeURIComponent(value) - .replace(/%3A/gi, ':') - .replace(/%24/g, '$') - .replace(/%2C/gi, ',') - .replace(/%20/g, '+') - .replace(/%5B/gi, '[') - .replace(/%5D/gi, ']'); - } - - protected removeUndefinedProperties(obj: Record): Record { - return Object.entries(obj) - .filter(([, value]) => typeof value !== 'undefined') - .reduce((accumulator, [key, value]) => ({ ...accumulator, [key]: value }), {}); - } - - async sendRequest(requestConfig: RequestConfig, callback: never, telemetryData?: any): Promise; - async sendRequest(requestConfig: RequestConfig, callback: Callback, telemetryData?: any): Promise; - async sendRequest(requestConfig: RequestConfig, callback: Callback | never): Promise { - try { - const response = await this.sendRequestFullResponse(requestConfig); - - return this.handleSuccessResponse(response.data, callback); - } catch (e: unknown) { - return this.handleFailedResponse(e, callback); - } - } - - async sendRequestFullResponse(requestConfig: RequestConfig): Promise> { - const modifiedRequestConfig = { - ...requestConfig, - headers: this.removeUndefinedProperties({ - Authorization: await getAuthenticationToken(this.config.authentication), - ...requestConfig.headers, - }), - }; - - return this.instance.request(modifiedRequestConfig); - } - - handleSuccessResponse(response: any, callback?: Callback | never): T | void { - const callbackResponseHandler = callback && ((data: T): void => callback(null, data)); - const defaultResponseHandler = (data: T): T => data; - - const responseHandler = callbackResponseHandler ?? defaultResponseHandler; - - this.config.middlewares?.onResponse?.(response.data); - - return responseHandler(response); - } - - handleFailedResponse(e: unknown, callback?: Callback | never): void { - const err = this.buildErrorHandlingResponse(e); - - const callbackErrorHandler = callback && ((error: Config.Error) => callback(error)); - const defaultErrorHandler = (error: Config.Error) => { - throw error; - }; - - const errorHandler = callbackErrorHandler ?? defaultErrorHandler; - - this.config.middlewares?.onError?.(err); - - return errorHandler(err); - } - - private buildErrorHandlingResponse(e: unknown): Config.Error { - if (axios.isAxiosError(e) && e.response) { - return new HttpException( - { - code: e.code, - message: e.message, - data: e.response.data, - status: e.response?.status, - statusText: e.response?.statusText, - }, - e.response.status, - { cause: e }, - ); - } - - if (axios.isAxiosError(e)) { - return e; - } - - if (isObject(e) && isObject((e as Record).response)) { - return new HttpException((e as Record).response); - } - - if (e instanceof Error) { - return new HttpException(e); - } - - return new HttpException('Unknown error occurred.', 500, { cause: e }); - } -} diff --git a/src/clients/client.mts b/src/clients/client.mts new file mode 100644 index 000000000..0ec6f7fa7 --- /dev/null +++ b/src/clients/client.mts @@ -0,0 +1,12 @@ +import type { AxiosResponse } from 'axios'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export interface Client { + sendRequest(requestConfig: RequestConfig, callback?: never, telemetryData?: any): Promise; + sendRequest(requestConfig: RequestConfig, callback?: Callback, telemetryData?: any): Promise; + + sendRequestFullResponse(requestConfig: RequestConfig): Promise>; + handleSuccessResponse(response: any, callback?: Callback | undefined | never): T | void; + handleFailedResponse(e: Error, callback?: Callback | never): void; +} diff --git a/src/clients/client.ts b/src/clients/client.ts deleted file mode 100644 index ed87f40a1..000000000 --- a/src/clients/client.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { AxiosResponse } from 'axios'; -import type { Callback } from '../callback.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export interface Client { - sendRequest(requestConfig: RequestConfig, callback?: never, telemetryData?: any): Promise; - sendRequest(requestConfig: RequestConfig, callback?: Callback, telemetryData?: any): Promise; - - sendRequestFullResponse(requestConfig: RequestConfig): Promise>; - handleSuccessResponse(response: any, callback?: Callback | undefined | never): T | void; - handleFailedResponse(e: Error, callback?: Callback | never): void; -} diff --git a/src/clients/httpException.ts b/src/clients/httpException.mts similarity index 100% rename from src/clients/httpException.ts rename to src/clients/httpException.mts diff --git a/src/clients/index.mts b/src/clients/index.mts new file mode 100644 index 000000000..e466efddd --- /dev/null +++ b/src/clients/index.mts @@ -0,0 +1,8 @@ +export * from './baseClient.mjs'; +export * from './client.mjs'; +export * from './httpException.mjs'; + +export { AgileClient, type AgileModels, type AgileParameters } from '../agile/index.mjs'; +export { Version2Client, type Version2Models, type Version2Parameters } from '../version2/index.mjs'; +export { Version3Client, type Version3Models, type Version3Parameters } from '../version3/index.mjs'; +export { ServiceDeskClient, type ServiceDeskModels, type ServiceDeskParameters } from '../serviceDesk/index.mjs'; diff --git a/src/clients/index.ts b/src/clients/index.ts deleted file mode 100644 index 1f1db4a76..000000000 --- a/src/clients/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from './baseClient.js'; -export * from './client.js'; -export * from './httpException.js'; - -export { AgileClient, AgileModels, AgileParameters } from '../agile/index.js'; - -export { Version2Client, Version2Models, Version2Parameters } from '../version2/index.js'; - -export { Version3Client, Version3Models, Version3Parameters } from '../version3/index.js'; - -export { ServiceDeskClient, ServiceDeskModels, ServiceDeskParameters } from '../serviceDesk/index.js'; diff --git a/src/config.mts b/src/config.mts new file mode 100644 index 000000000..8cb9a7fdf --- /dev/null +++ b/src/config.mts @@ -0,0 +1,75 @@ +import type { AxiosError } from 'axios'; +import type { RequestConfig } from '@/requestConfig.mjs'; +import type { UtilityTypes } from '@/utilityTypes.mjs'; +import type { HttpException } from '@/clients/index.mjs'; + +export interface Config { + host: string; + strictGDPR?: boolean; + /** Adds `'X-Atlassian-Token': 'no-check'` to each request header */ + noCheckAtlassianToken?: boolean; + baseRequestConfig?: Config.BaseRequestConfig; + authentication?: Config.Authentication; + middlewares?: Config.Middlewares; +} + +export namespace Config { + export type BaseRequestConfig = RequestConfig; + export type Error = AxiosError | HttpException; + + export type Authentication = UtilityTypes.XOR3< + { + personalAccessToken: Authentication.PersonalAccessToken; + }, + { + basic: Authentication.Basic; + }, + { + oauth2: Authentication.OAuth2; + } + >; + + export interface Middlewares { + onError?: Config.Middlewares.OnErrorHandler; + onResponse?: Config.Middlewares.OnResponseHandler; + } + + export namespace Middlewares { + export type OnErrorHandler = (error: Config.Error) => void; + export type OnResponseHandler = (data: any) => void; + } + + export namespace Authentication { + export type JWT = { + /** The key from the app descriptor. */ + issuer: string; + /** The sharedsecret key received during the app installation handshake */ + secret: string; + /** Token expiry time (default 3 minutes after issuing) */ + expiryTimeSeconds?: number; + }; + + export type Basic = UtilityTypes.XOR< + { + email: string; + apiToken: string; + }, + { + username: string; + password: string; + } + >; + + export interface OAuth { + consumerKey: string; + consumerSecret: string; + accessToken: string; + tokenSecret: string; + } + + export type OAuth2 = { + accessToken: string; + }; + export type PersonalAccessToken = string; + } +} diff --git a/src/config.ts b/src/config.ts deleted file mode 100644 index 56b381e14..000000000 --- a/src/config.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { AxiosError } from 'axios'; -import type { RequestConfig } from './requestConfig.js'; -import type { UtilityTypes } from './utilityTypes.js'; -import { HttpException } from './clients/index.js'; - -export interface Config { - host: string; - strictGDPR?: boolean; - /** Adds `'X-Atlassian-Token': 'no-check'` to each request header */ - noCheckAtlassianToken?: boolean; - baseRequestConfig?: Config.BaseRequestConfig; - authentication?: Config.Authentication; - middlewares?: Config.Middlewares; -} - -export namespace Config { - export type BaseRequestConfig = RequestConfig; - export type Error = AxiosError | HttpException; - - export type Authentication = UtilityTypes.XOR3< - { - personalAccessToken: Authentication.PersonalAccessToken; - }, - { - basic: Authentication.Basic; - }, - { - oauth2: Authentication.OAuth2; - } - >; - - export interface Middlewares { - onError?: Config.Middlewares.OnErrorHandler; - onResponse?: Config.Middlewares.OnResponseHandler; - } - - export namespace Middlewares { - export type OnErrorHandler = (error: Config.Error) => void; - export type OnResponseHandler = (data: any) => void; - } - - export namespace Authentication { - export type JWT = { - /** The key from the app descriptor. */ - issuer: string; - /** The sharedsecret key received during the app installation handshake */ - secret: string; - /** Token expiry time (default 3 minutes after issuing) */ - expiryTimeSeconds?: number; - }; - - export type Basic = UtilityTypes.XOR< - { - email: string; - apiToken: string; - }, - { - username: string; - password: string; - } - >; - - export interface OAuth { - consumerKey: string; - consumerSecret: string; - accessToken: string; - tokenSecret: string; - } - - export type OAuth2 = { - accessToken: string; - }; - export type PersonalAccessToken = string; - } -} diff --git a/src/createClient.ts b/src/createClient.ts deleted file mode 100644 index e81f6f3e3..000000000 --- a/src/createClient.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { AgileClient } from './agile/index.js'; -import { BaseClient } from './clients/index.js'; -import type { Config } from './config.js'; -import { ServiceDeskClient } from './serviceDesk/index.js'; -import { Version2Client } from './version2/index.js'; -import { Version3Client } from './version3/index.js'; - -export enum ClientType { - Agile = 'agile', - Version2 = 'version2', - Version3 = 'version3', - ServiceDesk = 'serviceDesk', -} - -export function createClient(clientType: ClientType.Agile, config: Config): AgileClient; -export function createClient(clientType: ClientType.Version2, config: Config): Version2Client; -export function createClient(clientType: ClientType.Version3, config: Config): Version3Client; -export function createClient(clientType: ClientType, config: Config): BaseClient { - switch (clientType) { - case ClientType.Agile: - return new AgileClient(config); - case ClientType.Version2: - return new Version2Client(config); - case ClientType.Version3: - return new Version3Client(config); - case ClientType.ServiceDesk: - return new ServiceDeskClient(config); - default: - return new BaseClient(config); - } -} diff --git a/src/index.mts b/src/index.mts new file mode 100644 index 000000000..ecd9a78d5 --- /dev/null +++ b/src/index.mts @@ -0,0 +1,11 @@ +export * from './clients/index.mjs'; +export * from './utilityTypes.mjs'; +export * from './config.mjs'; +export * from './callback.mjs'; +export * from './paginated.mjs'; +export * from './requestConfig.mjs'; + +export * as Agile from './agile/index.mjs'; +export * as Version2 from './version2/index.mjs'; +export * as Version3 from './version3/index.mjs'; +export * as ServiceDesk from './serviceDesk/index.mjs'; diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index 57e9f1da3..000000000 --- a/src/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -export * from './createClient.js'; -export * from './clients/index.js'; -export * from './utilityTypes.js'; -export * from './config.js'; -export * from './callback.js'; -export * from './paginated.js'; -export * from './requestConfig.js'; - -export * as Agile from './agile/index.js'; -export * as Version2 from './version2/index.js'; -export * as Version3 from './version3/index.js'; -export * as ServiceDesk from './serviceDesk/index.js'; diff --git a/src/paginated.ts b/src/paginated.mts similarity index 100% rename from src/paginated.ts rename to src/paginated.mts diff --git a/src/paramSerializer.ts b/src/paramSerializer.mts similarity index 100% rename from src/paramSerializer.ts rename to src/paramSerializer.mts diff --git a/src/requestConfig.ts b/src/requestConfig.mts similarity index 100% rename from src/requestConfig.ts rename to src/requestConfig.mts diff --git a/src/serviceDesk/client/index.ts b/src/serviceDesk/client/index.ts deleted file mode 100644 index c4db2252e..000000000 --- a/src/serviceDesk/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './serviceDeskClient.js'; diff --git a/src/serviceDesk/client/serviceDeskClient.mts b/src/serviceDesk/client/serviceDeskClient.mts new file mode 100644 index 000000000..fadeada80 --- /dev/null +++ b/src/serviceDesk/client/serviceDeskClient.mts @@ -0,0 +1,20 @@ +import { BaseClient } from '@/clients/baseClient.mjs'; +import { Customer } from '@/serviceDesk/customer.mjs'; +import { Info } from '@/serviceDesk/info.mjs'; +import { Insight } from '@/serviceDesk/insight.mjs'; +import { KnowledgeBase } from '@/serviceDesk/knowledgeBase.mjs'; +import { Organization } from '@/serviceDesk/organization.mjs'; +import { Request } from '@/serviceDesk/request.mjs'; +import { RequestType } from '@/serviceDesk/requestType.mjs'; +import { ServiceDesk } from '@/serviceDesk/serviceDesk.mjs'; + +export class ServiceDeskClient extends BaseClient { + customer = new Customer(this); + info = new Info(this); + insights = new Insight(this); + knowledgeBase = new KnowledgeBase(this); + organization = new Organization(this); + request = new Request(this); + requestType = new RequestType(this); + serviceDesk = new ServiceDesk(this); +} diff --git a/src/serviceDesk/client/serviceDeskClient.ts b/src/serviceDesk/client/serviceDeskClient.ts deleted file mode 100644 index c4e211dab..000000000 --- a/src/serviceDesk/client/serviceDeskClient.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { BaseClient } from '../../clients/index.js'; -import { Customer } from '../customer.js'; -import { Info } from '../info.js'; -import { Insight } from '../insight.js'; -import { KnowledgeBase } from '../knowledgeBase.js'; -import { Organization } from '../organization.js'; -import { Request } from '../request.js'; -import { RequestType } from '../requestType.js'; -import { ServiceDesk } from '../serviceDesk.js'; - -export class ServiceDeskClient extends BaseClient { - customer = new Customer(this); - info = new Info(this); - insights = new Insight(this); - knowledgeBase = new KnowledgeBase(this); - organization = new Organization(this); - request = new Request(this); - requestType = new RequestType(this); - serviceDesk = new ServiceDesk(this); -} diff --git a/src/serviceDesk/customer.mts b/src/serviceDesk/customer.mts new file mode 100644 index 000000000..18f589a6e --- /dev/null +++ b/src/serviceDesk/customer.mts @@ -0,0 +1,46 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Customer { + constructor(private client: Client) {} + + /** + * This method adds a customer to the Jira Service Management instance by passing a JSON file including an email + * address and display name. The display name does not need to be unique. The record's identifiers, `name` and `key`, + * are automatically generated from the request details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira + * Administrator Global permission + */ + async createCustomer( + parameters: Parameters.CreateCustomer | undefined, + callback: Callback, + ): Promise; + /** + * This method adds a customer to the Jira Service Management instance by passing a JSON file including an email + * address and display name. The display name does not need to be unique. The record's identifiers, `name` and `key`, + * are automatically generated from the request details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira + * Administrator Global permission + */ + async createCustomer(parameters?: Parameters.CreateCustomer, callback?: never): Promise; + async createCustomer( + parameters?: Parameters.CreateCustomer, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/customer', + method: 'POST', + data: { + email: parameters?.email, + displayName: parameters?.displayName, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/serviceDesk/customer.ts b/src/serviceDesk/customer.ts deleted file mode 100644 index f28ee0e08..000000000 --- a/src/serviceDesk/customer.ts +++ /dev/null @@ -1,46 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Customer { - constructor(private client: Client) {} - - /** - * This method adds a customer to the Jira Service Management instance by passing a JSON file including an email - * address and display name. The display name does not need to be unique. The record's identifiers, `name` and `key`, - * are automatically generated from the request details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira - * Administrator Global permission - */ - async createCustomer( - parameters: Parameters.CreateCustomer | undefined, - callback: Callback, - ): Promise; - /** - * This method adds a customer to the Jira Service Management instance by passing a JSON file including an email - * address and display name. The display name does not need to be unique. The record's identifiers, `name` and `key`, - * are automatically generated from the request details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira - * Administrator Global permission - */ - async createCustomer(parameters?: Parameters.CreateCustomer, callback?: never): Promise; - async createCustomer( - parameters?: Parameters.CreateCustomer, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/customer', - method: 'POST', - data: { - email: parameters?.email, - displayName: parameters?.displayName, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/serviceDesk/index.mts b/src/serviceDesk/index.mts new file mode 100644 index 000000000..8415ed8f6 --- /dev/null +++ b/src/serviceDesk/index.mts @@ -0,0 +1,12 @@ +export * from './customer.mjs'; +export * from './info.mjs'; +export * from './insight.mjs'; +export * from './knowledgeBase.mjs'; +export * from './organization.mjs'; +export * from './request.mjs'; +export * from './requestType.mjs'; +export * from './serviceDesk.mjs'; + +export * as ServiceDeskModels from './models/index.mjs'; +export * as ServiceDeskParameters from './parameters/index.mjs'; +export * from './client/serviceDeskClient.mjs'; diff --git a/src/serviceDesk/index.ts b/src/serviceDesk/index.ts deleted file mode 100644 index 661a24b13..000000000 --- a/src/serviceDesk/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -export * from './customer.js'; -export * from './info.js'; -export * from './insight.js'; -export * from './knowledgeBase.js'; -export * from './organization.js'; -export * from './request.js'; -export * from './requestType.js'; -export * from './serviceDesk.js'; - -export * as ServiceDeskModels from './models/index.js'; -export * as ServiceDeskParameters from './parameters/index.js'; -export * from './client/index.js'; diff --git a/src/serviceDesk/info.mts b/src/serviceDesk/info.mts new file mode 100644 index 000000000..b80918650 --- /dev/null +++ b/src/serviceDesk/info.mts @@ -0,0 +1,33 @@ +import * as Models from './models/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Info { + constructor(private client: Client) {} + + /** + * This method retrieves information about the Jira Service Management instance such as software version, builds, and + * related links. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: None, + * the user does not need to be logged in. + */ + async getInfo(callback: Callback): Promise; + /** + * This method retrieves information about the Jira Service Management instance such as software version, builds, and + * related links. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: None, + * the user does not need to be logged in. + */ + async getInfo(callback?: never): Promise; + async getInfo(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/info', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/serviceDesk/info.ts b/src/serviceDesk/info.ts deleted file mode 100644 index 882577edb..000000000 --- a/src/serviceDesk/info.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as Models from './models/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Info { - constructor(private client: Client) {} - - /** - * This method retrieves information about the Jira Service Management instance such as software version, builds, and - * related links. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: None, - * the user does not need to be logged in. - */ - async getInfo(callback: Callback): Promise; - /** - * This method retrieves information about the Jira Service Management instance such as software version, builds, and - * related links. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: None, - * the user does not need to be logged in. - */ - async getInfo(callback?: never): Promise; - async getInfo(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/info', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/serviceDesk/insight.mts b/src/serviceDesk/insight.mts new file mode 100644 index 000000000..65def6fd0 --- /dev/null +++ b/src/serviceDesk/insight.mts @@ -0,0 +1,45 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Insight { + constructor(private client: Client) {} + + /** + * Returns a list of Insight workspace IDs. Include a workspace ID in the path to access the [Insight REST + * APIs](https://developer.atlassian.com/cloud/insight/rest). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + */ + async getInsightWorkspaces( + parameters: Parameters.GetInsightWorkspaces | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of Insight workspace IDs. Include a workspace ID in the path to access the [Insight REST + * APIs](https://developer.atlassian.com/cloud/insight/rest). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + */ + async getInsightWorkspaces( + parameters?: Parameters.GetInsightWorkspaces, + callback?: never, + ): Promise; + async getInsightWorkspaces( + parameters?: Parameters.GetInsightWorkspaces, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/insight/workspace', + method: 'GET', + params: { + start: parameters?.start, + limit: parameters?.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/serviceDesk/insight.ts b/src/serviceDesk/insight.ts deleted file mode 100644 index 362f119a4..000000000 --- a/src/serviceDesk/insight.ts +++ /dev/null @@ -1,45 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Insight { - constructor(private client: Client) {} - - /** - * Returns a list of Insight workspace IDs. Include a workspace ID in the path to access the [Insight REST - * APIs](https://developer.atlassian.com/cloud/insight/rest). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - */ - async getInsightWorkspaces( - parameters: Parameters.GetInsightWorkspaces | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of Insight workspace IDs. Include a workspace ID in the path to access the [Insight REST - * APIs](https://developer.atlassian.com/cloud/insight/rest). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - */ - async getInsightWorkspaces( - parameters?: Parameters.GetInsightWorkspaces, - callback?: never, - ): Promise; - async getInsightWorkspaces( - parameters?: Parameters.GetInsightWorkspaces, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/insight/workspace', - method: 'GET', - params: { - start: parameters?.start, - limit: parameters?.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/serviceDesk/knowledgeBase.mts b/src/serviceDesk/knowledgeBase.mts new file mode 100644 index 000000000..a6962e6c6 --- /dev/null +++ b/src/serviceDesk/knowledgeBase.mts @@ -0,0 +1,46 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class KnowledgeBase { + constructor(private client: Client) {} + + /** + * Returns articles which match the given query string across all service desks. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the [customer + * portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). + */ + async getArticles(parameters: Parameters.GetArticles, callback: Callback): Promise; + /** + * Returns articles which match the given query string across all service desks. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the [customer + * portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). + */ + async getArticles(parameters: Parameters.GetArticles, callback?: never): Promise; + async getArticles( + parameters: Parameters.GetArticles, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/knowledgebase/article', + method: 'GET', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + params: { + query: parameters.query, + highlight: parameters.highlight, + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/serviceDesk/knowledgeBase.ts b/src/serviceDesk/knowledgeBase.ts deleted file mode 100644 index 8f2243650..000000000 --- a/src/serviceDesk/knowledgeBase.ts +++ /dev/null @@ -1,46 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class KnowledgeBase { - constructor(private client: Client) {} - - /** - * Returns articles which match the given query string across all service desks. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the [customer - * portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). - */ - async getArticles(parameters: Parameters.GetArticles, callback: Callback): Promise; - /** - * Returns articles which match the given query string across all service desks. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the [customer - * portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). - */ - async getArticles(parameters: Parameters.GetArticles, callback?: never): Promise; - async getArticles( - parameters: Parameters.GetArticles, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/knowledgebase/article', - method: 'GET', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - params: { - query: parameters.query, - highlight: parameters.highlight, - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/serviceDesk/models/additionalComment.ts b/src/serviceDesk/models/additionalComment.mts similarity index 100% rename from src/serviceDesk/models/additionalComment.ts rename to src/serviceDesk/models/additionalComment.mts diff --git a/src/serviceDesk/models/approval.mts b/src/serviceDesk/models/approval.mts new file mode 100644 index 000000000..a54b76b12 --- /dev/null +++ b/src/serviceDesk/models/approval.mts @@ -0,0 +1,22 @@ +import { Approver } from './approver.mjs'; +import { Date } from './date.mjs'; +import { SelfLink } from './selfLink.mjs'; + +export interface Approval { + /** ID of the approval. */ + id?: string; + /** Description of the approval being sought or provided. */ + name?: string; + /** Outcome of the approval, based on the approvals provided by all approvers. */ + finalDecision?: string; + /** + * Indicates whether the user making the request is one of the approvers and can respond to the approval (true) or not + * (false). + */ + canAnswerApproval?: boolean; + /** Detailed list of the users who must provide a response to the approval. */ + approvers?: Approver[]; + createdDate?: Date; + completedDate?: Date; + Links?: SelfLink; +} diff --git a/src/serviceDesk/models/approval.ts b/src/serviceDesk/models/approval.ts deleted file mode 100644 index 172fcdca6..000000000 --- a/src/serviceDesk/models/approval.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { Approver } from './approver.js'; -import type { Date } from './date.js'; -import type { SelfLink } from './selfLink.js'; - -export interface Approval { - /** ID of the approval. */ - id?: string; - /** Description of the approval being sought or provided. */ - name?: string; - /** Outcome of the approval, based on the approvals provided by all approvers. */ - finalDecision?: string; - /** - * Indicates whether the user making the request is one of the approvers and can respond to the approval (true) or not - * (false). - */ - canAnswerApproval?: boolean; - /** Detailed list of the users who must provide a response to the approval. */ - approvers?: Approver[]; - createdDate?: Date; - completedDate?: Date; - Links?: SelfLink; -} diff --git a/src/serviceDesk/models/approvalDecisionRequest.ts b/src/serviceDesk/models/approvalDecisionRequest.mts similarity index 100% rename from src/serviceDesk/models/approvalDecisionRequest.ts rename to src/serviceDesk/models/approvalDecisionRequest.mts diff --git a/src/serviceDesk/models/approver.mts b/src/serviceDesk/models/approver.mts new file mode 100644 index 000000000..7cdfcc5e8 --- /dev/null +++ b/src/serviceDesk/models/approver.mts @@ -0,0 +1,7 @@ +import { User } from './user.mjs'; + +export interface Approver { + approver?: User; + /** Decision made by the approver. */ + approverDecision?: string; +} diff --git a/src/serviceDesk/models/approver.ts b/src/serviceDesk/models/approver.ts deleted file mode 100644 index 6efeb41bd..000000000 --- a/src/serviceDesk/models/approver.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { User } from './user.js'; - -export interface Approver { - approver?: User; - /** Decision made by the approver. */ - approverDecision?: string; -} diff --git a/src/serviceDesk/models/article.mts b/src/serviceDesk/models/article.mts new file mode 100644 index 000000000..c0c474daa --- /dev/null +++ b/src/serviceDesk/models/article.mts @@ -0,0 +1,11 @@ +import { Content } from './content.mjs'; +import { Source } from './source.mjs'; + +export interface Article { + /** Title of the article. */ + title?: string; + /** Excerpt of the article which matches the given query string. */ + excerpt?: string; + source?: Source; + content?: Content; +} diff --git a/src/serviceDesk/models/article.ts b/src/serviceDesk/models/article.ts deleted file mode 100644 index edf0c3fd0..000000000 --- a/src/serviceDesk/models/article.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Content } from './content.js'; -import type { Source } from './source.js'; - -export interface Article { - /** Title of the article. */ - title?: string; - /** Excerpt of the article which matches the given query string. */ - excerpt?: string; - source?: Source; - content?: Content; -} diff --git a/src/serviceDesk/models/attachment.mts b/src/serviceDesk/models/attachment.mts new file mode 100644 index 000000000..1e33cc586 --- /dev/null +++ b/src/serviceDesk/models/attachment.mts @@ -0,0 +1,15 @@ +import { AttachmentLink } from './attachmentLink.mjs'; +import { Date } from './date.mjs'; +import { User } from './user.mjs'; + +export interface Attachment { + /** Filename of the item attached. */ + filename?: string; + author?: User; + created?: Date; + /** Size of the attachment in bytes. */ + size?: number; + /** MIME type of the attachment. */ + mimeType?: string; + Links?: AttachmentLink; +} diff --git a/src/serviceDesk/models/attachment.ts b/src/serviceDesk/models/attachment.ts deleted file mode 100644 index 8e6651d1b..000000000 --- a/src/serviceDesk/models/attachment.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { AttachmentLink } from './attachmentLink.js'; -import type { Date } from './date.js'; -import type { User } from './user.js'; - -export interface Attachment { - /** Filename of the item attached. */ - filename?: string; - author?: User; - created?: Date; - /** Size of the attachment in bytes. */ - size?: number; - /** MIME type of the attachment. */ - mimeType?: string; - Links?: AttachmentLink; -} diff --git a/src/serviceDesk/models/attachmentCreate.mts b/src/serviceDesk/models/attachmentCreate.mts new file mode 100644 index 000000000..b9d5b76e2 --- /dev/null +++ b/src/serviceDesk/models/attachmentCreate.mts @@ -0,0 +1,9 @@ +import { AdditionalComment } from './additionalComment.mjs'; + +export interface AttachmentCreate { + /** List of IDs for the temporary attachments to be added to the customer request. */ + temporaryAttachmentIds?: string[]; + additionalComment?: AdditionalComment; + /** Indicates whether the attachments are to be public (true) or private/internal (false). */ + public?: boolean; +} diff --git a/src/serviceDesk/models/attachmentCreate.ts b/src/serviceDesk/models/attachmentCreate.ts deleted file mode 100644 index d731ebcc6..000000000 --- a/src/serviceDesk/models/attachmentCreate.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { AdditionalComment } from './additionalComment.js'; - -export interface AttachmentCreate { - /** List of IDs for the temporary attachments to be added to the customer request. */ - temporaryAttachmentIds?: string[]; - additionalComment?: AdditionalComment; - /** Indicates whether the attachments are to be public (true) or private/internal (false). */ - public?: boolean; -} diff --git a/src/serviceDesk/models/attachmentCreateResult.mts b/src/serviceDesk/models/attachmentCreateResult.mts new file mode 100644 index 000000000..55613ebb2 --- /dev/null +++ b/src/serviceDesk/models/attachmentCreateResult.mts @@ -0,0 +1,7 @@ +import type { Comment } from './comment.mjs'; +import { PagedAttachment } from './pagedAttachment.mjs'; + +export interface AttachmentCreateResult { + comment?: Comment; + attachments?: PagedAttachment; +} diff --git a/src/serviceDesk/models/attachmentCreateResult.ts b/src/serviceDesk/models/attachmentCreateResult.ts deleted file mode 100644 index e00ab3920..000000000 --- a/src/serviceDesk/models/attachmentCreateResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Comment } from './comment.js'; -import type { PagedAttachment } from './pagedAttachment.js'; - -export interface AttachmentCreateResult { - comment?: Comment; - attachments?: PagedAttachment; -} diff --git a/src/serviceDesk/models/attachmentLink.ts b/src/serviceDesk/models/attachmentLink.mts similarity index 100% rename from src/serviceDesk/models/attachmentLink.ts rename to src/serviceDesk/models/attachmentLink.mts diff --git a/src/serviceDesk/models/avatarUrls.ts b/src/serviceDesk/models/avatarUrls.mts similarity index 100% rename from src/serviceDesk/models/avatarUrls.ts rename to src/serviceDesk/models/avatarUrls.mts diff --git a/src/serviceDesk/models/comment.mts b/src/serviceDesk/models/comment.mts new file mode 100644 index 000000000..d0d0f62d6 --- /dev/null +++ b/src/serviceDesk/models/comment.mts @@ -0,0 +1,21 @@ +import { Date } from './date.mjs'; +import { PagedAttachment } from './pagedAttachment.mjs'; +import { RenderedValue } from './renderedValue.mjs'; +import { SelfLink } from './selfLink.mjs'; +import { User } from './user.mjs'; + +export interface Comment { + /** ID of the comment. */ + id?: string; + /** Content of the comment. */ + body?: string; + renderedBody?: RenderedValue; + author?: User; + created?: Date; + attachments?: PagedAttachment; + /** List of items that can be expanded in the response by specifying the expand query parameter. */ + Expands?: string[]; + /** Indicates whether the comment is public (true) or private/internal (false). */ + public?: boolean; + Links?: SelfLink; +} diff --git a/src/serviceDesk/models/comment.ts b/src/serviceDesk/models/comment.ts deleted file mode 100644 index 5ea574b24..000000000 --- a/src/serviceDesk/models/comment.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Date } from './date.js'; -import type { PagedAttachment } from './pagedAttachment.js'; -import type { RenderedValue } from './renderedValue.js'; -import type { SelfLink } from './selfLink.js'; -import type { User } from './user.js'; - -export interface Comment { - /** ID of the comment. */ - id?: string; - /** Content of the comment. */ - body?: string; - renderedBody?: RenderedValue; - author?: User; - created?: Date; - attachments?: PagedAttachment; - /** List of items that can be expanded in the response by specifying the expand query parameter. */ - Expands?: string[]; - /** Indicates whether the comment is public (true) or private/internal (false). */ - public?: boolean; - Links?: SelfLink; -} diff --git a/src/serviceDesk/models/commentCreate.ts b/src/serviceDesk/models/commentCreate.mts similarity index 100% rename from src/serviceDesk/models/commentCreate.ts rename to src/serviceDesk/models/commentCreate.mts diff --git a/src/serviceDesk/models/content.ts b/src/serviceDesk/models/content.mts similarity index 100% rename from src/serviceDesk/models/content.ts rename to src/serviceDesk/models/content.mts diff --git a/src/serviceDesk/models/csatFeedbackFull.mts b/src/serviceDesk/models/csatFeedbackFull.mts new file mode 100644 index 000000000..1fccccf04 --- /dev/null +++ b/src/serviceDesk/models/csatFeedbackFull.mts @@ -0,0 +1,9 @@ +import { AdditionalComment } from './additionalComment.mjs'; + +export interface CsatFeedbackFull { + /** Indicates the type of feedback, supported values: `csat`. */ + type?: string; + /** A numeric representation of the rating, this must be an integer value between 1 and 5. */ + rating?: number; + comment?: AdditionalComment; +} diff --git a/src/serviceDesk/models/csatFeedbackFull.ts b/src/serviceDesk/models/csatFeedbackFull.ts deleted file mode 100644 index 61fdd7a61..000000000 --- a/src/serviceDesk/models/csatFeedbackFull.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { AdditionalComment } from './additionalComment.js'; - -export interface CsatFeedbackFull { - /** Indicates the type of feedback, supported values: `csat`. */ - type?: string; - /** A numeric representation of the rating, this must be an integer value between 1 and 5. */ - rating?: number; - comment?: AdditionalComment; -} diff --git a/src/serviceDesk/models/customerCreate.ts b/src/serviceDesk/models/customerCreate.mts similarity index 100% rename from src/serviceDesk/models/customerCreate.ts rename to src/serviceDesk/models/customerCreate.mts diff --git a/src/serviceDesk/models/customerRequest.mts b/src/serviceDesk/models/customerRequest.mts new file mode 100644 index 000000000..b1c51999f --- /dev/null +++ b/src/serviceDesk/models/customerRequest.mts @@ -0,0 +1,40 @@ +import { CustomerRequestActions } from './customerRequestActions.mjs'; +import { CustomerRequestFieldValue } from './customerRequestFieldValue.mjs'; +import { CustomerRequestLink } from './customerRequestLink.mjs'; +import { CustomerRequestStatus } from './customerRequestStatus.mjs'; +import { Date } from './date.mjs'; +import { PagedAttachment } from './pagedAttachment.mjs'; +import { PagedComment } from './pagedComment.mjs'; +import { PagedCustomerRequestStatus } from './pagedCustomerRequestStatus.mjs'; +import { PagedSlaInformation } from './pagedSlaInformation.mjs'; +import { PagedUser } from './pagedUser.mjs'; +import { RequestType } from './requestType.mjs'; +import { ServiceDesk } from './serviceDesk.mjs'; +import { User } from './user.mjs'; + +export interface CustomerRequest { + /** ID of the request, as the peer issue ID. */ + issueId?: string; + /** Key of the request, as the peer issue key. */ + issueKey?: string; + /** ID of the request type for the request. */ + requestTypeId?: string; + requestType?: RequestType; + /** ID of the service desk the request belongs to. */ + serviceDeskId?: string; + serviceDesk?: ServiceDesk; + createdDate?: Date; + reporter?: User; + /** JSON map of Jira field IDs and their values representing the content of the request. */ + requestFieldValues?: CustomerRequestFieldValue[]; + currentStatus?: CustomerRequestStatus; + status?: PagedCustomerRequestStatus; + participants?: PagedUser; + sla?: PagedSlaInformation; + attachments?: PagedAttachment; + comments?: PagedComment; + actions?: CustomerRequestActions; + /** List of items that can be expanded in the response by specifying the expand query parameter. */ + Expands?: string[]; + Links?: CustomerRequestLink; +} diff --git a/src/serviceDesk/models/customerRequest.ts b/src/serviceDesk/models/customerRequest.ts deleted file mode 100644 index e97d954a5..000000000 --- a/src/serviceDesk/models/customerRequest.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { CustomerRequestActions } from './customerRequestActions.js'; -import type { CustomerRequestFieldValue } from './customerRequestFieldValue.js'; -import type { CustomerRequestLink } from './customerRequestLink.js'; -import type { CustomerRequestStatus } from './customerRequestStatus.js'; -import type { Date } from './date.js'; -import type { PagedAttachment } from './pagedAttachment.js'; -import type { PagedComment } from './pagedComment.js'; -import type { PagedCustomerRequestStatus } from './pagedCustomerRequestStatus.js'; -import type { PagedSlaInformation } from './pagedSlaInformation.js'; -import type { PagedUser } from './pagedUser.js'; -import type { RequestType } from './requestType.js'; -import type { ServiceDesk } from './serviceDesk.js'; -import type { User } from './user.js'; - -export interface CustomerRequest { - /** ID of the request, as the peer issue ID. */ - issueId?: string; - /** Key of the request, as the peer issue key. */ - issueKey?: string; - /** ID of the request type for the request. */ - requestTypeId?: string; - requestType?: RequestType; - /** ID of the service desk the request belongs to. */ - serviceDeskId?: string; - serviceDesk?: ServiceDesk; - createdDate?: Date; - reporter?: User; - /** JSON map of Jira field IDs and their values representing the content of the request. */ - requestFieldValues?: CustomerRequestFieldValue[]; - currentStatus?: CustomerRequestStatus; - status?: PagedCustomerRequestStatus; - participants?: PagedUser; - sla?: PagedSlaInformation; - attachments?: PagedAttachment; - comments?: PagedComment; - actions?: CustomerRequestActions; - /** List of items that can be expanded in the response by specifying the expand query parameter. */ - Expands?: string[]; - Links?: CustomerRequestLink; -} diff --git a/src/serviceDesk/models/customerRequestAction.ts b/src/serviceDesk/models/customerRequestAction.mts similarity index 100% rename from src/serviceDesk/models/customerRequestAction.ts rename to src/serviceDesk/models/customerRequestAction.mts diff --git a/src/serviceDesk/models/customerRequestActions.mts b/src/serviceDesk/models/customerRequestActions.mts new file mode 100644 index 000000000..f6fae6bd1 --- /dev/null +++ b/src/serviceDesk/models/customerRequestActions.mts @@ -0,0 +1,8 @@ +import { CustomerRequestAction } from './customerRequestAction.mjs'; + +export interface CustomerRequestActions { + addAttachment?: CustomerRequestAction; + addComment?: CustomerRequestAction; + addParticipant?: CustomerRequestAction; + removeParticipant?: CustomerRequestAction; +} diff --git a/src/serviceDesk/models/customerRequestActions.ts b/src/serviceDesk/models/customerRequestActions.ts deleted file mode 100644 index e15b4033f..000000000 --- a/src/serviceDesk/models/customerRequestActions.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CustomerRequestAction } from './customerRequestAction.js'; - -export interface CustomerRequestActions { - addAttachment?: CustomerRequestAction; - addComment?: CustomerRequestAction; - addParticipant?: CustomerRequestAction; - removeParticipant?: CustomerRequestAction; -} diff --git a/src/serviceDesk/models/customerRequestCreateMeta.mts b/src/serviceDesk/models/customerRequestCreateMeta.mts new file mode 100644 index 000000000..8232df1f4 --- /dev/null +++ b/src/serviceDesk/models/customerRequestCreateMeta.mts @@ -0,0 +1,10 @@ +import { RequestTypeField } from './requestTypeField.mjs'; + +export interface CustomerRequestCreateMeta { + /** List of the fields included in this request. */ + requestTypeFields?: RequestTypeField[]; + /** Flag indicating if a request can be raised on behalf of another user (true) or not. */ + canRaiseOnBehalfOf?: boolean; + /** Flag indicating if participants can be added to a request (true) or not. */ + canAddRequestParticipants?: boolean; +} diff --git a/src/serviceDesk/models/customerRequestCreateMeta.ts b/src/serviceDesk/models/customerRequestCreateMeta.ts deleted file mode 100644 index 60f77cf4c..000000000 --- a/src/serviceDesk/models/customerRequestCreateMeta.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { RequestTypeField } from './requestTypeField.js'; - -export interface CustomerRequestCreateMeta { - /** List of the fields included in this request. */ - requestTypeFields?: RequestTypeField[]; - /** Flag indicating if a request can be raised on behalf of another user (true) or not. */ - canRaiseOnBehalfOf?: boolean; - /** Flag indicating if participants can be added to a request (true) or not. */ - canAddRequestParticipants?: boolean; -} diff --git a/src/serviceDesk/models/customerRequestFieldValue.ts b/src/serviceDesk/models/customerRequestFieldValue.mts similarity index 100% rename from src/serviceDesk/models/customerRequestFieldValue.ts rename to src/serviceDesk/models/customerRequestFieldValue.mts diff --git a/src/serviceDesk/models/customerRequestLink.ts b/src/serviceDesk/models/customerRequestLink.mts similarity index 100% rename from src/serviceDesk/models/customerRequestLink.ts rename to src/serviceDesk/models/customerRequestLink.mts diff --git a/src/serviceDesk/models/customerRequestStatus.mts b/src/serviceDesk/models/customerRequestStatus.mts new file mode 100644 index 000000000..7876bd797 --- /dev/null +++ b/src/serviceDesk/models/customerRequestStatus.mts @@ -0,0 +1,9 @@ +import { Date } from './date.mjs'; + +export interface CustomerRequestStatus { + /** Name of the status condition. */ + status?: string; + /** Status category the status belongs to. */ + statusCategory?: string; + statusDate?: Date; +} diff --git a/src/serviceDesk/models/customerRequestStatus.ts b/src/serviceDesk/models/customerRequestStatus.ts deleted file mode 100644 index 34850f81d..000000000 --- a/src/serviceDesk/models/customerRequestStatus.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Date } from './date.js'; - -export interface CustomerRequestStatus { - /** Name of the status condition. */ - status?: string; - /** Status category the status belongs to. */ - statusCategory?: string; - statusDate?: Date; -} diff --git a/src/serviceDesk/models/customerTransition.ts b/src/serviceDesk/models/customerTransition.mts similarity index 100% rename from src/serviceDesk/models/customerTransition.ts rename to src/serviceDesk/models/customerTransition.mts diff --git a/src/serviceDesk/models/customerTransitionExecution.mts b/src/serviceDesk/models/customerTransitionExecution.mts new file mode 100644 index 000000000..cb56fef14 --- /dev/null +++ b/src/serviceDesk/models/customerTransitionExecution.mts @@ -0,0 +1,7 @@ +import { AdditionalComment } from './additionalComment.mjs'; + +export interface CustomerTransitionExecution { + /** ID of the transition to be performed. */ + id?: string; + additionalComment?: AdditionalComment; +} diff --git a/src/serviceDesk/models/customerTransitionExecution.ts b/src/serviceDesk/models/customerTransitionExecution.ts deleted file mode 100644 index 4b11a6fb5..000000000 --- a/src/serviceDesk/models/customerTransitionExecution.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { AdditionalComment } from './additionalComment.js'; - -export interface CustomerTransitionExecution { - /** ID of the transition to be performed. */ - id?: string; - additionalComment?: AdditionalComment; -} diff --git a/src/serviceDesk/models/date.ts b/src/serviceDesk/models/date.mts similarity index 100% rename from src/serviceDesk/models/date.ts rename to src/serviceDesk/models/date.mts diff --git a/src/serviceDesk/models/duration.ts b/src/serviceDesk/models/duration.mts similarity index 100% rename from src/serviceDesk/models/duration.ts rename to src/serviceDesk/models/duration.mts diff --git a/src/serviceDesk/models/entityProperty.ts b/src/serviceDesk/models/entityProperty.mts similarity index 100% rename from src/serviceDesk/models/entityProperty.ts rename to src/serviceDesk/models/entityProperty.mts diff --git a/src/serviceDesk/models/index.mts b/src/serviceDesk/models/index.mts new file mode 100644 index 000000000..26d2ac436 --- /dev/null +++ b/src/serviceDesk/models/index.mts @@ -0,0 +1,79 @@ +export * from './additionalComment.mjs'; +export * from './approval.mjs'; +export * from './approvalDecisionRequest.mjs'; +export * from './approver.mjs'; +export * from './article.mjs'; +export * from './attachment.mjs'; +export * from './attachmentCreate.mjs'; +export * from './attachmentCreateResult.mjs'; +export * from './attachmentLink.mjs'; +export * from './avatarUrls.mjs'; +export * from './comment.mjs'; +export * from './commentCreate.mjs'; +export * from './content.mjs'; +export * from './csatFeedbackFull.mjs'; +export * from './customerCreate.mjs'; +export * from './customerRequest.mjs'; +export * from './customerRequestAction.mjs'; +export * from './customerRequestActions.mjs'; +export * from './customerRequestCreateMeta.mjs'; +export * from './customerRequestFieldValue.mjs'; +export * from './customerRequestLink.mjs'; +export * from './customerRequestStatus.mjs'; +export * from './customerTransition.mjs'; +export * from './customerTransitionExecution.mjs'; +export * from './date.mjs'; +export * from './duration.mjs'; +export * from './entityProperty.mjs'; +export * from './insightWorkspace.mjs'; +export * from './issue.mjs'; +export * from './issueTransition.mjs'; +export * from './jsonType.mjs'; +export * from './organization.mjs'; +export * from './organizationCreate.mjs'; +export * from './organizationServiceDeskUpdate.mjs'; +export * from './pagedApproval.mjs'; +export * from './pagedArticle.mjs'; +export * from './pagedAttachment.mjs'; +export * from './pagedComment.mjs'; +export * from './pagedCustomerRequest.mjs'; +export * from './pagedCustomerRequestStatus.mjs'; +export * from './pagedCustomerTransition.mjs'; +export * from './pagedInsightWorkspace.mjs'; +export * from './pagedIssue.mjs'; +export * from './pagedLink.mjs'; +export * from './pagedOrganization.mjs'; +export * from './pagedQueue.mjs'; +export * from './pagedRequestType.mjs'; +export * from './pagedRequestTypeGroup.mjs'; +export * from './pagedServiceDesk.mjs'; +export * from './pagedSlaInformation.mjs'; +export * from './pagedUser.mjs'; +export * from './propertyKey.mjs'; +export * from './propertyKeys.mjs'; +export * from './queue.mjs'; +export * from './renderedValue.mjs'; +export * from './requestCreate.mjs'; +export * from './requestNotificationSubscription.mjs'; +export * from './requestParticipantUpdate.mjs'; +export * from './requestType.mjs'; +export * from './requestTypeCreate.mjs'; +export * from './requestTypeField.mjs'; +export * from './requestTypeFieldValue.mjs'; +export * from './requestTypeGroup.mjs'; +export * from './requestTypeIcon.mjs'; +export * from './requestTypeIconLink.mjs'; +export * from './selfLink.mjs'; +export * from './serviceDesk.mjs'; +export * from './serviceDeskCustomer.mjs'; +export * from './slaInformation.mjs'; +export * from './slaInformationCompletedCycle.mjs'; +export * from './slaInformationOngoingCycle.mjs'; +export * from './softwareInfo.mjs'; +export * from './source.mjs'; +export * from './statusCategory.mjs'; +export * from './statusDetails.mjs'; +export * from './user.mjs'; +export * from './userDetails.mjs'; +export * from './userLink.mjs'; +export * from './usersOrganizationUpdate.mjs'; diff --git a/src/serviceDesk/models/index.ts b/src/serviceDesk/models/index.ts deleted file mode 100644 index e1686519a..000000000 --- a/src/serviceDesk/models/index.ts +++ /dev/null @@ -1,79 +0,0 @@ -export * from './additionalComment.js'; -export * from './approval.js'; -export * from './approvalDecisionRequest.js'; -export * from './approver.js'; -export * from './article.js'; -export * from './attachment.js'; -export * from './attachmentCreate.js'; -export * from './attachmentCreateResult.js'; -export * from './attachmentLink.js'; -export * from './avatarUrls.js'; -export * from './comment.js'; -export * from './commentCreate.js'; -export * from './content.js'; -export * from './csatFeedbackFull.js'; -export * from './customerCreate.js'; -export * from './customerRequest.js'; -export * from './customerRequestAction.js'; -export * from './customerRequestActions.js'; -export * from './customerRequestCreateMeta.js'; -export * from './customerRequestFieldValue.js'; -export * from './customerRequestLink.js'; -export * from './customerRequestStatus.js'; -export * from './customerTransition.js'; -export * from './customerTransitionExecution.js'; -export * from './date.js'; -export * from './duration.js'; -export * from './entityProperty.js'; -export * from './insightWorkspace.js'; -export * from './issue.js'; -export * from './issueTransition.js'; -export * from './jsonType.js'; -export * from './organization.js'; -export * from './organizationCreate.js'; -export * from './organizationServiceDeskUpdate.js'; -export * from './pagedApproval.js'; -export * from './pagedArticle.js'; -export * from './pagedAttachment.js'; -export * from './pagedComment.js'; -export * from './pagedCustomerRequest.js'; -export * from './pagedCustomerRequestStatus.js'; -export * from './pagedCustomerTransition.js'; -export * from './pagedInsightWorkspace.js'; -export * from './pagedIssue.js'; -export * from './pagedLink.js'; -export * from './pagedOrganization.js'; -export * from './pagedQueue.js'; -export * from './pagedRequestType.js'; -export * from './pagedRequestTypeGroup.js'; -export * from './pagedServiceDesk.js'; -export * from './pagedSlaInformation.js'; -export * from './pagedUser.js'; -export * from './propertyKey.js'; -export * from './propertyKeys.js'; -export * from './queue.js'; -export * from './renderedValue.js'; -export * from './requestCreate.js'; -export * from './requestNotificationSubscription.js'; -export * from './requestParticipantUpdate.js'; -export * from './requestType.js'; -export * from './requestTypeCreate.js'; -export * from './requestTypeField.js'; -export * from './requestTypeFieldValue.js'; -export * from './requestTypeGroup.js'; -export * from './requestTypeIcon.js'; -export * from './requestTypeIconLink.js'; -export * from './selfLink.js'; -export * from './serviceDesk.js'; -export * from './serviceDeskCustomer.js'; -export * from './slaInformation.js'; -export * from './slaInformationCompletedCycle.js'; -export * from './slaInformationOngoingCycle.js'; -export * from './softwareInfo.js'; -export * from './source.js'; -export * from './statusCategory.js'; -export * from './statusDetails.js'; -export * from './user.js'; -export * from './userDetails.js'; -export * from './userLink.js'; -export * from './usersOrganizationUpdate.js'; diff --git a/src/serviceDesk/models/insightWorkspace.ts b/src/serviceDesk/models/insightWorkspace.mts similarity index 100% rename from src/serviceDesk/models/insightWorkspace.ts rename to src/serviceDesk/models/insightWorkspace.mts diff --git a/src/serviceDesk/models/issue.mts b/src/serviceDesk/models/issue.mts new file mode 100644 index 000000000..46cbd38e2 --- /dev/null +++ b/src/serviceDesk/models/issue.mts @@ -0,0 +1,4 @@ +import { Issue as ExternalIssueInterface } from '../../version2/models/issue.mjs'; + +/** Details about an issue. */ +export type Issue = ExternalIssueInterface; diff --git a/src/serviceDesk/models/issue.ts b/src/serviceDesk/models/issue.ts deleted file mode 100644 index 5e0f2faf8..000000000 --- a/src/serviceDesk/models/issue.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Issue as ExternalIssueInterface } from '../../version2/models/issue.js'; - -/** Details about an issue. */ -export type Issue = ExternalIssueInterface; diff --git a/src/serviceDesk/models/issueTransition.mts b/src/serviceDesk/models/issueTransition.mts new file mode 100644 index 000000000..c9b9cf107 --- /dev/null +++ b/src/serviceDesk/models/issueTransition.mts @@ -0,0 +1,28 @@ +import type { StatusDetails } from './statusDetails.mjs'; + +/** Details of an issue transition. */ +export interface IssueTransition { + /** The ID of the issue transition. Required when specifying a transition to undertake. */ + id?: string; + /** The name of the issue transition. */ + name?: string; + to?: StatusDetails; + /** Whether there is a screen associated with the issue transition. */ + hasScreen?: boolean; + /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ + isGlobal?: boolean; + /** Whether this is the initial issue transition for the workflow. */ + isInitial?: boolean; + /** Whether the transition is available to be performed. */ + isAvailable?: boolean; + /** Whether the issue has to meet criteria before the issue transition is applied. */ + isConditional?: boolean; + /** + * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and + * `update` in a transition request. + */ + fields?: {}; + /** Expand options that include additional transition details in the response. */ + expand?: string; + looped?: boolean; +} diff --git a/src/serviceDesk/models/issueTransition.ts b/src/serviceDesk/models/issueTransition.ts deleted file mode 100644 index cacddba1c..000000000 --- a/src/serviceDesk/models/issueTransition.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { StatusDetails } from './statusDetails.js'; - -/** Details of an issue transition. */ -export interface IssueTransition { - /** The ID of the issue transition. Required when specifying a transition to undertake. */ - id?: string; - /** The name of the issue transition. */ - name?: string; - to?: StatusDetails; - /** Whether there is a screen associated with the issue transition. */ - hasScreen?: boolean; - /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ - isGlobal?: boolean; - /** Whether this is the initial issue transition for the workflow. */ - isInitial?: boolean; - /** Whether the transition is available to be performed. */ - isAvailable?: boolean; - /** Whether the issue has to meet criteria before the issue transition is applied. */ - isConditional?: boolean; - /** - * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and - * `update` in a transition request. - */ - fields?: {}; - /** Expand options that include additional transition details in the response. */ - expand?: string; - looped?: boolean; -} diff --git a/src/serviceDesk/models/jsonType.ts b/src/serviceDesk/models/jsonType.mts similarity index 100% rename from src/serviceDesk/models/jsonType.ts rename to src/serviceDesk/models/jsonType.mts diff --git a/src/serviceDesk/models/organization.mts b/src/serviceDesk/models/organization.mts new file mode 100644 index 000000000..e4a505052 --- /dev/null +++ b/src/serviceDesk/models/organization.mts @@ -0,0 +1,9 @@ +import { SelfLink } from './selfLink.mjs'; + +export interface Organization { + /** A unique system generated ID for the organization. */ + id?: string; + /** Name of the organization. */ + name?: string; + Links?: SelfLink; +} diff --git a/src/serviceDesk/models/organization.ts b/src/serviceDesk/models/organization.ts deleted file mode 100644 index 233edd6c8..000000000 --- a/src/serviceDesk/models/organization.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { SelfLink } from './selfLink.js'; - -export interface Organization { - /** A unique system generated ID for the organization. */ - id?: string; - /** Name of the organization. */ - name?: string; - Links?: SelfLink; -} diff --git a/src/serviceDesk/models/organizationCreate.ts b/src/serviceDesk/models/organizationCreate.mts similarity index 100% rename from src/serviceDesk/models/organizationCreate.ts rename to src/serviceDesk/models/organizationCreate.mts diff --git a/src/serviceDesk/models/organizationServiceDeskUpdate.ts b/src/serviceDesk/models/organizationServiceDeskUpdate.mts similarity index 100% rename from src/serviceDesk/models/organizationServiceDeskUpdate.ts rename to src/serviceDesk/models/organizationServiceDeskUpdate.mts diff --git a/src/serviceDesk/models/pagedApproval.mts b/src/serviceDesk/models/pagedApproval.mts new file mode 100644 index 000000000..95046498b --- /dev/null +++ b/src/serviceDesk/models/pagedApproval.mts @@ -0,0 +1,17 @@ +import { Approval } from './approval.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedApproval { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: Approval[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedApproval.ts b/src/serviceDesk/models/pagedApproval.ts deleted file mode 100644 index cc73d9636..000000000 --- a/src/serviceDesk/models/pagedApproval.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { Approval } from './approval.js'; -import type { PagedLink } from './pagedLink.js'; - -export interface PagedApproval { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: Approval[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedArticle.mts b/src/serviceDesk/models/pagedArticle.mts new file mode 100644 index 000000000..df8065872 --- /dev/null +++ b/src/serviceDesk/models/pagedArticle.mts @@ -0,0 +1,17 @@ +import { Article } from './article.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedArticle { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: Article[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedArticle.ts b/src/serviceDesk/models/pagedArticle.ts deleted file mode 100644 index 66f3e7f08..000000000 --- a/src/serviceDesk/models/pagedArticle.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { Article } from './article.js'; -import type { PagedLink } from './pagedLink.js'; - -export interface PagedArticle { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: Article[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedAttachment.mts b/src/serviceDesk/models/pagedAttachment.mts new file mode 100644 index 000000000..ccff8f75b --- /dev/null +++ b/src/serviceDesk/models/pagedAttachment.mts @@ -0,0 +1,17 @@ +import type { Attachment } from './attachment.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedAttachment { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: Attachment[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedAttachment.ts b/src/serviceDesk/models/pagedAttachment.ts deleted file mode 100644 index 509353070..000000000 --- a/src/serviceDesk/models/pagedAttachment.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { Attachment } from './attachment.js'; -import type { PagedLink } from './pagedLink.js'; - -export interface PagedAttachment { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: Attachment[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedComment.mts b/src/serviceDesk/models/pagedComment.mts new file mode 100644 index 000000000..d7e3a90e5 --- /dev/null +++ b/src/serviceDesk/models/pagedComment.mts @@ -0,0 +1,17 @@ +import type { Comment } from './comment.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedComment { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: Comment[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedComment.ts b/src/serviceDesk/models/pagedComment.ts deleted file mode 100644 index 3c3e92b3a..000000000 --- a/src/serviceDesk/models/pagedComment.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { Comment } from './comment.js'; -import type { PagedLink } from './pagedLink.js'; - -export interface PagedComment { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: Comment[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedCustomerRequest.mts b/src/serviceDesk/models/pagedCustomerRequest.mts new file mode 100644 index 000000000..8cc6ebfa9 --- /dev/null +++ b/src/serviceDesk/models/pagedCustomerRequest.mts @@ -0,0 +1,17 @@ +import { CustomerRequest } from './customerRequest.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedCustomerRequest { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: CustomerRequest[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedCustomerRequest.ts b/src/serviceDesk/models/pagedCustomerRequest.ts deleted file mode 100644 index 63d6de45d..000000000 --- a/src/serviceDesk/models/pagedCustomerRequest.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { CustomerRequest } from './customerRequest.js'; -import type { PagedLink } from './pagedLink.js'; - -export interface PagedCustomerRequest { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: CustomerRequest[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedCustomerRequestStatus.mts b/src/serviceDesk/models/pagedCustomerRequestStatus.mts new file mode 100644 index 000000000..3e7fe3501 --- /dev/null +++ b/src/serviceDesk/models/pagedCustomerRequestStatus.mts @@ -0,0 +1,17 @@ +import { CustomerRequestStatus } from './customerRequestStatus.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedCustomerRequestStatus { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: CustomerRequestStatus[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedCustomerRequestStatus.ts b/src/serviceDesk/models/pagedCustomerRequestStatus.ts deleted file mode 100644 index 637d5c08f..000000000 --- a/src/serviceDesk/models/pagedCustomerRequestStatus.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { CustomerRequestStatus } from './customerRequestStatus.js'; -import type { PagedLink } from './pagedLink.js'; - -export interface PagedCustomerRequestStatus { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: CustomerRequestStatus[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedCustomerTransition.mts b/src/serviceDesk/models/pagedCustomerTransition.mts new file mode 100644 index 000000000..33f7102e0 --- /dev/null +++ b/src/serviceDesk/models/pagedCustomerTransition.mts @@ -0,0 +1,17 @@ +import { CustomerTransition } from './customerTransition.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedCustomerTransition { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: CustomerTransition[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedCustomerTransition.ts b/src/serviceDesk/models/pagedCustomerTransition.ts deleted file mode 100644 index c83a9a069..000000000 --- a/src/serviceDesk/models/pagedCustomerTransition.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { CustomerTransition } from './customerTransition.js'; -import type { PagedLink } from './pagedLink.js'; - -export interface PagedCustomerTransition { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: CustomerTransition[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedInsightWorkspace.mts b/src/serviceDesk/models/pagedInsightWorkspace.mts new file mode 100644 index 000000000..ea319685f --- /dev/null +++ b/src/serviceDesk/models/pagedInsightWorkspace.mts @@ -0,0 +1,17 @@ +import { InsightWorkspace } from './insightWorkspace.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedInsightWorkspace { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: InsightWorkspace[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedInsightWorkspace.ts b/src/serviceDesk/models/pagedInsightWorkspace.ts deleted file mode 100644 index e74277547..000000000 --- a/src/serviceDesk/models/pagedInsightWorkspace.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { InsightWorkspace } from './insightWorkspace.js'; -import type { PagedLink } from './pagedLink.js'; - -export interface PagedInsightWorkspace { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: InsightWorkspace[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedIssue.mts b/src/serviceDesk/models/pagedIssue.mts new file mode 100644 index 000000000..486534403 --- /dev/null +++ b/src/serviceDesk/models/pagedIssue.mts @@ -0,0 +1,17 @@ +import type { Issue } from './issue.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedIssue { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: Issue[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedIssue.ts b/src/serviceDesk/models/pagedIssue.ts deleted file mode 100644 index 0fdbca4c3..000000000 --- a/src/serviceDesk/models/pagedIssue.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { Issue } from './issue.js'; -import type { PagedLink } from './pagedLink.js'; - -export interface PagedIssue { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: Issue[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedLink.ts b/src/serviceDesk/models/pagedLink.mts similarity index 100% rename from src/serviceDesk/models/pagedLink.ts rename to src/serviceDesk/models/pagedLink.mts diff --git a/src/serviceDesk/models/pagedOrganization.mts b/src/serviceDesk/models/pagedOrganization.mts new file mode 100644 index 000000000..fcae235ca --- /dev/null +++ b/src/serviceDesk/models/pagedOrganization.mts @@ -0,0 +1,17 @@ +import { Organization } from './organization.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedOrganization { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: Organization[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedOrganization.ts b/src/serviceDesk/models/pagedOrganization.ts deleted file mode 100644 index efdf93f68..000000000 --- a/src/serviceDesk/models/pagedOrganization.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { Organization } from './organization.js'; -import type { PagedLink } from './pagedLink.js'; - -export interface PagedOrganization { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: Organization[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedQueue.mts b/src/serviceDesk/models/pagedQueue.mts new file mode 100644 index 000000000..90f50e069 --- /dev/null +++ b/src/serviceDesk/models/pagedQueue.mts @@ -0,0 +1,17 @@ +import { PagedLink } from './pagedLink.mjs'; +import { Queue } from './queue.mjs'; + +export interface PagedQueue { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: Queue[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedQueue.ts b/src/serviceDesk/models/pagedQueue.ts deleted file mode 100644 index 7dc7af499..000000000 --- a/src/serviceDesk/models/pagedQueue.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { PagedLink } from './pagedLink.js'; -import type { Queue } from './queue.js'; - -export interface PagedQueue { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: Queue[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedRequestType.mts b/src/serviceDesk/models/pagedRequestType.mts new file mode 100644 index 000000000..aa1c41b89 --- /dev/null +++ b/src/serviceDesk/models/pagedRequestType.mts @@ -0,0 +1,17 @@ +import { PagedLink } from './pagedLink.mjs'; +import { RequestType } from './requestType.mjs'; + +export interface PagedRequestType { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: RequestType[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedRequestType.ts b/src/serviceDesk/models/pagedRequestType.ts deleted file mode 100644 index 496d00d11..000000000 --- a/src/serviceDesk/models/pagedRequestType.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { PagedLink } from './pagedLink.js'; -import type { RequestType } from './requestType.js'; - -export interface PagedRequestType { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: RequestType[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedRequestTypeGroup.mts b/src/serviceDesk/models/pagedRequestTypeGroup.mts new file mode 100644 index 000000000..8c4cd4460 --- /dev/null +++ b/src/serviceDesk/models/pagedRequestTypeGroup.mts @@ -0,0 +1,17 @@ +import { PagedLink } from './pagedLink.mjs'; +import { RequestTypeGroup } from './requestTypeGroup.mjs'; + +export interface PagedRequestTypeGroup { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: RequestTypeGroup[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedRequestTypeGroup.ts b/src/serviceDesk/models/pagedRequestTypeGroup.ts deleted file mode 100644 index 90fc5c09d..000000000 --- a/src/serviceDesk/models/pagedRequestTypeGroup.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { PagedLink } from './pagedLink.js'; -import type { RequestTypeGroup } from './requestTypeGroup.js'; - -export interface PagedRequestTypeGroup { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: RequestTypeGroup[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedServiceDesk.mts b/src/serviceDesk/models/pagedServiceDesk.mts new file mode 100644 index 000000000..4b066d281 --- /dev/null +++ b/src/serviceDesk/models/pagedServiceDesk.mts @@ -0,0 +1,17 @@ +import { PagedLink } from './pagedLink.mjs'; +import { ServiceDesk } from './serviceDesk.mjs'; + +export interface PagedServiceDesk { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: ServiceDesk[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedServiceDesk.ts b/src/serviceDesk/models/pagedServiceDesk.ts deleted file mode 100644 index 9f4183f31..000000000 --- a/src/serviceDesk/models/pagedServiceDesk.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { PagedLink } from './pagedLink.js'; -import type { ServiceDesk } from './serviceDesk.js'; - -export interface PagedServiceDesk { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: ServiceDesk[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedSlaInformation.mts b/src/serviceDesk/models/pagedSlaInformation.mts new file mode 100644 index 000000000..8e3775691 --- /dev/null +++ b/src/serviceDesk/models/pagedSlaInformation.mts @@ -0,0 +1,17 @@ +import { PagedLink } from './pagedLink.mjs'; +import { SlaInformation } from './slaInformation.mjs'; + +export interface PagedSlaInformation { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: SlaInformation[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedSlaInformation.ts b/src/serviceDesk/models/pagedSlaInformation.ts deleted file mode 100644 index cbe67cdf6..000000000 --- a/src/serviceDesk/models/pagedSlaInformation.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { PagedLink } from './pagedLink.js'; -import type { SlaInformation } from './slaInformation.js'; - -export interface PagedSlaInformation { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: SlaInformation[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedUser.mts b/src/serviceDesk/models/pagedUser.mts new file mode 100644 index 000000000..159b19c48 --- /dev/null +++ b/src/serviceDesk/models/pagedUser.mts @@ -0,0 +1,17 @@ +import { PagedLink } from './pagedLink.mjs'; +import { User } from './user.mjs'; + +export interface PagedUser { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: User[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedUser.ts b/src/serviceDesk/models/pagedUser.ts deleted file mode 100644 index b85a23088..000000000 --- a/src/serviceDesk/models/pagedUser.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { PagedLink } from './pagedLink.js'; -import type { User } from './user.js'; - -export interface PagedUser { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: User[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/propertyKey.ts b/src/serviceDesk/models/propertyKey.mts similarity index 100% rename from src/serviceDesk/models/propertyKey.ts rename to src/serviceDesk/models/propertyKey.mts diff --git a/src/serviceDesk/models/propertyKeys.mts b/src/serviceDesk/models/propertyKeys.mts new file mode 100644 index 000000000..3db8a9493 --- /dev/null +++ b/src/serviceDesk/models/propertyKeys.mts @@ -0,0 +1,7 @@ +import type { PropertyKey } from './propertyKey.mjs'; + +/** List of property keys. */ +export interface PropertyKeys { + /** Property key details. */ + keys?: PropertyKey[]; +} diff --git a/src/serviceDesk/models/propertyKeys.ts b/src/serviceDesk/models/propertyKeys.ts deleted file mode 100644 index 79e6474d8..000000000 --- a/src/serviceDesk/models/propertyKeys.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PropertyKey } from './propertyKey.js'; - -/** List of property keys. */ -export interface PropertyKeys { - /** Property key details. */ - keys?: PropertyKey[]; -} diff --git a/src/serviceDesk/models/queue.mts b/src/serviceDesk/models/queue.mts new file mode 100644 index 000000000..c6aaa7416 --- /dev/null +++ b/src/serviceDesk/models/queue.mts @@ -0,0 +1,15 @@ +import { SelfLink } from './selfLink.mjs'; + +export interface Queue { + /** ID for the queue. */ + id?: string; + /** Short name for the queue. */ + name?: string; + /** Jql query that filters reqeusts for the queue. */ + jql?: string; + /** Fields returned for each request in the queue. */ + fields?: string[]; + /** The count of customer requests in the queue. */ + issueCount?: number; + Links?: SelfLink; +} diff --git a/src/serviceDesk/models/queue.ts b/src/serviceDesk/models/queue.ts deleted file mode 100644 index 7ec82625f..000000000 --- a/src/serviceDesk/models/queue.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { SelfLink } from './selfLink.js'; - -export interface Queue { - /** ID for the queue. */ - id?: string; - /** Short name for the queue. */ - name?: string; - /** JQL query that filters reqeusts for the queue. */ - jql?: string; - /** Fields returned for each request in the queue. */ - fields?: string[]; - /** The count of customer requests in the queue. */ - issueCount?: number; - Links?: SelfLink; -} diff --git a/src/serviceDesk/models/renderedValue.ts b/src/serviceDesk/models/renderedValue.mts similarity index 100% rename from src/serviceDesk/models/renderedValue.ts rename to src/serviceDesk/models/renderedValue.mts diff --git a/src/serviceDesk/models/requestCreate.ts b/src/serviceDesk/models/requestCreate.mts similarity index 100% rename from src/serviceDesk/models/requestCreate.ts rename to src/serviceDesk/models/requestCreate.mts diff --git a/src/serviceDesk/models/requestNotificationSubscription.ts b/src/serviceDesk/models/requestNotificationSubscription.mts similarity index 100% rename from src/serviceDesk/models/requestNotificationSubscription.ts rename to src/serviceDesk/models/requestNotificationSubscription.mts diff --git a/src/serviceDesk/models/requestParticipantUpdate.ts b/src/serviceDesk/models/requestParticipantUpdate.mts similarity index 100% rename from src/serviceDesk/models/requestParticipantUpdate.ts rename to src/serviceDesk/models/requestParticipantUpdate.mts diff --git a/src/serviceDesk/models/requestType.mts b/src/serviceDesk/models/requestType.mts new file mode 100644 index 000000000..a8c38c2aa --- /dev/null +++ b/src/serviceDesk/models/requestType.mts @@ -0,0 +1,29 @@ +import { CustomerRequestCreateMeta } from './customerRequestCreateMeta.mjs'; +import { RequestTypeIcon } from './requestTypeIcon.mjs'; +import { SelfLink } from './selfLink.mjs'; + +export interface RequestType { + /** ID for the request type. */ + id?: string; + /** Short name for the request type. */ + name?: string; + /** Description of the request type. */ + description?: string; + /** Help text for the request type. */ + helpText?: string; + /** ID of the issue type the request type is based upon. */ + issueTypeId?: string; + /** ID of the service desk the request type belongs to. */ + serviceDeskId?: string; + /** ID of the customer portal associated with the service desk project. */ + portalId?: string; + /** List of the request type groups the request type belongs to. */ + groupIds?: string[]; + icon?: RequestTypeIcon; + fields?: CustomerRequestCreateMeta; + /** The request type's practice */ + practice?: string; + /** List of items that can be expanded in the response by specifying the expand query parameter. */ + Expands?: string[]; + Links?: SelfLink; +} diff --git a/src/serviceDesk/models/requestType.ts b/src/serviceDesk/models/requestType.ts deleted file mode 100644 index 51a24f606..000000000 --- a/src/serviceDesk/models/requestType.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { CustomerRequestCreateMeta } from './customerRequestCreateMeta.js'; -import type { RequestTypeIcon } from './requestTypeIcon.js'; -import type { SelfLink } from './selfLink.js'; - -export interface RequestType { - /** ID for the request type. */ - id?: string; - /** Short name for the request type. */ - name?: string; - /** Description of the request type. */ - description?: string; - /** Help text for the request type. */ - helpText?: string; - /** ID of the issue type the request type is based upon. */ - issueTypeId?: string; - /** ID of the service desk the request type belongs to. */ - serviceDeskId?: string; - /** ID of the customer portal associated with the service desk project. */ - portalId?: string; - /** List of the request type groups the request type belongs to. */ - groupIds?: string[]; - icon?: RequestTypeIcon; - fields?: CustomerRequestCreateMeta; - /** The request type's practice */ - practice?: string; - /** List of items that can be expanded in the response by specifying the expand query parameter. */ - Expands?: string[]; - Links?: SelfLink; -} diff --git a/src/serviceDesk/models/requestTypeCreate.ts b/src/serviceDesk/models/requestTypeCreate.mts similarity index 100% rename from src/serviceDesk/models/requestTypeCreate.ts rename to src/serviceDesk/models/requestTypeCreate.mts diff --git a/src/serviceDesk/models/requestTypeField.mts b/src/serviceDesk/models/requestTypeField.mts new file mode 100644 index 000000000..fc97717cf --- /dev/null +++ b/src/serviceDesk/models/requestTypeField.mts @@ -0,0 +1,21 @@ +import { JsonType } from './jsonType.mjs'; +import { RequestTypeFieldValue } from './requestTypeFieldValue.mjs'; + +export interface RequestTypeField { + /** ID of the field. */ + fieldId?: string; + /** Name of the field. */ + name?: string; + /** Description of the field. */ + description?: string; + /** Indicates if the field is required (true) or not (false). */ + required?: boolean; + /** List of default values for the field. */ + defaultValues?: RequestTypeFieldValue[]; + /** List of valid values for the field. */ + validValues?: RequestTypeFieldValue[]; + /** List of preset values for the field. */ + presetValues?: string[]; + jiraSchema?: JsonType; + visible?: boolean; +} diff --git a/src/serviceDesk/models/requestTypeField.ts b/src/serviceDesk/models/requestTypeField.ts deleted file mode 100644 index 6ede2dbfc..000000000 --- a/src/serviceDesk/models/requestTypeField.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { JsonType } from './jsonType.js'; -import type { RequestTypeFieldValue } from './requestTypeFieldValue.js'; - -export interface RequestTypeField { - /** ID of the field. */ - fieldId?: string; - /** Name of the field. */ - name?: string; - /** Description of the field. */ - description?: string; - /** Indicates if the field is required (true) or not (false). */ - required?: boolean; - /** List of default values for the field. */ - defaultValues?: RequestTypeFieldValue[]; - /** List of valid values for the field. */ - validValues?: RequestTypeFieldValue[]; - /** List of preset values for the field. */ - presetValues?: string[]; - jiraSchema?: JsonType; - visible?: boolean; -} diff --git a/src/serviceDesk/models/requestTypeFieldValue.ts b/src/serviceDesk/models/requestTypeFieldValue.mts similarity index 100% rename from src/serviceDesk/models/requestTypeFieldValue.ts rename to src/serviceDesk/models/requestTypeFieldValue.mts diff --git a/src/serviceDesk/models/requestTypeGroup.ts b/src/serviceDesk/models/requestTypeGroup.mts similarity index 100% rename from src/serviceDesk/models/requestTypeGroup.ts rename to src/serviceDesk/models/requestTypeGroup.mts diff --git a/src/serviceDesk/models/requestTypeIcon.mts b/src/serviceDesk/models/requestTypeIcon.mts new file mode 100644 index 000000000..cb3cc979b --- /dev/null +++ b/src/serviceDesk/models/requestTypeIcon.mts @@ -0,0 +1,7 @@ +import { RequestTypeIconLink } from './requestTypeIconLink.mjs'; + +export interface RequestTypeIcon { + /** ID of the request type icon. */ + id?: string; + Links?: RequestTypeIconLink; +} diff --git a/src/serviceDesk/models/requestTypeIcon.ts b/src/serviceDesk/models/requestTypeIcon.ts deleted file mode 100644 index fd4027c38..000000000 --- a/src/serviceDesk/models/requestTypeIcon.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { RequestTypeIconLink } from './requestTypeIconLink.js'; - -export interface RequestTypeIcon { - /** ID of the request type icon. */ - id?: string; - Links?: RequestTypeIconLink; -} diff --git a/src/serviceDesk/models/requestTypeIconLink.ts b/src/serviceDesk/models/requestTypeIconLink.mts similarity index 100% rename from src/serviceDesk/models/requestTypeIconLink.ts rename to src/serviceDesk/models/requestTypeIconLink.mts diff --git a/src/serviceDesk/models/selfLink.ts b/src/serviceDesk/models/selfLink.mts similarity index 100% rename from src/serviceDesk/models/selfLink.ts rename to src/serviceDesk/models/selfLink.mts diff --git a/src/serviceDesk/models/serviceDesk.mts b/src/serviceDesk/models/serviceDesk.mts new file mode 100644 index 000000000..3a8368e12 --- /dev/null +++ b/src/serviceDesk/models/serviceDesk.mts @@ -0,0 +1,13 @@ +import { SelfLink } from './selfLink.mjs'; + +export interface ServiceDesk { + /** ID of the service desk. */ + id?: string; + /** ID of the peer project for the service desk. */ + projectId?: string; + /** Name of the project and service desk. */ + projectName?: string; + /** Key of the peer project of the service desk. */ + projectKey?: string; + Links?: SelfLink; +} diff --git a/src/serviceDesk/models/serviceDesk.ts b/src/serviceDesk/models/serviceDesk.ts deleted file mode 100644 index 0a98936a3..000000000 --- a/src/serviceDesk/models/serviceDesk.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { SelfLink } from './selfLink.js'; - -export interface ServiceDesk { - /** ID of the service desk. */ - id?: string; - /** ID of the peer project for the service desk. */ - projectId?: string; - /** Name of the project and service desk. */ - projectName?: string; - /** Key of the peer project of the service desk. */ - projectKey?: string; - Links?: SelfLink; -} diff --git a/src/serviceDesk/models/serviceDeskCustomer.ts b/src/serviceDesk/models/serviceDeskCustomer.mts similarity index 100% rename from src/serviceDesk/models/serviceDeskCustomer.ts rename to src/serviceDesk/models/serviceDeskCustomer.mts diff --git a/src/serviceDesk/models/slaInformation.mts b/src/serviceDesk/models/slaInformation.mts new file mode 100644 index 000000000..9bc615f19 --- /dev/null +++ b/src/serviceDesk/models/slaInformation.mts @@ -0,0 +1,16 @@ +import { SelfLink } from './selfLink.mjs'; +import { SlaInformationCompletedCycle } from './slaInformationCompletedCycle.mjs'; +import { SlaInformationOngoingCycle } from './slaInformationOngoingCycle.mjs'; + +export interface SlaInformation { + /** ID of the Service Level Agreement (SLA). */ + id?: string; + /** Description of the SLA. */ + name?: string; + /** List of completed cycles for the SLA. */ + completedCycles?: SlaInformationCompletedCycle[]; + ongoingCycle?: SlaInformationOngoingCycle; + /** Format in which SLA is to be displayed in the UI */ + slaDisplayFormat?: string; + Links?: SelfLink; +} diff --git a/src/serviceDesk/models/slaInformation.ts b/src/serviceDesk/models/slaInformation.ts deleted file mode 100644 index d0d596e68..000000000 --- a/src/serviceDesk/models/slaInformation.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { SelfLink } from './selfLink.js'; -import type { SlaInformationCompletedCycle } from './slaInformationCompletedCycle.js'; -import type { SlaInformationOngoingCycle } from './slaInformationOngoingCycle.js'; - -export interface SlaInformation { - /** ID of the Service Level Agreement (SLA). */ - id?: string; - /** Description of the SLA. */ - name?: string; - /** List of completed cycles for the SLA. */ - completedCycles?: SlaInformationCompletedCycle[]; - ongoingCycle?: SlaInformationOngoingCycle; - /** Format in which SLA is to be displayed in the UI */ - slaDisplayFormat?: string; - Links?: SelfLink; -} diff --git a/src/serviceDesk/models/slaInformationCompletedCycle.mts b/src/serviceDesk/models/slaInformationCompletedCycle.mts new file mode 100644 index 000000000..5424b8926 --- /dev/null +++ b/src/serviceDesk/models/slaInformationCompletedCycle.mts @@ -0,0 +1,13 @@ +import { Date } from './date.mjs'; +import { Duration } from './duration.mjs'; + +export interface SlaInformationCompletedCycle { + startTime?: Date; + stopTime?: Date; + breachTime?: Date; + /** Indicates if the SLA (duration) was exceeded (true) or not (false). */ + breached?: boolean; + goalDuration?: Duration; + elapsedTime?: Duration; + remainingTime?: Duration; +} diff --git a/src/serviceDesk/models/slaInformationCompletedCycle.ts b/src/serviceDesk/models/slaInformationCompletedCycle.ts deleted file mode 100644 index 6aaee3a1e..000000000 --- a/src/serviceDesk/models/slaInformationCompletedCycle.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Date } from './date.js'; -import type { Duration } from './duration.js'; - -export interface SlaInformationCompletedCycle { - startTime?: Date; - stopTime?: Date; - breachTime?: Date; - /** Indicates if the SLA (duration) was exceeded (true) or not (false). */ - breached?: boolean; - goalDuration?: Duration; - elapsedTime?: Duration; - remainingTime?: Duration; -} diff --git a/src/serviceDesk/models/slaInformationOngoingCycle.mts b/src/serviceDesk/models/slaInformationOngoingCycle.mts new file mode 100644 index 000000000..3cd7b0bee --- /dev/null +++ b/src/serviceDesk/models/slaInformationOngoingCycle.mts @@ -0,0 +1,16 @@ +import { Date } from './date.mjs'; +import { Duration } from './duration.mjs'; + +export interface SlaInformationOngoingCycle { + startTime?: Date; + breachTime?: Date; + /** Indicates whether the SLA has been breached (true) or not (false). */ + breached?: boolean; + /** Indicates whether the SLA is paused (true) or not (false). */ + paused?: boolean; + /** Indicates whether the SLA it timed during calendared working hours only (true) or not (false). */ + withinCalendarHours?: boolean; + goalDuration?: Duration; + elapsedTime?: Duration; + remainingTime?: Duration; +} diff --git a/src/serviceDesk/models/slaInformationOngoingCycle.ts b/src/serviceDesk/models/slaInformationOngoingCycle.ts deleted file mode 100644 index 033db5643..000000000 --- a/src/serviceDesk/models/slaInformationOngoingCycle.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Date } from './date.js'; -import type { Duration } from './duration.js'; - -export interface SlaInformationOngoingCycle { - startTime?: Date; - breachTime?: Date; - /** Indicates whether the SLA has been breached (true) or not (false). */ - breached?: boolean; - /** Indicates whether the SLA is paused (true) or not (false). */ - paused?: boolean; - /** Indicates whether the SLA it timed during calendared working hours only (true) or not (false). */ - withinCalendarHours?: boolean; - goalDuration?: Duration; - elapsedTime?: Duration; - remainingTime?: Duration; -} diff --git a/src/serviceDesk/models/softwareInfo.mts b/src/serviceDesk/models/softwareInfo.mts new file mode 100644 index 000000000..7c4a44e82 --- /dev/null +++ b/src/serviceDesk/models/softwareInfo.mts @@ -0,0 +1,15 @@ +import { Date } from './date.mjs'; +import { SelfLink } from './selfLink.mjs'; + +export interface SoftwareInfo { + /** Jira Service Management version. */ + version?: string; + /** Jira Platform version upon which Service Desk is based. */ + platformVersion?: string; + buildDate?: Date; + /** Reference of the change set included in the build. */ + buildChangeSet?: string; + /** Indicates whether the instance is licensed (true) or not (false). */ + isLicensedForUse?: boolean; + Links?: SelfLink; +} diff --git a/src/serviceDesk/models/softwareInfo.ts b/src/serviceDesk/models/softwareInfo.ts deleted file mode 100644 index c7741a7d2..000000000 --- a/src/serviceDesk/models/softwareInfo.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Date } from './date.js'; -import type { SelfLink } from './selfLink.js'; - -export interface SoftwareInfo { - /** Jira Service Management version. */ - version?: string; - /** Jira Platform version upon which Service Desk is based. */ - platformVersion?: string; - buildDate?: Date; - /** Reference of the change set included in the build. */ - buildChangeSet?: string; - /** Indicates whether the instance is licensed (true) or not (false). */ - isLicensedForUse?: boolean; - Links?: SelfLink; -} diff --git a/src/serviceDesk/models/source.ts b/src/serviceDesk/models/source.mts similarity index 100% rename from src/serviceDesk/models/source.ts rename to src/serviceDesk/models/source.mts diff --git a/src/serviceDesk/models/statusCategory.ts b/src/serviceDesk/models/statusCategory.mts similarity index 100% rename from src/serviceDesk/models/statusCategory.ts rename to src/serviceDesk/models/statusCategory.mts diff --git a/src/serviceDesk/models/statusDetails.mts b/src/serviceDesk/models/statusDetails.mts new file mode 100644 index 000000000..affd80d61 --- /dev/null +++ b/src/serviceDesk/models/statusDetails.mts @@ -0,0 +1,16 @@ +import type { StatusCategory } from './statusCategory.mjs'; + +/** A status. */ +export interface StatusDetails { + /** The URL of the status. */ + self?: string; + /** The description of the status. */ + description?: string; + /** The URL of the icon used to represent the status. */ + iconUrl?: string; + /** The name of the status. */ + name?: string; + /** The ID of the status. */ + id?: string; + statusCategory?: StatusCategory; +} diff --git a/src/serviceDesk/models/statusDetails.ts b/src/serviceDesk/models/statusDetails.ts deleted file mode 100644 index f36b5169b..000000000 --- a/src/serviceDesk/models/statusDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { StatusCategory } from './statusCategory.js'; - -/** A status. */ -export interface StatusDetails { - /** The URL of the status. */ - self?: string; - /** The description of the status. */ - description?: string; - /** The URL of the icon used to represent the status. */ - iconUrl?: string; - /** The name of the status. */ - name?: string; - /** The ID of the status. */ - id?: string; - statusCategory?: StatusCategory; -} diff --git a/src/serviceDesk/models/user.mts b/src/serviceDesk/models/user.mts new file mode 100644 index 000000000..3c038e265 --- /dev/null +++ b/src/serviceDesk/models/user.mts @@ -0,0 +1,21 @@ +import { UserLink } from './userLink.mjs'; + +export interface User { + /** + * The accountId of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** Customer's email address. Depending on the customer’s privacy settings, this may be returned as null. */ + emailAddress?: string; + /** + * Customer's name for display in a UI. Depending on the customer’s privacy settings, this may return an alternative + * value. + */ + displayName?: string; + /** Indicates if the customer is active (true) or inactive (false) */ + active?: boolean; + /** Customer time zone. Depending on the customer’s privacy settings, this may be returned as null. */ + timeZone?: string; + Links?: UserLink; +} diff --git a/src/serviceDesk/models/user.ts b/src/serviceDesk/models/user.ts deleted file mode 100644 index 3e4897264..000000000 --- a/src/serviceDesk/models/user.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { UserLink } from './userLink.js'; - -export interface User { - /** - * The accountId of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** Customer's email address. Depending on the customer’s privacy settings, this may be returned as null. */ - emailAddress?: string; - /** - * Customer's name for display in a UI. Depending on the customer’s privacy settings, this may return an alternative - * value. - */ - displayName?: string; - /** Indicates if the customer is active (true) or inactive (false) */ - active?: boolean; - /** Customer time zone. Depending on the customer’s privacy settings, this may be returned as null. */ - timeZone?: string; - Links?: UserLink; -} diff --git a/src/serviceDesk/models/userDetails.mts b/src/serviceDesk/models/userDetails.mts new file mode 100644 index 000000000..5537a8b92 --- /dev/null +++ b/src/serviceDesk/models/userDetails.mts @@ -0,0 +1,51 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; + +/** + * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* + * + * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, + * `displayName` provides an indication and other parameters have default values or are blank (for example, email is + * blank). + * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted + * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. + * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have + * fallback values. + */ +export interface UserDetails { + /** The URL of the user. */ + self?: string; + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + name?: string; + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + key?: string; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ + emailAddress?: string; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ + displayName?: string; + /** Whether the user is active. */ + active?: boolean; + /** + * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as + * null. + */ + timeZone?: string; + /** + * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application + * user) or 'customer' (Jira Service Desk customer user) + */ + accountType?: string; +} diff --git a/src/serviceDesk/models/userDetails.ts b/src/serviceDesk/models/userDetails.ts deleted file mode 100644 index 6e698170e..000000000 --- a/src/serviceDesk/models/userDetails.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; - -/** - * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* - * - * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, - * `displayName` provides an indication and other parameters have default values or are blank (for example, email is - * blank). - * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted - * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. - * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have - * fallback values. - */ -export interface UserDetails { - /** The URL of the user. */ - self?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - name?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - key?: string; - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ - emailAddress?: string; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active?: boolean; - /** - * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as - * null. - */ - timeZone?: string; - /** - * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application - * user) or 'customer' (Jira Service Desk customer user) - */ - accountType?: string; -} diff --git a/src/serviceDesk/models/userLink.ts b/src/serviceDesk/models/userLink.mts similarity index 100% rename from src/serviceDesk/models/userLink.ts rename to src/serviceDesk/models/userLink.mts diff --git a/src/serviceDesk/models/usersOrganizationUpdate.ts b/src/serviceDesk/models/usersOrganizationUpdate.mts similarity index 100% rename from src/serviceDesk/models/usersOrganizationUpdate.ts rename to src/serviceDesk/models/usersOrganizationUpdate.mts diff --git a/src/serviceDesk/organization.mts b/src/serviceDesk/organization.mts new file mode 100644 index 000000000..f5f0de89f --- /dev/null +++ b/src/serviceDesk/organization.mts @@ -0,0 +1,516 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Organization { + constructor(private client: Client) {} + + /** + * This method returns a list of organizations in the Jira Service Management instance. Use this method when you want + * to present a list of organizations or want to locate an organization by name. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any. + * However, to fetch organizations based on `accountId` the user must have a Service Desk agent license. + * + * **Response limitations**: If the user is a customer, only those organizations of which the customer is a member are + * listed. + */ + async getOrganizations( + parameters: Parameters.GetOrganizations | undefined, + callback: Callback, + ): Promise; + /** + * This method returns a list of organizations in the Jira Service Management instance. Use this method when you want + * to present a list of organizations or want to locate an organization by name. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any. + * However, to fetch organizations based on `accountId` the user must have a Service Desk agent license. + * + * **Response limitations**: If the user is a customer, only those organizations of which the customer is a member are + * listed. + */ + async getOrganizations( + parameters?: Parameters.GetOrganizations, + callback?: never, + ): Promise; + async getOrganizations( + parameters?: Parameters.GetOrganizations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/organization', + method: 'GET', + params: { + start: parameters?.start, + limit: parameters?.limit, + accountId: parameters?.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method creates an organization by passing the name of the organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator or agent. Note: Permission to create organizations can be switched to users with the + * Jira administrator permission, using the **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async createOrganization( + parameters: Parameters.CreateOrganization | undefined, + callback: Callback, + ): Promise; + /** + * This method creates an organization by passing the name of the organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator or agent. Note: Permission to create organizations can be switched to users with the + * Jira administrator permission, using the **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async createOrganization( + parameters?: Parameters.CreateOrganization, + callback?: never, + ): Promise; + async createOrganization( + parameters?: Parameters.CreateOrganization, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/organization', + method: 'POST', + data: { + name: parameters?.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns details of an organization. Use this method to get organization details whenever your + * application component is passed an organization ID but needs to display other organization details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + * + * **Response limitations**: Customers can only retrieve organization of which they are members. + */ + async getOrganization( + parameters: Parameters.GetOrganization, + callback: Callback, + ): Promise; + /** + * This method returns details of an organization. Use this method to get organization details whenever your + * application component is passed an organization ID but needs to display other organization details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + * + * **Response limitations**: Customers can only retrieve organization of which they are members. + */ + async getOrganization(parameters: Parameters.GetOrganization, callback?: never): Promise; + async getOrganization( + parameters: Parameters.GetOrganization, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method deletes an organization. Note that the organization is deleted regardless of other associations it may + * have. For example, associations with service desks. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira + * administrator. + */ + async deleteOrganization(parameters: Parameters.DeleteOrganization, callback: Callback): Promise; + /** + * This method deletes an organization. Note that the organization is deleted regardless of other associations it may + * have. For example, associations with service desks. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira + * administrator. + */ + async deleteOrganization(parameters: Parameters.DeleteOrganization, callback?: never): Promise; + async deleteOrganization( + parameters: Parameters.DeleteOrganization, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the keys of all properties for an organization. Use this resource when you need to find out what additional + * properties items have been added to an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + * + * **Response limitations**: Customers can only access properties of organizations of which they are members. + */ + async getPropertiesKeys( + parameters: Parameters.GetOrganizationPropertyKeys, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for an organization. Use this resource when you need to find out what additional + * properties items have been added to an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + * + * **Response limitations**: Customers can only access properties of organizations of which they are members. + */ + async getPropertiesKeys( + parameters: Parameters.GetOrganizationPropertyKeys, + callback?: never, + ): Promise; + async getPropertiesKeys( + parameters: Parameters.GetOrganizationPropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}/property`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a property from an organization. Use this method to obtain the JSON content for an + * organization's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + * + * **Response limitations**: Customers can only access properties of organizations of which they are members. + */ + async getProperty( + parameters: Parameters.GetOrganizationProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a property from an organization. Use this method to obtain the JSON content for an + * organization's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + * + * **Response limitations**: Customers can only access properties of organizations of which they are members. + */ + async getProperty( + parameters: Parameters.GetOrganizationProperty, + callback?: never, + ): Promise; + async getProperty( + parameters: Parameters.GetOrganizationProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}/property/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a property for an organization. Use this resource to store custom data against an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service Desk Administrator or Agent. + * + * Note: Permission to manage organizations can be switched to users with the Jira administrator permission, using the + * **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async setProperty(parameters: Parameters.SetOrganizationProperty, callback: Callback): Promise; + /** + * Sets the value of a property for an organization. Use this resource to store custom data against an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service Desk Administrator or Agent. + * + * Note: Permission to manage organizations can be switched to users with the Jira administrator permission, using the + * **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async setProperty(parameters: Parameters.SetOrganizationProperty, callback?: never): Promise; + async setProperty( + parameters: Parameters.SetOrganizationProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}/property/${parameters.propertyKey}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a property from an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service Desk Administrator or Agent. + * + * Note: Permission to manage organizations can be switched to users with the Jira administrator permission, using the + * **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async deleteProperty( + parameters: Parameters.DeleteOrganizationProperty, + callback: Callback, + ): Promise; + /** + * Removes a property from an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service Desk Administrator or Agent. + * + * Note: Permission to manage organizations can be switched to users with the Jira administrator permission, using the + * **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async deleteProperty(parameters: Parameters.DeleteOrganizationProperty, callback?: never): Promise; + async deleteProperty( + parameters: Parameters.DeleteOrganizationProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}/property/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns all the users associated with an organization. Use this method where you want to provide a list + * of users for an organization or determine if a user is associated with an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator or agent. + */ + async getUsersInOrganization( + parameters: Parameters.GetUsersInOrganization, + callback: Callback, + ): Promise; + /** + * This method returns all the users associated with an organization. Use this method where you want to provide a list + * of users for an organization or determine if a user is associated with an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator or agent. + */ + async getUsersInOrganization( + parameters: Parameters.GetUsersInOrganization, + callback?: never, + ): Promise; + async getUsersInOrganization( + parameters: Parameters.GetUsersInOrganization, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}/user`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method adds users to an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator or agent. Note: Permission to add users to an organization can be switched to users with + * the Jira administrator permission, using the **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async addUsersToOrganization( + parameters: Parameters.AddUsersToOrganization, + callback: Callback, + ): Promise; + /** + * This method adds users to an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator or agent. Note: Permission to add users to an organization can be switched to users with + * the Jira administrator permission, using the **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async addUsersToOrganization(parameters: Parameters.AddUsersToOrganization, callback?: never): Promise; + async addUsersToOrganization( + parameters: Parameters.AddUsersToOrganization, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}/user`, + method: 'POST', + data: { + accountIds: parameters.accountIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method removes users from an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator or agent. Note: Permission to delete users from an organization can be switched to users + * with the Jira administrator permission, using the **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async removeUsersFromOrganization( + parameters: Parameters.RemoveUsersFromOrganization, + callback: Callback, + ): Promise; + /** + * This method removes users from an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator or agent. Note: Permission to delete users from an organization can be switched to users + * with the Jira administrator permission, using the **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async removeUsersFromOrganization( + parameters: Parameters.RemoveUsersFromOrganization, + callback?: never, + ): Promise; + async removeUsersFromOrganization( + parameters: Parameters.RemoveUsersFromOrganization, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}/user`, + method: 'DELETE', + data: { + accountIds: parameters.accountIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a list of all organizations associated with a service desk. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's agent. + */ + async getServiceDeskOrganizations( + parameters: Parameters.GetOrganizations, + callback: Callback, + ): Promise; + /** + * This method returns a list of all organizations associated with a service desk. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's agent. + */ + async getServiceDeskOrganizations( + parameters: Parameters.GetOrganizations, + callback?: never, + ): Promise; + async getServiceDeskOrganizations( + parameters: Parameters.GetOrganizations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/organization`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method adds an organization to a service desk. If the organization ID is already associated with the service + * desk, no change is made and the resource returns a 204 success code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's agent. + */ + async addOrganization(parameters: Parameters.AddOrganization, callback: Callback): Promise; + /** + * This method adds an organization to a service desk. If the organization ID is already associated with the service + * desk, no change is made and the resource returns a 204 success code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's agent. + */ + async addOrganization(parameters: Parameters.AddOrganization, callback?: never): Promise; + async addOrganization(parameters: Parameters.AddOrganization, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/organization`, + method: 'POST', + data: { + organizationId: parameters.organizationId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method removes an organization from a service desk. If the organization ID does not match an organization + * associated with the service desk, no change is made and the resource returns a 204 success code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's agent. + */ + async removeOrganization(parameters: Parameters.RemoveOrganization, callback: Callback): Promise; + /** + * This method removes an organization from a service desk. If the organization ID does not match an organization + * associated with the service desk, no change is made and the resource returns a 204 success code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's agent. + */ + async removeOrganization(parameters: Parameters.RemoveOrganization, callback?: never): Promise; + async removeOrganization( + parameters: Parameters.RemoveOrganization, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/organization`, + method: 'DELETE', + data: { + organizationId: parameters.organizationId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/serviceDesk/organization.ts b/src/serviceDesk/organization.ts deleted file mode 100644 index c49465176..000000000 --- a/src/serviceDesk/organization.ts +++ /dev/null @@ -1,516 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Organization { - constructor(private client: Client) {} - - /** - * This method returns a list of organizations in the Jira Service Management instance. Use this method when you want - * to present a list of organizations or want to locate an organization by name. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any. - * However, to fetch organizations based on `accountId` the user must have a Service Desk agent license. - * - * **Response limitations**: If the user is a customer, only those organizations of which the customer is a member are - * listed. - */ - async getOrganizations( - parameters: Parameters.GetOrganizations | undefined, - callback: Callback, - ): Promise; - /** - * This method returns a list of organizations in the Jira Service Management instance. Use this method when you want - * to present a list of organizations or want to locate an organization by name. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any. - * However, to fetch organizations based on `accountId` the user must have a Service Desk agent license. - * - * **Response limitations**: If the user is a customer, only those organizations of which the customer is a member are - * listed. - */ - async getOrganizations( - parameters?: Parameters.GetOrganizations, - callback?: never, - ): Promise; - async getOrganizations( - parameters?: Parameters.GetOrganizations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/organization', - method: 'GET', - params: { - start: parameters?.start, - limit: parameters?.limit, - accountId: parameters?.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method creates an organization by passing the name of the organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator or agent. Note: Permission to create organizations can be switched to users with the - * Jira administrator permission, using the **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async createOrganization( - parameters: Parameters.CreateOrganization | undefined, - callback: Callback, - ): Promise; - /** - * This method creates an organization by passing the name of the organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator or agent. Note: Permission to create organizations can be switched to users with the - * Jira administrator permission, using the **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async createOrganization( - parameters?: Parameters.CreateOrganization, - callback?: never, - ): Promise; - async createOrganization( - parameters?: Parameters.CreateOrganization, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/organization', - method: 'POST', - data: { - name: parameters?.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns details of an organization. Use this method to get organization details whenever your - * application component is passed an organization ID but needs to display other organization details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - * - * **Response limitations**: Customers can only retrieve organization of which they are members. - */ - async getOrganization( - parameters: Parameters.GetOrganization, - callback: Callback, - ): Promise; - /** - * This method returns details of an organization. Use this method to get organization details whenever your - * application component is passed an organization ID but needs to display other organization details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - * - * **Response limitations**: Customers can only retrieve organization of which they are members. - */ - async getOrganization(parameters: Parameters.GetOrganization, callback?: never): Promise; - async getOrganization( - parameters: Parameters.GetOrganization, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method deletes an organization. Note that the organization is deleted regardless of other associations it may - * have. For example, associations with service desks. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira - * administrator. - */ - async deleteOrganization(parameters: Parameters.DeleteOrganization, callback: Callback): Promise; - /** - * This method deletes an organization. Note that the organization is deleted regardless of other associations it may - * have. For example, associations with service desks. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira - * administrator. - */ - async deleteOrganization(parameters: Parameters.DeleteOrganization, callback?: never): Promise; - async deleteOrganization( - parameters: Parameters.DeleteOrganization, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the keys of all properties for an organization. Use this resource when you need to find out what additional - * properties items have been added to an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - * - * **Response limitations**: Customers can only access properties of organizations of which they are members. - */ - async getPropertiesKeys( - parameters: Parameters.GetOrganizationPropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for an organization. Use this resource when you need to find out what additional - * properties items have been added to an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - * - * **Response limitations**: Customers can only access properties of organizations of which they are members. - */ - async getPropertiesKeys( - parameters: Parameters.GetOrganizationPropertyKeys, - callback?: never, - ): Promise; - async getPropertiesKeys( - parameters: Parameters.GetOrganizationPropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}/property`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a property from an organization. Use this method to obtain the JSON content for an - * organization's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - * - * **Response limitations**: Customers can only access properties of organizations of which they are members. - */ - async getProperty( - parameters: Parameters.GetOrganizationProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a property from an organization. Use this method to obtain the JSON content for an - * organization's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - * - * **Response limitations**: Customers can only access properties of organizations of which they are members. - */ - async getProperty( - parameters: Parameters.GetOrganizationProperty, - callback?: never, - ): Promise; - async getProperty( - parameters: Parameters.GetOrganizationProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}/property/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a property for an organization. Use this resource to store custom data against an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service Desk Administrator or Agent. - * - * Note: Permission to manage organizations can be switched to users with the Jira administrator permission, using the - * **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async setProperty(parameters: Parameters.SetOrganizationProperty, callback: Callback): Promise; - /** - * Sets the value of a property for an organization. Use this resource to store custom data against an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service Desk Administrator or Agent. - * - * Note: Permission to manage organizations can be switched to users with the Jira administrator permission, using the - * **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async setProperty(parameters: Parameters.SetOrganizationProperty, callback?: never): Promise; - async setProperty( - parameters: Parameters.SetOrganizationProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}/property/${parameters.propertyKey}`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a property from an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service Desk Administrator or Agent. - * - * Note: Permission to manage organizations can be switched to users with the Jira administrator permission, using the - * **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async deleteProperty( - parameters: Parameters.DeleteOrganizationProperty, - callback: Callback, - ): Promise; - /** - * Removes a property from an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service Desk Administrator or Agent. - * - * Note: Permission to manage organizations can be switched to users with the Jira administrator permission, using the - * **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async deleteProperty(parameters: Parameters.DeleteOrganizationProperty, callback?: never): Promise; - async deleteProperty( - parameters: Parameters.DeleteOrganizationProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}/property/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns all the users associated with an organization. Use this method where you want to provide a list - * of users for an organization or determine if a user is associated with an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator or agent. - */ - async getUsersInOrganization( - parameters: Parameters.GetUsersInOrganization, - callback: Callback, - ): Promise; - /** - * This method returns all the users associated with an organization. Use this method where you want to provide a list - * of users for an organization or determine if a user is associated with an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator or agent. - */ - async getUsersInOrganization( - parameters: Parameters.GetUsersInOrganization, - callback?: never, - ): Promise; - async getUsersInOrganization( - parameters: Parameters.GetUsersInOrganization, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}/user`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method adds users to an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator or agent. Note: Permission to add users to an organization can be switched to users with - * the Jira administrator permission, using the **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async addUsersToOrganization( - parameters: Parameters.AddUsersToOrganization, - callback: Callback, - ): Promise; - /** - * This method adds users to an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator or agent. Note: Permission to add users to an organization can be switched to users with - * the Jira administrator permission, using the **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async addUsersToOrganization(parameters: Parameters.AddUsersToOrganization, callback?: never): Promise; - async addUsersToOrganization( - parameters: Parameters.AddUsersToOrganization, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}/user`, - method: 'POST', - data: { - accountIds: parameters.accountIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method removes users from an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator or agent. Note: Permission to delete users from an organization can be switched to users - * with the Jira administrator permission, using the **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async removeUsersFromOrganization( - parameters: Parameters.RemoveUsersFromOrganization, - callback: Callback, - ): Promise; - /** - * This method removes users from an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator or agent. Note: Permission to delete users from an organization can be switched to users - * with the Jira administrator permission, using the **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async removeUsersFromOrganization( - parameters: Parameters.RemoveUsersFromOrganization, - callback?: never, - ): Promise; - async removeUsersFromOrganization( - parameters: Parameters.RemoveUsersFromOrganization, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}/user`, - method: 'DELETE', - data: { - accountIds: parameters.accountIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a list of all organizations associated with a service desk. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's agent. - */ - async getServiceDeskOrganizations( - parameters: Parameters.GetOrganizations, - callback: Callback, - ): Promise; - /** - * This method returns a list of all organizations associated with a service desk. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's agent. - */ - async getServiceDeskOrganizations( - parameters: Parameters.GetOrganizations, - callback?: never, - ): Promise; - async getServiceDeskOrganizations( - parameters: Parameters.GetOrganizations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/organization`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method adds an organization to a service desk. If the organization ID is already associated with the service - * desk, no change is made and the resource returns a 204 success code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's agent. - */ - async addOrganization(parameters: Parameters.AddOrganization, callback: Callback): Promise; - /** - * This method adds an organization to a service desk. If the organization ID is already associated with the service - * desk, no change is made and the resource returns a 204 success code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's agent. - */ - async addOrganization(parameters: Parameters.AddOrganization, callback?: never): Promise; - async addOrganization(parameters: Parameters.AddOrganization, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/organization`, - method: 'POST', - data: { - organizationId: parameters.organizationId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method removes an organization from a service desk. If the organization ID does not match an organization - * associated with the service desk, no change is made and the resource returns a 204 success code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's agent. - */ - async removeOrganization(parameters: Parameters.RemoveOrganization, callback: Callback): Promise; - /** - * This method removes an organization from a service desk. If the organization ID does not match an organization - * associated with the service desk, no change is made and the resource returns a 204 success code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's agent. - */ - async removeOrganization(parameters: Parameters.RemoveOrganization, callback?: never): Promise; - async removeOrganization( - parameters: Parameters.RemoveOrganization, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/organization`, - method: 'DELETE', - data: { - organizationId: parameters.organizationId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/serviceDesk/parameters/addCustomers.mts b/src/serviceDesk/parameters/addCustomers.mts new file mode 100644 index 000000000..1e5564ad2 --- /dev/null +++ b/src/serviceDesk/parameters/addCustomers.mts @@ -0,0 +1,9 @@ +import { ServiceDeskCustomer } from '../models/index.mjs'; + +export interface AddCustomers extends ServiceDeskCustomer { + /** + * The ID of the service desk the customer list should be returned from. This can alternatively be a [project + * identifier.](#project-identifiers) + */ + serviceDeskId: string; +} diff --git a/src/serviceDesk/parameters/addCustomers.ts b/src/serviceDesk/parameters/addCustomers.ts deleted file mode 100644 index 0c07d5589..000000000 --- a/src/serviceDesk/parameters/addCustomers.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ServiceDeskCustomer } from '../models/index.js'; - -export interface AddCustomers extends ServiceDeskCustomer { - /** - * The ID of the service desk the customer list should be returned from. This can alternatively be a [project - * identifier.](#project-identifiers) - */ - serviceDeskId: string; -} diff --git a/src/serviceDesk/parameters/addOrganization.mts b/src/serviceDesk/parameters/addOrganization.mts new file mode 100644 index 000000000..3ed072d9b --- /dev/null +++ b/src/serviceDesk/parameters/addOrganization.mts @@ -0,0 +1,9 @@ +import { OrganizationServiceDeskUpdate } from '../models/index.mjs'; + +export interface AddOrganization extends OrganizationServiceDeskUpdate { + /** + * The ID of the service desk to which the organization will be added. This can alternatively be a [project + * identifier.](#project-identifiers) + */ + serviceDeskId: string; +} diff --git a/src/serviceDesk/parameters/addOrganization.ts b/src/serviceDesk/parameters/addOrganization.ts deleted file mode 100644 index 3dd78545c..000000000 --- a/src/serviceDesk/parameters/addOrganization.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { OrganizationServiceDeskUpdate } from '../models/index.js'; - -export interface AddOrganization extends OrganizationServiceDeskUpdate { - /** - * The ID of the service desk to which the organization will be added. This can alternatively be a [project - * identifier.](#project-identifiers) - */ - serviceDeskId: string; -} diff --git a/src/serviceDesk/parameters/addRequestParticipants.mts b/src/serviceDesk/parameters/addRequestParticipants.mts new file mode 100644 index 000000000..1414fc812 --- /dev/null +++ b/src/serviceDesk/parameters/addRequestParticipants.mts @@ -0,0 +1,6 @@ +import { RequestParticipantUpdate } from '../models/index.mjs'; + +export interface AddRequestParticipants extends RequestParticipantUpdate { + /** The ID or key of the customer request to have participants added. */ + issueIdOrKey: string; +} diff --git a/src/serviceDesk/parameters/addRequestParticipants.ts b/src/serviceDesk/parameters/addRequestParticipants.ts deleted file mode 100644 index fbff611ee..000000000 --- a/src/serviceDesk/parameters/addRequestParticipants.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { RequestParticipantUpdate } from '../models/index.js'; - -export interface AddRequestParticipants extends RequestParticipantUpdate { - /** The ID or key of the customer request to have participants added. */ - issueIdOrKey: string; -} diff --git a/src/serviceDesk/parameters/addUsersToOrganization.mts b/src/serviceDesk/parameters/addUsersToOrganization.mts new file mode 100644 index 000000000..24d23ddd7 --- /dev/null +++ b/src/serviceDesk/parameters/addUsersToOrganization.mts @@ -0,0 +1,6 @@ +import { UsersOrganizationUpdate } from '../models/index.mjs'; + +export interface AddUsersToOrganization extends UsersOrganizationUpdate { + /** The ID of the organization. */ + organizationId: number; +} diff --git a/src/serviceDesk/parameters/addUsersToOrganization.ts b/src/serviceDesk/parameters/addUsersToOrganization.ts deleted file mode 100644 index 836ec8218..000000000 --- a/src/serviceDesk/parameters/addUsersToOrganization.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UsersOrganizationUpdate } from '../models/index.js'; - -export interface AddUsersToOrganization extends UsersOrganizationUpdate { - /** The ID of the organization. */ - organizationId: number; -} diff --git a/src/serviceDesk/parameters/answerApproval.mts b/src/serviceDesk/parameters/answerApproval.mts new file mode 100644 index 000000000..77714d4c4 --- /dev/null +++ b/src/serviceDesk/parameters/answerApproval.mts @@ -0,0 +1,8 @@ +import { ApprovalDecisionRequest } from '../models/index.mjs'; + +export interface AnswerApproval extends ApprovalDecisionRequest { + /** The ID or key of the customer request to be updated. */ + issueIdOrKey: string; + /** The ID of the approval to be updated. */ + approvalId: number; +} diff --git a/src/serviceDesk/parameters/answerApproval.ts b/src/serviceDesk/parameters/answerApproval.ts deleted file mode 100644 index b48b829df..000000000 --- a/src/serviceDesk/parameters/answerApproval.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ApprovalDecisionRequest } from '../models/index.js'; - -export interface AnswerApproval extends ApprovalDecisionRequest { - /** The ID or key of the customer request to be updated. */ - issueIdOrKey: string; - /** The ID of the approval to be updated. */ - approvalId: number; -} diff --git a/src/serviceDesk/parameters/attachTemporaryFile.ts b/src/serviceDesk/parameters/attachTemporaryFile.mts similarity index 100% rename from src/serviceDesk/parameters/attachTemporaryFile.ts rename to src/serviceDesk/parameters/attachTemporaryFile.mts diff --git a/src/serviceDesk/parameters/createAttachment.mts b/src/serviceDesk/parameters/createAttachment.mts new file mode 100644 index 000000000..e514eeacc --- /dev/null +++ b/src/serviceDesk/parameters/createAttachment.mts @@ -0,0 +1,6 @@ +import { AttachmentCreate } from '../models/index.mjs'; + +export interface CreateAttachment extends AttachmentCreate { + /** The ID or key of the customer request to which the attachment will be added. */ + issueIdOrKey: string; +} diff --git a/src/serviceDesk/parameters/createAttachment.ts b/src/serviceDesk/parameters/createAttachment.ts deleted file mode 100644 index 2ebf25799..000000000 --- a/src/serviceDesk/parameters/createAttachment.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AttachmentCreate } from '../models/index.js'; - -export interface CreateAttachment extends AttachmentCreate { - /** The ID or key of the customer request to which the attachment will be added. */ - issueIdOrKey: string; -} diff --git a/src/serviceDesk/parameters/createCustomer.mts b/src/serviceDesk/parameters/createCustomer.mts new file mode 100644 index 000000000..a1fa695ed --- /dev/null +++ b/src/serviceDesk/parameters/createCustomer.mts @@ -0,0 +1,3 @@ +import { CustomerCreate } from '../models/index.mjs'; + +export interface CreateCustomer extends CustomerCreate {} diff --git a/src/serviceDesk/parameters/createCustomer.ts b/src/serviceDesk/parameters/createCustomer.ts deleted file mode 100644 index 7ab204dff..000000000 --- a/src/serviceDesk/parameters/createCustomer.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CustomerCreate } from '../models/index.js'; - -export interface CreateCustomer extends CustomerCreate {} diff --git a/src/serviceDesk/parameters/createCustomerRequest.mts b/src/serviceDesk/parameters/createCustomerRequest.mts new file mode 100644 index 000000000..d40b180b0 --- /dev/null +++ b/src/serviceDesk/parameters/createCustomerRequest.mts @@ -0,0 +1,3 @@ +import { RequestCreate } from '../models/index.mjs'; + +export interface CreateCustomerRequest extends RequestCreate {} diff --git a/src/serviceDesk/parameters/createCustomerRequest.ts b/src/serviceDesk/parameters/createCustomerRequest.ts deleted file mode 100644 index 0b0618bb6..000000000 --- a/src/serviceDesk/parameters/createCustomerRequest.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { RequestCreate } from '../models/index.js'; - -export interface CreateCustomerRequest extends RequestCreate {} diff --git a/src/serviceDesk/parameters/createOrganization.mts b/src/serviceDesk/parameters/createOrganization.mts new file mode 100644 index 000000000..927956ac5 --- /dev/null +++ b/src/serviceDesk/parameters/createOrganization.mts @@ -0,0 +1,3 @@ +import { OrganizationCreate } from '../models/index.mjs'; + +export interface CreateOrganization extends OrganizationCreate {} diff --git a/src/serviceDesk/parameters/createOrganization.ts b/src/serviceDesk/parameters/createOrganization.ts deleted file mode 100644 index 9d87dec08..000000000 --- a/src/serviceDesk/parameters/createOrganization.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { OrganizationCreate } from '../models/index.js'; - -export interface CreateOrganization extends OrganizationCreate {} diff --git a/src/serviceDesk/parameters/createRequestComment.mts b/src/serviceDesk/parameters/createRequestComment.mts new file mode 100644 index 000000000..0275b869d --- /dev/null +++ b/src/serviceDesk/parameters/createRequestComment.mts @@ -0,0 +1,6 @@ +import { CommentCreate } from '../models/index.mjs'; + +export interface CreateRequestComment extends CommentCreate { + /** The ID or key of the customer request to which the comment will be added. */ + issueIdOrKey: string; +} diff --git a/src/serviceDesk/parameters/createRequestComment.ts b/src/serviceDesk/parameters/createRequestComment.ts deleted file mode 100644 index 4d1622677..000000000 --- a/src/serviceDesk/parameters/createRequestComment.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CommentCreate } from '../models/index.js'; - -export interface CreateRequestComment extends CommentCreate { - /** The ID or key of the customer request to which the comment will be added. */ - issueIdOrKey: string; -} diff --git a/src/serviceDesk/parameters/createRequestType.mts b/src/serviceDesk/parameters/createRequestType.mts new file mode 100644 index 000000000..803478e14 --- /dev/null +++ b/src/serviceDesk/parameters/createRequestType.mts @@ -0,0 +1,9 @@ +import { RequestTypeCreate } from '../models/index.mjs'; + +export interface CreateRequestType extends RequestTypeCreate { + /** + * The ID of the service desk where the customer request type is to be created. This can alternatively be a [project + * identifier.](#project-identifiers) + */ + serviceDeskId: string; +} diff --git a/src/serviceDesk/parameters/createRequestType.ts b/src/serviceDesk/parameters/createRequestType.ts deleted file mode 100644 index 8ce2539b5..000000000 --- a/src/serviceDesk/parameters/createRequestType.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { RequestTypeCreate } from '../models/index.js'; - -export interface CreateRequestType extends RequestTypeCreate { - /** - * The ID of the service desk where the customer request type is to be created. This can alternatively be a [project - * identifier.](#project-identifiers) - */ - serviceDeskId: string; -} diff --git a/src/serviceDesk/parameters/deleteFeedback.ts b/src/serviceDesk/parameters/deleteFeedback.mts similarity index 100% rename from src/serviceDesk/parameters/deleteFeedback.ts rename to src/serviceDesk/parameters/deleteFeedback.mts diff --git a/src/serviceDesk/parameters/deleteOrganization.ts b/src/serviceDesk/parameters/deleteOrganization.mts similarity index 100% rename from src/serviceDesk/parameters/deleteOrganization.ts rename to src/serviceDesk/parameters/deleteOrganization.mts diff --git a/src/serviceDesk/parameters/deleteOrganizationProperty.ts b/src/serviceDesk/parameters/deleteOrganizationProperty.mts similarity index 100% rename from src/serviceDesk/parameters/deleteOrganizationProperty.ts rename to src/serviceDesk/parameters/deleteOrganizationProperty.mts diff --git a/src/serviceDesk/parameters/deleteProperty.ts b/src/serviceDesk/parameters/deleteProperty.mts similarity index 100% rename from src/serviceDesk/parameters/deleteProperty.ts rename to src/serviceDesk/parameters/deleteProperty.mts diff --git a/src/serviceDesk/parameters/deleteRequestType.ts b/src/serviceDesk/parameters/deleteRequestType.mts similarity index 100% rename from src/serviceDesk/parameters/deleteRequestType.ts rename to src/serviceDesk/parameters/deleteRequestType.mts diff --git a/src/serviceDesk/parameters/getAllRequestTypes.ts b/src/serviceDesk/parameters/getAllRequestTypes.mts similarity index 100% rename from src/serviceDesk/parameters/getAllRequestTypes.ts rename to src/serviceDesk/parameters/getAllRequestTypes.mts diff --git a/src/serviceDesk/parameters/getApprovalById.ts b/src/serviceDesk/parameters/getApprovalById.mts similarity index 100% rename from src/serviceDesk/parameters/getApprovalById.ts rename to src/serviceDesk/parameters/getApprovalById.mts diff --git a/src/serviceDesk/parameters/getApprovals.ts b/src/serviceDesk/parameters/getApprovals.mts similarity index 100% rename from src/serviceDesk/parameters/getApprovals.ts rename to src/serviceDesk/parameters/getApprovals.mts diff --git a/src/serviceDesk/parameters/getArticles.ts b/src/serviceDesk/parameters/getArticles.mts similarity index 100% rename from src/serviceDesk/parameters/getArticles.ts rename to src/serviceDesk/parameters/getArticles.mts diff --git a/src/serviceDesk/parameters/getAttachmentContent.ts b/src/serviceDesk/parameters/getAttachmentContent.mts similarity index 100% rename from src/serviceDesk/parameters/getAttachmentContent.ts rename to src/serviceDesk/parameters/getAttachmentContent.mts diff --git a/src/serviceDesk/parameters/getAttachmentThumbnail.ts b/src/serviceDesk/parameters/getAttachmentThumbnail.mts similarity index 100% rename from src/serviceDesk/parameters/getAttachmentThumbnail.ts rename to src/serviceDesk/parameters/getAttachmentThumbnail.mts diff --git a/src/serviceDesk/parameters/getAttachmentsForRequest.ts b/src/serviceDesk/parameters/getAttachmentsForRequest.mts similarity index 100% rename from src/serviceDesk/parameters/getAttachmentsForRequest.ts rename to src/serviceDesk/parameters/getAttachmentsForRequest.mts diff --git a/src/serviceDesk/parameters/getCommentAttachments.ts b/src/serviceDesk/parameters/getCommentAttachments.mts similarity index 100% rename from src/serviceDesk/parameters/getCommentAttachments.ts rename to src/serviceDesk/parameters/getCommentAttachments.mts diff --git a/src/serviceDesk/parameters/getCustomerRequestByIdOrKey.ts b/src/serviceDesk/parameters/getCustomerRequestByIdOrKey.mts similarity index 100% rename from src/serviceDesk/parameters/getCustomerRequestByIdOrKey.ts rename to src/serviceDesk/parameters/getCustomerRequestByIdOrKey.mts diff --git a/src/serviceDesk/parameters/getCustomerRequestStatus.ts b/src/serviceDesk/parameters/getCustomerRequestStatus.mts similarity index 100% rename from src/serviceDesk/parameters/getCustomerRequestStatus.ts rename to src/serviceDesk/parameters/getCustomerRequestStatus.mts diff --git a/src/serviceDesk/parameters/getCustomerRequests.ts b/src/serviceDesk/parameters/getCustomerRequests.mts similarity index 100% rename from src/serviceDesk/parameters/getCustomerRequests.ts rename to src/serviceDesk/parameters/getCustomerRequests.mts diff --git a/src/serviceDesk/parameters/getCustomerTransitions.ts b/src/serviceDesk/parameters/getCustomerTransitions.mts similarity index 100% rename from src/serviceDesk/parameters/getCustomerTransitions.ts rename to src/serviceDesk/parameters/getCustomerTransitions.mts diff --git a/src/serviceDesk/parameters/getCustomers.ts b/src/serviceDesk/parameters/getCustomers.mts similarity index 100% rename from src/serviceDesk/parameters/getCustomers.ts rename to src/serviceDesk/parameters/getCustomers.mts diff --git a/src/serviceDesk/parameters/getFeedback.ts b/src/serviceDesk/parameters/getFeedback.mts similarity index 100% rename from src/serviceDesk/parameters/getFeedback.ts rename to src/serviceDesk/parameters/getFeedback.mts diff --git a/src/serviceDesk/parameters/getInsightWorkspaces.ts b/src/serviceDesk/parameters/getInsightWorkspaces.mts similarity index 100% rename from src/serviceDesk/parameters/getInsightWorkspaces.ts rename to src/serviceDesk/parameters/getInsightWorkspaces.mts diff --git a/src/serviceDesk/parameters/getIssuesInQueue.ts b/src/serviceDesk/parameters/getIssuesInQueue.mts similarity index 100% rename from src/serviceDesk/parameters/getIssuesInQueue.ts rename to src/serviceDesk/parameters/getIssuesInQueue.mts diff --git a/src/serviceDesk/parameters/getOrganization.ts b/src/serviceDesk/parameters/getOrganization.mts similarity index 100% rename from src/serviceDesk/parameters/getOrganization.ts rename to src/serviceDesk/parameters/getOrganization.mts diff --git a/src/serviceDesk/parameters/getOrganizationProperty.ts b/src/serviceDesk/parameters/getOrganizationProperty.mts similarity index 100% rename from src/serviceDesk/parameters/getOrganizationProperty.ts rename to src/serviceDesk/parameters/getOrganizationProperty.mts diff --git a/src/serviceDesk/parameters/getOrganizationPropertyKeys.ts b/src/serviceDesk/parameters/getOrganizationPropertyKeys.mts similarity index 100% rename from src/serviceDesk/parameters/getOrganizationPropertyKeys.ts rename to src/serviceDesk/parameters/getOrganizationPropertyKeys.mts diff --git a/src/serviceDesk/parameters/getOrganizations.ts b/src/serviceDesk/parameters/getOrganizations.mts similarity index 100% rename from src/serviceDesk/parameters/getOrganizations.ts rename to src/serviceDesk/parameters/getOrganizations.mts diff --git a/src/serviceDesk/parameters/getPropertiesKeys.ts b/src/serviceDesk/parameters/getPropertiesKeys.mts similarity index 100% rename from src/serviceDesk/parameters/getPropertiesKeys.ts rename to src/serviceDesk/parameters/getPropertiesKeys.mts diff --git a/src/serviceDesk/parameters/getProperty.ts b/src/serviceDesk/parameters/getProperty.mts similarity index 100% rename from src/serviceDesk/parameters/getProperty.ts rename to src/serviceDesk/parameters/getProperty.mts diff --git a/src/serviceDesk/parameters/getQueue.ts b/src/serviceDesk/parameters/getQueue.mts similarity index 100% rename from src/serviceDesk/parameters/getQueue.ts rename to src/serviceDesk/parameters/getQueue.mts diff --git a/src/serviceDesk/parameters/getQueues.ts b/src/serviceDesk/parameters/getQueues.mts similarity index 100% rename from src/serviceDesk/parameters/getQueues.ts rename to src/serviceDesk/parameters/getQueues.mts diff --git a/src/serviceDesk/parameters/getRequestCommentById.ts b/src/serviceDesk/parameters/getRequestCommentById.mts similarity index 100% rename from src/serviceDesk/parameters/getRequestCommentById.ts rename to src/serviceDesk/parameters/getRequestCommentById.mts diff --git a/src/serviceDesk/parameters/getRequestComments.ts b/src/serviceDesk/parameters/getRequestComments.mts similarity index 100% rename from src/serviceDesk/parameters/getRequestComments.ts rename to src/serviceDesk/parameters/getRequestComments.mts diff --git a/src/serviceDesk/parameters/getRequestParticipants.ts b/src/serviceDesk/parameters/getRequestParticipants.mts similarity index 100% rename from src/serviceDesk/parameters/getRequestParticipants.ts rename to src/serviceDesk/parameters/getRequestParticipants.mts diff --git a/src/serviceDesk/parameters/getRequestTypeById.ts b/src/serviceDesk/parameters/getRequestTypeById.mts similarity index 100% rename from src/serviceDesk/parameters/getRequestTypeById.ts rename to src/serviceDesk/parameters/getRequestTypeById.mts diff --git a/src/serviceDesk/parameters/getRequestTypeFields.ts b/src/serviceDesk/parameters/getRequestTypeFields.mts similarity index 100% rename from src/serviceDesk/parameters/getRequestTypeFields.ts rename to src/serviceDesk/parameters/getRequestTypeFields.mts diff --git a/src/serviceDesk/parameters/getRequestTypeGroups.ts b/src/serviceDesk/parameters/getRequestTypeGroups.mts similarity index 100% rename from src/serviceDesk/parameters/getRequestTypeGroups.ts rename to src/serviceDesk/parameters/getRequestTypeGroups.mts diff --git a/src/serviceDesk/parameters/getRequestTypes.ts b/src/serviceDesk/parameters/getRequestTypes.mts similarity index 100% rename from src/serviceDesk/parameters/getRequestTypes.ts rename to src/serviceDesk/parameters/getRequestTypes.mts diff --git a/src/serviceDesk/parameters/getServiceDeskById.ts b/src/serviceDesk/parameters/getServiceDeskById.mts similarity index 100% rename from src/serviceDesk/parameters/getServiceDeskById.ts rename to src/serviceDesk/parameters/getServiceDeskById.mts diff --git a/src/serviceDesk/parameters/getServiceDesks.ts b/src/serviceDesk/parameters/getServiceDesks.mts similarity index 100% rename from src/serviceDesk/parameters/getServiceDesks.ts rename to src/serviceDesk/parameters/getServiceDesks.mts diff --git a/src/serviceDesk/parameters/getSlaInformation.ts b/src/serviceDesk/parameters/getSlaInformation.mts similarity index 100% rename from src/serviceDesk/parameters/getSlaInformation.ts rename to src/serviceDesk/parameters/getSlaInformation.mts diff --git a/src/serviceDesk/parameters/getSlaInformationById.ts b/src/serviceDesk/parameters/getSlaInformationById.mts similarity index 100% rename from src/serviceDesk/parameters/getSlaInformationById.ts rename to src/serviceDesk/parameters/getSlaInformationById.mts diff --git a/src/serviceDesk/parameters/getSubscriptionStatus.ts b/src/serviceDesk/parameters/getSubscriptionStatus.mts similarity index 100% rename from src/serviceDesk/parameters/getSubscriptionStatus.ts rename to src/serviceDesk/parameters/getSubscriptionStatus.mts diff --git a/src/serviceDesk/parameters/getUsersInOrganization.ts b/src/serviceDesk/parameters/getUsersInOrganization.mts similarity index 100% rename from src/serviceDesk/parameters/getUsersInOrganization.ts rename to src/serviceDesk/parameters/getUsersInOrganization.mts diff --git a/src/serviceDesk/parameters/index.mts b/src/serviceDesk/parameters/index.mts new file mode 100644 index 000000000..9f68c5578 --- /dev/null +++ b/src/serviceDesk/parameters/index.mts @@ -0,0 +1,70 @@ +export * from './addCustomers.mjs'; +export * from './addOrganization.mjs'; +export * from './addRequestParticipants.mjs'; +export * from './addUsersToOrganization.mjs'; +export * from './answerApproval.mjs'; +export * from './attachTemporaryFile.mjs'; +export * from './createAttachment.mjs'; +export * from './createCustomer.mjs'; +export * from './createCustomerRequest.mjs'; +export * from './createOrganization.mjs'; +export * from './createRequestComment.mjs'; +export * from './createRequestType.mjs'; +export * from './deleteFeedback.mjs'; +export * from './deleteOrganization.mjs'; +export * from './deleteOrganizationProperty.mjs'; +export * from './deleteProperty.mjs'; +export * from './deleteProperty.mjs'; +export * from './deleteRequestType.mjs'; +export * from './getAllRequestTypes.mjs'; +export * from './getApprovalById.mjs'; +export * from './getApprovals.mjs'; +export * from './getArticles.mjs'; +export * from './getArticles.mjs'; +export * from './getAttachmentContent.mjs'; +export * from './getAttachmentsForRequest.mjs'; +export * from './getAttachmentThumbnail.mjs'; +export * from './getCommentAttachments.mjs'; +export * from './getCustomerRequestByIdOrKey.mjs'; +export * from './getCustomerRequests.mjs'; +export * from './getCustomerRequestStatus.mjs'; +export * from './getCustomers.mjs'; +export * from './getCustomerTransitions.mjs'; +export * from './getFeedback.mjs'; +export * from './getInsightWorkspaces.mjs'; +export * from './getIssuesInQueue.mjs'; +export * from './getOrganization.mjs'; +export * from './getOrganizationProperty.mjs'; +export * from './getOrganizationPropertyKeys.mjs'; +export * from './getOrganizations.mjs'; +export * from './getOrganizations.mjs'; +export * from './getPropertiesKeys.mjs'; +export * from './getPropertiesKeys.mjs'; +export * from './getProperty.mjs'; +export * from './getProperty.mjs'; +export * from './getQueue.mjs'; +export * from './getQueues.mjs'; +export * from './getRequestCommentById.mjs'; +export * from './getRequestComments.mjs'; +export * from './getRequestParticipants.mjs'; +export * from './getRequestTypeById.mjs'; +export * from './getRequestTypeFields.mjs'; +export * from './getRequestTypeGroups.mjs'; +export * from './getRequestTypes.mjs'; +export * from './getServiceDeskById.mjs'; +export * from './getServiceDesks.mjs'; +export * from './getSlaInformation.mjs'; +export * from './getSlaInformationById.mjs'; +export * from './getSubscriptionStatus.mjs'; +export * from './getUsersInOrganization.mjs'; +export * from './performCustomerTransition.mjs'; +export * from './postFeedback.mjs'; +export * from './removeCustomers.mjs'; +export * from './removeOrganization.mjs'; +export * from './removeRequestParticipants.mjs'; +export * from './removeUsersFromOrganization.mjs'; +export * from './setOrganizationProperty.mjs'; +export * from './setProperty.mjs'; +export * from './setProperty.mjs'; +export * from './subscribe.mjs'; +export * from './unsubscribe.mjs'; diff --git a/src/serviceDesk/parameters/index.ts b/src/serviceDesk/parameters/index.ts deleted file mode 100644 index f9bbba1e1..000000000 --- a/src/serviceDesk/parameters/index.ts +++ /dev/null @@ -1,70 +0,0 @@ -export * from './addCustomers.js'; -export * from './addOrganization.js'; -export * from './addRequestParticipants.js'; -export * from './addUsersToOrganization.js'; -export * from './answerApproval.js'; -export * from './attachTemporaryFile.js'; -export * from './createAttachment.js'; -export * from './createCustomer.js'; -export * from './createCustomerRequest.js'; -export * from './createOrganization.js'; -export * from './createRequestComment.js'; -export * from './createRequestType.js'; -export * from './deleteFeedback.js'; -export * from './deleteOrganization.js'; -export * from './deleteOrganizationProperty.js'; -export * from './deleteProperty.js'; -export * from './deleteProperty.js'; -export * from './deleteRequestType.js'; -export * from './getAllRequestTypes.js'; -export * from './getApprovalById.js'; -export * from './getApprovals.js'; -export * from './getArticles.js'; -export * from './getArticles.js'; -export * from './getAttachmentContent.js'; -export * from './getAttachmentsForRequest.js'; -export * from './getAttachmentThumbnail.js'; -export * from './getCommentAttachments.js'; -export * from './getCustomerRequestByIdOrKey.js'; -export * from './getCustomerRequests.js'; -export * from './getCustomerRequestStatus.js'; -export * from './getCustomers.js'; -export * from './getCustomerTransitions.js'; -export * from './getFeedback.js'; -export * from './getInsightWorkspaces.js'; -export * from './getIssuesInQueue.js'; -export * from './getOrganization.js'; -export * from './getOrganizationProperty.js'; -export * from './getOrganizationPropertyKeys.js'; -export * from './getOrganizations.js'; -export * from './getOrganizations.js'; -export * from './getPropertiesKeys.js'; -export * from './getPropertiesKeys.js'; -export * from './getProperty.js'; -export * from './getProperty.js'; -export * from './getQueue.js'; -export * from './getQueues.js'; -export * from './getRequestCommentById.js'; -export * from './getRequestComments.js'; -export * from './getRequestParticipants.js'; -export * from './getRequestTypeById.js'; -export * from './getRequestTypeFields.js'; -export * from './getRequestTypeGroups.js'; -export * from './getRequestTypes.js'; -export * from './getServiceDeskById.js'; -export * from './getServiceDesks.js'; -export * from './getSlaInformation.js'; -export * from './getSlaInformationById.js'; -export * from './getSubscriptionStatus.js'; -export * from './getUsersInOrganization.js'; -export * from './performCustomerTransition.js'; -export * from './postFeedback.js'; -export * from './removeCustomers.js'; -export * from './removeOrganization.js'; -export * from './removeRequestParticipants.js'; -export * from './removeUsersFromOrganization.js'; -export * from './setOrganizationProperty.js'; -export * from './setProperty.js'; -export * from './setProperty.js'; -export * from './subscribe.js'; -export * from './unsubscribe.js'; diff --git a/src/serviceDesk/parameters/performCustomerTransition.mts b/src/serviceDesk/parameters/performCustomerTransition.mts new file mode 100644 index 000000000..4f039a7de --- /dev/null +++ b/src/serviceDesk/parameters/performCustomerTransition.mts @@ -0,0 +1,6 @@ +import { CustomerTransitionExecution } from '../models/index.mjs'; + +export interface PerformCustomerTransition extends CustomerTransitionExecution { + /** ID or key of the issue to transition */ + issueIdOrKey: string; +} diff --git a/src/serviceDesk/parameters/performCustomerTransition.ts b/src/serviceDesk/parameters/performCustomerTransition.ts deleted file mode 100644 index 0d7b5c22d..000000000 --- a/src/serviceDesk/parameters/performCustomerTransition.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CustomerTransitionExecution } from '../models/index.js'; - -export interface PerformCustomerTransition extends CustomerTransitionExecution { - /** ID or key of the issue to transition */ - issueIdOrKey: string; -} diff --git a/src/serviceDesk/parameters/postFeedback.mts b/src/serviceDesk/parameters/postFeedback.mts new file mode 100644 index 000000000..ab60035f5 --- /dev/null +++ b/src/serviceDesk/parameters/postFeedback.mts @@ -0,0 +1,6 @@ +import { CsatFeedbackFull } from '../models/index.mjs'; + +export interface PostFeedback extends CsatFeedbackFull { + /** The id or the key of the request to post the feedback on */ + requestIdOrKey: string; +} diff --git a/src/serviceDesk/parameters/postFeedback.ts b/src/serviceDesk/parameters/postFeedback.ts deleted file mode 100644 index dc5d398f7..000000000 --- a/src/serviceDesk/parameters/postFeedback.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CsatFeedbackFull } from '../models/index.js'; - -export interface PostFeedback extends CsatFeedbackFull { - /** The id or the key of the request to post the feedback on */ - requestIdOrKey: string; -} diff --git a/src/serviceDesk/parameters/removeCustomers.mts b/src/serviceDesk/parameters/removeCustomers.mts new file mode 100644 index 000000000..c0e964b86 --- /dev/null +++ b/src/serviceDesk/parameters/removeCustomers.mts @@ -0,0 +1,9 @@ +import { ServiceDeskCustomer } from '../models/index.mjs'; + +export interface RemoveCustomers extends ServiceDeskCustomer { + /** + * The ID of the service desk the customers should be removed from. This can alternatively be a [project + * identifier.](#project-identifiers) + */ + serviceDeskId: string; +} diff --git a/src/serviceDesk/parameters/removeCustomers.ts b/src/serviceDesk/parameters/removeCustomers.ts deleted file mode 100644 index a96f08938..000000000 --- a/src/serviceDesk/parameters/removeCustomers.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ServiceDeskCustomer } from '../models/index.js'; - -export interface RemoveCustomers extends ServiceDeskCustomer { - /** - * The ID of the service desk the customers should be removed from. This can alternatively be a [project - * identifier.](#project-identifiers) - */ - serviceDeskId: string; -} diff --git a/src/serviceDesk/parameters/removeOrganization.mts b/src/serviceDesk/parameters/removeOrganization.mts new file mode 100644 index 000000000..a2d9270b7 --- /dev/null +++ b/src/serviceDesk/parameters/removeOrganization.mts @@ -0,0 +1,9 @@ +import { OrganizationServiceDeskUpdate } from '../models/index.mjs'; + +export interface RemoveOrganization extends OrganizationServiceDeskUpdate { + /** + * The ID of the service desk from which the organization will be removed. This can alternatively be a [project + * identifier.](#project-identifiers) + */ + serviceDeskId: string; +} diff --git a/src/serviceDesk/parameters/removeOrganization.ts b/src/serviceDesk/parameters/removeOrganization.ts deleted file mode 100644 index f340839f5..000000000 --- a/src/serviceDesk/parameters/removeOrganization.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { OrganizationServiceDeskUpdate } from '../models/index.js'; - -export interface RemoveOrganization extends OrganizationServiceDeskUpdate { - /** - * The ID of the service desk from which the organization will be removed. This can alternatively be a [project - * identifier.](#project-identifiers) - */ - serviceDeskId: string; -} diff --git a/src/serviceDesk/parameters/removeRequestParticipants.mts b/src/serviceDesk/parameters/removeRequestParticipants.mts new file mode 100644 index 000000000..e5e0e0321 --- /dev/null +++ b/src/serviceDesk/parameters/removeRequestParticipants.mts @@ -0,0 +1,6 @@ +import { RequestParticipantUpdate } from '../models/index.mjs'; + +export interface RemoveRequestParticipants extends RequestParticipantUpdate { + /** The ID or key of the customer request to have participants removed. */ + issueIdOrKey: string; +} diff --git a/src/serviceDesk/parameters/removeRequestParticipants.ts b/src/serviceDesk/parameters/removeRequestParticipants.ts deleted file mode 100644 index b4fab89d5..000000000 --- a/src/serviceDesk/parameters/removeRequestParticipants.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { RequestParticipantUpdate } from '../models/index.js'; - -export interface RemoveRequestParticipants extends RequestParticipantUpdate { - /** The ID or key of the customer request to have participants removed. */ - issueIdOrKey: string; -} diff --git a/src/serviceDesk/parameters/removeUsersFromOrganization.mts b/src/serviceDesk/parameters/removeUsersFromOrganization.mts new file mode 100644 index 000000000..4730d72cf --- /dev/null +++ b/src/serviceDesk/parameters/removeUsersFromOrganization.mts @@ -0,0 +1,6 @@ +import { UsersOrganizationUpdate } from '../models/index.mjs'; + +export interface RemoveUsersFromOrganization extends UsersOrganizationUpdate { + /** The ID of the organization. */ + organizationId: number; +} diff --git a/src/serviceDesk/parameters/removeUsersFromOrganization.ts b/src/serviceDesk/parameters/removeUsersFromOrganization.ts deleted file mode 100644 index 42e090140..000000000 --- a/src/serviceDesk/parameters/removeUsersFromOrganization.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UsersOrganizationUpdate } from '../models/index.js'; - -export interface RemoveUsersFromOrganization extends UsersOrganizationUpdate { - /** The ID of the organization. */ - organizationId: number; -} diff --git a/src/serviceDesk/parameters/setOrganizationProperty.ts b/src/serviceDesk/parameters/setOrganizationProperty.mts similarity index 100% rename from src/serviceDesk/parameters/setOrganizationProperty.ts rename to src/serviceDesk/parameters/setOrganizationProperty.mts diff --git a/src/serviceDesk/parameters/setProperty.ts b/src/serviceDesk/parameters/setProperty.mts similarity index 100% rename from src/serviceDesk/parameters/setProperty.ts rename to src/serviceDesk/parameters/setProperty.mts diff --git a/src/serviceDesk/parameters/subscribe.ts b/src/serviceDesk/parameters/subscribe.mts similarity index 100% rename from src/serviceDesk/parameters/subscribe.ts rename to src/serviceDesk/parameters/subscribe.mts diff --git a/src/serviceDesk/parameters/unsubscribe.ts b/src/serviceDesk/parameters/unsubscribe.mts similarity index 100% rename from src/serviceDesk/parameters/unsubscribe.ts rename to src/serviceDesk/parameters/unsubscribe.mts diff --git a/src/serviceDesk/request.mts b/src/serviceDesk/request.mts new file mode 100644 index 000000000..e921c9a7d --- /dev/null +++ b/src/serviceDesk/request.mts @@ -0,0 +1,1105 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Request { + constructor(private client: Client) {} + + /** + * This method returns all customer requests for the user executing the query. + * + * The returned customer requests are ordered chronologically by the latest activity on each request. For example, the + * latest status transition or comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the specified service desk. + * + * **Response limitations**: For customers, the list returned will include request they created (or were created on + * their behalf) or are participating in only. + */ + async getCustomerRequests( + parameters: Parameters.GetCustomerRequests | undefined, + callback: Callback, + ): Promise; + /** + * This method returns all customer requests for the user executing the query. + * + * The returned customer requests are ordered chronologically by the latest activity on each request. For example, the + * latest status transition or comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the specified service desk. + * + * **Response limitations**: For customers, the list returned will include request they created (or were created on + * their behalf) or are participating in only. + */ + async getCustomerRequests( + parameters?: Parameters.GetCustomerRequests, + callback?: never, + ): Promise; + async getCustomerRequests( + parameters?: Parameters.GetCustomerRequests, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/request', + method: 'GET', + params: { + searchTerm: parameters?.searchTerm, + requestStatus: parameters?.requestStatus, + approvalStatus: parameters?.approvalStatus, + organizationId: parameters?.organizationId, + serviceDeskId: parameters?.serviceDeskId, + requestTypeId: parameters?.requestTypeId, + expand: parameters?.expand, + start: parameters?.start, + limit: parameters?.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method creates a customer request in a service desk. + * + * The JSON request must include the service desk and customer request type, as well as any fields that are required + * for the request type. A list of the fields required by a customer request type can be obtained using + * [servicedesk/{serviceDeskId}/requesttype/{requestTypeId}/field](#api-servicedesk-serviceDeskId-requesttype-requestTypeId-field-get). + * + * The fields required for a customer request type depend on the user's permissions: + * + * - `raiseOnBehalfOf` is not available to Users who have the customer permission only. + * - `requestParticipants` is not available to Users who have the customer permission only or if the feature is turned + * off for customers. + * + * `requestFieldValues` is a map of Jira field IDs and their values. See [Field input formats](#fieldformats), for + * details of each field's JSON semantics and the values they can take. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to create requests in the specified service desk. + */ + async createCustomerRequest( + parameters: Parameters.CreateCustomerRequest | undefined, + callback: Callback, + ): Promise; + /** + * This method creates a customer request in a service desk. + * + * The JSON request must include the service desk and customer request type, as well as any fields that are required + * for the request type. A list of the fields required by a customer request type can be obtained using + * [servicedesk/{serviceDeskId}/requesttype/{requestTypeId}/field](#api-servicedesk-serviceDeskId-requesttype-requestTypeId-field-get). + * + * The fields required for a customer request type depend on the user's permissions: + * + * - `raiseOnBehalfOf` is not available to Users who have the customer permission only. + * - `requestParticipants` is not available to Users who have the customer permission only or if the feature is turned + * off for customers. + * + * `requestFieldValues` is a map of Jira field IDs and their values. See [Field input formats](#fieldformats), for + * details of each field's JSON semantics and the values they can take. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to create requests in the specified service desk. + */ + async createCustomerRequest( + parameters?: Parameters.CreateCustomerRequest, + callback?: never, + ): Promise; + async createCustomerRequest( + parameters?: Parameters.CreateCustomerRequest, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/request', + method: 'POST', + data: { + serviceDeskId: parameters?.serviceDeskId, + requestTypeId: parameters?.requestTypeId, + requestFieldValues: parameters?.requestFieldValues, + requestParticipants: parameters?.requestParticipants, + raiseOnBehalfOf: parameters?.raiseOnBehalfOf, + channel: parameters?.channel, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the specified service desk. + * + * **Response limitations**: For customers, only a request they created, was created on their behalf, or they are + * participating in will be returned. + */ + async getCustomerRequestByIdOrKey( + parameters: Parameters.GetCustomerRequestByIdOrKey, + callback: Callback, + ): Promise; + /** + * This method returns a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the specified service desk. + * + * **Response limitations**: For customers, only a request they created, was created on their behalf, or they are + * participating in will be returned. + */ + async getCustomerRequestByIdOrKey( + parameters: Parameters.GetCustomerRequestByIdOrKey, + callback?: never, + ): Promise; + async getCustomerRequestByIdOrKey( + parameters: Parameters.GetCustomerRequestByIdOrKey, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns all approvals on a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getApprovals( + parameters: Parameters.GetApprovals, + callback: Callback, + ): Promise; + /** + * This method returns all approvals on a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getApprovals(parameters: Parameters.GetApprovals, callback?: never): Promise; + async getApprovals( + parameters: Parameters.GetApprovals, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/approval`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns an approval. Use this method to determine the status of an approval and the list of approvers. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getApprovalById( + parameters: Parameters.GetApprovalById, + callback: Callback, + ): Promise; + /** + * This method returns an approval. Use this method to determine the status of an approval and the list of approvers. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getApprovalById(parameters: Parameters.GetApprovalById, callback?: never): Promise; + async getApprovalById( + parameters: Parameters.GetApprovalById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/approval/${parameters.approvalId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method enables a user to **Approve** or **Decline** an approval on a customer request. The approval is assumed + * to be owned by the user making the call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * is assigned to the approval request. + */ + async answerApproval( + parameters: Parameters.AnswerApproval, + callback: Callback, + ): Promise; + /** + * This method enables a user to **Approve** or **Decline** an approval on a customer request. The approval is assumed + * to be owned by the user making the call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * is assigned to the approval request. + */ + async answerApproval(parameters: Parameters.AnswerApproval, callback?: never): Promise; + async answerApproval( + parameters: Parameters.AnswerApproval, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/approval/${parameters.approvalId}`, + method: 'POST', + data: { + decision: parameters.decision, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns all the attachments for a customer requests. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + * + * **Response limitations**: Customers will only get a list of public attachments. + */ + async getAttachmentsForRequest( + parameters: Parameters.GetAttachmentsForRequest, + callback: Callback, + ): Promise; + /** + * This method returns all the attachments for a customer requests. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + * + * **Response limitations**: Customers will only get a list of public attachments. + */ + async getAttachmentsForRequest( + parameters: Parameters.GetAttachmentsForRequest, + callback?: never, + ): Promise; + async getAttachmentsForRequest( + parameters: Parameters.GetAttachmentsForRequest, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/attachment`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method adds one or more temporary files (attached to the request's service desk using + * [servicedesk/{serviceDeskId}/attachTemporaryFile](#api-servicedesk-serviceDeskId-attachTemporaryFile-post)) as + * attachments to a customer request and set the attachment visibility using the `public` flag. Also, it is possible + * to include a comment with the attachments. + * + * To get a list of attachments for a comment on the request use + * [servicedeskapi/request/{issueIdOrKey}/comment/{commentId}/attachment](#api-request-issueIdOrKey-comment-commentId-attachment-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to add an attachment. + * + * **Request limitations**: Customers can set attachments to public visibility only. + */ + async createAttachment( + parameters: Parameters.CreateAttachment, + callback: Callback, + ): Promise; + /** + * This method adds one or more temporary files (attached to the request's service desk using + * [servicedesk/{serviceDeskId}/attachTemporaryFile](#api-servicedesk-serviceDeskId-attachTemporaryFile-post)) as + * attachments to a customer request and set the attachment visibility using the `public` flag. Also, it is possible + * to include a comment with the attachments. + * + * To get a list of attachments for a comment on the request use + * [servicedeskapi/request/{issueIdOrKey}/comment/{commentId}/attachment](#api-request-issueIdOrKey-comment-commentId-attachment-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to add an attachment. + * + * **Request limitations**: Customers can set attachments to public visibility only. + */ + async createAttachment( + parameters: Parameters.CreateAttachment, + callback?: never, + ): Promise; + async createAttachment( + parameters: Parameters.CreateAttachment, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/attachment`, + method: 'POST', + data: { + temporaryAttachmentIds: parameters.temporaryAttachmentIds, + additionalComment: parameters.additionalComment, + public: parameters.public, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the contents of an attachment. + * + * To return a thumbnail of the attachment, use + * [servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}/thumbnail](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-thumbnail-get). + * + * **[Permissions](#permissions) required:** For the issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAttachmentContent( + parameters: Parameters.GetAttachmentContent, + callback: Callback, + ): Promise; + /** + * Returns the contents of an attachment. + * + * To return a thumbnail of the attachment, use + * [servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}/thumbnail](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-thumbnail-get). + * + * **[Permissions](#permissions) required:** For the issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAttachmentContent(parameters: Parameters.GetAttachmentContent, callback?: never): Promise; + async getAttachmentContent( + parameters: Parameters.GetAttachmentContent, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/attachment/${parameters.attachmentId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the thumbnail of an attachment. + * + * To return the attachment contents, use + * [servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-get). + * + * **[Permissions](#permissions) required:** For the issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail, + callback: Callback, + ): Promise; + /** + * Returns the thumbnail of an attachment. + * + * To return the attachment contents, use + * [servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-get). + * + * **[Permissions](#permissions) required:** For the issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail, + callback?: never, + ): Promise; + async getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/attachment/${parameters.attachmentId}/thumbnail`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns all comments on a customer request. No permissions error is provided if, for example, the user + * doesn't have access to the service desk or request, the method simply returns an empty response. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + * + * **Response limitations**: Customers are returned public comments only. + */ + async getRequestComments( + parameters: Parameters.GetRequestComments, + callback: Callback, + ): Promise; + /** + * This method returns all comments on a customer request. No permissions error is provided if, for example, the user + * doesn't have access to the service desk or request, the method simply returns an empty response. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + * + * **Response limitations**: Customers are returned public comments only. + */ + async getRequestComments( + parameters: Parameters.GetRequestComments, + callback?: never, + ): Promise; + async getRequestComments( + parameters: Parameters.GetRequestComments, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/comment`, + method: 'GET', + params: { + public: parameters.public, + internal: parameters.internal, + expand: parameters.expand, + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method creates a public or private (internal) comment on a customer request, with the comment visibility set + * by `public`. The user recorded as the author of the comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * has Add Comments permission. + * + * **Request limitations**: Customers can set comments to public visibility only. + */ + async createRequestComment( + parameters: Parameters.CreateRequestComment, + callback: Callback, + ): Promise; + /** + * This method creates a public or private (internal) comment on a customer request, with the comment visibility set + * by `public`. The user recorded as the author of the comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * has Add Comments permission. + * + * **Request limitations**: Customers can set comments to public visibility only. + */ + async createRequestComment( + parameters: Parameters.CreateRequestComment, + callback?: never, + ): Promise; + async createRequestComment( + parameters: Parameters.CreateRequestComment, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/comment`, + method: 'POST', + data: { + body: parameters.body, + public: parameters.public, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns details of a customer request's comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + * + * **Response limitations**: Customers can only view public comments on requests where they are the reporter or a + * participant whereas agents can see both internal and public comments. + */ + async getRequestCommentById( + parameters: Parameters.GetRequestCommentById, + callback: Callback, + ): Promise; + /** + * This method returns details of a customer request's comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + * + * **Response limitations**: Customers can only view public comments on requests where they are the reporter or a + * participant whereas agents can see both internal and public comments. + */ + async getRequestCommentById( + parameters: Parameters.GetRequestCommentById, + callback?: never, + ): Promise; + async getRequestCommentById( + parameters: Parameters.GetRequestCommentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/comment/${parameters.commentId}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns the attachments referenced in a comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + * + * **Response limitations**: Customers can only view public comments, and retrieve their attachments, on requests + * where they are the reporter or a participant whereas agents can see both internal and public comments. + */ + async getCommentAttachments( + parameters: Parameters.GetCommentAttachments, + callback: Callback, + ): Promise; + /** + * This method returns the attachments referenced in a comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + * + * **Response limitations**: Customers can only view public comments, and retrieve their attachments, on requests + * where they are the reporter or a participant whereas agents can see both internal and public comments. + */ + async getCommentAttachments( + parameters: Parameters.GetCommentAttachments, + callback?: never, + ): Promise; + async getCommentAttachments( + parameters: Parameters.GetCommentAttachments, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/comment/${parameters.commentId}/attachment`, + method: 'GET', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns the notification subscription status of the user making the request. Use this method to + * determine if the user is subscribed to a customer request's notifications. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getSubscriptionStatus( + parameters: Parameters.GetSubscriptionStatus, + callback: Callback, + ): Promise; + /** + * This method returns the notification subscription status of the user making the request. Use this method to + * determine if the user is subscribed to a customer request's notifications. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getSubscriptionStatus( + parameters: Parameters.GetSubscriptionStatus, + callback?: never, + ): Promise; + async getSubscriptionStatus( + parameters: Parameters.GetSubscriptionStatus, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/notification`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method subscribes the user to receiving notifications from a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async subscribe(parameters: Parameters.Subscribe, callback: Callback): Promise; + /** + * This method subscribes the user to receiving notifications from a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async subscribe(parameters: Parameters.Subscribe, callback?: never): Promise; + async subscribe(parameters: Parameters.Subscribe, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/notification`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method unsubscribes the user from notifications from a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async unsubscribe(parameters: Parameters.Unsubscribe, callback: Callback): Promise; + /** + * This method unsubscribes the user from notifications from a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async unsubscribe(parameters: Parameters.Unsubscribe, callback?: never): Promise; + async unsubscribe(parameters: Parameters.Unsubscribe, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/notification`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a list of all the participants on a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getRequestParticipants( + parameters: Parameters.GetRequestParticipants, + callback: Callback, + ): Promise; + /** + * This method returns a list of all the participants on a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getRequestParticipants( + parameters: Parameters.GetRequestParticipants, + callback?: never, + ): Promise; + async getRequestParticipants( + parameters: Parameters.GetRequestParticipants, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/participant`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method adds participants to a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to manage participants on the customer request. + * + * Note, participants can be added when creating a customer request using the + * [request](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/) resource, by defining + * the participants in the `requestParticipants` field. + */ + async addRequestParticipants( + parameters: Parameters.AddRequestParticipants, + callback: Callback, + ): Promise; + /** + * This method adds participants to a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to manage participants on the customer request. + * + * Note, participants can be added when creating a customer request using the + * [request](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/) resource, by defining + * the participants in the `requestParticipants` field. + */ + async addRequestParticipants( + parameters: Parameters.AddRequestParticipants, + callback?: never, + ): Promise; + async addRequestParticipants( + parameters: Parameters.AddRequestParticipants, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/participant`, + method: 'POST', + data: { + usernames: parameters.usernames, + accountIds: parameters.accountIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method removes participants from a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to manage participants on the customer request. + */ + async removeRequestParticipants( + parameters: Parameters.RemoveRequestParticipants, + callback: Callback, + ): Promise; + /** + * This method removes participants from a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to manage participants on the customer request. + */ + async removeRequestParticipants( + parameters: Parameters.RemoveRequestParticipants, + callback?: never, + ): Promise; + async removeRequestParticipants( + parameters: Parameters.RemoveRequestParticipants, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/participant`, + method: 'DELETE', + data: { + usernames: parameters.usernames, + accountIds: parameters.accountIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns all the SLA records on a customer request. A customer request can have zero or more SLAs. Each + * SLA can have recordings for zero or more "completed cycles" and zero or 1 "ongoing cycle". Each cycle includes + * information on when it started and stopped, and whether it breached the SLA goal. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Agent + * for the Service Desk containing the queried customer request. + */ + async getSlaInformation( + parameters: Parameters.GetSlaInformation, + callback: Callback, + ): Promise; + /** + * This method returns all the SLA records on a customer request. A customer request can have zero or more SLAs. Each + * SLA can have recordings for zero or more "completed cycles" and zero or 1 "ongoing cycle". Each cycle includes + * information on when it started and stopped, and whether it breached the SLA goal. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Agent + * for the Service Desk containing the queried customer request. + */ + async getSlaInformation( + parameters: Parameters.GetSlaInformation, + callback?: never, + ): Promise; + async getSlaInformation( + parameters: Parameters.GetSlaInformation, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/sla`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns the details for an SLA on a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Agent + * for the Service Desk containing the queried customer request. + */ + async getSlaInformationById( + parameters: Parameters.GetSlaInformationById, + callback: Callback, + ): Promise; + /** + * This method returns the details for an SLA on a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Agent + * for the Service Desk containing the queried customer request. + */ + async getSlaInformationById( + parameters: Parameters.GetSlaInformationById, + callback?: never, + ): Promise; + async getSlaInformationById( + parameters: Parameters.GetSlaInformationById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/sla/${parameters.slaMetricId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a list of all the statuses a customer Request has achieved. A status represents the state of an + * issue in its workflow. An issue can have one active status only. The list returns the status history in + * chronological order, most recent (current) status first. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getCustomerRequestStatus( + parameters: Parameters.GetCustomerRequestStatus, + callback: Callback, + ): Promise; + /** + * This method returns a list of all the statuses a customer Request has achieved. A status represents the state of an + * issue in its workflow. An issue can have one active status only. The list returns the status history in + * chronological order, most recent (current) status first. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getCustomerRequestStatus( + parameters: Parameters.GetCustomerRequestStatus, + callback?: never, + ): Promise; + async getCustomerRequestStatus( + parameters: Parameters.GetCustomerRequestStatus, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/status`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a list of transitions, the workflow processes that moves a customer request from one status to + * another, that the user can perform on a request. Use this method to provide a user with a list if the actions they + * can take on a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getCustomerTransitions( + parameters: Parameters.GetCustomerTransitions, + callback: Callback, + ): Promise; + /** + * This method returns a list of transitions, the workflow processes that moves a customer request from one status to + * another, that the user can perform on a request. Use this method to provide a user with a list if the actions they + * can take on a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getCustomerTransitions( + parameters: Parameters.GetCustomerTransitions, + callback?: never, + ): Promise; + async getCustomerTransitions( + parameters: Parameters.GetCustomerTransitions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/transition`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method performs a customer transition for a given request and transition. An optional comment can be included + * to provide a reason for the transition. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: The + * user must be able to view the request and have the Transition Issues permission. If a comment is passed the user + * must have the Add Comments permission. + */ + async performCustomerTransition( + parameters: Parameters.PerformCustomerTransition, + callback: Callback, + ): Promise; + /** + * This method performs a customer transition for a given request and transition. An optional comment can be included + * to provide a reason for the transition. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: The + * user must be able to view the request and have the Transition Issues permission. If a comment is passed the user + * must have the Add Comments permission. + */ + async performCustomerTransition( + parameters: Parameters.PerformCustomerTransition, + callback?: never, + ): Promise; + async performCustomerTransition( + parameters: Parameters.PerformCustomerTransition, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/transition`, + method: 'POST', + data: { + id: parameters.id, + additionalComment: parameters.additionalComment, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method retrieves a feedback of a request using it's `requestKey` or `requestId` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * has view request permissions. + */ + async getFeedback( + parameters: Parameters.GetFeedback, + callback: Callback, + ): Promise; + /** + * This method retrieves a feedback of a request using it's `requestKey` or `requestId` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * has view request permissions. + */ + async getFeedback(parameters: Parameters.GetFeedback, callback?: never): Promise; + async getFeedback( + parameters: Parameters.GetFeedback, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.requestIdOrKey}/feedback`, + method: 'GET', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method adds a feedback on a request using it's `requestKey` or `requestId` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * must be the reporter or an Atlassian Connect app. + */ + async postFeedback( + parameters: Parameters.PostFeedback, + callback: Callback, + ): Promise; + /** + * This method adds a feedback on a request using it's `requestKey` or `requestId` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * must be the reporter or an Atlassian Connect app. + */ + async postFeedback(parameters: Parameters.PostFeedback, callback?: never): Promise; + async postFeedback( + parameters: Parameters.PostFeedback, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.requestIdOrKey}/feedback`, + method: 'POST', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + data: { + type: parameters.type, + rating: parameters.rating, + comment: parameters.comment, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method deletes the feedback of request using it's `requestKey` or `requestId` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * must be the reporter or an Atlassian Connect app. + */ + async deleteFeedback(parameters: Parameters.DeleteFeedback, callback: Callback): Promise; + /** + * This method deletes the feedback of request using it's `requestKey` or `requestId` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * must be the reporter or an Atlassian Connect app. + */ + async deleteFeedback(parameters: Parameters.DeleteFeedback, callback?: never): Promise; + async deleteFeedback(parameters: Parameters.DeleteFeedback, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.requestIdOrKey}/feedback`, + method: 'DELETE', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/serviceDesk/request.ts b/src/serviceDesk/request.ts deleted file mode 100644 index 1546b84a3..000000000 --- a/src/serviceDesk/request.ts +++ /dev/null @@ -1,1105 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Request { - constructor(private client: Client) {} - - /** - * This method returns all customer requests for the user executing the query. - * - * The returned customer requests are ordered chronologically by the latest activity on each request. For example, the - * latest status transition or comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the specified service desk. - * - * **Response limitations**: For customers, the list returned will include request they created (or were created on - * their behalf) or are participating in only. - */ - async getCustomerRequests( - parameters: Parameters.GetCustomerRequests | undefined, - callback: Callback, - ): Promise; - /** - * This method returns all customer requests for the user executing the query. - * - * The returned customer requests are ordered chronologically by the latest activity on each request. For example, the - * latest status transition or comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the specified service desk. - * - * **Response limitations**: For customers, the list returned will include request they created (or were created on - * their behalf) or are participating in only. - */ - async getCustomerRequests( - parameters?: Parameters.GetCustomerRequests, - callback?: never, - ): Promise; - async getCustomerRequests( - parameters?: Parameters.GetCustomerRequests, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/request', - method: 'GET', - params: { - searchTerm: parameters?.searchTerm, - requestStatus: parameters?.requestStatus, - approvalStatus: parameters?.approvalStatus, - organizationId: parameters?.organizationId, - serviceDeskId: parameters?.serviceDeskId, - requestTypeId: parameters?.requestTypeId, - expand: parameters?.expand, - start: parameters?.start, - limit: parameters?.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method creates a customer request in a service desk. - * - * The JSON request must include the service desk and customer request type, as well as any fields that are required - * for the request type. A list of the fields required by a customer request type can be obtained using - * [servicedesk/{serviceDeskId}/requesttype/{requestTypeId}/field](#api-servicedesk-serviceDeskId-requesttype-requestTypeId-field-get). - * - * The fields required for a customer request type depend on the user's permissions: - * - * - `raiseOnBehalfOf` is not available to Users who have the customer permission only. - * - `requestParticipants` is not available to Users who have the customer permission only or if the feature is turned - * off for customers. - * - * `requestFieldValues` is a map of Jira field IDs and their values. See [Field input formats](#fieldformats), for - * details of each field's JSON semantics and the values they can take. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to create requests in the specified service desk. - */ - async createCustomerRequest( - parameters: Parameters.CreateCustomerRequest | undefined, - callback: Callback, - ): Promise; - /** - * This method creates a customer request in a service desk. - * - * The JSON request must include the service desk and customer request type, as well as any fields that are required - * for the request type. A list of the fields required by a customer request type can be obtained using - * [servicedesk/{serviceDeskId}/requesttype/{requestTypeId}/field](#api-servicedesk-serviceDeskId-requesttype-requestTypeId-field-get). - * - * The fields required for a customer request type depend on the user's permissions: - * - * - `raiseOnBehalfOf` is not available to Users who have the customer permission only. - * - `requestParticipants` is not available to Users who have the customer permission only or if the feature is turned - * off for customers. - * - * `requestFieldValues` is a map of Jira field IDs and their values. See [Field input formats](#fieldformats), for - * details of each field's JSON semantics and the values they can take. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to create requests in the specified service desk. - */ - async createCustomerRequest( - parameters?: Parameters.CreateCustomerRequest, - callback?: never, - ): Promise; - async createCustomerRequest( - parameters?: Parameters.CreateCustomerRequest, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/request', - method: 'POST', - data: { - serviceDeskId: parameters?.serviceDeskId, - requestTypeId: parameters?.requestTypeId, - requestFieldValues: parameters?.requestFieldValues, - requestParticipants: parameters?.requestParticipants, - raiseOnBehalfOf: parameters?.raiseOnBehalfOf, - channel: parameters?.channel, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the specified service desk. - * - * **Response limitations**: For customers, only a request they created, was created on their behalf, or they are - * participating in will be returned. - */ - async getCustomerRequestByIdOrKey( - parameters: Parameters.GetCustomerRequestByIdOrKey, - callback: Callback, - ): Promise; - /** - * This method returns a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the specified service desk. - * - * **Response limitations**: For customers, only a request they created, was created on their behalf, or they are - * participating in will be returned. - */ - async getCustomerRequestByIdOrKey( - parameters: Parameters.GetCustomerRequestByIdOrKey, - callback?: never, - ): Promise; - async getCustomerRequestByIdOrKey( - parameters: Parameters.GetCustomerRequestByIdOrKey, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns all approvals on a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getApprovals( - parameters: Parameters.GetApprovals, - callback: Callback, - ): Promise; - /** - * This method returns all approvals on a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getApprovals(parameters: Parameters.GetApprovals, callback?: never): Promise; - async getApprovals( - parameters: Parameters.GetApprovals, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/approval`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns an approval. Use this method to determine the status of an approval and the list of approvers. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getApprovalById( - parameters: Parameters.GetApprovalById, - callback: Callback, - ): Promise; - /** - * This method returns an approval. Use this method to determine the status of an approval and the list of approvers. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getApprovalById(parameters: Parameters.GetApprovalById, callback?: never): Promise; - async getApprovalById( - parameters: Parameters.GetApprovalById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/approval/${parameters.approvalId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method enables a user to **Approve** or **Decline** an approval on a customer request. The approval is assumed - * to be owned by the user making the call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * is assigned to the approval request. - */ - async answerApproval( - parameters: Parameters.AnswerApproval, - callback: Callback, - ): Promise; - /** - * This method enables a user to **Approve** or **Decline** an approval on a customer request. The approval is assumed - * to be owned by the user making the call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * is assigned to the approval request. - */ - async answerApproval(parameters: Parameters.AnswerApproval, callback?: never): Promise; - async answerApproval( - parameters: Parameters.AnswerApproval, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/approval/${parameters.approvalId}`, - method: 'POST', - data: { - decision: parameters.decision, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns all the attachments for a customer requests. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - * - * **Response limitations**: Customers will only get a list of public attachments. - */ - async getAttachmentsForRequest( - parameters: Parameters.GetAttachmentsForRequest, - callback: Callback, - ): Promise; - /** - * This method returns all the attachments for a customer requests. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - * - * **Response limitations**: Customers will only get a list of public attachments. - */ - async getAttachmentsForRequest( - parameters: Parameters.GetAttachmentsForRequest, - callback?: never, - ): Promise; - async getAttachmentsForRequest( - parameters: Parameters.GetAttachmentsForRequest, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/attachment`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method adds one or more temporary files (attached to the request's service desk using - * [servicedesk/{serviceDeskId}/attachTemporaryFile](#api-servicedesk-serviceDeskId-attachTemporaryFile-post)) as - * attachments to a customer request and set the attachment visibility using the `public` flag. Also, it is possible - * to include a comment with the attachments. - * - * To get a list of attachments for a comment on the request use - * [servicedeskapi/request/{issueIdOrKey}/comment/{commentId}/attachment](#api-request-issueIdOrKey-comment-commentId-attachment-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to add an attachment. - * - * **Request limitations**: Customers can set attachments to public visibility only. - */ - async createAttachment( - parameters: Parameters.CreateAttachment, - callback: Callback, - ): Promise; - /** - * This method adds one or more temporary files (attached to the request's service desk using - * [servicedesk/{serviceDeskId}/attachTemporaryFile](#api-servicedesk-serviceDeskId-attachTemporaryFile-post)) as - * attachments to a customer request and set the attachment visibility using the `public` flag. Also, it is possible - * to include a comment with the attachments. - * - * To get a list of attachments for a comment on the request use - * [servicedeskapi/request/{issueIdOrKey}/comment/{commentId}/attachment](#api-request-issueIdOrKey-comment-commentId-attachment-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to add an attachment. - * - * **Request limitations**: Customers can set attachments to public visibility only. - */ - async createAttachment( - parameters: Parameters.CreateAttachment, - callback?: never, - ): Promise; - async createAttachment( - parameters: Parameters.CreateAttachment, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/attachment`, - method: 'POST', - data: { - temporaryAttachmentIds: parameters.temporaryAttachmentIds, - additionalComment: parameters.additionalComment, - public: parameters.public, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the contents of an attachment. - * - * To return a thumbnail of the attachment, use - * [servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}/thumbnail](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-thumbnail-get). - * - * **[Permissions](#permissions) required:** For the issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getAttachmentContent( - parameters: Parameters.GetAttachmentContent, - callback: Callback, - ): Promise; - /** - * Returns the contents of an attachment. - * - * To return a thumbnail of the attachment, use - * [servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}/thumbnail](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-thumbnail-get). - * - * **[Permissions](#permissions) required:** For the issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getAttachmentContent(parameters: Parameters.GetAttachmentContent, callback?: never): Promise; - async getAttachmentContent( - parameters: Parameters.GetAttachmentContent, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/attachment/${parameters.attachmentId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the thumbnail of an attachment. - * - * To return the attachment contents, use - * [servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-get). - * - * **[Permissions](#permissions) required:** For the issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail, - callback: Callback, - ): Promise; - /** - * Returns the thumbnail of an attachment. - * - * To return the attachment contents, use - * [servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-get). - * - * **[Permissions](#permissions) required:** For the issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail, - callback?: never, - ): Promise; - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/attachment/${parameters.attachmentId}/thumbnail`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns all comments on a customer request. No permissions error is provided if, for example, the user - * doesn't have access to the service desk or request, the method simply returns an empty response. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - * - * **Response limitations**: Customers are returned public comments only. - */ - async getRequestComments( - parameters: Parameters.GetRequestComments, - callback: Callback, - ): Promise; - /** - * This method returns all comments on a customer request. No permissions error is provided if, for example, the user - * doesn't have access to the service desk or request, the method simply returns an empty response. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - * - * **Response limitations**: Customers are returned public comments only. - */ - async getRequestComments( - parameters: Parameters.GetRequestComments, - callback?: never, - ): Promise; - async getRequestComments( - parameters: Parameters.GetRequestComments, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/comment`, - method: 'GET', - params: { - public: parameters.public, - internal: parameters.internal, - expand: parameters.expand, - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method creates a public or private (internal) comment on a customer request, with the comment visibility set - * by `public`. The user recorded as the author of the comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * has Add Comments permission. - * - * **Request limitations**: Customers can set comments to public visibility only. - */ - async createRequestComment( - parameters: Parameters.CreateRequestComment, - callback: Callback, - ): Promise; - /** - * This method creates a public or private (internal) comment on a customer request, with the comment visibility set - * by `public`. The user recorded as the author of the comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * has Add Comments permission. - * - * **Request limitations**: Customers can set comments to public visibility only. - */ - async createRequestComment( - parameters: Parameters.CreateRequestComment, - callback?: never, - ): Promise; - async createRequestComment( - parameters: Parameters.CreateRequestComment, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/comment`, - method: 'POST', - data: { - body: parameters.body, - public: parameters.public, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns details of a customer request's comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - * - * **Response limitations**: Customers can only view public comments on requests where they are the reporter or a - * participant whereas agents can see both internal and public comments. - */ - async getRequestCommentById( - parameters: Parameters.GetRequestCommentById, - callback: Callback, - ): Promise; - /** - * This method returns details of a customer request's comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - * - * **Response limitations**: Customers can only view public comments on requests where they are the reporter or a - * participant whereas agents can see both internal and public comments. - */ - async getRequestCommentById( - parameters: Parameters.GetRequestCommentById, - callback?: never, - ): Promise; - async getRequestCommentById( - parameters: Parameters.GetRequestCommentById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/comment/${parameters.commentId}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns the attachments referenced in a comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - * - * **Response limitations**: Customers can only view public comments, and retrieve their attachments, on requests - * where they are the reporter or a participant whereas agents can see both internal and public comments. - */ - async getCommentAttachments( - parameters: Parameters.GetCommentAttachments, - callback: Callback, - ): Promise; - /** - * This method returns the attachments referenced in a comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - * - * **Response limitations**: Customers can only view public comments, and retrieve their attachments, on requests - * where they are the reporter or a participant whereas agents can see both internal and public comments. - */ - async getCommentAttachments( - parameters: Parameters.GetCommentAttachments, - callback?: never, - ): Promise; - async getCommentAttachments( - parameters: Parameters.GetCommentAttachments, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/comment/${parameters.commentId}/attachment`, - method: 'GET', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns the notification subscription status of the user making the request. Use this method to - * determine if the user is subscribed to a customer request's notifications. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getSubscriptionStatus( - parameters: Parameters.GetSubscriptionStatus, - callback: Callback, - ): Promise; - /** - * This method returns the notification subscription status of the user making the request. Use this method to - * determine if the user is subscribed to a customer request's notifications. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getSubscriptionStatus( - parameters: Parameters.GetSubscriptionStatus, - callback?: never, - ): Promise; - async getSubscriptionStatus( - parameters: Parameters.GetSubscriptionStatus, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/notification`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method subscribes the user to receiving notifications from a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async subscribe(parameters: Parameters.Subscribe, callback: Callback): Promise; - /** - * This method subscribes the user to receiving notifications from a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async subscribe(parameters: Parameters.Subscribe, callback?: never): Promise; - async subscribe(parameters: Parameters.Subscribe, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/notification`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method unsubscribes the user from notifications from a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async unsubscribe(parameters: Parameters.Unsubscribe, callback: Callback): Promise; - /** - * This method unsubscribes the user from notifications from a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async unsubscribe(parameters: Parameters.Unsubscribe, callback?: never): Promise; - async unsubscribe(parameters: Parameters.Unsubscribe, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/notification`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a list of all the participants on a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getRequestParticipants( - parameters: Parameters.GetRequestParticipants, - callback: Callback, - ): Promise; - /** - * This method returns a list of all the participants on a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getRequestParticipants( - parameters: Parameters.GetRequestParticipants, - callback?: never, - ): Promise; - async getRequestParticipants( - parameters: Parameters.GetRequestParticipants, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/participant`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method adds participants to a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to manage participants on the customer request. - * - * Note, participants can be added when creating a customer request using the - * [request](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/) resource, by defining - * the participants in the `requestParticipants` field. - */ - async addRequestParticipants( - parameters: Parameters.AddRequestParticipants, - callback: Callback, - ): Promise; - /** - * This method adds participants to a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to manage participants on the customer request. - * - * Note, participants can be added when creating a customer request using the - * [request](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/) resource, by defining - * the participants in the `requestParticipants` field. - */ - async addRequestParticipants( - parameters: Parameters.AddRequestParticipants, - callback?: never, - ): Promise; - async addRequestParticipants( - parameters: Parameters.AddRequestParticipants, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/participant`, - method: 'POST', - data: { - usernames: parameters.usernames, - accountIds: parameters.accountIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method removes participants from a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to manage participants on the customer request. - */ - async removeRequestParticipants( - parameters: Parameters.RemoveRequestParticipants, - callback: Callback, - ): Promise; - /** - * This method removes participants from a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to manage participants on the customer request. - */ - async removeRequestParticipants( - parameters: Parameters.RemoveRequestParticipants, - callback?: never, - ): Promise; - async removeRequestParticipants( - parameters: Parameters.RemoveRequestParticipants, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/participant`, - method: 'DELETE', - data: { - usernames: parameters.usernames, - accountIds: parameters.accountIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns all the SLA records on a customer request. A customer request can have zero or more SLAs. Each - * SLA can have recordings for zero or more "completed cycles" and zero or 1 "ongoing cycle". Each cycle includes - * information on when it started and stopped, and whether it breached the SLA goal. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Agent - * for the Service Desk containing the queried customer request. - */ - async getSlaInformation( - parameters: Parameters.GetSlaInformation, - callback: Callback, - ): Promise; - /** - * This method returns all the SLA records on a customer request. A customer request can have zero or more SLAs. Each - * SLA can have recordings for zero or more "completed cycles" and zero or 1 "ongoing cycle". Each cycle includes - * information on when it started and stopped, and whether it breached the SLA goal. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Agent - * for the Service Desk containing the queried customer request. - */ - async getSlaInformation( - parameters: Parameters.GetSlaInformation, - callback?: never, - ): Promise; - async getSlaInformation( - parameters: Parameters.GetSlaInformation, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/sla`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns the details for an SLA on a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Agent - * for the Service Desk containing the queried customer request. - */ - async getSlaInformationById( - parameters: Parameters.GetSlaInformationById, - callback: Callback, - ): Promise; - /** - * This method returns the details for an SLA on a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Agent - * for the Service Desk containing the queried customer request. - */ - async getSlaInformationById( - parameters: Parameters.GetSlaInformationById, - callback?: never, - ): Promise; - async getSlaInformationById( - parameters: Parameters.GetSlaInformationById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/sla/${parameters.slaMetricId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a list of all the statuses a customer Request has achieved. A status represents the state of an - * issue in its workflow. An issue can have one active status only. The list returns the status history in - * chronological order, most recent (current) status first. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getCustomerRequestStatus( - parameters: Parameters.GetCustomerRequestStatus, - callback: Callback, - ): Promise; - /** - * This method returns a list of all the statuses a customer Request has achieved. A status represents the state of an - * issue in its workflow. An issue can have one active status only. The list returns the status history in - * chronological order, most recent (current) status first. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getCustomerRequestStatus( - parameters: Parameters.GetCustomerRequestStatus, - callback?: never, - ): Promise; - async getCustomerRequestStatus( - parameters: Parameters.GetCustomerRequestStatus, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/status`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a list of transitions, the workflow processes that moves a customer request from one status to - * another, that the user can perform on a request. Use this method to provide a user with a list if the actions they - * can take on a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getCustomerTransitions( - parameters: Parameters.GetCustomerTransitions, - callback: Callback, - ): Promise; - /** - * This method returns a list of transitions, the workflow processes that moves a customer request from one status to - * another, that the user can perform on a request. Use this method to provide a user with a list if the actions they - * can take on a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getCustomerTransitions( - parameters: Parameters.GetCustomerTransitions, - callback?: never, - ): Promise; - async getCustomerTransitions( - parameters: Parameters.GetCustomerTransitions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/transition`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method performs a customer transition for a given request and transition. An optional comment can be included - * to provide a reason for the transition. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: The - * user must be able to view the request and have the Transition Issues permission. If a comment is passed the user - * must have the Add Comments permission. - */ - async performCustomerTransition( - parameters: Parameters.PerformCustomerTransition, - callback: Callback, - ): Promise; - /** - * This method performs a customer transition for a given request and transition. An optional comment can be included - * to provide a reason for the transition. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: The - * user must be able to view the request and have the Transition Issues permission. If a comment is passed the user - * must have the Add Comments permission. - */ - async performCustomerTransition( - parameters: Parameters.PerformCustomerTransition, - callback?: never, - ): Promise; - async performCustomerTransition( - parameters: Parameters.PerformCustomerTransition, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/transition`, - method: 'POST', - data: { - id: parameters.id, - additionalComment: parameters.additionalComment, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method retrieves a feedback of a request using it's `requestKey` or `requestId` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * has view request permissions. - */ - async getFeedback( - parameters: Parameters.GetFeedback, - callback: Callback, - ): Promise; - /** - * This method retrieves a feedback of a request using it's `requestKey` or `requestId` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * has view request permissions. - */ - async getFeedback(parameters: Parameters.GetFeedback, callback?: never): Promise; - async getFeedback( - parameters: Parameters.GetFeedback, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.requestIdOrKey}/feedback`, - method: 'GET', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method adds a feedback on a request using it's `requestKey` or `requestId` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * must be the reporter or an Atlassian Connect app. - */ - async postFeedback( - parameters: Parameters.PostFeedback, - callback: Callback, - ): Promise; - /** - * This method adds a feedback on a request using it's `requestKey` or `requestId` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * must be the reporter or an Atlassian Connect app. - */ - async postFeedback(parameters: Parameters.PostFeedback, callback?: never): Promise; - async postFeedback( - parameters: Parameters.PostFeedback, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.requestIdOrKey}/feedback`, - method: 'POST', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - data: { - type: parameters.type, - rating: parameters.rating, - comment: parameters.comment, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method deletes the feedback of request using it's `requestKey` or `requestId` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * must be the reporter or an Atlassian Connect app. - */ - async deleteFeedback(parameters: Parameters.DeleteFeedback, callback: Callback): Promise; - /** - * This method deletes the feedback of request using it's `requestKey` or `requestId` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * must be the reporter or an Atlassian Connect app. - */ - async deleteFeedback(parameters: Parameters.DeleteFeedback, callback?: never): Promise; - async deleteFeedback(parameters: Parameters.DeleteFeedback, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.requestIdOrKey}/feedback`, - method: 'DELETE', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/serviceDesk/requestType.mts b/src/serviceDesk/requestType.mts new file mode 100644 index 000000000..508963698 --- /dev/null +++ b/src/serviceDesk/requestType.mts @@ -0,0 +1,65 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class RequestType { + constructor(private client: Client) {} + + /** + * This method returns all customer request types used in the Jira Service Management instance, optionally filtered by + * a query string. + * + * Use [servicedeskapi/servicedesk/{serviceDeskId}/requesttype](#api-servicedesk-serviceDeskId-requesttype-get) to + * find the customer request types supported by a specific service desk. + * + * The returned list of customer request types can be filtered using the `query` parameter. The parameter is matched + * against the customer request types' `name` or `description`. For example, searching for "Install", "Inst", "Equi", + * or "Equipment" will match a customer request type with the _name_ "Equipment Installation Request". + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + */ + async getAllRequestTypes( + parameters: Parameters.GetAllRequestTypes | undefined, + callback: Callback, + ): Promise; + /** + * This method returns all customer request types used in the Jira Service Management instance, optionally filtered by + * a query string. + * + * Use [servicedeskapi/servicedesk/{serviceDeskId}/requesttype](#api-servicedesk-serviceDeskId-requesttype-get) to + * find the customer request types supported by a specific service desk. + * + * The returned list of customer request types can be filtered using the `query` parameter. The parameter is matched + * against the customer request types' `name` or `description`. For example, searching for "Install", "Inst", "Equi", + * or "Equipment" will match a customer request type with the _name_ "Equipment Installation Request". + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + */ + async getAllRequestTypes( + parameters?: Parameters.GetAllRequestTypes, + callback?: never, + ): Promise; + async getAllRequestTypes( + parameters?: Parameters.GetAllRequestTypes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/requesttype', + method: 'GET', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + params: { + searchQuery: parameters?.searchQuery, + serviceDeskId: parameters?.serviceDeskId, + start: parameters?.start, + limit: parameters?.limit, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/serviceDesk/requestType.ts b/src/serviceDesk/requestType.ts deleted file mode 100644 index 4bad95723..000000000 --- a/src/serviceDesk/requestType.ts +++ /dev/null @@ -1,65 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class RequestType { - constructor(private client: Client) {} - - /** - * This method returns all customer request types used in the Jira Service Management instance, optionally filtered by - * a query string. - * - * Use [servicedeskapi/servicedesk/{serviceDeskId}/requesttype](#api-servicedesk-serviceDeskId-requesttype-get) to - * find the customer request types supported by a specific service desk. - * - * The returned list of customer request types can be filtered using the `query` parameter. The parameter is matched - * against the customer request types' `name` or `description`. For example, searching for "Install", "Inst", "Equi", - * or "Equipment" will match a customer request type with the _name_ "Equipment Installation Request". - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - */ - async getAllRequestTypes( - parameters: Parameters.GetAllRequestTypes | undefined, - callback: Callback, - ): Promise; - /** - * This method returns all customer request types used in the Jira Service Management instance, optionally filtered by - * a query string. - * - * Use [servicedeskapi/servicedesk/{serviceDeskId}/requesttype](#api-servicedesk-serviceDeskId-requesttype-get) to - * find the customer request types supported by a specific service desk. - * - * The returned list of customer request types can be filtered using the `query` parameter. The parameter is matched - * against the customer request types' `name` or `description`. For example, searching for "Install", "Inst", "Equi", - * or "Equipment" will match a customer request type with the _name_ "Equipment Installation Request". - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - */ - async getAllRequestTypes( - parameters?: Parameters.GetAllRequestTypes, - callback?: never, - ): Promise; - async getAllRequestTypes( - parameters?: Parameters.GetAllRequestTypes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/requesttype', - method: 'GET', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - params: { - searchQuery: parameters?.searchQuery, - serviceDeskId: parameters?.serviceDeskId, - start: parameters?.start, - limit: parameters?.limit, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/serviceDesk/serviceDesk.mts b/src/serviceDesk/serviceDesk.mts new file mode 100644 index 000000000..c761a73d2 --- /dev/null +++ b/src/serviceDesk/serviceDesk.mts @@ -0,0 +1,802 @@ +import { FormData } from 'formdata-node'; +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ServiceDesk { + constructor(private client: Client) {} + + /** + * This method returns all the service desks in the Jira Service Management instance that the user has permission to + * access. Use this method where you need a list of service desks or need to locate a service desk by name or + * keyword. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + */ + async getServiceDesks( + parameters: Parameters.GetServiceDesks | undefined, + callback: Callback, + ): Promise; + /** + * This method returns all the service desks in the Jira Service Management instance that the user has permission to + * access. Use this method where you need a list of service desks or need to locate a service desk by name or + * keyword. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + */ + async getServiceDesks( + parameters?: Parameters.GetServiceDesks, + callback?: never, + ): Promise; + async getServiceDesks( + parameters?: Parameters.GetServiceDesks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/servicedesk', + method: 'GET', + params: { + start: parameters?.start, + limit: parameters?.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a service desk. Use this method to get service desk details whenever your application component + * is passed a service desk ID but needs to display other service desk details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the Service Desk. For example, being the Service Desk's Administrator or one of its Agents or + * Users. + */ + async getServiceDeskById( + parameters: Parameters.GetServiceDeskById, + callback: Callback, + ): Promise; + /** + * This method returns a service desk. Use this method to get service desk details whenever your application component + * is passed a service desk ID but needs to display other service desk details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the Service Desk. For example, being the Service Desk's Administrator or one of its Agents or + * Users. + */ + async getServiceDeskById( + parameters: Parameters.GetServiceDeskById, + callback?: never, + ): Promise; + async getServiceDeskById( + parameters: Parameters.GetServiceDeskById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method adds one or more temporary attachments to a service desk, which can then be permanently attached to a + * customer request using + * [servicedeskapi/request/{issueIdOrKey}/attachment](#api-request-issueIdOrKey-attachment-post). + * + * **Note**: It is possible for a service desk administrator to turn off the ability to add attachments to a service + * desk. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to add attachments in this Service Desk. + */ + async attachTemporaryFile( + parameters: Parameters.AttachTemporaryFile, + callback: Callback, + ): Promise; + /** + * This method adds one or more temporary attachments to a service desk, which can then be permanently attached to a + * customer request using + * [servicedeskapi/request/{issueIdOrKey}/attachment](#api-request-issueIdOrKey-attachment-post). + * + * **Note**: It is possible for a service desk administrator to turn off the ability to add attachments to a service + * desk. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to add attachments in this Service Desk. + */ + async attachTemporaryFile(parameters: Parameters.AttachTemporaryFile, callback?: never): Promise; + async attachTemporaryFile( + parameters: Parameters.AttachTemporaryFile, + callback?: Callback, + ): Promise { + const formData = new FormData(); + const attachments = Array.isArray(parameters.attachment) ? parameters.attachment : [parameters.attachment]; + + attachments.forEach(attachment => formData.append('file', attachment.file, attachment.filename)); + + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/attachTemporaryFile`, + method: 'POST', + headers: { + 'X-Atlassian-Token': 'no-check', + 'Content-Type': 'multipart/form-data', + }, + data: formData, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a list of the customers on a service desk. + * + * The returned list of customers can be filtered using the `query` parameter. The parameter is matched against + * customers' `displayName`, `name`, or `email`. For example, searching for "John", "Jo", "Smi", or "Smith" will match + * a user with display name "John Smith". + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view this Service Desk's customers. + */ + async getCustomers(parameters: Parameters.GetCustomers, callback: Callback): Promise; + /** + * This method returns a list of the customers on a service desk. + * + * The returned list of customers can be filtered using the `query` parameter. The parameter is matched against + * customers' `displayName`, `name`, or `email`. For example, searching for "John", "Jo", "Smi", or "Smith" will match + * a user with display name "John Smith". + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view this Service Desk's customers. + */ + async getCustomers(parameters: Parameters.GetCustomers, callback?: never): Promise; + async getCustomers( + parameters: Parameters.GetCustomers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/customer`, + method: 'GET', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + params: { + query: parameters.query, + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds one or more customers to a service desk. If any of the passed customers are associated with the service desk, + * no changes will be made for those customers and the resource returns a 204 success code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator + */ + async addCustomers(parameters: Parameters.AddCustomers, callback: Callback): Promise; + /** + * Adds one or more customers to a service desk. If any of the passed customers are associated with the service desk, + * no changes will be made for those customers and the resource returns a 204 success code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator + */ + async addCustomers(parameters: Parameters.AddCustomers, callback?: never): Promise; + async addCustomers(parameters: Parameters.AddCustomers, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/customer`, + method: 'POST', + data: { + usernames: parameters.usernames, + accountIds: parameters.accountIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method removes one or more customers from a service desk. The service desk must have closed access. If any of + * the passed customers are not associated with the service desk, no changes will be made for those customers and the + * resource returns a 204 success code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Services desk administrator + */ + async removeCustomers(parameters: Parameters.RemoveCustomers, callback: Callback): Promise; + /** + * This method removes one or more customers from a service desk. The service desk must have closed access. If any of + * the passed customers are not associated with the service desk, no changes will be made for those customers and the + * resource returns a 204 success code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Services desk administrator + */ + async removeCustomers(parameters: Parameters.RemoveCustomers, callback?: never): Promise; + async removeCustomers(parameters: Parameters.RemoveCustomers, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/customer`, + method: 'DELETE', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + data: { + usernames: parameters.usernames, + accountIds: parameters.accountIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns articles which match the given query and belong to the knowledge base linked to the service desk. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the service desk. + */ + async getArticles(parameters: Parameters.GetArticles, callback: Callback): Promise; + /** + * Returns articles which match the given query and belong to the knowledge base linked to the service desk. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the service desk. + */ + async getArticles(parameters: Parameters.GetArticles, callback?: never): Promise; + async getArticles( + parameters: Parameters.GetArticles, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/knowledgebase/article`, + method: 'GET', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + params: { + query: parameters.query, + highlight: parameters.highlight, + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns the queues in a service desk. To include a customer request count for each queue (in the + * `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * service desk's Agent. + */ + async getQueues(parameters: Parameters.GetQueues, callback: Callback): Promise; + /** + * This method returns the queues in a service desk. To include a customer request count for each queue (in the + * `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * service desk's Agent. + */ + async getQueues(parameters: Parameters.GetQueues, callback?: never): Promise; + async getQueues(parameters: Parameters.GetQueues, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/queue`, + method: 'GET', + params: { + includeCount: parameters.includeCount, + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a specific queues in a service desk. To include a customer request count for the queue (in the + * `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * service desk's Agent. + */ + async getQueue(parameters: Parameters.GetQueue, callback: Callback): Promise; + /** + * This method returns a specific queues in a service desk. To include a customer request count for the queue (in the + * `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * service desk's Agent. + */ + async getQueue(parameters: Parameters.GetQueue, callback?: never): Promise; + async getQueue(parameters: Parameters.GetQueue, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/queue/${parameters.queueId}`, + method: 'GET', + params: { + includeCount: parameters.includeCount, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns the customer requests in a queue. Only fields that the queue is configured to show are + * returned. For example, if a queue is configured to show description and due date, then only those two fields are + * returned for each customer request in the queue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's agent. + */ + async getIssuesInQueue( + parameters: Parameters.GetIssuesInQueue, + callback: Callback, + ): Promise; + /** + * This method returns the customer requests in a queue. Only fields that the queue is configured to show are + * returned. For example, if a queue is configured to show description and due date, then only those two fields are + * returned for each customer request in the queue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's agent. + */ + async getIssuesInQueue(parameters: Parameters.GetIssuesInQueue, callback?: never): Promise; + async getIssuesInQueue( + parameters: Parameters.GetIssuesInQueue, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/queue/${parameters.queueId}/issue`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns all customer request types from a service desk. There are two parameters for filtering the + * returned list: + * + * - `groupId` which filters the results to items in the customer request type group. + * - `searchQuery` which is matched against request types' `name` or `description`. For example, the strings "Install", + * "Inst", "Equi", or "Equipment" will match a request type with the _name_ "Equipment Installation Request". + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the service desk. + */ + async getRequestTypes( + parameters: Parameters.GetRequestTypes, + callback: Callback, + ): Promise; + /** + * This method returns all customer request types from a service desk. There are two parameters for filtering the + * returned list: + * + * - `groupId` which filters the results to items in the customer request type group. + * - `searchQuery` which is matched against request types' `name` or `description`. For example, the strings "Install", + * "Inst", "Equi", or "Equipment" will match a request type with the _name_ "Equipment Installation Request". + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the service desk. + */ + async getRequestTypes( + parameters: Parameters.GetRequestTypes, + callback?: never, + ): Promise; + async getRequestTypes( + parameters: Parameters.GetRequestTypes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype`, + method: 'GET', + params: { + groupId: parameters.groupId, + expand: parameters.expand, + searchQuery: parameters.searchQuery, + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method enables a customer request type to be added to a service desk based on an issue type. Note that not all + * customer request type fields can be specified in the request and these fields are given the following default + * values: + * + * - Request type icon is given the headset icon. + * - Request type groups is left empty, which means this customer request type will not be visible on the [customer + * portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). + * - Request type status mapping is left empty, so the request type has no custom status mapping but inherits the status + * map from the issue type upon which it is based. + * - Request type field mapping is set to show the required fields as specified by the issue type used to create the + * customer request type. + * + * These fields can be updated by a service desk administrator using the **Request types** option in **Project + * settings**.\ + * Request Types are created in next-gen projects by creating Issue Types. Please use the Jira Cloud Platform Create + * issue type endpoint instead. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's administrator + */ + async createRequestType( + parameters: Parameters.CreateRequestType, + callback: Callback, + ): Promise; + /** + * This method enables a customer request type to be added to a service desk based on an issue type. Note that not all + * customer request type fields can be specified in the request and these fields are given the following default + * values: + * + * - Request type icon is given the headset icon. + * - Request type groups is left empty, which means this customer request type will not be visible on the [customer + * portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). + * - Request type status mapping is left empty, so the request type has no custom status mapping but inherits the status + * map from the issue type upon which it is based. + * - Request type field mapping is set to show the required fields as specified by the issue type used to create the + * customer request type. + * + * These fields can be updated by a service desk administrator using the **Request types** option in **Project + * settings**.\ + * Request Types are created in next-gen projects by creating Issue Types. Please use the Jira Cloud Platform Create + * issue type endpoint instead. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's administrator + */ + async createRequestType( + parameters: Parameters.CreateRequestType, + callback?: never, + ): Promise; + async createRequestType( + parameters: Parameters.CreateRequestType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype`, + method: 'POST', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + data: { + issueTypeId: parameters.issueTypeId, + name: parameters.name, + description: parameters.description, + helpText: parameters.helpText, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a customer request type from a service desk. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the service desk. + */ + async getRequestTypeById( + parameters: Parameters.GetRequestTypeById, + callback: Callback, + ): Promise; + /** + * This method returns a customer request type from a service desk. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the service desk. + */ + async getRequestTypeById( + parameters: Parameters.GetRequestTypeById, + callback?: never, + ): Promise; + async getRequestTypeById( + parameters: Parameters.GetRequestTypeById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method deletes a customer request type from a service desk, and removes it from all customer requests.\ + * This only supports classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator. + */ + async deleteRequestType(parameters: Parameters.DeleteRequestType, callback: Callback): Promise; + /** + * This method deletes a customer request type from a service desk, and removes it from all customer requests.\ + * This only supports classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator. + */ + async deleteRequestType(parameters: Parameters.DeleteRequestType, callback?: never): Promise; + async deleteRequestType( + parameters: Parameters.DeleteRequestType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}`, + method: 'DELETE', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns the fields for a service desk's customer request type. + * + * Also, the following information about the user's permissions for the request type is returned: + * + * - `canRaiseOnBehalfOf` returns `true` if the user has permission to raise customer requests on behalf of other + * customers. Otherwise, returns `false`. + * - `canAddRequestParticipants` returns `true` if the user can add customer request participants. Otherwise, returns + * `false`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the Service Desk. However, hidden fields would be visible to only Service desk's Administrator. + */ + async getRequestTypeFields( + parameters: Parameters.GetRequestTypeFields, + callback: Callback, + ): Promise; + /** + * This method returns the fields for a service desk's customer request type. + * + * Also, the following information about the user's permissions for the request type is returned: + * + * - `canRaiseOnBehalfOf` returns `true` if the user has permission to raise customer requests on behalf of other + * customers. Otherwise, returns `false`. + * - `canAddRequestParticipants` returns `true` if the user can add customer request participants. Otherwise, returns + * `false`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the Service Desk. However, hidden fields would be visible to only Service desk's Administrator. + */ + async getRequestTypeFields( + parameters: Parameters.GetRequestTypeFields, + callback?: never, + ): Promise; + async getRequestTypeFields( + parameters: Parameters.GetRequestTypeFields, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/field`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the keys of all properties for a request type. + * + * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore the keys of all + * properties for a request type are also available by calling the Jira Cloud Platform [Get issue type property + * keys](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-get) + * endpoint. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: The + * user must have permission to view the request type. + */ + async getPropertiesKeys( + parameters: Parameters.GetPropertiesKeys, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for a request type. + * + * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore the keys of all + * properties for a request type are also available by calling the Jira Cloud Platform [Get issue type property + * keys](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-get) + * endpoint. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: The + * user must have permission to view the request type. + */ + async getPropertiesKeys( + parameters: Parameters.GetPropertiesKeys, + callback?: never, + ): Promise; + async getPropertiesKeys( + parameters: Parameters.GetPropertiesKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/property`, + method: 'GET', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of the property from a request type. + * + * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore also available by + * calling the Jira Cloud Platform [Get issue type + * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-get) + * endpoint. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * must have permission to view the request type. + */ + async getProperty( + parameters: Parameters.GetProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of the property from a request type. + * + * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore also available by + * calling the Jira Cloud Platform [Get issue type + * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-get) + * endpoint. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * must have permission to view the request type. + */ + async getProperty(parameters: Parameters.GetProperty, callback?: never): Promise; + async getProperty( + parameters: Parameters.GetProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/property/${parameters.propertyKey}`, + method: 'GET', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a request type property. Use this resource to store custom data against a request type. + * + * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be set by + * calling the Jira Cloud Platform [Set issue type + * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-put) + * endpoint. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira + * project administrator with a Jira Service Management agent license. + */ + async setProperty(parameters: Parameters.SetProperty, callback: Callback): Promise; + /** + * Sets the value of a request type property. Use this resource to store custom data against a request type. + * + * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be set by + * calling the Jira Cloud Platform [Set issue type + * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-put) + * endpoint. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira + * project administrator with a Jira Service Management agent license. + */ + async setProperty(parameters: Parameters.SetProperty, callback?: never): Promise; + async setProperty(parameters: Parameters.SetProperty, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/property/${parameters.propertyKey}`, + method: 'PUT', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a property from a request type. + * + * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be deleted by + * calling the Jira Cloud Platform [Delete issue type + * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-delete) + * endpoint. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira + * project administrator with a Jira Service Management agent license. + */ + async deleteProperty(parameters: Parameters.DeleteProperty, callback: Callback): Promise; + /** + * Removes a property from a request type. + * + * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be deleted by + * calling the Jira Cloud Platform [Delete issue type + * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-delete) + * endpoint. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira + * project administrator with a Jira Service Management agent license. + */ + async deleteProperty(parameters: Parameters.DeleteProperty, callback?: never): Promise; + async deleteProperty(parameters: Parameters.DeleteProperty, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/property/${parameters.propertyKey}`, + method: 'DELETE', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a service desk's customer request type groups. Jira Service Management administrators can + * arrange the customer request type groups in an arbitrary order for display on the customer portal; the groups are + * returned in this order. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the service desk. + */ + async getRequestTypeGroups( + parameters: Parameters.GetRequestTypeGroups, + callback: Callback, + ): Promise; + /** + * This method returns a service desk's customer request type groups. Jira Service Management administrators can + * arrange the customer request type groups in an arbitrary order for display on the customer portal; the groups are + * returned in this order. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the service desk. + */ + async getRequestTypeGroups( + parameters: Parameters.GetRequestTypeGroups, + callback?: never, + ): Promise; + async getRequestTypeGroups( + parameters: Parameters.GetRequestTypeGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttypegroup`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/serviceDesk/serviceDesk.ts b/src/serviceDesk/serviceDesk.ts deleted file mode 100644 index ec3d824f1..000000000 --- a/src/serviceDesk/serviceDesk.ts +++ /dev/null @@ -1,802 +0,0 @@ -import { FormData } from 'formdata-node'; -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ServiceDesk { - constructor(private client: Client) {} - - /** - * This method returns all the service desks in the Jira Service Management instance that the user has permission to - * access. Use this method where you need a list of service desks or need to locate a service desk by name or - * keyword. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - */ - async getServiceDesks( - parameters: Parameters.GetServiceDesks | undefined, - callback: Callback, - ): Promise; - /** - * This method returns all the service desks in the Jira Service Management instance that the user has permission to - * access. Use this method where you need a list of service desks or need to locate a service desk by name or - * keyword. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - */ - async getServiceDesks( - parameters?: Parameters.GetServiceDesks, - callback?: never, - ): Promise; - async getServiceDesks( - parameters?: Parameters.GetServiceDesks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/servicedesk', - method: 'GET', - params: { - start: parameters?.start, - limit: parameters?.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a service desk. Use this method to get service desk details whenever your application component - * is passed a service desk ID but needs to display other service desk details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the Service Desk. For example, being the Service Desk's Administrator or one of its Agents or - * Users. - */ - async getServiceDeskById( - parameters: Parameters.GetServiceDeskById, - callback: Callback, - ): Promise; - /** - * This method returns a service desk. Use this method to get service desk details whenever your application component - * is passed a service desk ID but needs to display other service desk details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the Service Desk. For example, being the Service Desk's Administrator or one of its Agents or - * Users. - */ - async getServiceDeskById( - parameters: Parameters.GetServiceDeskById, - callback?: never, - ): Promise; - async getServiceDeskById( - parameters: Parameters.GetServiceDeskById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method adds one or more temporary attachments to a service desk, which can then be permanently attached to a - * customer request using - * [servicedeskapi/request/{issueIdOrKey}/attachment](#api-request-issueIdOrKey-attachment-post). - * - * **Note**: It is possible for a service desk administrator to turn off the ability to add attachments to a service - * desk. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to add attachments in this Service Desk. - */ - async attachTemporaryFile( - parameters: Parameters.AttachTemporaryFile, - callback: Callback, - ): Promise; - /** - * This method adds one or more temporary attachments to a service desk, which can then be permanently attached to a - * customer request using - * [servicedeskapi/request/{issueIdOrKey}/attachment](#api-request-issueIdOrKey-attachment-post). - * - * **Note**: It is possible for a service desk administrator to turn off the ability to add attachments to a service - * desk. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to add attachments in this Service Desk. - */ - async attachTemporaryFile(parameters: Parameters.AttachTemporaryFile, callback?: never): Promise; - async attachTemporaryFile( - parameters: Parameters.AttachTemporaryFile, - callback?: Callback, - ): Promise { - const formData = new FormData(); - const attachments = Array.isArray(parameters.attachment) ? parameters.attachment : [parameters.attachment]; - - attachments.forEach(attachment => formData.append('file', attachment.file, attachment.filename)); - - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/attachTemporaryFile`, - method: 'POST', - headers: { - 'X-Atlassian-Token': 'no-check', - 'Content-Type': 'multipart/form-data', - }, - data: formData, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a list of the customers on a service desk. - * - * The returned list of customers can be filtered using the `query` parameter. The parameter is matched against - * customers' `displayName`, `name`, or `email`. For example, searching for "John", "Jo", "Smi", or "Smith" will match - * a user with display name "John Smith". - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view this Service Desk's customers. - */ - async getCustomers(parameters: Parameters.GetCustomers, callback: Callback): Promise; - /** - * This method returns a list of the customers on a service desk. - * - * The returned list of customers can be filtered using the `query` parameter. The parameter is matched against - * customers' `displayName`, `name`, or `email`. For example, searching for "John", "Jo", "Smi", or "Smith" will match - * a user with display name "John Smith". - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view this Service Desk's customers. - */ - async getCustomers(parameters: Parameters.GetCustomers, callback?: never): Promise; - async getCustomers( - parameters: Parameters.GetCustomers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/customer`, - method: 'GET', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - params: { - query: parameters.query, - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds one or more customers to a service desk. If any of the passed customers are associated with the service desk, - * no changes will be made for those customers and the resource returns a 204 success code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator - */ - async addCustomers(parameters: Parameters.AddCustomers, callback: Callback): Promise; - /** - * Adds one or more customers to a service desk. If any of the passed customers are associated with the service desk, - * no changes will be made for those customers and the resource returns a 204 success code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator - */ - async addCustomers(parameters: Parameters.AddCustomers, callback?: never): Promise; - async addCustomers(parameters: Parameters.AddCustomers, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/customer`, - method: 'POST', - data: { - usernames: parameters.usernames, - accountIds: parameters.accountIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method removes one or more customers from a service desk. The service desk must have closed access. If any of - * the passed customers are not associated with the service desk, no changes will be made for those customers and the - * resource returns a 204 success code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Services desk administrator - */ - async removeCustomers(parameters: Parameters.RemoveCustomers, callback: Callback): Promise; - /** - * This method removes one or more customers from a service desk. The service desk must have closed access. If any of - * the passed customers are not associated with the service desk, no changes will be made for those customers and the - * resource returns a 204 success code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Services desk administrator - */ - async removeCustomers(parameters: Parameters.RemoveCustomers, callback?: never): Promise; - async removeCustomers(parameters: Parameters.RemoveCustomers, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/customer`, - method: 'DELETE', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - data: { - usernames: parameters.usernames, - accountIds: parameters.accountIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns articles which match the given query and belong to the knowledge base linked to the service desk. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the service desk. - */ - async getArticles(parameters: Parameters.GetArticles, callback: Callback): Promise; - /** - * Returns articles which match the given query and belong to the knowledge base linked to the service desk. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the service desk. - */ - async getArticles(parameters: Parameters.GetArticles, callback?: never): Promise; - async getArticles( - parameters: Parameters.GetArticles, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/knowledgebase/article`, - method: 'GET', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - params: { - query: parameters.query, - highlight: parameters.highlight, - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns the queues in a service desk. To include a customer request count for each queue (in the - * `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * service desk's Agent. - */ - async getQueues(parameters: Parameters.GetQueues, callback: Callback): Promise; - /** - * This method returns the queues in a service desk. To include a customer request count for each queue (in the - * `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * service desk's Agent. - */ - async getQueues(parameters: Parameters.GetQueues, callback?: never): Promise; - async getQueues(parameters: Parameters.GetQueues, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/queue`, - method: 'GET', - params: { - includeCount: parameters.includeCount, - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a specific queues in a service desk. To include a customer request count for the queue (in the - * `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * service desk's Agent. - */ - async getQueue(parameters: Parameters.GetQueue, callback: Callback): Promise; - /** - * This method returns a specific queues in a service desk. To include a customer request count for the queue (in the - * `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * service desk's Agent. - */ - async getQueue(parameters: Parameters.GetQueue, callback?: never): Promise; - async getQueue(parameters: Parameters.GetQueue, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/queue/${parameters.queueId}`, - method: 'GET', - params: { - includeCount: parameters.includeCount, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns the customer requests in a queue. Only fields that the queue is configured to show are - * returned. For example, if a queue is configured to show description and due date, then only those two fields are - * returned for each customer request in the queue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's agent. - */ - async getIssuesInQueue( - parameters: Parameters.GetIssuesInQueue, - callback: Callback, - ): Promise; - /** - * This method returns the customer requests in a queue. Only fields that the queue is configured to show are - * returned. For example, if a queue is configured to show description and due date, then only those two fields are - * returned for each customer request in the queue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's agent. - */ - async getIssuesInQueue(parameters: Parameters.GetIssuesInQueue, callback?: never): Promise; - async getIssuesInQueue( - parameters: Parameters.GetIssuesInQueue, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/queue/${parameters.queueId}/issue`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns all customer request types from a service desk. There are two parameters for filtering the - * returned list: - * - * - `groupId` which filters the results to items in the customer request type group. - * - `searchQuery` which is matched against request types' `name` or `description`. For example, the strings "Install", - * "Inst", "Equi", or "Equipment" will match a request type with the _name_ "Equipment Installation Request". - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the service desk. - */ - async getRequestTypes( - parameters: Parameters.GetRequestTypes, - callback: Callback, - ): Promise; - /** - * This method returns all customer request types from a service desk. There are two parameters for filtering the - * returned list: - * - * - `groupId` which filters the results to items in the customer request type group. - * - `searchQuery` which is matched against request types' `name` or `description`. For example, the strings "Install", - * "Inst", "Equi", or "Equipment" will match a request type with the _name_ "Equipment Installation Request". - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the service desk. - */ - async getRequestTypes( - parameters: Parameters.GetRequestTypes, - callback?: never, - ): Promise; - async getRequestTypes( - parameters: Parameters.GetRequestTypes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype`, - method: 'GET', - params: { - groupId: parameters.groupId, - expand: parameters.expand, - searchQuery: parameters.searchQuery, - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method enables a customer request type to be added to a service desk based on an issue type. Note that not all - * customer request type fields can be specified in the request and these fields are given the following default - * values: - * - * - Request type icon is given the headset icon. - * - Request type groups is left empty, which means this customer request type will not be visible on the [customer - * portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). - * - Request type status mapping is left empty, so the request type has no custom status mapping but inherits the status - * map from the issue type upon which it is based. - * - Request type field mapping is set to show the required fields as specified by the issue type used to create the - * customer request type. - * - * These fields can be updated by a service desk administrator using the **Request types** option in **Project - * settings**.\ - * Request Types are created in next-gen projects by creating Issue Types. Please use the Jira Cloud Platform Create - * issue type endpoint instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's administrator - */ - async createRequestType( - parameters: Parameters.CreateRequestType, - callback: Callback, - ): Promise; - /** - * This method enables a customer request type to be added to a service desk based on an issue type. Note that not all - * customer request type fields can be specified in the request and these fields are given the following default - * values: - * - * - Request type icon is given the headset icon. - * - Request type groups is left empty, which means this customer request type will not be visible on the [customer - * portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). - * - Request type status mapping is left empty, so the request type has no custom status mapping but inherits the status - * map from the issue type upon which it is based. - * - Request type field mapping is set to show the required fields as specified by the issue type used to create the - * customer request type. - * - * These fields can be updated by a service desk administrator using the **Request types** option in **Project - * settings**.\ - * Request Types are created in next-gen projects by creating Issue Types. Please use the Jira Cloud Platform Create - * issue type endpoint instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's administrator - */ - async createRequestType( - parameters: Parameters.CreateRequestType, - callback?: never, - ): Promise; - async createRequestType( - parameters: Parameters.CreateRequestType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype`, - method: 'POST', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - data: { - issueTypeId: parameters.issueTypeId, - name: parameters.name, - description: parameters.description, - helpText: parameters.helpText, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a customer request type from a service desk. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the service desk. - */ - async getRequestTypeById( - parameters: Parameters.GetRequestTypeById, - callback: Callback, - ): Promise; - /** - * This method returns a customer request type from a service desk. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the service desk. - */ - async getRequestTypeById( - parameters: Parameters.GetRequestTypeById, - callback?: never, - ): Promise; - async getRequestTypeById( - parameters: Parameters.GetRequestTypeById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method deletes a customer request type from a service desk, and removes it from all customer requests.\ - * This only supports classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator. - */ - async deleteRequestType(parameters: Parameters.DeleteRequestType, callback: Callback): Promise; - /** - * This method deletes a customer request type from a service desk, and removes it from all customer requests.\ - * This only supports classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator. - */ - async deleteRequestType(parameters: Parameters.DeleteRequestType, callback?: never): Promise; - async deleteRequestType( - parameters: Parameters.DeleteRequestType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}`, - method: 'DELETE', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns the fields for a service desk's customer request type. - * - * Also, the following information about the user's permissions for the request type is returned: - * - * - `canRaiseOnBehalfOf` returns `true` if the user has permission to raise customer requests on behalf of other - * customers. Otherwise, returns `false`. - * - `canAddRequestParticipants` returns `true` if the user can add customer request participants. Otherwise, returns - * `false`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the Service Desk. However, hidden fields would be visible to only Service desk's Administrator. - */ - async getRequestTypeFields( - parameters: Parameters.GetRequestTypeFields, - callback: Callback, - ): Promise; - /** - * This method returns the fields for a service desk's customer request type. - * - * Also, the following information about the user's permissions for the request type is returned: - * - * - `canRaiseOnBehalfOf` returns `true` if the user has permission to raise customer requests on behalf of other - * customers. Otherwise, returns `false`. - * - `canAddRequestParticipants` returns `true` if the user can add customer request participants. Otherwise, returns - * `false`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the Service Desk. However, hidden fields would be visible to only Service desk's Administrator. - */ - async getRequestTypeFields( - parameters: Parameters.GetRequestTypeFields, - callback?: never, - ): Promise; - async getRequestTypeFields( - parameters: Parameters.GetRequestTypeFields, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/field`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the keys of all properties for a request type. - * - * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore the keys of all - * properties for a request type are also available by calling the Jira Cloud Platform [Get issue type property - * keys](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-get) - * endpoint. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: The - * user must have permission to view the request type. - */ - async getPropertiesKeys( - parameters: Parameters.GetPropertiesKeys, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for a request type. - * - * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore the keys of all - * properties for a request type are also available by calling the Jira Cloud Platform [Get issue type property - * keys](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-get) - * endpoint. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: The - * user must have permission to view the request type. - */ - async getPropertiesKeys( - parameters: Parameters.GetPropertiesKeys, - callback?: never, - ): Promise; - async getPropertiesKeys( - parameters: Parameters.GetPropertiesKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/property`, - method: 'GET', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of the property from a request type. - * - * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore also available by - * calling the Jira Cloud Platform [Get issue type - * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-get) - * endpoint. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * must have permission to view the request type. - */ - async getProperty( - parameters: Parameters.GetProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of the property from a request type. - * - * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore also available by - * calling the Jira Cloud Platform [Get issue type - * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-get) - * endpoint. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * must have permission to view the request type. - */ - async getProperty(parameters: Parameters.GetProperty, callback?: never): Promise; - async getProperty( - parameters: Parameters.GetProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/property/${parameters.propertyKey}`, - method: 'GET', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a request type property. Use this resource to store custom data against a request type. - * - * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be set by - * calling the Jira Cloud Platform [Set issue type - * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-put) - * endpoint. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira - * project administrator with a Jira Service Management agent license. - */ - async setProperty(parameters: Parameters.SetProperty, callback: Callback): Promise; - /** - * Sets the value of a request type property. Use this resource to store custom data against a request type. - * - * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be set by - * calling the Jira Cloud Platform [Set issue type - * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-put) - * endpoint. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira - * project administrator with a Jira Service Management agent license. - */ - async setProperty(parameters: Parameters.SetProperty, callback?: never): Promise; - async setProperty(parameters: Parameters.SetProperty, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/property/${parameters.propertyKey}`, - method: 'PUT', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a property from a request type. - * - * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be deleted by - * calling the Jira Cloud Platform [Delete issue type - * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-delete) - * endpoint. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira - * project administrator with a Jira Service Management agent license. - */ - async deleteProperty(parameters: Parameters.DeleteProperty, callback: Callback): Promise; - /** - * Removes a property from a request type. - * - * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be deleted by - * calling the Jira Cloud Platform [Delete issue type - * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-delete) - * endpoint. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira - * project administrator with a Jira Service Management agent license. - */ - async deleteProperty(parameters: Parameters.DeleteProperty, callback?: never): Promise; - async deleteProperty(parameters: Parameters.DeleteProperty, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/property/${parameters.propertyKey}`, - method: 'DELETE', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a service desk's customer request type groups. Jira Service Management administrators can - * arrange the customer request type groups in an arbitrary order for display on the customer portal; the groups are - * returned in this order. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the service desk. - */ - async getRequestTypeGroups( - parameters: Parameters.GetRequestTypeGroups, - callback: Callback, - ): Promise; - /** - * This method returns a service desk's customer request type groups. Jira Service Management administrators can - * arrange the customer request type groups in an arbitrary order for display on the customer portal; the groups are - * returned in this order. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the service desk. - */ - async getRequestTypeGroups( - parameters: Parameters.GetRequestTypeGroups, - callback?: never, - ): Promise; - async getRequestTypeGroups( - parameters: Parameters.GetRequestTypeGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttypegroup`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/services/authenticationService/authentications/createBasicAuthenticationToken.mts b/src/services/authenticationService/authentications/createBasicAuthenticationToken.mts new file mode 100644 index 000000000..32e815993 --- /dev/null +++ b/src/services/authenticationService/authentications/createBasicAuthenticationToken.mts @@ -0,0 +1,19 @@ +import { Base64Encoder } from '../base64Encoder.mjs'; +import { Config } from '@/config.mjs'; + +export function createBasicAuthenticationToken(authenticationData: Config.Authentication.Basic) { + let login; + let secret; + + if ('username' in authenticationData) { + login = authenticationData.username; + secret = authenticationData.password; + } else { + login = authenticationData.email; + secret = authenticationData.apiToken; + } + + const token = Base64Encoder.encode(`${login}:${secret}`); + + return `Basic ${token}`; +} diff --git a/src/services/authenticationService/authentications/createBasicAuthenticationToken.ts b/src/services/authenticationService/authentications/createBasicAuthenticationToken.ts deleted file mode 100644 index 670c59438..000000000 --- a/src/services/authenticationService/authentications/createBasicAuthenticationToken.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Base64Encoder } from '../base64Encoder.js'; -import type { Config } from '../../../config.js'; - -export function createBasicAuthenticationToken(authenticationData: Config.Authentication.Basic) { - let login; - let secret; - - if ('username' in authenticationData) { - login = authenticationData.username; - secret = authenticationData.password; - } else { - login = authenticationData.email; - secret = authenticationData.apiToken; - } - - const token = Base64Encoder.encode(`${login}:${secret}`); - - return `Basic ${token}`; -} diff --git a/src/services/authenticationService/authentications/createOAuth2AuthenticationToken.mts b/src/services/authenticationService/authentications/createOAuth2AuthenticationToken.mts new file mode 100644 index 000000000..b8aaa46d8 --- /dev/null +++ b/src/services/authenticationService/authentications/createOAuth2AuthenticationToken.mts @@ -0,0 +1,5 @@ +import { Config } from '@/config.mjs'; + +export function createOAuth2AuthenticationToken(authenticationData: Config.Authentication.OAuth2) { + return `Bearer ${authenticationData.accessToken}`; +} diff --git a/src/services/authenticationService/authentications/createOAuth2AuthenticationToken.ts b/src/services/authenticationService/authentications/createOAuth2AuthenticationToken.ts deleted file mode 100644 index 6749bd6f3..000000000 --- a/src/services/authenticationService/authentications/createOAuth2AuthenticationToken.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Config } from '../../../config.js'; - -export function createOAuth2AuthenticationToken(authenticationData: Config.Authentication.OAuth2) { - return `Bearer ${authenticationData.accessToken}`; -} diff --git a/src/services/authenticationService/authentications/createPATAuthentication.mts b/src/services/authenticationService/authentications/createPATAuthentication.mts new file mode 100644 index 000000000..e6bdfd00f --- /dev/null +++ b/src/services/authenticationService/authentications/createPATAuthentication.mts @@ -0,0 +1,5 @@ +import { Config } from '@/config.mjs'; + +export function createPATAuthentication(pat: Config.Authentication.PersonalAccessToken) { + return `Bearer ${pat}`; +} diff --git a/src/services/authenticationService/authentications/createPATAuthentication.ts b/src/services/authenticationService/authentications/createPATAuthentication.ts deleted file mode 100644 index 69a23b920..000000000 --- a/src/services/authenticationService/authentications/createPATAuthentication.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Config } from '../../../config.js'; - -export function createPATAuthentication(pat: Config.Authentication.PersonalAccessToken) { - return `Bearer ${pat}`; -} diff --git a/src/services/authenticationService/authentications/index.mts b/src/services/authenticationService/authentications/index.mts new file mode 100644 index 000000000..509a00576 --- /dev/null +++ b/src/services/authenticationService/authentications/index.mts @@ -0,0 +1,3 @@ +export * from './createBasicAuthenticationToken.mjs'; +export * from './createOAuth2AuthenticationToken.mjs'; +export * from './createPATAuthentication.mjs'; diff --git a/src/services/authenticationService/authentications/index.ts b/src/services/authenticationService/authentications/index.ts deleted file mode 100644 index 7622a0936..000000000 --- a/src/services/authenticationService/authentications/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './createBasicAuthenticationToken.js'; -export * from './createOAuth2AuthenticationToken.js'; -export * from './createPATAuthentication.js'; diff --git a/src/services/authenticationService/base64Encoder.mts b/src/services/authenticationService/base64Encoder.mts new file mode 100644 index 000000000..c12f0a591 --- /dev/null +++ b/src/services/authenticationService/base64Encoder.mts @@ -0,0 +1,70 @@ +// todo replace to builtin solution +/* eslint-disable */ +/** @copyright The code was taken from the portal http://www.webtoolkit.info/javascript-base64.html */ + +export namespace Base64Encoder { + const base64Sequence = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + + const utf8Encode = (value: string) => { + value = value.replace(/\r\n/g, '\n'); + + let utftext = ''; + + for (let n = 0; n < value.length; n++) { + const c = value.charCodeAt(n); + + if (c < 128) { + utftext += String.fromCharCode(c); + } else if (c > 127 && c < 2048) { + utftext += String.fromCharCode((c >> 6) | 192); + + utftext += String.fromCharCode((c & 63) | 128); + } else { + utftext += String.fromCharCode((c >> 12) | 224); + + utftext += String.fromCharCode(((c >> 6) & 63) | 128); + + utftext += String.fromCharCode((c & 63) | 128); + } + } + + return utftext; + }; + + export const encode = (input: string) => { + let output = ''; + let chr1; + let chr2; + let chr3; + let enc1; + let enc2; + let enc3; + let enc4; + let i = 0; + + input = utf8Encode(input); + + while (i < input.length) { + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + + output += `${base64Sequence.charAt(enc1)}${base64Sequence.charAt(enc2)}${base64Sequence.charAt( + enc3, + )}${base64Sequence.charAt(enc4)}`; + } + + return output; + }; +} diff --git a/src/services/authenticationService/base64Encoder.ts b/src/services/authenticationService/base64Encoder.ts deleted file mode 100644 index f20d74e9b..000000000 --- a/src/services/authenticationService/base64Encoder.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* eslint-disable */ -/** @copyright The code was taken from the portal http://www.webtoolkit.info/javascript-base64.html */ - -export namespace Base64Encoder { - const base64Sequence = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - const utf8Encode = (value: string) => { - value = value.replace(/\r\n/g, '\n'); - - let utftext = ''; - - for (let n = 0; n < value.length; n++) { - const c = value.charCodeAt(n); - - if (c < 128) { - utftext += String.fromCharCode(c); - } else if (c > 127 && c < 2048) { - utftext += String.fromCharCode((c >> 6) | 192); - - utftext += String.fromCharCode((c & 63) | 128); - } else { - utftext += String.fromCharCode((c >> 12) | 224); - - utftext += String.fromCharCode(((c >> 6) & 63) | 128); - - utftext += String.fromCharCode((c & 63) | 128); - } - } - - return utftext; - }; - - export const encode = (input: string) => { - let output = ''; - let chr1; - let chr2; - let chr3; - let enc1; - let enc2; - let enc3; - let enc4; - let i = 0; - - input = utf8Encode(input); - - while (i < input.length) { - chr1 = input.charCodeAt(i++); - chr2 = input.charCodeAt(i++); - chr3 = input.charCodeAt(i++); - - enc1 = chr1 >> 2; - enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); - enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); - enc4 = chr3 & 63; - - if (isNaN(chr2)) { - enc3 = enc4 = 64; - } else if (isNaN(chr3)) { - enc4 = 64; - } - - output += `${base64Sequence.charAt(enc1)}${base64Sequence.charAt(enc2)}${base64Sequence.charAt( - enc3, - )}${base64Sequence.charAt(enc4)}`; - } - - return output; - }; -} diff --git a/src/services/authenticationService/getAuthenticationToken.mts b/src/services/authenticationService/getAuthenticationToken.mts new file mode 100644 index 000000000..92392560a --- /dev/null +++ b/src/services/authenticationService/getAuthenticationToken.mts @@ -0,0 +1,28 @@ +import { Config } from '@/config.mjs'; +import { + createBasicAuthenticationToken, + createOAuth2AuthenticationToken, + createPATAuthentication, +} from './authentications/index.mjs'; + +export async function getAuthenticationToken( + authentication: Config.Authentication | undefined, +): Promise { + if (!authentication) { + return undefined; + } + + if (authentication.basic) { + return createBasicAuthenticationToken(authentication.basic); + } + + if (authentication.oauth2) { + return createOAuth2AuthenticationToken(authentication.oauth2); + } + + if (authentication.personalAccessToken) { + return createPATAuthentication(authentication.personalAccessToken); + } + + return undefined; +} diff --git a/src/services/authenticationService/getAuthenticationToken.ts b/src/services/authenticationService/getAuthenticationToken.ts deleted file mode 100644 index 93d5aa7ee..000000000 --- a/src/services/authenticationService/getAuthenticationToken.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Config } from '../../config.js'; -import { - createBasicAuthenticationToken, - createOAuth2AuthenticationToken, - createPATAuthentication, -} from './authentications/index.js'; - -export async function getAuthenticationToken( - authentication: Config.Authentication | undefined, -): Promise { - if (!authentication) { - return undefined; - } - - if (authentication.basic) { - return createBasicAuthenticationToken(authentication.basic); - } - - if (authentication.oauth2) { - return createOAuth2AuthenticationToken(authentication.oauth2); - } - - if (authentication.personalAccessToken) { - return createPATAuthentication(authentication.personalAccessToken); - } - - return undefined; -} diff --git a/src/services/authenticationService/index.mts b/src/services/authenticationService/index.mts new file mode 100644 index 000000000..2e827214b --- /dev/null +++ b/src/services/authenticationService/index.mts @@ -0,0 +1 @@ +export * from './getAuthenticationToken.mjs'; diff --git a/src/services/authenticationService/index.ts b/src/services/authenticationService/index.ts deleted file mode 100644 index 1a88e6112..000000000 --- a/src/services/authenticationService/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './getAuthenticationToken.js'; diff --git a/src/utilityTypes.ts b/src/utilityTypes.mts similarity index 100% rename from src/utilityTypes.ts rename to src/utilityTypes.mts diff --git a/src/version2/announcementBanner.mts b/src/version2/announcementBanner.mts new file mode 100644 index 000000000..e48d49996 --- /dev/null +++ b/src/version2/announcementBanner.mts @@ -0,0 +1,61 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class AnnouncementBanner { + constructor(private client: Client) {} + + /** + * Returns the current announcement banner configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getBanner(callback: Callback): Promise; + /** + * Returns the current announcement banner configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getBanner(callback?: never): Promise; + async getBanner(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/announcementBanner', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the announcement banner configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setBanner(parameters: Parameters.SetBanner, callback: Callback): Promise; + /** + * Updates the announcement banner configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setBanner(parameters: Parameters.SetBanner, callback?: never): Promise; + async setBanner(parameters: Parameters.SetBanner, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/announcementBanner', + method: 'PUT', + data: { + isDismissible: parameters.isDismissible, + isEnabled: parameters.isEnabled, + message: parameters.message, + visibility: parameters.visibility, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/announcementBanner.ts b/src/version2/announcementBanner.ts deleted file mode 100644 index 587891614..000000000 --- a/src/version2/announcementBanner.ts +++ /dev/null @@ -1,61 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class AnnouncementBanner { - constructor(private client: Client) {} - - /** - * Returns the current announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getBanner(callback: Callback): Promise; - /** - * Returns the current announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getBanner(callback?: never): Promise; - async getBanner(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/announcementBanner', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setBanner(parameters: Parameters.SetBanner, callback: Callback): Promise; - /** - * Updates the announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setBanner(parameters: Parameters.SetBanner, callback?: never): Promise; - async setBanner(parameters: Parameters.SetBanner, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/announcementBanner', - method: 'PUT', - data: { - isDismissible: parameters.isDismissible, - isEnabled: parameters.isEnabled, - message: parameters.message, - visibility: parameters.visibility, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/appMigration.mts b/src/version2/appMigration.mts new file mode 100644 index 000000000..7b8abb238 --- /dev/null +++ b/src/version2/appMigration.mts @@ -0,0 +1,114 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class AppMigration { + constructor(private client: Client) {} + + /** + * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom + * fields can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback: Callback): Promise; + /** + * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom + * fields can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback?: never): Promise; + async updateIssueFields( + parameters: Parameters.UpdateIssueFields, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/migration/field', + method: 'PUT', + headers: { + 'Atlassian-Account-Id': parameters.accountId, + 'Atlassian-Transfer-Id': parameters.transferId, + }, + data: { + updateValueList: parameters.updateValueList, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for + * use by Connect apps during app migration. + */ + async updateEntityPropertiesValue( + parameters: Parameters.UpdateEntityPropertiesValue, + callback: Callback, + ): Promise; + /** + * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for + * use by Connect apps during app migration. + */ + async updateEntityPropertiesValue( + parameters: Parameters.UpdateEntityPropertiesValue, + callback?: never, + ): Promise; + async updateEntityPropertiesValue( + parameters: Parameters.UpdateEntityPropertiesValue, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/migration/properties/${parameters.entityType}`, + method: 'PUT', + headers: { + 'Atlassian-Account-Id': parameters.accountId, + 'Atlassian-Transfer-Id': parameters.transferId, + 'Content-Type': 'application/json', + }, + data: parameters.entities, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect + * app. + */ + async workflowRuleSearch( + parameters: Parameters.WorkflowRuleSearch, + callback: Callback, + ): Promise; + /** + * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect + * app. + */ + async workflowRuleSearch( + parameters: Parameters.WorkflowRuleSearch, + callback?: never, + ): Promise; + async workflowRuleSearch( + parameters: Parameters.WorkflowRuleSearch, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/migration/workflow/rule/search', + method: 'POST', + headers: { + 'Atlassian-Transfer-Id': parameters.transferId, + }, + data: { + expand: parameters.expand, + ruleIds: parameters.ruleIds, + workflowEntityId: parameters.workflowEntityId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/appMigration.ts b/src/version2/appMigration.ts deleted file mode 100644 index 6c31ed5ab..000000000 --- a/src/version2/appMigration.ts +++ /dev/null @@ -1,114 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class AppMigration { - constructor(private client: Client) {} - - /** - * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom - * fields can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback: Callback): Promise; - /** - * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom - * fields can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback?: never): Promise; - async updateIssueFields( - parameters: Parameters.UpdateIssueFields, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/migration/field', - method: 'PUT', - headers: { - 'Atlassian-Account-Id': parameters.accountId, - 'Atlassian-Transfer-Id': parameters.transferId, - }, - data: { - updateValueList: parameters.updateValueList, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for - * use by Connect apps during app migration. - */ - async updateEntityPropertiesValue( - parameters: Parameters.UpdateEntityPropertiesValue, - callback: Callback, - ): Promise; - /** - * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for - * use by Connect apps during app migration. - */ - async updateEntityPropertiesValue( - parameters: Parameters.UpdateEntityPropertiesValue, - callback?: never, - ): Promise; - async updateEntityPropertiesValue( - parameters: Parameters.UpdateEntityPropertiesValue, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/migration/properties/${parameters.entityType}`, - method: 'PUT', - headers: { - 'Atlassian-Account-Id': parameters.accountId, - 'Atlassian-Transfer-Id': parameters.transferId, - 'Content-Type': 'application/json', - }, - data: parameters.entities, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect - * app. - */ - async workflowRuleSearch( - parameters: Parameters.WorkflowRuleSearch, - callback: Callback, - ): Promise; - /** - * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect - * app. - */ - async workflowRuleSearch( - parameters: Parameters.WorkflowRuleSearch, - callback?: never, - ): Promise; - async workflowRuleSearch( - parameters: Parameters.WorkflowRuleSearch, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/migration/workflow/rule/search', - method: 'POST', - headers: { - 'Atlassian-Transfer-Id': parameters.transferId, - }, - data: { - expand: parameters.expand, - ruleIds: parameters.ruleIds, - workflowEntityId: parameters.workflowEntityId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/appProperties.mts b/src/version2/appProperties.mts new file mode 100644 index 000000000..fa7f9886f --- /dev/null +++ b/src/version2/appProperties.mts @@ -0,0 +1,224 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class AppProperties { + constructor(private client: Client) {} + + /** + * Gets all the properties of an app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the + * Marketplace can access properties of Connect apps they were [migrated + * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + */ + async getAddonProperties( + parameters: Parameters.GetAddonProperties | string, + callback: Callback, + ): Promise; + /** + * Gets all the properties of an app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the + * Marketplace can access properties of Connect apps they were [migrated + * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + */ + async getAddonProperties( + parameters: Parameters.GetAddonProperties | string, + callback?: never, + ): Promise; + async getAddonProperties( + parameters: Parameters.GetAddonProperties | string, + callback?: Callback, + ): Promise { + const addonKey = typeof parameters === 'string' ? parameters : parameters.addonKey; + + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/addons/${addonKey}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the key and value of an app's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the + * Marketplace can access properties of Connect apps they were [migrated + * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + */ + async getAddonProperty( + parameters: Parameters.GetAddonProperty, + callback: Callback, + ): Promise; + /** + * Returns the key and value of an app's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the + * Marketplace can access properties of Connect apps they were [migrated + * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + */ + async getAddonProperty( + parameters: Parameters.GetAddonProperty, + callback?: never, + ): Promise; + async getAddonProperty( + parameters: Parameters.GetAddonProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of an app's property. Use this resource to store custom data for your app. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. + */ + async putAddonProperty( + parameters: Parameters.PutAddonProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of an app's property. Use this resource to store custom data for your app. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. + */ + async putAddonProperty( + parameters: Parameters.PutAddonProperty, + callback?: never, + ): Promise; + async putAddonProperty( + parameters: Parameters.PutAddonProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an app's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. + */ + async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback: Callback): Promise; + /** + * Deletes an app's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. + */ + async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback?: never): Promise; + async deleteAddonProperty( + parameters: Parameters.DeleteAddonProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a Forge app's property. These values can be retrieved in [Jira + * expressions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) through the `app` [context + * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). + * + * For other use cases, use the [Storage + * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Forge apps can make this request. + */ + async putAppProperty( + parameters: Parameters.PutAppProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of a Forge app's property. These values can be retrieved in [Jira + * expressions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) through the `app` [context + * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). + * + * For other use cases, use the [Storage + * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Forge apps can make this request. + */ + async putAppProperty( + parameters: Parameters.PutAppProperty, + callback?: never, + ): Promise; + async putAppProperty( + parameters: Parameters.PutAppProperty, + callback?: Callback, + ): Promise { + // todo + const config: RequestConfig = { + url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a Forge app's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Forge apps can make this request. + */ + async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback: Callback): Promise; + /** + * Deletes a Forge app's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Forge apps can make this request. + */ + async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback?: never): Promise; + async deleteAppProperty( + parameters: Parameters.DeleteAppProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/appProperties.ts b/src/version2/appProperties.ts deleted file mode 100644 index 8d8f6a7f8..000000000 --- a/src/version2/appProperties.ts +++ /dev/null @@ -1,224 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class AppProperties { - constructor(private client: Client) {} - - /** - * Gets all the properties of an app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). - */ - async getAddonProperties( - parameters: Parameters.GetAddonProperties | string, - callback: Callback, - ): Promise; - /** - * Gets all the properties of an app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). - */ - async getAddonProperties( - parameters: Parameters.GetAddonProperties | string, - callback?: never, - ): Promise; - async getAddonProperties( - parameters: Parameters.GetAddonProperties | string, - callback?: Callback, - ): Promise { - const addonKey = typeof parameters === 'string' ? parameters : parameters.addonKey; - - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/addons/${addonKey}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the key and value of an app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). - */ - async getAddonProperty( - parameters: Parameters.GetAddonProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of an app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). - */ - async getAddonProperty( - parameters: Parameters.GetAddonProperty, - callback?: never, - ): Promise; - async getAddonProperty( - parameters: Parameters.GetAddonProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of an app's property. Use this resource to store custom data for your app. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. - */ - async putAddonProperty( - parameters: Parameters.PutAddonProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of an app's property. Use this resource to store custom data for your app. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. - */ - async putAddonProperty( - parameters: Parameters.PutAddonProperty, - callback?: never, - ): Promise; - async putAddonProperty( - parameters: Parameters.PutAddonProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. - */ - async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback: Callback): Promise; - /** - * Deletes an app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. - */ - async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback?: never): Promise; - async deleteAddonProperty( - parameters: Parameters.DeleteAddonProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a Forge app's property. These values can be retrieved in [Jira - * expressions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) through the `app` [context - * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). - * - * For other use cases, use the [Storage - * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Forge apps can make this request. - */ - async putAppProperty( - parameters: Parameters.PutAppProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of a Forge app's property. These values can be retrieved in [Jira - * expressions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) through the `app` [context - * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). - * - * For other use cases, use the [Storage - * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Forge apps can make this request. - */ - async putAppProperty( - parameters: Parameters.PutAppProperty, - callback?: never, - ): Promise; - async putAppProperty( - parameters: Parameters.PutAppProperty, - callback?: Callback, - ): Promise { - // todo - const config: RequestConfig = { - url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a Forge app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Forge apps can make this request. - */ - async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback: Callback): Promise; - /** - * Deletes a Forge app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Forge apps can make this request. - */ - async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback?: never): Promise; - async deleteAppProperty( - parameters: Parameters.DeleteAppProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/applicationRoles.mts b/src/version2/applicationRoles.mts new file mode 100644 index 000000000..468826b8c --- /dev/null +++ b/src/version2/applicationRoles.mts @@ -0,0 +1,68 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ApplicationRoles { + constructor(private client: Client) {} + + /** + * Returns all application roles. In Jira, application roles are managed using the [Application access + * configuration](https://confluence.atlassian.com/x/3YxjL) page. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllApplicationRoles(callback: Callback): Promise; + /** + * Returns all application roles. In Jira, application roles are managed using the [Application access + * configuration](https://confluence.atlassian.com/x/3YxjL) page. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllApplicationRoles(callback?: never): Promise; + async getAllApplicationRoles(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/applicationrole', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an application role. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApplicationRole( + parameters: Parameters.GetApplicationRole | string, + callback: Callback, + ): Promise; + /** + * Returns an application role. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApplicationRole( + parameters: Parameters.GetApplicationRole | string, + callback?: never, + ): Promise; + async getApplicationRole( + parameters: Parameters.GetApplicationRole | string, + callback?: Callback, + ): Promise { + const key = typeof parameters === 'string' ? parameters : parameters.key; + + const config: RequestConfig = { + url: `/rest/api/2/applicationrole/${key}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/applicationRoles.ts b/src/version2/applicationRoles.ts deleted file mode 100644 index 9635020a9..000000000 --- a/src/version2/applicationRoles.ts +++ /dev/null @@ -1,68 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ApplicationRoles { - constructor(private client: Client) {} - - /** - * Returns all application roles. In Jira, application roles are managed using the [Application access - * configuration](https://confluence.atlassian.com/x/3YxjL) page. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllApplicationRoles(callback: Callback): Promise; - /** - * Returns all application roles. In Jira, application roles are managed using the [Application access - * configuration](https://confluence.atlassian.com/x/3YxjL) page. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllApplicationRoles(callback?: never): Promise; - async getAllApplicationRoles(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/applicationrole', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an application role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationRole( - parameters: Parameters.GetApplicationRole | string, - callback: Callback, - ): Promise; - /** - * Returns an application role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationRole( - parameters: Parameters.GetApplicationRole | string, - callback?: never, - ): Promise; - async getApplicationRole( - parameters: Parameters.GetApplicationRole | string, - callback?: Callback, - ): Promise { - const key = typeof parameters === 'string' ? parameters : parameters.key; - - const config: RequestConfig = { - url: `/rest/api/2/applicationrole/${key}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/auditRecords.mts b/src/version2/auditRecords.mts new file mode 100644 index 000000000..1c0361aa2 --- /dev/null +++ b/src/version2/auditRecords.mts @@ -0,0 +1,79 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class AuditRecords { + constructor(private client: Client) {} + + /** + * Returns a list of audit records. The list can be filtered to include items: + * + * - Where each item in `filter` has at least one match in any of these fields: + * + * - `summary` + * - `category` + * - `eventSource` + * - `objectItem.name` If the object is a user, account ID is available to filter. + * - `objectItem.parentName` + * - `objectItem.typeName` + * - `changedValues.changedFrom` + * - `changedValues.changedTo` + * - `remoteAddress` + * + * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and + * `"category": "group management"` is returned. + * - Created on or after a date and time. + * - Created on or before a date and time. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAuditRecords( + parameters: Parameters.GetAuditRecords | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of audit records. The list can be filtered to include items: + * + * - Where each item in `filter` has at least one match in any of these fields: + * + * - `summary` + * - `category` + * - `eventSource` + * - `objectItem.name` If the object is a user, account ID is available to filter. + * - `objectItem.parentName` + * - `objectItem.typeName` + * - `changedValues.changedFrom` + * - `changedValues.changedTo` + * - `remoteAddress` + * + * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and + * `"category": "group management"` is returned. + * - Created on or after a date and time. + * - Created on or before a date and time. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAuditRecords(parameters?: Parameters.GetAuditRecords, callback?: never): Promise; + async getAuditRecords( + parameters?: Parameters.GetAuditRecords, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/auditing/record', + method: 'GET', + params: { + offset: parameters?.offset, + limit: parameters?.limit, + filter: parameters?.filter, + from: parameters?.from, + to: parameters?.to, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/auditRecords.ts b/src/version2/auditRecords.ts deleted file mode 100644 index 4f5f031a0..000000000 --- a/src/version2/auditRecords.ts +++ /dev/null @@ -1,79 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class AuditRecords { - constructor(private client: Client) {} - - /** - * Returns a list of audit records. The list can be filtered to include items: - * - * - Where each item in `filter` has at least one match in any of these fields: - * - * - `summary` - * - `category` - * - `eventSource` - * - `objectItem.name` If the object is a user, account ID is available to filter. - * - `objectItem.parentName` - * - `objectItem.typeName` - * - `changedValues.changedFrom` - * - `changedValues.changedTo` - * - `remoteAddress` - * - * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and - * `"category": "group management"` is returned. - * - Created on or after a date and time. - * - Created on or before a date and time. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAuditRecords( - parameters: Parameters.GetAuditRecords | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of audit records. The list can be filtered to include items: - * - * - Where each item in `filter` has at least one match in any of these fields: - * - * - `summary` - * - `category` - * - `eventSource` - * - `objectItem.name` If the object is a user, account ID is available to filter. - * - `objectItem.parentName` - * - `objectItem.typeName` - * - `changedValues.changedFrom` - * - `changedValues.changedTo` - * - `remoteAddress` - * - * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and - * `"category": "group management"` is returned. - * - Created on or after a date and time. - * - Created on or before a date and time. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAuditRecords(parameters?: Parameters.GetAuditRecords, callback?: never): Promise; - async getAuditRecords( - parameters?: Parameters.GetAuditRecords, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/auditing/record', - method: 'GET', - params: { - offset: parameters?.offset, - limit: parameters?.limit, - filter: parameters?.filter, - from: parameters?.from, - to: parameters?.to, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/avatars.mts b/src/version2/avatars.mts new file mode 100644 index 000000000..43410b7e5 --- /dev/null +++ b/src/version2/avatars.mts @@ -0,0 +1,332 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Avatars { + constructor(private client: Client) {} + + /** + * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllSystemAvatars( + parameters: Parameters.GetAllSystemAvatars | string, + callback: Callback, + ): Promise; + /** + * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllSystemAvatars( + parameters: Parameters.GetAllSystemAvatars | string, + callback?: never, + ): Promise; + async getAllSystemAvatars( + parameters: Parameters.GetAllSystemAvatars | string, + callback?: Callback, + ): Promise { + const type = typeof parameters === 'string' ? parameters : parameters.type; + + const config: RequestConfig = { + url: `/rest/api/2/avatar/${type}/system`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the system and custom avatars for a project or issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * the project the avatar belongs to. + * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for at least one project the issue type is used in. + * - For system avatars, none. + */ + async getAvatars(parameters: Parameters.GetAvatars, callback: Callback): Promise; + /** + * Returns the system and custom avatars for a project or issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * the project the avatar belongs to. + * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for at least one project the issue type is used in. + * - For system avatars, none. + */ + async getAvatars(parameters: Parameters.GetAvatars, callback?: never): Promise; + async getAvatars(parameters: Parameters.GetAvatars, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Loads a custom avatar for a project or issue type. + * + * Specify the avatar's local file location in the body of the request. Also, include the following headers: + * + * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special + * Headers](#special-request-headers). + * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * + * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of + * the image. The length of the square's sides is set to the smaller of the height or width of the image. + * + * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. + * + * After creating the avatar use: + * + * - [Update issue type](#api-rest-api-2-issuetype-id-put) to set it as the issue type's displayed avatar. + * - [Set project avatar](#api-rest-api-2-project-projectIdOrKey-avatar-put) to set it as the project's displayed + * avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async storeAvatar(parameters: Parameters.StoreAvatar, callback: Callback): Promise; + /** + * Loads a custom avatar for a project or issue type. + * + * Specify the avatar's local file location in the body of the request. Also, include the following headers: + * + * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special + * Headers](#special-request-headers). + * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * + * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of + * the image. The length of the square's sides is set to the smaller of the height or width of the image. + * + * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. + * + * After creating the avatar use: + * + * - [Update issue type](#api-rest-api-2-issuetype-id-put) to set it as the issue type's displayed avatar. + * - [Set project avatar](#api-rest-api-2-project-projectIdOrKey-avatar-put) to set it as the project's displayed + * avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async storeAvatar(parameters: Parameters.StoreAvatar, callback?: never): Promise; + async storeAvatar(parameters: Parameters.StoreAvatar, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, + method: 'POST', + params: { + x: parameters.x, + y: parameters.y, + size: parameters.size, + }, + data: parameters.avatar, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an avatar from a project or issue type. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteAvatar(parameters: Parameters.DeleteAvatar, callback: Callback): Promise; + /** + * Deletes an avatar from a project or issue type. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteAvatar(parameters: Parameters.DeleteAvatar, callback?: never): Promise; + async deleteAvatar(parameters: Parameters.DeleteAvatar, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.owningObjectId}/avatar/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the default project or issue type avatar image. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType | string, + callback: Callback, + ): Promise; + /** + * Returns the default project or issue type avatar image. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType | string, + callback?: never, + ): Promise; + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType | string, + callback?: Callback, + ): Promise { + const type = typeof parameters === 'string' ? parameters : parameters.type; + + const config: RequestConfig = { + url: `/rest/api/2/universal_avatar/view/type/${type}`, + method: 'GET', + responseType: 'arraybuffer', + params: { + size: typeof parameters !== 'string' && parameters.size, + format: typeof parameters !== 'string' && parameters.format, + }, + }; + + const { + data: avatar, + headers: { 'content-type': contentTypeWithEncoding }, + } = await this.client.sendRequestFullResponse(config); + + const contentType = contentTypeWithEncoding.split(';')[0].trim(); + + return this.client.handleSuccessResponse({ contentType, avatar }, callback); + } + + /** + * Returns a project or issue type avatar image by ID. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - For system avatars, none. + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * the project the avatar belongs to. + * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for at least one project the issue type is used in. + */ + async getAvatarImageByID( + parameters: Parameters.GetAvatarImageByID, + callback: Callback, + ): Promise; + /** + * Returns a project or issue type avatar image by ID. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - For system avatars, none. + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * the project the avatar belongs to. + * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for at least one project the issue type is used in. + */ + async getAvatarImageByID( + parameters: Parameters.GetAvatarImageByID, + callback?: never, + ): Promise; + async getAvatarImageByID( + parameters: Parameters.GetAvatarImageByID, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/universal_avatar/view/type/${parameters.type}/avatar/${parameters.id}`, + method: 'GET', + responseType: 'arraybuffer', + params: { + size: parameters.size, + format: parameters.format, + }, + }; + + const { + data: avatar, + headers: { 'content-type': contentTypeWithEncoding }, + } = await this.client.sendRequestFullResponse(config); + + const contentType = contentTypeWithEncoding.split(';')[0].trim(); + + return this.client.handleSuccessResponse({ contentType, avatar }, callback); + } + + /** + * Returns the avatar image for a project or issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - For system avatars, none. + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * the project the avatar belongs to. + * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for at least one project the issue type is used in. + */ + async getAvatarImageByOwner( + parameters: Parameters.GetAvatarImageByOwner, + callback: Callback, + ): Promise; + /** + * Returns the avatar image for a project or issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - For system avatars, none. + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * the project the avatar belongs to. + * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for at least one project the issue type is used in. + */ + async getAvatarImageByOwner( + parameters: Parameters.GetAvatarImageByOwner, + callback?: never, + ): Promise; + async getAvatarImageByOwner( + parameters: Parameters.GetAvatarImageByOwner, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/universal_avatar/view/type/${parameters.type}/owner/${parameters.entityId}`, + method: 'GET', + responseType: 'arraybuffer', + params: { + size: parameters.size, + format: parameters.format, + }, + }; + + const { + data: avatar, + headers: { 'content-type': contentTypeWithEncoding }, + } = await this.client.sendRequestFullResponse(config); + + const contentType = contentTypeWithEncoding.split(';')[0].trim(); + + return this.client.handleSuccessResponse({ contentType, avatar }, callback); + } +} diff --git a/src/version2/avatars.ts b/src/version2/avatars.ts deleted file mode 100644 index 3424d39da..000000000 --- a/src/version2/avatars.ts +++ /dev/null @@ -1,332 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Avatars { - constructor(private client: Client) {} - - /** - * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, - callback: Callback, - ): Promise; - /** - * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, - callback?: never, - ): Promise; - async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, - callback?: Callback, - ): Promise { - const type = typeof parameters === 'string' ? parameters : parameters.type; - - const config: RequestConfig = { - url: `/rest/api/2/avatar/${type}/system`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the system and custom avatars for a project or issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - * - For system avatars, none. - */ - async getAvatars(parameters: Parameters.GetAvatars, callback: Callback): Promise; - /** - * Returns the system and custom avatars for a project or issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - * - For system avatars, none. - */ - async getAvatars(parameters: Parameters.GetAvatars, callback?: never): Promise; - async getAvatars(parameters: Parameters.GetAvatars, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Loads a custom avatar for a project or issue type. - * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar use: - * - * - [Update issue type](#api-rest-api-2-issuetype-id-put) to set it as the issue type's displayed avatar. - * - [Set project avatar](#api-rest-api-2-project-projectIdOrKey-avatar-put) to set it as the project's displayed - * avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async storeAvatar(parameters: Parameters.StoreAvatar, callback: Callback): Promise; - /** - * Loads a custom avatar for a project or issue type. - * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar use: - * - * - [Update issue type](#api-rest-api-2-issuetype-id-put) to set it as the issue type's displayed avatar. - * - [Set project avatar](#api-rest-api-2-project-projectIdOrKey-avatar-put) to set it as the project's displayed - * avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async storeAvatar(parameters: Parameters.StoreAvatar, callback?: never): Promise; - async storeAvatar(parameters: Parameters.StoreAvatar, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, - method: 'POST', - params: { - x: parameters.x, - y: parameters.y, - size: parameters.size, - }, - data: parameters.avatar, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an avatar from a project or issue type. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteAvatar(parameters: Parameters.DeleteAvatar, callback: Callback): Promise; - /** - * Deletes an avatar from a project or issue type. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteAvatar(parameters: Parameters.DeleteAvatar, callback?: never): Promise; - async deleteAvatar(parameters: Parameters.DeleteAvatar, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.owningObjectId}/avatar/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the default project or issue type avatar image. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType | string, - callback: Callback, - ): Promise; - /** - * Returns the default project or issue type avatar image. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType | string, - callback?: never, - ): Promise; - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType | string, - callback?: Callback, - ): Promise { - const type = typeof parameters === 'string' ? parameters : parameters.type; - - const config: RequestConfig = { - url: `/rest/api/2/universal_avatar/view/type/${type}`, - method: 'GET', - responseType: 'arraybuffer', - params: { - size: typeof parameters !== 'string' && parameters.size, - format: typeof parameters !== 'string' && parameters.format, - }, - }; - - const { - data: avatar, - headers: { 'content-type': contentTypeWithEncoding }, - } = await this.client.sendRequestFullResponse(config); - - const contentType = contentTypeWithEncoding.split(';')[0].trim(); - - return this.client.handleSuccessResponse({ contentType, avatar }, callback); - } - - /** - * Returns a project or issue type avatar image by ID. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - */ - async getAvatarImageByID( - parameters: Parameters.GetAvatarImageByID, - callback: Callback, - ): Promise; - /** - * Returns a project or issue type avatar image by ID. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - */ - async getAvatarImageByID( - parameters: Parameters.GetAvatarImageByID, - callback?: never, - ): Promise; - async getAvatarImageByID( - parameters: Parameters.GetAvatarImageByID, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/universal_avatar/view/type/${parameters.type}/avatar/${parameters.id}`, - method: 'GET', - responseType: 'arraybuffer', - params: { - size: parameters.size, - format: parameters.format, - }, - }; - - const { - data: avatar, - headers: { 'content-type': contentTypeWithEncoding }, - } = await this.client.sendRequestFullResponse(config); - - const contentType = contentTypeWithEncoding.split(';')[0].trim(); - - return this.client.handleSuccessResponse({ contentType, avatar }, callback); - } - - /** - * Returns the avatar image for a project or issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - */ - async getAvatarImageByOwner( - parameters: Parameters.GetAvatarImageByOwner, - callback: Callback, - ): Promise; - /** - * Returns the avatar image for a project or issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - */ - async getAvatarImageByOwner( - parameters: Parameters.GetAvatarImageByOwner, - callback?: never, - ): Promise; - async getAvatarImageByOwner( - parameters: Parameters.GetAvatarImageByOwner, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/universal_avatar/view/type/${parameters.type}/owner/${parameters.entityId}`, - method: 'GET', - responseType: 'arraybuffer', - params: { - size: parameters.size, - format: parameters.format, - }, - }; - - const { - data: avatar, - headers: { 'content-type': contentTypeWithEncoding }, - } = await this.client.sendRequestFullResponse(config); - - const contentType = contentTypeWithEncoding.split(';')[0].trim(); - - return this.client.handleSuccessResponse({ contentType, avatar }, callback); - } -} diff --git a/src/version2/client/index.ts b/src/version2/client/index.ts deleted file mode 100644 index 6ac4394fd..000000000 --- a/src/version2/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './version2Client.js'; diff --git a/src/version2/client/version2Client.mts b/src/version2/client/version2Client.mts new file mode 100644 index 000000000..d6eed4b34 --- /dev/null +++ b/src/version2/client/version2Client.mts @@ -0,0 +1,174 @@ +import { BaseClient } from '@/clients/baseClient.mjs'; +import { AnnouncementBanner } from '@/version2/announcementBanner.mjs'; +import { ApplicationRoles } from '@/version2/applicationRoles.mjs'; +import { AppMigration } from '@/version2/appMigration.mjs'; +import { AppProperties } from '@/version2/appProperties.mjs'; +import { AuditRecords } from '@/version2/auditRecords.mjs'; +import { Avatars } from '@/version2/avatars.mjs'; +import { Dashboards } from '@/version2/dashboards.mjs'; +import { DynamicModules } from '@/version2/dynamicModules.mjs'; +import { Filters } from '@/version2/filters.mjs'; +import { FilterSharing } from '@/version2/filterSharing.mjs'; +import { GroupAndUserPicker } from '@/version2/groupAndUserPicker.mjs'; +import { Groups } from '@/version2/groups.mjs'; +import { IssueAttachments } from '@/version2/issueAttachments.mjs'; +import { IssueCommentProperties } from '@/version2/issueCommentProperties.mjs'; +import { IssueComments } from '@/version2/issueComments.mjs'; +import { IssueCustomFieldConfigurationApps } from '@/version2/issueCustomFieldConfigurationApps.mjs'; +import { IssueCustomFieldContexts } from '@/version2/issueCustomFieldContexts.mjs'; +import { IssueCustomFieldOptions } from '@/version2/issueCustomFieldOptions.mjs'; +import { IssueCustomFieldOptionsApps } from '@/version2/issueCustomFieldOptionsApps.mjs'; +import { IssueCustomFieldValuesApps } from '@/version2/issueCustomFieldValuesApps.mjs'; +import { IssueFieldConfigurations } from '@/version2/issueFieldConfigurations.mjs'; +import { IssueFields } from '@/version2/issueFields.mjs'; +import { IssueLinks } from '@/version2/issueLinks.mjs'; +import { IssueLinkTypes } from '@/version2/issueLinkTypes.mjs'; +import { IssueNavigatorSettings } from '@/version2/issueNavigatorSettings.mjs'; +import { IssueNotificationSchemes } from '@/version2/issueNotificationSchemes.mjs'; +import { IssuePriorities } from '@/version2/issuePriorities.mjs'; +import { IssueProperties } from '@/version2/issueProperties.mjs'; +import { IssueRemoteLinks } from '@/version2/issueRemoteLinks.mjs'; +import { IssueResolutions } from '@/version2/issueResolutions.mjs'; +import { Issues } from '@/version2/issues.mjs'; +import { IssueSearch } from '@/version2/issueSearch.mjs'; +import { IssueSecurityLevel } from '@/version2/issueSecurityLevel.mjs'; +import { IssueSecuritySchemes } from '@/version2/issueSecuritySchemes.mjs'; +import { IssueTypeProperties } from '@/version2/issueTypeProperties.mjs'; +import { IssueTypes } from '@/version2/issueTypes.mjs'; +import { IssueTypeSchemes } from '@/version2/issueTypeSchemes.mjs'; +import { IssueTypeScreenSchemes } from '@/version2/issueTypeScreenSchemes.mjs'; +import { IssueVotes } from '@/version2/issueVotes.mjs'; +import { IssueWatchers } from '@/version2/issueWatchers.mjs'; +import { IssueWorklogProperties } from '@/version2/issueWorklogProperties.mjs'; +import { IssueWorklogs } from '@/version2/issueWorklogs.mjs'; +import { JiraExpressions } from '@/version2/jiraExpressions.mjs'; +import { JiraSettings } from '@/version2/jiraSettings.mjs'; +import { JQL } from '@/version2/jql.mjs'; +import { JqlFunctionsApps } from '@/version2/jqlFunctionsApps.mjs'; +import { Labels } from '@/version2/labels.mjs'; +import { LicenseMetrics } from '@/version2/licenseMetrics.mjs'; +import { Myself } from '@/version2/myself.mjs'; +import { Permissions } from '@/version2/permissions.mjs'; +import { PermissionSchemes } from '@/version2/permissionSchemes.mjs'; +import { ProjectAvatars } from '@/version2/projectAvatars.mjs'; +import { ProjectCategories } from '@/version2/projectCategories.mjs'; +import { ProjectComponents } from '@/version2/projectComponents.mjs'; +import { ProjectEmail } from '@/version2/projectEmail.mjs'; +import { ProjectFeatures } from '@/version2/projectFeatures.mjs'; +import { ProjectKeyAndNameValidation } from '@/version2/projectKeyAndNameValidation.mjs'; +import { ProjectPermissionSchemes } from '@/version2/projectPermissionSchemes.mjs'; +import { ProjectProperties } from '@/version2/projectProperties.mjs'; +import { ProjectRoleActors } from '@/version2/projectRoleActors.mjs'; +import { ProjectRoles } from '@/version2/projectRoles.mjs'; +import { Projects } from '@/version2/projects.mjs'; +import { ProjectTypes } from '@/version2/projectTypes.mjs'; +import { ProjectVersions } from '@/version2/projectVersions.mjs'; +import { Screens } from '@/version2/screens.mjs'; +import { ScreenSchemes } from '@/version2/screenSchemes.mjs'; +import { ScreenTabFields } from '@/version2/screenTabFields.mjs'; +import { ScreenTabs } from '@/version2/screenTabs.mjs'; +import { ServerInfo } from '@/version2/serverInfo.mjs'; +import { Status } from '@/version2/status.mjs'; +import { Tasks } from '@/version2/tasks.mjs'; +import { TimeTracking } from '@/version2/timeTracking.mjs'; +import { UiModificationsApps } from '@/version2/uiModificationsApps.mjs'; +import { UserProperties } from '@/version2/userProperties.mjs'; +import { Users } from '@/version2/users.mjs'; +import { UserSearch } from '@/version2/userSearch.mjs'; +import { Webhooks } from '@/version2/webhooks.mjs'; +import { Workflows } from '@/version2/workflows.mjs'; +import { WorkflowSchemeDrafts } from '@/version2/workflowSchemeDrafts.mjs'; +import { WorkflowSchemeProjectAssociations } from '@/version2/workflowSchemeProjectAssociations.mjs'; +import { WorkflowSchemes } from '@/version2/workflowSchemes.mjs'; +import { WorkflowStatusCategories } from '@/version2/workflowStatusCategories.mjs'; +import { WorkflowStatuses } from '@/version2/workflowStatuses.mjs'; +import { WorkflowTransitionProperties } from '@/version2/workflowTransitionProperties.mjs'; +import { WorkflowTransitionRules } from '@/version2/workflowTransitionRules.mjs'; + +export class Version2Client extends BaseClient { + announcementBanner = new AnnouncementBanner(this); + applicationRoles = new ApplicationRoles(this); + appMigration = new AppMigration(this); + appProperties = new AppProperties(this); + auditRecords = new AuditRecords(this); + avatars = new Avatars(this); + dashboards = new Dashboards(this); + dynamicModules = new DynamicModules(this); + filters = new Filters(this); + filterSharing = new FilterSharing(this); + groupAndUserPicker = new GroupAndUserPicker(this); + groups = new Groups(this); + issueAttachments = new IssueAttachments(this); + issueCommentProperties = new IssueCommentProperties(this); + issueComments = new IssueComments(this); + issueCustomFieldConfigurationApps = new IssueCustomFieldConfigurationApps(this); + issueCustomFieldContexts = new IssueCustomFieldContexts(this); + issueCustomFieldOptions = new IssueCustomFieldOptions(this); + issueCustomFieldOptionsApps = new IssueCustomFieldOptionsApps(this); + issueCustomFieldValuesApps = new IssueCustomFieldValuesApps(this); + issueFieldConfigurations = new IssueFieldConfigurations(this); + issueFields = new IssueFields(this); + issueLinks = new IssueLinks(this); + issueLinkTypes = new IssueLinkTypes(this); + issueNavigatorSettings = new IssueNavigatorSettings(this); + issueNotificationSchemes = new IssueNotificationSchemes(this); + issuePriorities = new IssuePriorities(this); + issueProperties = new IssueProperties(this); + issueRemoteLinks = new IssueRemoteLinks(this); + issueResolutions = new IssueResolutions(this); + issues = new Issues(this); + issueSearch = new IssueSearch(this); + issueSecurityLevel = new IssueSecurityLevel(this); + issueSecuritySchemes = new IssueSecuritySchemes(this); + issueTypeProperties = new IssueTypeProperties(this); + issueTypes = new IssueTypes(this); + issueTypeSchemes = new IssueTypeSchemes(this); + issueTypeScreenSchemes = new IssueTypeScreenSchemes(this); + issueVotes = new IssueVotes(this); + issueWatchers = new IssueWatchers(this); + issueWorklogProperties = new IssueWorklogProperties(this); + issueWorklogs = new IssueWorklogs(this); + jiraExpressions = new JiraExpressions(this); + jiraSettings = new JiraSettings(this); + jql = new JQL(this); + jqlFunctionsApps = new JqlFunctionsApps(this); + labels = new Labels(this); + licenseMetrics = new LicenseMetrics(this); + myself = new Myself(this); + permissions = new Permissions(this); + permissionSchemes = new PermissionSchemes(this); + projectAvatars = new ProjectAvatars(this); + projectCategories = new ProjectCategories(this); + projectComponents = new ProjectComponents(this); + projectEmail = new ProjectEmail(this); + projectFeatures = new ProjectFeatures(this); + projectKeyAndNameValidation = new ProjectKeyAndNameValidation(this); + projectPermissionSchemes = new ProjectPermissionSchemes(this); + projectProperties = new ProjectProperties(this); + projectRoleActors = new ProjectRoleActors(this); + projectRoles = new ProjectRoles(this); + projects = new Projects(this); + projectTypes = new ProjectTypes(this); + projectVersions = new ProjectVersions(this); + screens = new Screens(this); + screenSchemes = new ScreenSchemes(this); + screenTabFields = new ScreenTabFields(this); + screenTabs = new ScreenTabs(this); + serverInfo = new ServerInfo(this); + status = new Status(this); + tasks = new Tasks(this); + timeTracking = new TimeTracking(this); + uiModificationsApps = new UiModificationsApps(this); + userProperties = new UserProperties(this); + users = new Users(this); + userSearch = new UserSearch(this); + webhooks = new Webhooks(this); + workflows = new Workflows(this); + workflowSchemeDrafts = new WorkflowSchemeDrafts(this); + workflowSchemeProjectAssociations = new WorkflowSchemeProjectAssociations(this); + workflowSchemes = new WorkflowSchemes(this); + workflowStatusCategories = new WorkflowStatusCategories(this); + workflowStatuses = new WorkflowStatuses(this); + workflowTransitionProperties = new WorkflowTransitionProperties(this); + workflowTransitionRules = new WorkflowTransitionRules(this); +} diff --git a/src/version2/client/version2Client.ts b/src/version2/client/version2Client.ts deleted file mode 100644 index d5ff6c82d..000000000 --- a/src/version2/client/version2Client.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { BaseClient } from '../../clients/index.js'; -import { - AnnouncementBanner, - ApplicationRoles, - AppMigration, - AppProperties, - AuditRecords, - Avatars, - Dashboards, - DynamicModules, - Filters, - FilterSharing, - GroupAndUserPicker, - Groups, - IssueAttachments, - IssueCommentProperties, - IssueComments, - IssueCustomFieldConfigurationApps, - IssueCustomFieldContexts, - IssueCustomFieldOptions, - IssueCustomFieldOptionsApps, - IssueCustomFieldValuesApps, - IssueFieldConfigurations, - IssueFields, - IssueLinks, - IssueLinkTypes, - IssueNavigatorSettings, - IssueNotificationSchemes, - IssuePriorities, - IssueProperties, - IssueRemoteLinks, - IssueResolutions, - Issues, - IssueSearch, - IssueSecurityLevel, - IssueSecuritySchemes, - IssueTypeProperties, - IssueTypes, - IssueTypeSchemes, - IssueTypeScreenSchemes, - IssueVotes, - IssueWatchers, - IssueWorklogProperties, - IssueWorklogs, - JiraExpressions, - JiraSettings, - JQL, - JqlFunctionsApps, - Labels, - LicenseMetrics, - Myself, - Permissions, - PermissionSchemes, - ProjectAvatars, - ProjectCategories, - ProjectComponents, - ProjectEmail, - ProjectFeatures, - ProjectKeyAndNameValidation, - ProjectPermissionSchemes, - ProjectProperties, - ProjectRoleActors, - ProjectRoles, - Projects, - ProjectTypes, - ProjectVersions, - Screens, - ScreenSchemes, - ScreenTabFields, - ScreenTabs, - ServerInfo, - Status, - Tasks, - TimeTracking, - UIModificationsApps, - UserProperties, - Users, - UserSearch, - Webhooks, - Workflows, - WorkflowSchemeDrafts, - WorkflowSchemeProjectAssociations, - WorkflowSchemes, - WorkflowStatusCategories, - WorkflowStatuses, - WorkflowTransitionProperties, - WorkflowTransitionRules, -} from '../index.js'; - -export class Version2Client extends BaseClient { - announcementBanner = new AnnouncementBanner(this); - applicationRoles = new ApplicationRoles(this); - appMigration = new AppMigration(this); - appProperties = new AppProperties(this); - auditRecords = new AuditRecords(this); - avatars = new Avatars(this); - dashboards = new Dashboards(this); - dynamicModules = new DynamicModules(this); - filters = new Filters(this); - filterSharing = new FilterSharing(this); - groupAndUserPicker = new GroupAndUserPicker(this); - groups = new Groups(this); - issueAttachments = new IssueAttachments(this); - issueCommentProperties = new IssueCommentProperties(this); - issueComments = new IssueComments(this); - issueCustomFieldConfigurationApps = new IssueCustomFieldConfigurationApps(this); - issueCustomFieldContexts = new IssueCustomFieldContexts(this); - issueCustomFieldOptions = new IssueCustomFieldOptions(this); - issueCustomFieldOptionsApps = new IssueCustomFieldOptionsApps(this); - issueCustomFieldValuesApps = new IssueCustomFieldValuesApps(this); - issueFieldConfigurations = new IssueFieldConfigurations(this); - issueFields = new IssueFields(this); - issueLinks = new IssueLinks(this); - issueLinkTypes = new IssueLinkTypes(this); - issueNavigatorSettings = new IssueNavigatorSettings(this); - issueNotificationSchemes = new IssueNotificationSchemes(this); - issuePriorities = new IssuePriorities(this); - issueProperties = new IssueProperties(this); - issueRemoteLinks = new IssueRemoteLinks(this); - issueResolutions = new IssueResolutions(this); - issues = new Issues(this); - issueSearch = new IssueSearch(this); - issueSecurityLevel = new IssueSecurityLevel(this); - issueSecuritySchemes = new IssueSecuritySchemes(this); - issueTypeProperties = new IssueTypeProperties(this); - issueTypes = new IssueTypes(this); - issueTypeSchemes = new IssueTypeSchemes(this); - issueTypeScreenSchemes = new IssueTypeScreenSchemes(this); - issueVotes = new IssueVotes(this); - issueWatchers = new IssueWatchers(this); - issueWorklogProperties = new IssueWorklogProperties(this); - issueWorklogs = new IssueWorklogs(this); - jiraExpressions = new JiraExpressions(this); - jiraSettings = new JiraSettings(this); - jql = new JQL(this); - jqlFunctionsApps = new JqlFunctionsApps(this); - labels = new Labels(this); - licenseMetrics = new LicenseMetrics(this); - myself = new Myself(this); - permissions = new Permissions(this); - permissionSchemes = new PermissionSchemes(this); - projectAvatars = new ProjectAvatars(this); - projectCategories = new ProjectCategories(this); - projectComponents = new ProjectComponents(this); - projectEmail = new ProjectEmail(this); - projectFeatures = new ProjectFeatures(this); - projectKeyAndNameValidation = new ProjectKeyAndNameValidation(this); - projectPermissionSchemes = new ProjectPermissionSchemes(this); - projectProperties = new ProjectProperties(this); - projectRoleActors = new ProjectRoleActors(this); - projectRoles = new ProjectRoles(this); - projects = new Projects(this); - projectTypes = new ProjectTypes(this); - projectVersions = new ProjectVersions(this); - screens = new Screens(this); - screenSchemes = new ScreenSchemes(this); - screenTabFields = new ScreenTabFields(this); - screenTabs = new ScreenTabs(this); - serverInfo = new ServerInfo(this); - status = new Status(this); - tasks = new Tasks(this); - timeTracking = new TimeTracking(this); - uiModificationsApps = new UIModificationsApps(this); - userProperties = new UserProperties(this); - users = new Users(this); - userSearch = new UserSearch(this); - webhooks = new Webhooks(this); - workflows = new Workflows(this); - workflowSchemeDrafts = new WorkflowSchemeDrafts(this); - workflowSchemeProjectAssociations = new WorkflowSchemeProjectAssociations(this); - workflowSchemes = new WorkflowSchemes(this); - workflowStatusCategories = new WorkflowStatusCategories(this); - workflowStatuses = new WorkflowStatuses(this); - workflowTransitionProperties = new WorkflowTransitionProperties(this); - workflowTransitionRules = new WorkflowTransitionRules(this); -} diff --git a/src/version2/dashboards.mts b/src/version2/dashboards.mts new file mode 100644 index 000000000..118e6a3d8 --- /dev/null +++ b/src/version2/dashboards.mts @@ -0,0 +1,727 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { paramSerializer } from '../paramSerializer.mjs'; +import { RequestConfig } from '../requestConfig.mjs'; + +export class Dashboards { + constructor(private client: Client) {} + + /** + * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or + * owned dashboards. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllDashboards( + parameters: Parameters.GetAllDashboards | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or + * owned dashboards. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllDashboards( + parameters?: Parameters.GetAllDashboards, + callback?: never, + ): Promise; + async getAllDashboards( + parameters?: Parameters.GetAllDashboards, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/dashboard', + method: 'GET', + params: { + filter: parameters?.filter, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async createDashboard( + parameters: Parameters.CreateDashboard, + callback: Callback, + ): Promise; + /** + * Creates a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async createDashboard(parameters: Parameters.CreateDashboard, callback?: never): Promise; + async createDashboard( + parameters: Parameters.CreateDashboard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/dashboard', + method: 'POST', + data: { + description: parameters.description, + editPermissions: parameters.editPermissions, + name: parameters.name, + sharePermissions: parameters.sharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * + * The dashboards to be updated must be owned by the user, or the user must be an administrator. + */ + async bulkEditDashboards( + parameters: Parameters.BulkEditDashboards, + callback: Callback, + ): Promise; + /** + * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * + * The dashboards to be updated must be owned by the user, or the user must be an administrator. + */ + async bulkEditDashboards( + parameters: Parameters.BulkEditDashboards, + callback?: never, + ): Promise; + async bulkEditDashboards( + parameters: Parameters.BulkEditDashboards, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/dashboard/bulk/edit', + method: 'PUT', + data: { + action: parameters.action, + changeOwnerDetails: parameters.changeOwnerDetails, + entityIds: parameters.entityIds, + extendAdminPermissions: parameters.extendAdminPermissions, + permissionDetails: parameters.permissionDetails, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets a list of all available gadgets that can be added to all dashboards. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllAvailableDashboardGadgets( + callback: Callback, + ): Promise; + /** + * Gets a list of all available gadgets that can be added to all dashboards. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllAvailableDashboardGadgets(callback?: never): Promise; + async getAllAvailableDashboardGadgets( + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/dashboard/gadgets', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * dashboards. This operation is similar to [Get dashboards](#api-rest-api-2-dashboard-get) except that the results + * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. + * When multiple attributes are specified only filters matching all attributes are returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * following dashboards that match the query parameters are returned: + * + * - Dashboards owned by the user. Not returned for anonymous users. + * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. + * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. + * - Dashboards shared with a public project. + * - Dashboards shared with the public. + */ + async getDashboardsPaginated( + parameters: Parameters.GetDashboardsPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * dashboards. This operation is similar to [Get dashboards](#api-rest-api-2-dashboard-get) except that the results + * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. + * When multiple attributes are specified only filters matching all attributes are returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * following dashboards that match the query parameters are returned: + * + * - Dashboards owned by the user. Not returned for anonymous users. + * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. + * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. + * - Dashboards shared with a public project. + * - Dashboards shared with the public. + */ + async getDashboardsPaginated( + parameters?: Parameters.GetDashboardsPaginated, + callback?: never, + ): Promise; + async getDashboardsPaginated( + parameters?: Parameters.GetDashboardsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/dashboard/search', + method: 'GET', + params: { + dashboardName: parameters?.dashboardName, + accountId: parameters?.accountId, + groupname: parameters?.groupname, + groupId: parameters?.groupId, + projectId: parameters?.projectId, + orderBy: parameters?.orderBy, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + status: parameters?.status, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of dashboard gadgets on a dashboard. + * + * This operation returns: + * + * - Gadgets from a list of IDs, when `id` is set. + * - Gadgets with a module key, when `moduleKey` is set. + * - Gadgets from a list of URIs, when `uri` is set. + * - All gadgets, when no other parameters are set. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllGadgets( + parameters: Parameters.GetAllGadgets, + callback: Callback, + ): Promise; + /** + * Returns a list of dashboard gadgets on a dashboard. + * + * This operation returns: + * + * - Gadgets from a list of IDs, when `id` is set. + * - Gadgets with a module key, when `moduleKey` is set. + * - Gadgets from a list of URIs, when `uri` is set. + * - All gadgets, when no other parameters are set. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllGadgets( + parameters: Parameters.GetAllGadgets, + callback?: never, + ): Promise; + async getAllGadgets( + parameters: Parameters.GetAllGadgets, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget`, + method: 'GET', + params: { + moduleKey: paramSerializer('moduleKey', parameters.moduleKey), + uri: parameters.uri, + gadgetId: paramSerializer('gadgetId', parameters.gadgetId), + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a gadget to a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async addGadget(parameters: Parameters.AddGadget, callback: Callback): Promise; + /** + * Adds a gadget to a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async addGadget(parameters: Parameters.AddGadget, callback?: never): Promise; + async addGadget( + parameters: Parameters.AddGadget, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget`, + method: 'POST', + data: { + color: parameters.color, + ignoreUriAndModuleKeyValidation: parameters.ignoreUriAndModuleKeyValidation, + moduleKey: parameters.moduleKey, + position: parameters.position, + title: parameters.title, + uri: parameters.uri, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the title, position, and color of the gadget on a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async updateGadget(parameters: Parameters.UpdateGadget, callback: Callback): Promise; + /** + * Changes the title, position, and color of the gadget on a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async updateGadget(parameters: Parameters.UpdateGadget, callback?: never): Promise; + async updateGadget(parameters: Parameters.UpdateGadget, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, + method: 'PUT', + data: { + color: parameters.color, + position: parameters.position, + title: parameters.title, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a dashboard gadget from a dashboard. + * + * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied + * position. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async removeGadget(parameters: Parameters.RemoveGadget, callback: Callback): Promise; + /** + * Removes a dashboard gadget from a dashboard. + * + * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied + * position. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async removeGadget(parameters: Parameters.RemoveGadget, callback?: never): Promise; + async removeGadget(parameters: Parameters.RemoveGadget, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the keys of all properties for a dashboard item. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when + * Jira’s anonymous access is permitted. + */ + async getDashboardItemPropertyKeys( + parameters: Parameters.GetDashboardItemPropertyKeys, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for a dashboard item. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when + * Jira’s anonymous access is permitted. + */ + async getDashboardItemPropertyKeys( + parameters: Parameters.GetDashboardItemPropertyKeys, + callback?: never, + ): Promise; + async getDashboardItemPropertyKeys( + parameters: Parameters.GetDashboardItemPropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the key and value of a dashboard item property. + * + * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding + * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * + * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * + * There is no resource to set or get dashboard items. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when + * Jira’s anonymous access is permitted. + */ + async getDashboardItemProperty( + parameters: Parameters.GetDashboardItemProperty, + callback: Callback, + ): Promise; + /** + * Returns the key and value of a dashboard item property. + * + * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding + * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * + * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * + * There is no resource to set or get dashboard items. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when + * Jira’s anonymous access is permitted. + */ + async getDashboardItemProperty( + parameters: Parameters.GetDashboardItemProperty, + callback?: never, + ): Promise; + async getDashboardItemProperty( + parameters: Parameters.GetDashboardItemProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard + * item. + * + * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding + * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * + * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * + * There is no resource to set or get dashboard items. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async setDashboardItemProperty( + parameters: Parameters.SetDashboardItemProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard + * item. + * + * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding + * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * + * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * + * There is no resource to set or get dashboard items. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async setDashboardItemProperty( + parameters: Parameters.SetDashboardItemProperty, + callback?: never, + ): Promise; + async setDashboardItemProperty( + parameters: Parameters.SetDashboardItemProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a dashboard item property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async deleteDashboardItemProperty( + parameters: Parameters.DeleteDashboardItemProperty, + callback: Callback, + ): Promise; + /** + * Deletes a dashboard item property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async deleteDashboardItemProperty( + parameters: Parameters.DeleteDashboardItemProperty, + callback?: never, + ): Promise; + async deleteDashboardItemProperty( + parameters: Parameters.DeleteDashboardItemProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a dashboard. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * + * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with + * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the + * System dashboard. The System dashboard is considered to be shared with all other users. + */ + async getDashboard( + parameters: Parameters.GetDashboard | string, + callback: Callback, + ): Promise; + /** + * Returns a dashboard. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * + * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with + * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the + * System dashboard. The System dashboard is considered to be shared with all other users. + */ + async getDashboard(parameters: Parameters.GetDashboard | string, callback?: never): Promise; + async getDashboard( + parameters: Parameters.GetDashboard | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a dashboard, replacing all the dashboard details with those provided. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * + * The dashboard to be updated must be owned by the user. + */ + async updateDashboard( + parameters: Parameters.UpdateDashboard, + callback: Callback, + ): Promise; + /** + * Updates a dashboard, replacing all the dashboard details with those provided. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * + * The dashboard to be updated must be owned by the user. + */ + async updateDashboard(parameters: Parameters.UpdateDashboard, callback?: never): Promise; + async updateDashboard( + parameters: Parameters.UpdateDashboard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.id}`, + method: 'PUT', + data: { + description: parameters.description, + editPermissions: parameters.editPermissions, + name: parameters.name, + sharePermissions: parameters.sharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * + * The dashboard to be deleted must be owned by the user. + */ + async deleteDashboard( + parameters: Parameters.DeleteDashboard | string, + callback: Callback, + ): Promise; + /** + * Deletes a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * + * The dashboard to be deleted must be owned by the user. + */ + async deleteDashboard(parameters: Parameters.DeleteDashboard | string, callback?: never): Promise; + async deleteDashboard( + parameters: Parameters.DeleteDashboard | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * + * The dashboard to be copied must be owned by or shared with the user. + */ + async copyDashboard(parameters: Parameters.CopyDashboard, callback: Callback): Promise; + /** + * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * + * The dashboard to be copied must be owned by or shared with the user. + */ + async copyDashboard(parameters: Parameters.CopyDashboard, callback?: never): Promise; + async copyDashboard( + parameters: Parameters.CopyDashboard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.id}/copy`, + method: 'POST', + data: { + description: parameters.description, + editPermissions: parameters.editPermissions, + name: parameters.name, + sharePermissions: parameters.sharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/dashboards.ts b/src/version2/dashboards.ts deleted file mode 100644 index 695a360e8..000000000 --- a/src/version2/dashboards.ts +++ /dev/null @@ -1,727 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import { paramSerializer } from '../paramSerializer.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Dashboards { - constructor(private client: Client) {} - - /** - * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or - * owned dashboards. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllDashboards( - parameters: Parameters.GetAllDashboards | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or - * owned dashboards. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllDashboards( - parameters?: Parameters.GetAllDashboards, - callback?: never, - ): Promise; - async getAllDashboards( - parameters?: Parameters.GetAllDashboards, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/dashboard', - method: 'GET', - params: { - filter: parameters?.filter, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async createDashboard( - parameters: Parameters.CreateDashboard, - callback: Callback, - ): Promise; - /** - * Creates a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async createDashboard(parameters: Parameters.CreateDashboard, callback?: never): Promise; - async createDashboard( - parameters: Parameters.CreateDashboard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/dashboard', - method: 'POST', - data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - name: parameters.name, - sharePermissions: parameters.sharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboards to be updated must be owned by the user, or the user must be an administrator. - */ - async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, - callback: Callback, - ): Promise; - /** - * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboards to be updated must be owned by the user, or the user must be an administrator. - */ - async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, - callback?: never, - ): Promise; - async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/dashboard/bulk/edit', - method: 'PUT', - data: { - action: parameters.action, - changeOwnerDetails: parameters.changeOwnerDetails, - entityIds: parameters.entityIds, - extendAdminPermissions: parameters.extendAdminPermissions, - permissionDetails: parameters.permissionDetails, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets a list of all available gadgets that can be added to all dashboards. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllAvailableDashboardGadgets( - callback: Callback, - ): Promise; - /** - * Gets a list of all available gadgets that can be added to all dashboards. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllAvailableDashboardGadgets(callback?: never): Promise; - async getAllAvailableDashboardGadgets( - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/dashboard/gadgets', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * dashboards. This operation is similar to [Get dashboards](#api-rest-api-2-dashboard-get) except that the results - * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. - * When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * following dashboards that match the query parameters are returned: - * - * - Dashboards owned by the user. Not returned for anonymous users. - * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. - * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. - * - Dashboards shared with a public project. - * - Dashboards shared with the public. - */ - async getDashboardsPaginated( - parameters: Parameters.GetDashboardsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * dashboards. This operation is similar to [Get dashboards](#api-rest-api-2-dashboard-get) except that the results - * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. - * When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * following dashboards that match the query parameters are returned: - * - * - Dashboards owned by the user. Not returned for anonymous users. - * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. - * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. - * - Dashboards shared with a public project. - * - Dashboards shared with the public. - */ - async getDashboardsPaginated( - parameters?: Parameters.GetDashboardsPaginated, - callback?: never, - ): Promise; - async getDashboardsPaginated( - parameters?: Parameters.GetDashboardsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/dashboard/search', - method: 'GET', - params: { - dashboardName: parameters?.dashboardName, - accountId: parameters?.accountId, - groupname: parameters?.groupname, - groupId: parameters?.groupId, - projectId: parameters?.projectId, - orderBy: parameters?.orderBy, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - status: parameters?.status, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of dashboard gadgets on a dashboard. - * - * This operation returns: - * - * - Gadgets from a list of IDs, when `id` is set. - * - Gadgets with a module key, when `moduleKey` is set. - * - Gadgets from a list of URIs, when `uri` is set. - * - All gadgets, when no other parameters are set. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllGadgets( - parameters: Parameters.GetAllGadgets, - callback: Callback, - ): Promise; - /** - * Returns a list of dashboard gadgets on a dashboard. - * - * This operation returns: - * - * - Gadgets from a list of IDs, when `id` is set. - * - Gadgets with a module key, when `moduleKey` is set. - * - Gadgets from a list of URIs, when `uri` is set. - * - All gadgets, when no other parameters are set. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllGadgets( - parameters: Parameters.GetAllGadgets, - callback?: never, - ): Promise; - async getAllGadgets( - parameters: Parameters.GetAllGadgets, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget`, - method: 'GET', - params: { - moduleKey: paramSerializer('moduleKey', parameters.moduleKey), - uri: parameters.uri, - gadgetId: paramSerializer('gadgetId', parameters.gadgetId), - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a gadget to a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async addGadget(parameters: Parameters.AddGadget, callback: Callback): Promise; - /** - * Adds a gadget to a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async addGadget(parameters: Parameters.AddGadget, callback?: never): Promise; - async addGadget( - parameters: Parameters.AddGadget, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget`, - method: 'POST', - data: { - color: parameters.color, - ignoreUriAndModuleKeyValidation: parameters.ignoreUriAndModuleKeyValidation, - moduleKey: parameters.moduleKey, - position: parameters.position, - title: parameters.title, - uri: parameters.uri, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the title, position, and color of the gadget on a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async updateGadget(parameters: Parameters.UpdateGadget, callback: Callback): Promise; - /** - * Changes the title, position, and color of the gadget on a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async updateGadget(parameters: Parameters.UpdateGadget, callback?: never): Promise; - async updateGadget(parameters: Parameters.UpdateGadget, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, - method: 'PUT', - data: { - color: parameters.color, - position: parameters.position, - title: parameters.title, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a dashboard gadget from a dashboard. - * - * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied - * position. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async removeGadget(parameters: Parameters.RemoveGadget, callback: Callback): Promise; - /** - * Removes a dashboard gadget from a dashboard. - * - * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied - * position. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async removeGadget(parameters: Parameters.RemoveGadget, callback?: never): Promise; - async removeGadget(parameters: Parameters.RemoveGadget, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the keys of all properties for a dashboard item. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemPropertyKeys( - parameters: Parameters.GetDashboardItemPropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for a dashboard item. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemPropertyKeys( - parameters: Parameters.GetDashboardItemPropertyKeys, - callback?: never, - ): Promise; - async getDashboardItemPropertyKeys( - parameters: Parameters.GetDashboardItemPropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the key and value of a dashboard item property. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemProperty( - parameters: Parameters.GetDashboardItemProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of a dashboard item property. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemProperty( - parameters: Parameters.GetDashboardItemProperty, - callback?: never, - ): Promise; - async getDashboardItemProperty( - parameters: Parameters.GetDashboardItemProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard - * item. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async setDashboardItemProperty( - parameters: Parameters.SetDashboardItemProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard - * item. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async setDashboardItemProperty( - parameters: Parameters.SetDashboardItemProperty, - callback?: never, - ): Promise; - async setDashboardItemProperty( - parameters: Parameters.SetDashboardItemProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, - method: 'PUT', - headers: { - 'Content-Type': 'application/json', - }, - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a dashboard item property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async deleteDashboardItemProperty( - parameters: Parameters.DeleteDashboardItemProperty, - callback: Callback, - ): Promise; - /** - * Deletes a dashboard item property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async deleteDashboardItemProperty( - parameters: Parameters.DeleteDashboardItemProperty, - callback?: never, - ): Promise; - async deleteDashboardItemProperty( - parameters: Parameters.DeleteDashboardItemProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a dashboard. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - * - * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with - * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the - * System dashboard. The System dashboard is considered to be shared with all other users. - */ - async getDashboard( - parameters: Parameters.GetDashboard | string, - callback: Callback, - ): Promise; - /** - * Returns a dashboard. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - * - * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with - * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the - * System dashboard. The System dashboard is considered to be shared with all other users. - */ - async getDashboard(parameters: Parameters.GetDashboard | string, callback?: never): Promise; - async getDashboard( - parameters: Parameters.GetDashboard | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a dashboard, replacing all the dashboard details with those provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboard to be updated must be owned by the user. - */ - async updateDashboard( - parameters: Parameters.UpdateDashboard, - callback: Callback, - ): Promise; - /** - * Updates a dashboard, replacing all the dashboard details with those provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboard to be updated must be owned by the user. - */ - async updateDashboard(parameters: Parameters.UpdateDashboard, callback?: never): Promise; - async updateDashboard( - parameters: Parameters.UpdateDashboard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.id}`, - method: 'PUT', - data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - name: parameters.name, - sharePermissions: parameters.sharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboard to be deleted must be owned by the user. - */ - async deleteDashboard( - parameters: Parameters.DeleteDashboard | string, - callback: Callback, - ): Promise; - /** - * Deletes a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboard to be deleted must be owned by the user. - */ - async deleteDashboard(parameters: Parameters.DeleteDashboard | string, callback?: never): Promise; - async deleteDashboard( - parameters: Parameters.DeleteDashboard | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboard to be copied must be owned by or shared with the user. - */ - async copyDashboard(parameters: Parameters.CopyDashboard, callback: Callback): Promise; - /** - * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboard to be copied must be owned by or shared with the user. - */ - async copyDashboard(parameters: Parameters.CopyDashboard, callback?: never): Promise; - async copyDashboard( - parameters: Parameters.CopyDashboard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.id}/copy`, - method: 'POST', - data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - name: parameters.name, - sharePermissions: parameters.sharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/dynamicModules.mts b/src/version2/dynamicModules.mts new file mode 100644 index 000000000..905ceb577 --- /dev/null +++ b/src/version2/dynamicModules.mts @@ -0,0 +1,90 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class DynamicModules { + constructor(private client: Client) {} + + /** + * Returns all modules registered dynamically by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async getModules(callback: Callback): Promise; + /** + * Returns all modules registered dynamically by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async getModules(callback?: never): Promise; + async getModules(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/app/module/dynamic', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Registers a list of modules. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async registerModules( + parameters: Parameters.RegisterModules | undefined, + callback: Callback, + ): Promise; + /** + * Registers a list of modules. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async registerModules(parameters?: Parameters.RegisterModules, callback?: never): Promise; + async registerModules( + parameters?: Parameters.RegisterModules, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/app/module/dynamic', + method: 'POST', + data: { + modules: parameters?.modules, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Remove all or a list of modules registered by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async removeModules(parameters: Parameters.RemoveModules | undefined, callback: Callback): Promise; + /** + * Remove all or a list of modules registered by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async removeModules(parameters?: Parameters.RemoveModules, callback?: never): Promise; + async removeModules(parameters?: Parameters.RemoveModules, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/app/module/dynamic', + method: 'DELETE', + params: { + moduleKey: parameters?.moduleKey, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/dynamicModules.ts b/src/version2/dynamicModules.ts deleted file mode 100644 index cd44b4361..000000000 --- a/src/version2/dynamicModules.ts +++ /dev/null @@ -1,90 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class DynamicModules { - constructor(private client: Client) {} - - /** - * Returns all modules registered dynamically by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async getModules(callback: Callback): Promise; - /** - * Returns all modules registered dynamically by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async getModules(callback?: never): Promise; - async getModules(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/app/module/dynamic', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Registers a list of modules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async registerModules( - parameters: Parameters.RegisterModules | undefined, - callback: Callback, - ): Promise; - /** - * Registers a list of modules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async registerModules(parameters?: Parameters.RegisterModules, callback?: never): Promise; - async registerModules( - parameters?: Parameters.RegisterModules, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/app/module/dynamic', - method: 'POST', - data: { - modules: parameters?.modules, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Remove all or a list of modules registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async removeModules(parameters: Parameters.RemoveModules | undefined, callback: Callback): Promise; - /** - * Remove all or a list of modules registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async removeModules(parameters?: Parameters.RemoveModules, callback?: never): Promise; - async removeModules(parameters?: Parameters.RemoveModules, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/app/module/dynamic', - method: 'DELETE', - params: { - moduleKey: parameters?.moduleKey, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/filterSharing.mts b/src/version2/filterSharing.mts new file mode 100644 index 000000000..a8b3c58f0 --- /dev/null +++ b/src/version2/filterSharing.mts @@ -0,0 +1,255 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class FilterSharing { + constructor(private client: Client) {} + + /** + * Returns the default sharing settings for new filters and dashboards for a user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getDefaultShareScope(callback: Callback): Promise; + /** + * Returns the default sharing settings for new filters and dashboards for a user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getDefaultShareScope(callback?: never): Promise; + async getDefaultShareScope(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/filter/defaultShareScope', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default sharing for new filters and dashboards for a user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async setDefaultShareScope( + parameters: Parameters.SetDefaultShareScope | string, + callback: Callback, + ): Promise; + /** + * Sets the default sharing for new filters and dashboards for a user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async setDefaultShareScope( + parameters: Parameters.SetDefaultShareScope | string, + callback?: never, + ): Promise; + async setDefaultShareScope( + parameters: Parameters.SetDefaultShareScope | string, + callback?: Callback, + ): Promise { + const scope = typeof parameters === 'string' ? parameters : parameters.scope; + + const config: RequestConfig = { + url: '/rest/api/2/filter/defaultShareScope', + method: 'PUT', + data: { + scope, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or + * the public. Sharing with all logged-in users or the public is known as a global share permission. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, share permissions are only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getSharePermissions( + parameters: Parameters.GetSharePermissions | string, + callback: Callback, + ): Promise; + /** + * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or + * the public. Sharing with all logged-in users or the public is known as a global share permission. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, share permissions are only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getSharePermissions( + parameters: Parameters.GetSharePermissions | string, + callback?: never, + ): Promise; + async getSharePermissions( + parameters: Parameters.GetSharePermissions | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/filter/${id}/permission`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the + * public) it will overwrite all share permissions for the filter. + * + * Be aware that this operation uses different objects for updating share permissions compared to [Update + * filter](#api-rest-api-2-filter-id-put). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Share + * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the + * filter. + */ + async addSharePermission( + parameters: Parameters.AddSharePermission, + callback: Callback, + ): Promise; + /** + * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the + * public) it will overwrite all share permissions for the filter. + * + * Be aware that this operation uses different objects for updating share permissions compared to [Update + * filter](#api-rest-api-2-filter-id-put). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Share + * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the + * filter. + */ + async addSharePermission( + parameters: Parameters.AddSharePermission, + callback?: never, + ): Promise; + async addSharePermission( + parameters: Parameters.AddSharePermission, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/filter/${parameters.id}/permission`, + method: 'POST', + data: { + type: parameters.type, + projectId: parameters.projectId, + groupname: parameters.groupname, + projectRoleId: parameters.projectRoleId, + accountId: parameters.accountId, + rights: parameters.rights, + groupId: parameters.groupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the + * public. Sharing with all logged-in users or the public is known as a global share permission. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, a share permission is only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getSharePermission( + parameters: Parameters.GetSharePermission, + callback: Callback, + ): Promise; + /** + * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the + * public. Sharing with all logged-in users or the public is known as a global share permission. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, a share permission is only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getSharePermission( + parameters: Parameters.GetSharePermission, + callback?: never, + ): Promise; + async getSharePermission( + parameters: Parameters.GetSharePermission, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/filter/${parameters.id}/permission/${parameters.permissionId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a share permission from a filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira and the user must own the filter. + */ + async deleteSharePermission( + parameters: Parameters.DeleteSharePermission, + callback: Callback, + ): Promise; + /** + * Deletes a share permission from a filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira and the user must own the filter. + */ + async deleteSharePermission(parameters: Parameters.DeleteSharePermission, callback?: never): Promise; + async deleteSharePermission( + parameters: Parameters.DeleteSharePermission, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/filter/${parameters.id}/permission/${parameters.permissionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/filterSharing.ts b/src/version2/filterSharing.ts deleted file mode 100644 index b82b96384..000000000 --- a/src/version2/filterSharing.ts +++ /dev/null @@ -1,255 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class FilterSharing { - constructor(private client: Client) {} - - /** - * Returns the default sharing settings for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getDefaultShareScope(callback: Callback): Promise; - /** - * Returns the default sharing settings for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getDefaultShareScope(callback?: never): Promise; - async getDefaultShareScope(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/filter/defaultShareScope', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default sharing for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async setDefaultShareScope( - parameters: Parameters.SetDefaultShareScope | string, - callback: Callback, - ): Promise; - /** - * Sets the default sharing for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async setDefaultShareScope( - parameters: Parameters.SetDefaultShareScope | string, - callback?: never, - ): Promise; - async setDefaultShareScope( - parameters: Parameters.SetDefaultShareScope | string, - callback?: Callback, - ): Promise { - const scope = typeof parameters === 'string' ? parameters : parameters.scope; - - const config: RequestConfig = { - url: '/rest/api/2/filter/defaultShareScope', - method: 'PUT', - data: { - scope, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or - * the public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, share permissions are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermissions( - parameters: Parameters.GetSharePermissions | string, - callback: Callback, - ): Promise; - /** - * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or - * the public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, share permissions are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermissions( - parameters: Parameters.GetSharePermissions | string, - callback?: never, - ): Promise; - async getSharePermissions( - parameters: Parameters.GetSharePermissions | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/filter/${id}/permission`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the - * public) it will overwrite all share permissions for the filter. - * - * Be aware that this operation uses different objects for updating share permissions compared to [Update - * filter](#api-rest-api-2-filter-id-put). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Share - * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the - * filter. - */ - async addSharePermission( - parameters: Parameters.AddSharePermission, - callback: Callback, - ): Promise; - /** - * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the - * public) it will overwrite all share permissions for the filter. - * - * Be aware that this operation uses different objects for updating share permissions compared to [Update - * filter](#api-rest-api-2-filter-id-put). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Share - * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the - * filter. - */ - async addSharePermission( - parameters: Parameters.AddSharePermission, - callback?: never, - ): Promise; - async addSharePermission( - parameters: Parameters.AddSharePermission, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/permission`, - method: 'POST', - data: { - type: parameters.type, - projectId: parameters.projectId, - groupname: parameters.groupname, - projectRoleId: parameters.projectRoleId, - accountId: parameters.accountId, - rights: parameters.rights, - groupId: parameters.groupId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the - * public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, a share permission is only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermission( - parameters: Parameters.GetSharePermission, - callback: Callback, - ): Promise; - /** - * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the - * public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, a share permission is only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermission( - parameters: Parameters.GetSharePermission, - callback?: never, - ): Promise; - async getSharePermission( - parameters: Parameters.GetSharePermission, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/permission/${parameters.permissionId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a share permission from a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira and the user must own the filter. - */ - async deleteSharePermission( - parameters: Parameters.DeleteSharePermission, - callback: Callback, - ): Promise; - /** - * Deletes a share permission from a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira and the user must own the filter. - */ - async deleteSharePermission(parameters: Parameters.DeleteSharePermission, callback?: never): Promise; - async deleteSharePermission( - parameters: Parameters.DeleteSharePermission, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/permission/${parameters.permissionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/filters.mts b/src/version2/filters.mts new file mode 100644 index 000000000..f68bea879 --- /dev/null +++ b/src/version2/filters.mts @@ -0,0 +1,624 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Filters { + constructor(private client: Client) {} + + /** + * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-2-filter-post). The + * filter is not selected as a favorite. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async createFilter(parameters: Parameters.CreateFilter, callback: Callback): Promise; + /** + * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-2-filter-post). The + * filter is not selected as a favorite. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async createFilter(parameters: Parameters.CreateFilter, callback?: never): Promise; + async createFilter( + parameters: Parameters.CreateFilter, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/filter', + method: 'POST', + params: { + expand: parameters?.expand, + overrideSharePermissions: parameters?.overrideSharePermissions, + }, + data: { + description: parameters.description, + editPermissions: parameters.editPermissions, + favourite: parameters.favourite, + favouritedCount: parameters.favouritedCount, + id: parameters.id, + jql: parameters.jql, + name: parameters.name, + owner: parameters.owner, + searchUrl: parameters.searchUrl, + self: parameters.self, + sharePermissions: parameters.sharePermissions, + sharedUsers: parameters.sharedUsers, + subscriptions: parameters.subscriptions, + viewUrl: parameters.viewUrl, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the visible favorite filters of the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** A + * favorite filter is only visible to the user where the filter is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + * + * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. + */ + async getFavouriteFilters( + parameters: Parameters.GetFavouriteFilters | undefined, + callback: Callback, + ): Promise; + /** + * Returns the visible favorite filters of the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** A + * favorite filter is only visible to the user where the filter is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + * + * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. + */ + async getFavouriteFilters( + parameters?: Parameters.GetFavouriteFilters, + callback?: never, + ): Promise; + async getFavouriteFilters( + parameters?: Parameters.GetFavouriteFilters, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/filter/favourite', + method: 'GET', + params: { + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are + * also returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + * + * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. + */ + async getMyFilters( + parameters: Parameters.GetMyFilters | undefined, + callback: Callback, + ): Promise; + /** + * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are + * also returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + * + * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. + */ + async getMyFilters(parameters?: Parameters.GetMyFilters, callback?: never): Promise; + async getMyFilters( + parameters?: Parameters.GetMyFilters, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/filter/my', + method: 'GET', + params: { + expand: parameters?.expand, + includeFavourites: parameters?.includeFavourites, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * filters. Use this operation to get: + * + * - Specific filters, by defining `id` only. + * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in + * their name. When multiple attributes are specified only filters matching all attributes are returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, only the following filters that match the query parameters are returned: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getFiltersPaginated( + parameters: Parameters.GetFiltersPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * filters. Use this operation to get: + * + * - Specific filters, by defining `id` only. + * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in + * their name. When multiple attributes are specified only filters matching all attributes are returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, only the following filters that match the query parameters are returned: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getFiltersPaginated( + parameters?: Parameters.GetFiltersPaginated, + callback?: never, + ): Promise; + async getFiltersPaginated( + parameters?: Parameters.GetFiltersPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/filter/search', + method: 'GET', + params: { + filterName: parameters?.filterName, + accountId: parameters?.accountId, + groupname: parameters?.groupname, + groupId: parameters?.groupId, + projectId: parameters?.projectId, + id: parameters?.id, + orderBy: parameters?.orderBy, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + expand: parameters?.expand, + overrideSharePermissions: parameters?.overrideSharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a filter. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, the filter is only returned where it is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + */ + async getFilter(parameters: Parameters.GetFilter | string, callback: Callback): Promise; + /** + * Returns a filter. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, the filter is only returned where it is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + */ + async getFilter(parameters: Parameters.GetFilter | string, callback?: never): Promise; + async getFilter( + parameters: Parameters.GetFilter | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/filter/${id}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + overrideSharePermissions: typeof parameters !== 'string' && parameters.overrideSharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a filter. Use this operation to update a filter's name, description, Jql, or sharing. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however the user must own the filter. + */ + async updateFilter(parameters: Parameters.UpdateFilter, callback: Callback): Promise; + /** + * Updates a filter. Use this operation to update a filter's name, description, Jql, or sharing. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however the user must own the filter. + */ + async updateFilter(parameters: Parameters.UpdateFilter, callback?: never): Promise; + async updateFilter( + parameters: Parameters.UpdateFilter, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/filter/${parameters.id}`, + method: 'PUT', + params: { + expand: parameters.expand, + overrideSharePermissions: parameters.overrideSharePermissions, + }, + data: { + name: parameters.name, + description: parameters.description, + jql: parameters.jql, + favourite: parameters.favourite, + sharePermissions: parameters.sharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete a filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFilter(parameters: Parameters.DeleteFilter | string, callback: Callback): Promise; + /** + * Delete a filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFilter(parameters: Parameters.DeleteFilter | string, callback?: never): Promise; + async deleteFilter( + parameters: Parameters.DeleteFilter | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/filter/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed + * in _List View_ with the _Columns_ set to _Filter_. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, column details are only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getColumns( + parameters: Parameters.GetColumns | string, + callback: Callback, + ): Promise; + /** + * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed + * in _List View_ with the _Columns_ set to _Filter_. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, column details are only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getColumns(parameters: Parameters.GetColumns | string, callback?: never): Promise; + async getColumns( + parameters: Parameters.GetColumns | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/filter/${id}/columns`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get + * fields](#api-rest-api-2-field-get) to get the list fields in Jira. A navigable field has `navigable` set to + * `true`. + * + * The parameters for this resource are expressed as HTML form data. For example, in curl: + * + * `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/2/filter/10000/columns` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, columns are only set for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async setColumns(parameters: Parameters.SetColumns, callback: Callback): Promise; + /** + * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get + * fields](#api-rest-api-2-field-get) to get the list fields in Jira. A navigable field has `navigable` set to + * `true`. + * + * The parameters for this resource are expressed as HTML form data. For example, in curl: + * + * `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/2/filter/10000/columns` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, columns are only set for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async setColumns(parameters: Parameters.SetColumns, callback?: never): Promise; + async setColumns(parameters: Parameters.SetColumns, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/filter/${parameters.id}/columns`, + method: 'PUT', + data: parameters.columns, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Reset the user's column configuration for the filter to the default. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, columns are only reset for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async resetColumns(parameters: Parameters.ResetColumns, callback: Callback): Promise; + /** + * Reset the user's column configuration for the filter to the default. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, columns are only reset for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async resetColumns(parameters: Parameters.ResetColumns, callback?: never): Promise; + async resetColumns(parameters: Parameters.ResetColumns, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/filter/${parameters.id}/columns`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Add a filter as a favorite for the user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, the user can only favorite: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async setFavouriteForFilter( + parameters: Parameters.SetFavouriteForFilter | string, + callback: Callback, + ): Promise; + /** + * Add a filter as a favorite for the user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, the user can only favorite: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async setFavouriteForFilter( + parameters: Parameters.SetFavouriteForFilter | string, + callback?: never, + ): Promise; + async setFavouriteForFilter( + parameters: Parameters.SetFavouriteForFilter | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/filter/${id}/favourite`, + method: 'PUT', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from + * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private + * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async deleteFavouriteForFilter( + parameters: Parameters.DeleteFavouriteForFilter | string, + callback: Callback, + ): Promise; + /** + * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from + * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private + * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async deleteFavouriteForFilter( + parameters: Parameters.DeleteFavouriteForFilter | string, + callback?: never, + ): Promise; + async deleteFavouriteForFilter( + parameters: Parameters.DeleteFavouriteForFilter | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/filter/${id}/favourite`, + method: 'DELETE', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the owner of the filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback: Callback): Promise; + /** + * Changes the owner of the filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback?: never): Promise; + async changeFilterOwner( + parameters: Parameters.ChangeFilterOwner, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/filter/${parameters.id}/owner`, + method: 'PUT', + data: { + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/filters.ts b/src/version2/filters.ts deleted file mode 100644 index 88d63cb80..000000000 --- a/src/version2/filters.ts +++ /dev/null @@ -1,624 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Filters { - constructor(private client: Client) {} - - /** - * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-2-filter-post). The - * filter is not selected as a favorite. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async createFilter(parameters: Parameters.CreateFilter, callback: Callback): Promise; - /** - * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-2-filter-post). The - * filter is not selected as a favorite. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async createFilter(parameters: Parameters.CreateFilter, callback?: never): Promise; - async createFilter( - parameters: Parameters.CreateFilter, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/filter', - method: 'POST', - params: { - expand: parameters?.expand, - overrideSharePermissions: parameters?.overrideSharePermissions, - }, - data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - favourite: parameters.favourite, - favouritedCount: parameters.favouritedCount, - id: parameters.id, - jql: parameters.jql, - name: parameters.name, - owner: parameters.owner, - searchUrl: parameters.searchUrl, - self: parameters.self, - sharePermissions: parameters.sharePermissions, - sharedUsers: parameters.sharedUsers, - subscriptions: parameters.subscriptions, - viewUrl: parameters.viewUrl, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the visible favorite filters of the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** A - * favorite filter is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getFavouriteFilters( - parameters: Parameters.GetFavouriteFilters | undefined, - callback: Callback, - ): Promise; - /** - * Returns the visible favorite filters of the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** A - * favorite filter is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getFavouriteFilters( - parameters?: Parameters.GetFavouriteFilters, - callback?: never, - ): Promise; - async getFavouriteFilters( - parameters?: Parameters.GetFavouriteFilters, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/filter/favourite', - method: 'GET', - params: { - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are - * also returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getMyFilters( - parameters: Parameters.GetMyFilters | undefined, - callback: Callback, - ): Promise; - /** - * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are - * also returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getMyFilters(parameters?: Parameters.GetMyFilters, callback?: never): Promise; - async getMyFilters( - parameters?: Parameters.GetMyFilters, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/filter/my', - method: 'GET', - params: { - expand: parameters?.expand, - includeFavourites: parameters?.includeFavourites, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * filters. Use this operation to get: - * - * - Specific filters, by defining `id` only. - * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in - * their name. When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, only the following filters that match the query parameters are returned: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getFiltersPaginated( - parameters: Parameters.GetFiltersPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * filters. Use this operation to get: - * - * - Specific filters, by defining `id` only. - * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in - * their name. When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, only the following filters that match the query parameters are returned: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getFiltersPaginated( - parameters?: Parameters.GetFiltersPaginated, - callback?: never, - ): Promise; - async getFiltersPaginated( - parameters?: Parameters.GetFiltersPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/filter/search', - method: 'GET', - params: { - filterName: parameters?.filterName, - accountId: parameters?.accountId, - groupname: parameters?.groupname, - groupId: parameters?.groupId, - projectId: parameters?.projectId, - id: parameters?.id, - orderBy: parameters?.orderBy, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - expand: parameters?.expand, - overrideSharePermissions: parameters?.overrideSharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a filter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, the filter is only returned where it is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - */ - async getFilter(parameters: Parameters.GetFilter | string, callback: Callback): Promise; - /** - * Returns a filter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, the filter is only returned where it is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - */ - async getFilter(parameters: Parameters.GetFilter | string, callback?: never): Promise; - async getFilter( - parameters: Parameters.GetFilter | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/filter/${id}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - overrideSharePermissions: typeof parameters !== 'string' && parameters.overrideSharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a filter. Use this operation to update a filter's name, description, JQL, or sharing. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however the user must own the filter. - */ - async updateFilter(parameters: Parameters.UpdateFilter, callback: Callback): Promise; - /** - * Updates a filter. Use this operation to update a filter's name, description, JQL, or sharing. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however the user must own the filter. - */ - async updateFilter(parameters: Parameters.UpdateFilter, callback?: never): Promise; - async updateFilter( - parameters: Parameters.UpdateFilter, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}`, - method: 'PUT', - params: { - expand: parameters.expand, - overrideSharePermissions: parameters.overrideSharePermissions, - }, - data: { - name: parameters.name, - description: parameters.description, - jql: parameters.jql, - favourite: parameters.favourite, - sharePermissions: parameters.sharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFilter(parameters: Parameters.DeleteFilter | string, callback: Callback): Promise; - /** - * Delete a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFilter(parameters: Parameters.DeleteFilter | string, callback?: never): Promise; - async deleteFilter( - parameters: Parameters.DeleteFilter | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/filter/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed - * in _List View_ with the _Columns_ set to _Filter_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, column details are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getColumns( - parameters: Parameters.GetColumns | string, - callback: Callback, - ): Promise; - /** - * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed - * in _List View_ with the _Columns_ set to _Filter_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, column details are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getColumns(parameters: Parameters.GetColumns | string, callback?: never): Promise; - async getColumns( - parameters: Parameters.GetColumns | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/filter/${id}/columns`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get - * fields](#api-rest-api-2-field-get) to get the list fields in Jira. A navigable field has `navigable` set to - * `true`. - * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/2/filter/10000/columns` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, columns are only set for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setColumns(parameters: Parameters.SetColumns, callback: Callback): Promise; - /** - * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get - * fields](#api-rest-api-2-field-get) to get the list fields in Jira. A navigable field has `navigable` set to - * `true`. - * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/2/filter/10000/columns` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, columns are only set for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setColumns(parameters: Parameters.SetColumns, callback?: never): Promise; - async setColumns(parameters: Parameters.SetColumns, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/columns`, - method: 'PUT', - data: parameters.columns, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Reset the user's column configuration for the filter to the default. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, columns are only reset for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async resetColumns(parameters: Parameters.ResetColumns, callback: Callback): Promise; - /** - * Reset the user's column configuration for the filter to the default. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, columns are only reset for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async resetColumns(parameters: Parameters.ResetColumns, callback?: never): Promise; - async resetColumns(parameters: Parameters.ResetColumns, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/columns`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Add a filter as a favorite for the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user can only favorite: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, - callback: Callback, - ): Promise; - /** - * Add a filter as a favorite for the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user can only favorite: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, - callback?: never, - ): Promise; - async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/filter/${id}/favourite`, - method: 'PUT', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from - * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private - * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, - callback: Callback, - ): Promise; - /** - * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from - * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private - * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, - callback?: never, - ): Promise; - async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/filter/${id}/favourite`, - method: 'DELETE', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the owner of the filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback: Callback): Promise; - /** - * Changes the owner of the filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback?: never): Promise; - async changeFilterOwner( - parameters: Parameters.ChangeFilterOwner, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/owner`, - method: 'PUT', - data: { - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/groupAndUserPicker.mts b/src/version2/groupAndUserPicker.mts new file mode 100644 index 000000000..9ac828939 --- /dev/null +++ b/src/version2/groupAndUserPicker.mts @@ -0,0 +1,110 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class GroupAndUserPicker { + constructor(private client: Client) {} + + /** + * Returns a list of users and groups matching a string. The string is used: + * + * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden + * their email address in their user profile, partial matches of the email address will not find the user. An exact + * match is required. + * - For groups, to find a case-sensitive match with group name. + * + * For example, if the string _tin_ is used, records with the display name _Tina_, email address + * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. + * + * Optionally, the search can be refined to: + * + * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further + * refined to return only users and groups that have permission to view specific: + * + * - Projects. + * - Issue types. + * + * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or + * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be + * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. + * - Not return Connect app users and groups. + * - Return groups that have a case-insensitive match with the query. + * + * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this + * end, the returned object includes an `html` field for each list. This field highlights the matched query term in + * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for + * use in a picker, specifically _Showing X of Y matching groups_. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). + */ + async findUsersAndGroups( + parameters: Parameters.FindUsersAndGroups, + callback: Callback, + ): Promise; + /** + * Returns a list of users and groups matching a string. The string is used: + * + * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden + * their email address in their user profile, partial matches of the email address will not find the user. An exact + * match is required. + * - For groups, to find a case-sensitive match with group name. + * + * For example, if the string _tin_ is used, records with the display name _Tina_, email address + * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. + * + * Optionally, the search can be refined to: + * + * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further + * refined to return only users and groups that have permission to view specific: + * + * - Projects. + * - Issue types. + * + * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or + * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be + * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. + * - Not return Connect app users and groups. + * - Return groups that have a case-insensitive match with the query. + * + * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this + * end, the returned object includes an `html` field for each list. This field highlights the matched query term in + * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for + * use in a picker, specifically _Showing X of Y matching groups_. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). + */ + async findUsersAndGroups( + parameters: Parameters.FindUsersAndGroups, + callback?: never, + ): Promise; + async findUsersAndGroups( + parameters: Parameters.FindUsersAndGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/groupuserpicker', + method: 'GET', + params: { + query: parameters.query, + maxResults: parameters.maxResults, + showAvatar: parameters.showAvatar, + fieldId: parameters.fieldId, + projectId: parameters.projectId, + issueTypeId: parameters.issueTypeId, + avatarSize: parameters.avatarSize, + caseInsensitive: parameters.caseInsensitive, + excludeConnectAddons: parameters.excludeConnectAddons, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/groupAndUserPicker.ts b/src/version2/groupAndUserPicker.ts deleted file mode 100644 index 9b864e40f..000000000 --- a/src/version2/groupAndUserPicker.ts +++ /dev/null @@ -1,110 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class GroupAndUserPicker { - constructor(private client: Client) {} - - /** - * Returns a list of users and groups matching a string. The string is used: - * - * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden - * their email address in their user profile, partial matches of the email address will not find the user. An exact - * match is required. - * - For groups, to find a case-sensitive match with group name. - * - * For example, if the string _tin_ is used, records with the display name _Tina_, email address - * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. - * - * Optionally, the search can be refined to: - * - * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further - * refined to return only users and groups that have permission to view specific: - * - * - Projects. - * - Issue types. - * - * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or - * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be - * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. - * - Not return Connect app users and groups. - * - Return groups that have a case-insensitive match with the query. - * - * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this - * end, the returned object includes an `html` field for each list. This field highlights the matched query term in - * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for - * use in a picker, specifically _Showing X of Y matching groups_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). - */ - async findUsersAndGroups( - parameters: Parameters.FindUsersAndGroups, - callback: Callback, - ): Promise; - /** - * Returns a list of users and groups matching a string. The string is used: - * - * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden - * their email address in their user profile, partial matches of the email address will not find the user. An exact - * match is required. - * - For groups, to find a case-sensitive match with group name. - * - * For example, if the string _tin_ is used, records with the display name _Tina_, email address - * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. - * - * Optionally, the search can be refined to: - * - * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further - * refined to return only users and groups that have permission to view specific: - * - * - Projects. - * - Issue types. - * - * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or - * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be - * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. - * - Not return Connect app users and groups. - * - Return groups that have a case-insensitive match with the query. - * - * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this - * end, the returned object includes an `html` field for each list. This field highlights the matched query term in - * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for - * use in a picker, specifically _Showing X of Y matching groups_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). - */ - async findUsersAndGroups( - parameters: Parameters.FindUsersAndGroups, - callback?: never, - ): Promise; - async findUsersAndGroups( - parameters: Parameters.FindUsersAndGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/groupuserpicker', - method: 'GET', - params: { - query: parameters.query, - maxResults: parameters.maxResults, - showAvatar: parameters.showAvatar, - fieldId: parameters.fieldId, - projectId: parameters.projectId, - issueTypeId: parameters.issueTypeId, - avatarSize: parameters.avatarSize, - caseInsensitive: parameters.caseInsensitive, - excludeConnectAddons: parameters.excludeConnectAddons, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/groups.mts b/src/version2/groups.mts new file mode 100644 index 000000000..acfa13bbe --- /dev/null +++ b/src/version2/groups.mts @@ -0,0 +1,281 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Groups { + constructor(private client: Client) {} + + /** + * Creates a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async createGroup(parameters: Parameters.CreateGroup, callback: Callback): Promise; + /** + * Creates a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async createGroup(parameters: Parameters.CreateGroup, callback?: never): Promise; + async createGroup(parameters: Parameters.CreateGroup, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/group', + method: 'POST', + data: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeGroup(parameters: Parameters.RemoveGroup, callback: Callback): Promise; + /** + * Deletes a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeGroup(parameters: Parameters.RemoveGroup, callback?: never): Promise; + async removeGroup(parameters: Parameters.RemoveGroup, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/group', + method: 'DELETE', + params: { + groupname: parameters?.groupname, + groupId: parameters?.groupId, + swapGroup: parameters?.swapGroup, + swapGroupId: parameters?.swapGroupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * groups. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async bulkGetGroups( + parameters: Parameters.BulkGetGroups | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * groups. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async bulkGetGroups(parameters?: Parameters.BulkGetGroups, callback?: never): Promise; + async bulkGetGroups( + parameters?: Parameters.BulkGetGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/group/bulk', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + groupId: parameters?.groupId, + groupName: parameters?.groupName, + accessType: parameters?.accessType, + applicationKey: parameters?.applicationKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * users in a group. + * + * Note that users are ordered by username, however the username is not returned in the results due to privacy + * reasons. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getUsersFromGroup( + parameters: Parameters.GetUsersFromGroup, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * users in a group. + * + * Note that users are ordered by username, however the username is not returned in the results due to privacy + * reasons. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getUsersFromGroup( + parameters: Parameters.GetUsersFromGroup, + callback?: never, + ): Promise; + async getUsersFromGroup( + parameters: Parameters.GetUsersFromGroup, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/group/member', + method: 'GET', + params: { + groupname: parameters.groupname, + groupId: parameters.groupId, + includeInactiveUsers: parameters.includeInactiveUsers, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a user to a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async addUserToGroup(parameters: Parameters.AddUserToGroup, callback: Callback): Promise; + /** + * Adds a user to a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async addUserToGroup(parameters: Parameters.AddUserToGroup, callback?: never): Promise; + async addUserToGroup( + parameters: Parameters.AddUserToGroup, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/group/user', + method: 'POST', + params: { + groupname: parameters.groupName, + groupId: parameters.groupId, + }, + data: { + name: parameters.name, + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a user from a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeUserFromGroup( + parameters: Parameters.RemoveUserFromGroup, + callback: Callback, + ): Promise; + /** + * Removes a user from a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeUserFromGroup(parameters: Parameters.RemoveUserFromGroup, callback?: never): Promise; + async removeUserFromGroup( + parameters: Parameters.RemoveUserFromGroup, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/group/user', + method: 'DELETE', + params: { + groupname: parameters.groupname, + groupId: parameters.groupId, + username: parameters.username, + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude + * groups from the results. + * + * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned + * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong + * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, + * specifically _Showing X of Y matching groups_. + * + * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). Anonymous calls and calls by users + * without the required permission return an empty list. + * + * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, + * calls where query is not an exact match to an existing group will return an empty list. + */ + async findGroups( + parameters: Parameters.FindGroups | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude + * groups from the results. + * + * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned + * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong + * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, + * specifically _Showing X of Y matching groups_. + * + * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). Anonymous calls and calls by users + * without the required permission return an empty list. + * + * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, + * calls where query is not an exact match to an existing group will return an empty list. + */ + async findGroups(parameters?: Parameters.FindGroups, callback?: never): Promise; + async findGroups( + parameters?: Parameters.FindGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/groups/picker', + method: 'GET', + params: { + query: parameters?.query, + exclude: parameters?.exclude, + excludeId: parameters?.excludeId, + maxResults: parameters?.maxResults, + caseInsensitive: parameters?.caseInsensitive, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/groups.ts b/src/version2/groups.ts deleted file mode 100644 index 0616d2481..000000000 --- a/src/version2/groups.ts +++ /dev/null @@ -1,281 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Groups { - constructor(private client: Client) {} - - /** - * Creates a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async createGroup(parameters: Parameters.CreateGroup, callback: Callback): Promise; - /** - * Creates a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async createGroup(parameters: Parameters.CreateGroup, callback?: never): Promise; - async createGroup(parameters: Parameters.CreateGroup, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/group', - method: 'POST', - data: parameters, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeGroup(parameters: Parameters.RemoveGroup, callback: Callback): Promise; - /** - * Deletes a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeGroup(parameters: Parameters.RemoveGroup, callback?: never): Promise; - async removeGroup(parameters: Parameters.RemoveGroup, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/group', - method: 'DELETE', - params: { - groupname: parameters?.groupname, - groupId: parameters?.groupId, - swapGroup: parameters?.swapGroup, - swapGroupId: parameters?.swapGroupId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * groups. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async bulkGetGroups( - parameters: Parameters.BulkGetGroups | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * groups. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async bulkGetGroups(parameters?: Parameters.BulkGetGroups, callback?: never): Promise; - async bulkGetGroups( - parameters?: Parameters.BulkGetGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/group/bulk', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - groupId: parameters?.groupId, - groupName: parameters?.groupName, - accessType: parameters?.accessType, - applicationKey: parameters?.applicationKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * users in a group. - * - * Note that users are ordered by username, however the username is not returned in the results due to privacy - * reasons. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getUsersFromGroup( - parameters: Parameters.GetUsersFromGroup, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * users in a group. - * - * Note that users are ordered by username, however the username is not returned in the results due to privacy - * reasons. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getUsersFromGroup( - parameters: Parameters.GetUsersFromGroup, - callback?: never, - ): Promise; - async getUsersFromGroup( - parameters: Parameters.GetUsersFromGroup, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/group/member', - method: 'GET', - params: { - groupname: parameters.groupname, - groupId: parameters.groupId, - includeInactiveUsers: parameters.includeInactiveUsers, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a user to a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async addUserToGroup(parameters: Parameters.AddUserToGroup, callback: Callback): Promise; - /** - * Adds a user to a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async addUserToGroup(parameters: Parameters.AddUserToGroup, callback?: never): Promise; - async addUserToGroup( - parameters: Parameters.AddUserToGroup, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/group/user', - method: 'POST', - params: { - groupname: parameters.groupName, - groupId: parameters.groupId, - }, - data: { - name: parameters.name, - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a user from a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUserFromGroup( - parameters: Parameters.RemoveUserFromGroup, - callback: Callback, - ): Promise; - /** - * Removes a user from a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUserFromGroup(parameters: Parameters.RemoveUserFromGroup, callback?: never): Promise; - async removeUserFromGroup( - parameters: Parameters.RemoveUserFromGroup, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/group/user', - method: 'DELETE', - params: { - groupname: parameters.groupname, - groupId: parameters.groupId, - username: parameters.username, - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude - * groups from the results. - * - * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned - * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong - * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, - * specifically _Showing X of Y matching groups_. - * - * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). Anonymous calls and calls by users - * without the required permission return an empty list. - * - * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, - * calls where query is not an exact match to an existing group will return an empty list. - */ - async findGroups( - parameters: Parameters.FindGroups | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude - * groups from the results. - * - * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned - * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong - * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, - * specifically _Showing X of Y matching groups_. - * - * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). Anonymous calls and calls by users - * without the required permission return an empty list. - * - * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, - * calls where query is not an exact match to an existing group will return an empty list. - */ - async findGroups(parameters?: Parameters.FindGroups, callback?: never): Promise; - async findGroups( - parameters?: Parameters.FindGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/groups/picker', - method: 'GET', - params: { - query: parameters?.query, - exclude: parameters?.exclude, - excludeId: parameters?.excludeId, - maxResults: parameters?.maxResults, - caseInsensitive: parameters?.caseInsensitive, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/index.mts b/src/version2/index.mts new file mode 100644 index 000000000..d85c443fb --- /dev/null +++ b/src/version2/index.mts @@ -0,0 +1,89 @@ +export * from './announcementBanner.mjs'; +export * from './applicationRoles.mjs'; +export * from './appMigration.mjs'; +export * from './appProperties.mjs'; +export * from './auditRecords.mjs'; +export * from './avatars.mjs'; +export * from './dashboards.mjs'; +export * from './dynamicModules.mjs'; +export * from './filters.mjs'; +export * from './filterSharing.mjs'; +export * from './groupAndUserPicker.mjs'; +export * from './groups.mjs'; +export * from './issueAttachments.mjs'; +export * from './issueCommentProperties.mjs'; +export * from './issueComments.mjs'; +export * from './issueCustomFieldConfigurationApps.mjs'; +export * from './issueCustomFieldContexts.mjs'; +export * from './issueCustomFieldOptions.mjs'; +export * from './issueCustomFieldOptionsApps.mjs'; +export * from './issueCustomFieldValuesApps.mjs'; +export * from './issueFieldConfigurations.mjs'; +export * from './issueFields.mjs'; +export * from './issueLinks.mjs'; +export * from './issueLinkTypes.mjs'; +export * from './issueNavigatorSettings.mjs'; +export * from './issueNotificationSchemes.mjs'; +export * from './issuePriorities.mjs'; +export * from './issueProperties.mjs'; +export * from './issueRemoteLinks.mjs'; +export * from './issueResolutions.mjs'; +export * from './issues.mjs'; +export * from './issueSearch.mjs'; +export * from './issueSecurityLevel.mjs'; +export * from './issueSecuritySchemes.mjs'; +export * from './issueTypeProperties.mjs'; +export * from './issueTypes.mjs'; +export * from './issueTypeSchemes.mjs'; +export * from './issueTypeScreenSchemes.mjs'; +export * from './issueVotes.mjs'; +export * from './issueWatchers.mjs'; +export * from './issueWorklogProperties.mjs'; +export * from './issueWorklogs.mjs'; +export * from './jiraExpressions.mjs'; +export * from './jiraSettings.mjs'; +export * from './jql.mjs'; +export * from './jqlFunctionsApps.mjs'; +export * from './labels.mjs'; +export * from './licenseMetrics.mjs'; +export * from './myself.mjs'; +export * from './permissions.mjs'; +export * from './permissionSchemes.mjs'; +export * from './projectAvatars.mjs'; +export * from './projectCategories.mjs'; +export * from './projectComponents.mjs'; +export * from './projectEmail.mjs'; +export * from './projectFeatures.mjs'; +export * from './projectKeyAndNameValidation.mjs'; +export * from './projectPermissionSchemes.mjs'; +export * from './projectProperties.mjs'; +export * from './projectRoleActors.mjs'; +export * from './projectRoles.mjs'; +export * from './projects.mjs'; +export * from './projectTypes.mjs'; +export * from './projectVersions.mjs'; +export * from './screens.mjs'; +export * from './screenSchemes.mjs'; +export * from './screenTabFields.mjs'; +export * from './screenTabs.mjs'; +export * from './serverInfo.mjs'; +export * from './status.mjs'; +export * from './tasks.mjs'; +export * from './timeTracking.mjs'; +export * from './uiModificationsApps.mjs'; +export * from './userProperties.mjs'; +export * from './users.mjs'; +export * from './userSearch.mjs'; +export * from './webhooks.mjs'; +export * from './workflows.mjs'; +export * from './workflowSchemeDrafts.mjs'; +export * from './workflowSchemeProjectAssociations.mjs'; +export * from './workflowSchemes.mjs'; +export * from './workflowStatusCategories.mjs'; +export * from './workflowStatuses.mjs'; +export * from './workflowTransitionProperties.mjs'; +export * from './workflowTransitionRules.mjs'; + +export * as Version2Models from './models/index.mjs'; +export * as Version2Parameters from './parameters/index.mjs'; +export * from './client/version2Client.mjs'; diff --git a/src/version2/index.ts b/src/version2/index.ts deleted file mode 100644 index 77cbaa7ef..000000000 --- a/src/version2/index.ts +++ /dev/null @@ -1,89 +0,0 @@ -export * from './announcementBanner.js'; -export * from './applicationRoles.js'; -export * from './appMigration.js'; -export * from './appProperties.js'; -export * from './auditRecords.js'; -export * from './avatars.js'; -export * from './dashboards.js'; -export * from './dynamicModules.js'; -export * from './filters.js'; -export * from './filterSharing.js'; -export * from './groupAndUserPicker.js'; -export * from './groups.js'; -export * from './issueAttachments.js'; -export * from './issueCommentProperties.js'; -export * from './issueComments.js'; -export * from './issueCustomFieldConfigurationApps.js'; -export * from './issueCustomFieldContexts.js'; -export * from './issueCustomFieldOptions.js'; -export * from './issueCustomFieldOptionsApps.js'; -export * from './issueCustomFieldValuesApps.js'; -export * from './issueFieldConfigurations.js'; -export * from './issueFields.js'; -export * from './issueLinks.js'; -export * from './issueLinkTypes.js'; -export * from './issueNavigatorSettings.js'; -export * from './issueNotificationSchemes.js'; -export * from './issuePriorities.js'; -export * from './issueProperties.js'; -export * from './issueRemoteLinks.js'; -export * from './issueResolutions.js'; -export * from './issues.js'; -export * from './issueSearch.js'; -export * from './issueSecurityLevel.js'; -export * from './issueSecuritySchemes.js'; -export * from './issueTypeProperties.js'; -export * from './issueTypes.js'; -export * from './issueTypeSchemes.js'; -export * from './issueTypeScreenSchemes.js'; -export * from './issueVotes.js'; -export * from './issueWatchers.js'; -export * from './issueWorklogProperties.js'; -export * from './issueWorklogs.js'; -export * from './jiraExpressions.js'; -export * from './jiraSettings.js'; -export * from './jQL.js'; -export * from './jqlFunctionsApps.js'; -export * from './labels.js'; -export * from './licenseMetrics.js'; -export * from './myself.js'; -export * from './permissions.js'; -export * from './permissionSchemes.js'; -export * from './projectAvatars.js'; -export * from './projectCategories.js'; -export * from './projectComponents.js'; -export * from './projectEmail.js'; -export * from './projectFeatures.js'; -export * from './projectKeyAndNameValidation.js'; -export * from './projectPermissionSchemes.js'; -export * from './projectProperties.js'; -export * from './projectRoleActors.js'; -export * from './projectRoles.js'; -export * from './projects.js'; -export * from './projectTypes.js'; -export * from './projectVersions.js'; -export * from './screens.js'; -export * from './screenSchemes.js'; -export * from './screenTabFields.js'; -export * from './screenTabs.js'; -export * from './serverInfo.js'; -export * from './status.js'; -export * from './tasks.js'; -export * from './timeTracking.js'; -export * from './uIModificationsApps.js'; -export * from './userProperties.js'; -export * from './users.js'; -export * from './userSearch.js'; -export * from './webhooks.js'; -export * from './workflows.js'; -export * from './workflowSchemeDrafts.js'; -export * from './workflowSchemeProjectAssociations.js'; -export * from './workflowSchemes.js'; -export * from './workflowStatusCategories.js'; -export * from './workflowStatuses.js'; -export * from './workflowTransitionProperties.js'; -export * from './workflowTransitionRules.js'; - -export * as Version2Models from './models/index.js'; -export * as Version2Parameters from './parameters/index.js'; -export * from './client/index.js'; diff --git a/src/version2/issueAttachments.mts b/src/version2/issueAttachments.mts new file mode 100644 index 000000000..90f4deb6e --- /dev/null +++ b/src/version2/issueAttachments.mts @@ -0,0 +1,445 @@ +import FormData from 'form-data'; +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueAttachments { + constructor(private client: Client) {} + + /** + * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment + * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) + * for details. + * + * To return a thumbnail of the attachment, use [Get attachment + * thumbnail](#api-rest-api-2-attachment-thumbnail-id-get). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAttachmentContent( + parameters: Parameters.GetAttachmentContent | string, + callback: Callback, + ): Promise; + /** + * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment + * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) + * for details. + * + * To return a thumbnail of the attachment, use [Get attachment + * thumbnail](#api-rest-api-2-attachment-thumbnail-id-get). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAttachmentContent( + parameters: Parameters.GetAttachmentContent | string, + callback?: never, + ): Promise; + async getAttachmentContent( + parameters: Parameters.GetAttachmentContent | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/attachment/content/${id}`, + method: 'GET', + params: { + redirect: typeof parameters !== 'string' && parameters.redirect, + }, + responseType: 'arraybuffer', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. + * + * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether + * users can create and delete attachments. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAttachmentMeta(callback: Callback): Promise; + /** + * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. + * + * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether + * users can create and delete attachments. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAttachmentMeta(callback?: never): Promise; + async getAttachmentMeta(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/attachment/meta', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the thumbnail of an attachment. + * + * To return the attachment contents, use [Get attachment content](#api-rest-api-2-attachment-content-id-get). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail | string, + callback: Callback, + ): Promise; + /** + * Returns the thumbnail of an attachment. + * + * To return the attachment contents, use [Get attachment content](#api-rest-api-2-attachment-content-id-get). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail | string, + callback?: never, + ): Promise; + async getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/attachment/thumbnail/${id}`, + method: 'GET', + params: { + redirect: typeof parameters !== 'string' && parameters.redirect, + fallbackToDefault: typeof parameters !== 'string' && parameters.fallbackToDefault, + width: typeof parameters !== 'string' && parameters.width, + height: typeof parameters !== 'string' && parameters.height, + }, + responseType: 'arraybuffer', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the metadata for an attachment. Note that the attachment itself is not returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAttachment( + parameters: Parameters.GetAttachment | string, + callback: Callback, + ): Promise; + /** + * Returns the metadata for an attachment. Note that the attachment itself is not returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAttachment( + parameters: Parameters.GetAttachment | string, + callback?: never, + ): Promise; + async getAttachment( + parameters: Parameters.GetAttachment | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/attachment/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an attachment from an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * project holding the issue containing the attachment: + * + * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by the calling user. + * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by any user. + */ + async removeAttachment( + parameters: Parameters.RemoveAttachment | string, + callback: Callback, + ): Promise; + /** + * Deletes an attachment from an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * project holding the issue containing the attachment: + * + * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by the calling user. + * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by any user. + */ + async removeAttachment(parameters: Parameters.RemoveAttachment | string, callback?: never): Promise; + async removeAttachment( + parameters: Parameters.RemoveAttachment | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/attachment/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment + * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is + * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. + * + * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the + * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded + * attachment](#api-rest-api-2-attachment-id-expand-raw-get), which only returns the metadata for the attachment's + * contents. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async expandAttachmentForHumans( + parameters: Parameters.ExpandAttachmentForHumans | string, + callback: Callback, + ): Promise; + /** + * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment + * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is + * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. + * + * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the + * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded + * attachment](#api-rest-api-2-attachment-id-expand-raw-get), which only returns the metadata for the attachment's + * contents. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async expandAttachmentForHumans( + parameters: Parameters.ExpandAttachmentForHumans | string, + callback?: never, + ): Promise; + async expandAttachmentForHumans( + parameters: Parameters.ExpandAttachmentForHumans | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/attachment/${id}/expand/human`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a + * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is + * supported. + * + * Use this operation if you are processing the data without presenting it to the user, as this operation only returns + * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all + * metadata for an expanded attachment](#api-rest-api-2-attachment-id-expand-human-get) which also returns the + * metadata for the attachment itself, such as the attachment's ID and name. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async expandAttachmentForMachines( + parameters: Parameters.ExpandAttachmentForMachines | string, + callback: Callback, + ): Promise; + /** + * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a + * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is + * supported. + * + * Use this operation if you are processing the data without presenting it to the user, as this operation only returns + * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all + * metadata for an expanded attachment](#api-rest-api-2-attachment-id-expand-human-get) which also returns the + * metadata for the attachment itself, such as the attachment's ID and name. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async expandAttachmentForMachines( + parameters: Parameters.ExpandAttachmentForMachines | string, + callback?: never, + ): Promise; + async expandAttachmentForMachines( + parameters: Parameters.ExpandAttachmentForMachines | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/attachment/${id}/expand/raw`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC + * 1867](https://www.ietf.org/rfc/rfc1867.txt)). + * + * Note that: + * + * - The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special + * headers](#special-request-headers) for more information. + * - The name of the multipart/form-data parameter that contains the attachments must be `file`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse Projects_ and _Create attachments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addAttachment( + parameters: Parameters.AddAttachment, + callback: Callback, + ): Promise; + /** + * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC + * 1867](https://www.ietf.org/rfc/rfc1867.txt)). + * + * Note that: + * + * - The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special + * headers](#special-request-headers) for more information. + * - The name of the multipart/form-data parameter that contains the attachments must be `file`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse Projects_ and _Create attachments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addAttachment(parameters: Parameters.AddAttachment, callback?: never): Promise; + async addAttachment( + parameters: Parameters.AddAttachment, + callback?: Callback, + ): Promise { + const formData = new FormData(); + const attachments = Array.isArray(parameters.attachment) ? parameters.attachment : [parameters.attachment]; + + attachments.forEach(attachment => formData.append('file', attachment.file, attachment.filename)); + + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/attachments`, + method: 'POST', + headers: { + 'X-Atlassian-Token': 'no-check', + 'Content-Type': 'multipart/form-data', + ...formData.getHeaders?.(), + }, + data: formData, + maxBodyLength: Infinity, + maxContentLength: Infinity, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueAttachments.ts b/src/version2/issueAttachments.ts deleted file mode 100644 index 33bad5b82..000000000 --- a/src/version2/issueAttachments.ts +++ /dev/null @@ -1,444 +0,0 @@ -import { FormData } from 'formdata-node'; -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueAttachments { - constructor(private client: Client) {} - - /** - * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment - * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) - * for details. - * - * To return a thumbnail of the attachment, use [Get attachment - * thumbnail](#api-rest-api-2-attachment-thumbnail-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getAttachmentContent( - parameters: Parameters.GetAttachmentContent | string, - callback: Callback, - ): Promise; - /** - * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment - * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) - * for details. - * - * To return a thumbnail of the attachment, use [Get attachment - * thumbnail](#api-rest-api-2-attachment-thumbnail-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getAttachmentContent( - parameters: Parameters.GetAttachmentContent | string, - callback?: never, - ): Promise; - async getAttachmentContent( - parameters: Parameters.GetAttachmentContent | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/attachment/content/${id}`, - method: 'GET', - params: { - redirect: typeof parameters !== 'string' && parameters.redirect, - }, - responseType: 'arraybuffer', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. - * - * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether - * users can create and delete attachments. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAttachmentMeta(callback: Callback): Promise; - /** - * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. - * - * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether - * users can create and delete attachments. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAttachmentMeta(callback?: never): Promise; - async getAttachmentMeta(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/attachment/meta', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the thumbnail of an attachment. - * - * To return the attachment contents, use [Get attachment content](#api-rest-api-2-attachment-content-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, - callback: Callback, - ): Promise; - /** - * Returns the thumbnail of an attachment. - * - * To return the attachment contents, use [Get attachment content](#api-rest-api-2-attachment-content-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, - callback?: never, - ): Promise; - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/attachment/thumbnail/${id}`, - method: 'GET', - params: { - redirect: typeof parameters !== 'string' && parameters.redirect, - fallbackToDefault: typeof parameters !== 'string' && parameters.fallbackToDefault, - width: typeof parameters !== 'string' && parameters.width, - height: typeof parameters !== 'string' && parameters.height, - }, - responseType: 'arraybuffer', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the metadata for an attachment. Note that the attachment itself is not returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getAttachment( - parameters: Parameters.GetAttachment | string, - callback: Callback, - ): Promise; - /** - * Returns the metadata for an attachment. Note that the attachment itself is not returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getAttachment( - parameters: Parameters.GetAttachment | string, - callback?: never, - ): Promise; - async getAttachment( - parameters: Parameters.GetAttachment | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/attachment/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an attachment from an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * project holding the issue containing the attachment: - * - * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by the calling user. - * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by any user. - */ - async removeAttachment( - parameters: Parameters.RemoveAttachment | string, - callback: Callback, - ): Promise; - /** - * Deletes an attachment from an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * project holding the issue containing the attachment: - * - * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by the calling user. - * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by any user. - */ - async removeAttachment(parameters: Parameters.RemoveAttachment | string, callback?: never): Promise; - async removeAttachment( - parameters: Parameters.RemoveAttachment | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/attachment/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment - * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is - * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. - * - * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the - * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded - * attachment](#api-rest-api-2-attachment-id-expand-raw-get), which only returns the metadata for the attachment's - * contents. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, - callback: Callback, - ): Promise; - /** - * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment - * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is - * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. - * - * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the - * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded - * attachment](#api-rest-api-2-attachment-id-expand-raw-get), which only returns the metadata for the attachment's - * contents. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, - callback?: never, - ): Promise; - async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/attachment/${id}/expand/human`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a - * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is - * supported. - * - * Use this operation if you are processing the data without presenting it to the user, as this operation only returns - * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all - * metadata for an expanded attachment](#api-rest-api-2-attachment-id-expand-human-get) which also returns the - * metadata for the attachment itself, such as the attachment's ID and name. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, - callback: Callback, - ): Promise; - /** - * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a - * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is - * supported. - * - * Use this operation if you are processing the data without presenting it to the user, as this operation only returns - * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all - * metadata for an expanded attachment](#api-rest-api-2-attachment-id-expand-human-get) which also returns the - * metadata for the attachment itself, such as the attachment's ID and name. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, - callback?: never, - ): Promise; - async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/attachment/${id}/expand/raw`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC - * 1867](https://www.ietf.org/rfc/rfc1867.txt)). - * - * Note that: - * - * - The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special - * headers](#special-request-headers) for more information. - * - The name of the multipart/form-data parameter that contains the attachments must be `file`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse Projects_ and _Create attachments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addAttachment( - parameters: Parameters.AddAttachment, - callback: Callback, - ): Promise; - /** - * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC - * 1867](https://www.ietf.org/rfc/rfc1867.txt)). - * - * Note that: - * - * - The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special - * headers](#special-request-headers) for more information. - * - The name of the multipart/form-data parameter that contains the attachments must be `file`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse Projects_ and _Create attachments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addAttachment(parameters: Parameters.AddAttachment, callback?: never): Promise; - async addAttachment( - parameters: Parameters.AddAttachment, - callback?: Callback, - ): Promise { - const formData = new FormData(); - const attachments = Array.isArray(parameters.attachment) ? parameters.attachment : [parameters.attachment]; - - attachments.forEach(attachment => formData.append('file', attachment.file, attachment.filename)); - - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/attachments`, - method: 'POST', - headers: { - 'X-Atlassian-Token': 'no-check', - 'Content-Type': 'multipart/form-data', - }, - data: formData, - maxBodyLength: Infinity, - maxContentLength: Infinity, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueCommentProperties.mts b/src/version2/issueCommentProperties.mts new file mode 100644 index 000000000..33f3b1bba --- /dev/null +++ b/src/version2/issueCommentProperties.mts @@ -0,0 +1,196 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCommentProperties { + constructor(private client: Client) {} + + /** + * Returns the keys of all the properties of a comment. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentPropertyKeys( + parameters: Parameters.GetCommentPropertyKeys | string, + callback: Callback, + ): Promise; + /** + * Returns the keys of all the properties of a comment. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentPropertyKeys( + parameters: Parameters.GetCommentPropertyKeys | string, + callback?: never, + ): Promise; + async getCommentPropertyKeys( + parameters: Parameters.GetCommentPropertyKeys | string, + callback?: Callback, + ): Promise { + const commentId = typeof parameters === 'string' ? parameters : parameters.commentId; + + const config: RequestConfig = { + url: `/rest/api/2/comment/${commentId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a comment property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentProperty( + parameters: Parameters.GetCommentProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a comment property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentProperty( + parameters: Parameters.GetCommentProperty, + callback?: never, + ): Promise; + async getCommentProperty( + parameters: Parameters.GetCommentProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on any comment. + * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on a comment created by the user. + * + * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. + */ + async setCommentProperty( + parameters: Parameters.SetCommentProperty, + callback: Callback, + ): Promise; + /** + * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on any comment. + * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on a comment created by the user. + * + * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. + */ + async setCommentProperty(parameters: Parameters.SetCommentProperty, callback?: never): Promise; + async setCommentProperty( + parameters: Parameters.SetCommentProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.property, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a comment property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any + * comment. + * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a + * comment created by the user. + * + * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. + */ + async deleteCommentProperty( + parameters: Parameters.DeleteCommentProperty, + callback: Callback, + ): Promise; + /** + * Deletes a comment property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any + * comment. + * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a + * comment created by the user. + * + * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. + */ + async deleteCommentProperty(parameters: Parameters.DeleteCommentProperty, callback?: never): Promise; + async deleteCommentProperty( + parameters: Parameters.DeleteCommentProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueCommentProperties.ts b/src/version2/issueCommentProperties.ts deleted file mode 100644 index 59cffd587..000000000 --- a/src/version2/issueCommentProperties.ts +++ /dev/null @@ -1,196 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueCommentProperties { - constructor(private client: Client) {} - - /** - * Returns the keys of all the properties of a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentPropertyKeys( - parameters: Parameters.GetCommentPropertyKeys | string, - callback: Callback, - ): Promise; - /** - * Returns the keys of all the properties of a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentPropertyKeys( - parameters: Parameters.GetCommentPropertyKeys | string, - callback?: never, - ): Promise; - async getCommentPropertyKeys( - parameters: Parameters.GetCommentPropertyKeys | string, - callback?: Callback, - ): Promise { - const commentId = typeof parameters === 'string' ? parameters : parameters.commentId; - - const config: RequestConfig = { - url: `/rest/api/2/comment/${commentId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a comment property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentProperty( - parameters: Parameters.GetCommentProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a comment property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentProperty( - parameters: Parameters.GetCommentProperty, - callback?: never, - ): Promise; - async getCommentProperty( - parameters: Parameters.GetCommentProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on any comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on a comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async setCommentProperty( - parameters: Parameters.SetCommentProperty, - callback: Callback, - ): Promise; - /** - * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on any comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on a comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async setCommentProperty(parameters: Parameters.SetCommentProperty, callback?: never): Promise; - async setCommentProperty( - parameters: Parameters.SetCommentProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.property, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a comment property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any - * comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a - * comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async deleteCommentProperty( - parameters: Parameters.DeleteCommentProperty, - callback: Callback, - ): Promise; - /** - * Deletes a comment property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any - * comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a - * comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async deleteCommentProperty(parameters: Parameters.DeleteCommentProperty, callback?: never): Promise; - async deleteCommentProperty( - parameters: Parameters.DeleteCommentProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueComments.mts b/src/version2/issueComments.mts new file mode 100644 index 000000000..95535e577 --- /dev/null +++ b/src/version2/issueComments.mts @@ -0,0 +1,309 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueComments { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * comments specified by a list of comment IDs. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Comments are returned where the user: + * + * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentsByIds( + parameters: Parameters.GetCommentsByIds, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * comments specified by a list of comment IDs. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Comments are returned where the user: + * + * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentsByIds(parameters: Parameters.GetCommentsByIds, callback?: never): Promise; + async getCommentsByIds( + parameters: Parameters.GetCommentsByIds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/comment/list', + method: 'POST', + params: { + expand: parameters.expand, + }, + data: { + ids: parameters.ids, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all comments for an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Comments are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is + * restricted to. + */ + async getComments( + parameters: Parameters.GetComments | string, + callback: Callback, + ): Promise; + /** + * Returns all comments for an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Comments are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is + * restricted to. + */ + async getComments( + parameters: Parameters.GetComments | string, + callback?: never, + ): Promise; + async getComments( + parameters: Parameters.GetComments | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/comment`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + orderBy: typeof parameters !== 'string' && parameters.orderBy, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a comment to an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addComment(parameters: Parameters.AddComment, callback: Callback): Promise; + /** + * Adds a comment to an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addComment(parameters: Parameters.AddComment, callback?: never): Promise; + async addComment(parameters: Parameters.AddComment, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment`, + method: 'POST', + params: { + expand: parameters.expand, + }, + data: { + self: parameters.self, + id: parameters.id, + author: parameters.author, + body: parameters.comment, + renderedBody: parameters.renderedBody, + updateAuthor: parameters.updateAuthor, + created: parameters.created, + updated: parameters.updated, + visibility: parameters.visibility, + jsdPublic: parameters.jsdPublic, + jsdAuthorCanSeeRequest: parameters.jsdAuthorCanSeeRequest, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a comment. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async getComment(parameters: Parameters.GetComment, callback: Callback): Promise; + /** + * Returns a comment. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async getComment(parameters: Parameters.GetComment, callback?: never): Promise; + async getComment(parameters: Parameters.GetComment, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a comment. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue + * containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit + * own comments_ to update comment created by the user. + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async updateComment(parameters: Parameters.UpdateComment, callback: Callback): Promise; + /** + * Updates a comment. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue + * containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit + * own comments_ to update comment created by the user. + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async updateComment(parameters: Parameters.UpdateComment, callback?: never): Promise; + async updateComment( + parameters: Parameters.UpdateComment, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, + method: 'PUT', + params: { + notifyUsers: parameters.notifyUsers, + overrideEditableFlag: parameters.overrideEditableFlag, + expand: parameters.expand, + }, + data: { + body: parameters.comment, + visibility: parameters.visibility, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue + * containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or + * _Delete own comments_ to delete comment created by the user, + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async deleteComment(parameters: Parameters.DeleteComment, callback: Callback): Promise; + /** + * Deletes a comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue + * containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or + * _Delete own comments_ to delete comment created by the user, + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async deleteComment(parameters: Parameters.DeleteComment, callback?: never): Promise; + async deleteComment(parameters: Parameters.DeleteComment, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueComments.ts b/src/version2/issueComments.ts deleted file mode 100644 index 979ba9f5a..000000000 --- a/src/version2/issueComments.ts +++ /dev/null @@ -1,309 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueComments { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * comments specified by a list of comment IDs. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Comments are returned where the user: - * - * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentsByIds( - parameters: Parameters.GetCommentsByIds, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * comments specified by a list of comment IDs. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Comments are returned where the user: - * - * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentsByIds(parameters: Parameters.GetCommentsByIds, callback?: never): Promise; - async getCommentsByIds( - parameters: Parameters.GetCommentsByIds, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/comment/list', - method: 'POST', - params: { - expand: parameters.expand, - }, - data: { - ids: parameters.ids, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all comments for an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Comments are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is - * restricted to. - */ - async getComments( - parameters: Parameters.GetComments | string, - callback: Callback, - ): Promise; - /** - * Returns all comments for an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Comments are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is - * restricted to. - */ - async getComments( - parameters: Parameters.GetComments | string, - callback?: never, - ): Promise; - async getComments( - parameters: Parameters.GetComments | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/comment`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - orderBy: typeof parameters !== 'string' && parameters.orderBy, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a comment to an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addComment(parameters: Parameters.AddComment, callback: Callback): Promise; - /** - * Adds a comment to an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addComment(parameters: Parameters.AddComment, callback?: never): Promise; - async addComment(parameters: Parameters.AddComment, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment`, - method: 'POST', - params: { - expand: parameters.expand, - }, - data: { - self: parameters.self, - id: parameters.id, - author: parameters.author, - body: parameters.comment, - renderedBody: parameters.renderedBody, - updateAuthor: parameters.updateAuthor, - created: parameters.created, - updated: parameters.updated, - visibility: parameters.visibility, - jsdPublic: parameters.jsdPublic, - jsdAuthorCanSeeRequest: parameters.jsdAuthorCanSeeRequest, - properties: parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async getComment(parameters: Parameters.GetComment, callback: Callback): Promise; - /** - * Returns a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async getComment(parameters: Parameters.GetComment, callback?: never): Promise; - async getComment(parameters: Parameters.GetComment, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit - * own comments_ to update comment created by the user. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async updateComment(parameters: Parameters.UpdateComment, callback: Callback): Promise; - /** - * Updates a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit - * own comments_ to update comment created by the user. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async updateComment(parameters: Parameters.UpdateComment, callback?: never): Promise; - async updateComment( - parameters: Parameters.UpdateComment, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, - method: 'PUT', - params: { - notifyUsers: parameters.notifyUsers, - overrideEditableFlag: parameters.overrideEditableFlag, - expand: parameters.expand, - }, - data: { - body: parameters.comment, - visibility: parameters.visibility, - properties: parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or - * _Delete own comments_ to delete comment created by the user, - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async deleteComment(parameters: Parameters.DeleteComment, callback: Callback): Promise; - /** - * Deletes a comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or - * _Delete own comments_ to delete comment created by the user, - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async deleteComment(parameters: Parameters.DeleteComment, callback?: never): Promise; - async deleteComment(parameters: Parameters.DeleteComment, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueCustomFieldConfigurationApps.mts b/src/version2/issueCustomFieldConfigurationApps.mts new file mode 100644 index 000000000..d43364e09 --- /dev/null +++ b/src/version2/issueCustomFieldConfigurationApps.mts @@ -0,0 +1,111 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldConfigurationApps { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * configurations for a custom field created by a [Forge app](https://developer.atlassian.com/platform/forge/). + * + * The result can be filtered by one of these criteria: + * + * - `id`. + * - `fieldContextId`. + * - `issueId`. + * - `projectKeyOrId` and `issueTypeId`. + * + * Otherwise, all configurations are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the Forge app that created the custom field. + */ + async getCustomFieldConfiguration( + parameters: Parameters.GetCustomFieldConfiguration, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * configurations for a custom field created by a [Forge app](https://developer.atlassian.com/platform/forge/). + * + * The result can be filtered by one of these criteria: + * + * - `id`. + * - `fieldContextId`. + * - `issueId`. + * - `projectKeyOrId` and `issueTypeId`. + * + * Otherwise, all configurations are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the Forge app that created the custom field. + */ + async getCustomFieldConfiguration( + parameters: Parameters.GetCustomFieldConfiguration, + callback?: never, + ): Promise; + async getCustomFieldConfiguration( + parameters: Parameters.GetCustomFieldConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/app/field/${parameters.fieldIdOrKey}/context/configuration`, + method: 'GET', + params: { + id: parameters.id, + fieldContextId: parameters.fieldContextId, + issueId: parameters.issueId, + projectKeyOrId: parameters.projectKeyOrId, + issueTypeId: parameters.issueTypeId, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update the configuration for contexts of a custom field created by a [Forge + * app](https://developer.atlassian.com/platform/forge/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the Forge app that created the custom field. + */ + async updateCustomFieldConfiguration( + parameters: Parameters.UpdateCustomFieldConfiguration, + callback: Callback, + ): Promise; + /** + * Update the configuration for contexts of a custom field created by a [Forge + * app](https://developer.atlassian.com/platform/forge/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the Forge app that created the custom field. + */ + async updateCustomFieldConfiguration( + parameters: Parameters.UpdateCustomFieldConfiguration, + callback?: never, + ): Promise; + async updateCustomFieldConfiguration( + parameters: Parameters.UpdateCustomFieldConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/app/field/${parameters.fieldIdOrKey}/context/configuration`, + method: 'PUT', + data: { + configurations: parameters.configurations, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueCustomFieldConfigurationApps.ts b/src/version2/issueCustomFieldConfigurationApps.ts deleted file mode 100644 index 64dd68747..000000000 --- a/src/version2/issueCustomFieldConfigurationApps.ts +++ /dev/null @@ -1,111 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueCustomFieldConfigurationApps { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * configurations for a custom field created by a [Forge app](https://developer.atlassian.com/platform/forge/). - * - * The result can be filtered by one of these criteria: - * - * - `id`. - * - `fieldContextId`. - * - `issueId`. - * - `projectKeyOrId` and `issueTypeId`. - * - * Otherwise, all configurations are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. - */ - async getCustomFieldConfiguration( - parameters: Parameters.GetCustomFieldConfiguration, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * configurations for a custom field created by a [Forge app](https://developer.atlassian.com/platform/forge/). - * - * The result can be filtered by one of these criteria: - * - * - `id`. - * - `fieldContextId`. - * - `issueId`. - * - `projectKeyOrId` and `issueTypeId`. - * - * Otherwise, all configurations are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. - */ - async getCustomFieldConfiguration( - parameters: Parameters.GetCustomFieldConfiguration, - callback?: never, - ): Promise; - async getCustomFieldConfiguration( - parameters: Parameters.GetCustomFieldConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/app/field/${parameters.fieldIdOrKey}/context/configuration`, - method: 'GET', - params: { - id: parameters.id, - fieldContextId: parameters.fieldContextId, - issueId: parameters.issueId, - projectKeyOrId: parameters.projectKeyOrId, - issueTypeId: parameters.issueTypeId, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Update the configuration for contexts of a custom field created by a [Forge - * app](https://developer.atlassian.com/platform/forge/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. - */ - async updateCustomFieldConfiguration( - parameters: Parameters.UpdateCustomFieldConfiguration, - callback: Callback, - ): Promise; - /** - * Update the configuration for contexts of a custom field created by a [Forge - * app](https://developer.atlassian.com/platform/forge/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. - */ - async updateCustomFieldConfiguration( - parameters: Parameters.UpdateCustomFieldConfiguration, - callback?: never, - ): Promise; - async updateCustomFieldConfiguration( - parameters: Parameters.UpdateCustomFieldConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/app/field/${parameters.fieldIdOrKey}/context/configuration`, - method: 'PUT', - data: { - configurations: parameters.configurations, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueCustomFieldContexts.mts b/src/version2/issueCustomFieldContexts.mts new file mode 100644 index 000000000..c31bd826d --- /dev/null +++ b/src/version2/issueCustomFieldContexts.mts @@ -0,0 +1,724 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldContexts { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of [ + * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a + * custom field. Contexts can be returned as follows: + * + * - With no other parameters set, all contexts. + * - By defining `id` only, all contexts from the list of IDs. + * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types + * (true) or those that apply to only a subset of issue types (false) + * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global + * contexts) (true) or those that apply to only a subset of projects (false). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getContextsForField( + parameters: Parameters.GetContextsForField | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of [ + * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a + * custom field. Contexts can be returned as follows: + * + * - With no other parameters set, all contexts. + * - By defining `id` only, all contexts from the list of IDs. + * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types + * (true) or those that apply to only a subset of issue types (false) + * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global + * contexts) (true) or those that apply to only a subset of projects (false). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getContextsForField( + parameters: Parameters.GetContextsForField | string, + callback?: never, + ): Promise; + async getContextsForField( + parameters: Parameters.GetContextsForField | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/2/field/${fieldId}/context`, + method: 'GET', + params: { + isAnyIssueType: typeof parameters !== 'string' && parameters.isAnyIssueType, + isGlobalContext: typeof parameters !== 'string' && parameters.isGlobalContext, + contextId: typeof parameters !== 'string' && parameters.contextId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a custom field context. + * + * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If + * `issueTypeIds` is empty, the context applies to all issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomFieldContext( + parameters: Parameters.CreateCustomFieldContext, + callback: Callback, + ): Promise; + /** + * Creates a custom field context. + * + * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If + * `issueTypeIds` is empty, the context applies to all issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomFieldContext( + parameters: Parameters.CreateCustomFieldContext, + callback?: never, + ): Promise; + async createCustomFieldContext( + parameters: Parameters.CreateCustomFieldContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context`, + method: 'POST', + data: { + id: parameters.id, + name: parameters.name, + description: parameters.description, + projectIds: parameters.projectIds, + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * defaults for a custom field. The results can be filtered by `contextId`, otherwise all values are returned. If no + * defaults are set for a context, nothing is returned. The returned object depends on type of the custom field: + * + * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * + * Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * + * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultValues( + parameters: Parameters.GetDefaultValues | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * defaults for a custom field. The results can be filtered by `contextId`, otherwise all values are returned. If no + * defaults are set for a context, nothing is returned. The returned object depends on type of the custom field: + * + * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * + * Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * + * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultValues( + parameters: Parameters.GetDefaultValues | string, + callback?: never, + ): Promise; + async getDefaultValues( + parameters: Parameters.GetDefaultValues | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/2/field/${fieldId}/context/defaultValue`, + method: 'GET', + params: { + contextId: typeof parameters !== 'string' && parameters.contextId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets default for contexts of a custom field. Default are defined using these objects: + * + * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * + * Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * + * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * + * Only one type of default object can be included in a request. To remove a default for a context, set the default + * parameter to `null`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultValues(parameters: Parameters.SetDefaultValues, callback: Callback): Promise; + /** + * Sets default for contexts of a custom field. Default are defined using these objects: + * + * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * + * Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * + * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * + * Only one type of default object can be included in a request. To remove a default for a context, set the default + * parameter to `null`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: never): Promise; + async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/defaultValue`, + method: 'PUT', + data: { + defaultValues: parameters.defaultValues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. + * Mappings are ordered first by context ID and then by issue type ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeMappingsForContexts( + parameters: Parameters.GetIssueTypeMappingsForContexts | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. + * Mappings are ordered first by context ID and then by issue type ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeMappingsForContexts( + parameters: Parameters.GetIssueTypeMappingsForContexts | string, + callback?: never, + ): Promise; + async getIssueTypeMappingsForContexts( + parameters: Parameters.GetIssueTypeMappingsForContexts | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/2/field/${fieldId}/context/issuetypemapping`, + method: 'GET', + params: { + contextId: typeof parameters !== 'string' && parameters.contextId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * project and issue type mappings and, for each mapping, the ID of a [custom field + * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. + * + * If there is no custom field context assigned to the project then, if present, the custom field context that applies + * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is + * not found, the returned custom field context ID is `null`. + * + * Duplicate project and issue type mappings cannot be provided in the request. + * + * The order of the returned values is the same as provided in the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getCustomFieldContextsForProjectsAndIssueTypes( + parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * project and issue type mappings and, for each mapping, the ID of a [custom field + * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. + * + * If there is no custom field context assigned to the project then, if present, the custom field context that applies + * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is + * not found, the returned custom field context ID is `null`. + * + * Duplicate project and issue type mappings cannot be provided in the request. + * + * The order of the returned values is the same as provided in the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getCustomFieldContextsForProjectsAndIssueTypes( + parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, + callback?: never, + ): Promise; + async getCustomFieldContextsForProjectsAndIssueTypes( + parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/mapping`, + method: 'POST', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + data: { + mappings: parameters.mappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings + * are returned. Invalid IDs are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectContextMapping( + parameters: Parameters.GetProjectContextMapping | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings + * are returned. Invalid IDs are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectContextMapping( + parameters: Parameters.GetProjectContextMapping | string, + callback?: never, + ): Promise; + async getProjectContextMapping( + parameters: Parameters.GetProjectContextMapping | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/2/field/${fieldId}/context/projectmapping`, + method: 'GET', + params: { + contextId: typeof parameters !== 'string' && parameters.contextId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a [ custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomFieldContext( + parameters: Parameters.UpdateCustomFieldContext, + callback: Callback, + ): Promise; + /** + * Updates a [ custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomFieldContext( + parameters: Parameters.UpdateCustomFieldContext, + callback?: never, + ): Promise; + async updateCustomFieldContext( + parameters: Parameters.UpdateCustomFieldContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a [custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomFieldContext( + parameters: Parameters.DeleteCustomFieldContext, + callback: Callback, + ): Promise; + /** + * Deletes a [custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomFieldContext( + parameters: Parameters.DeleteCustomFieldContext, + callback?: never, + ): Promise; + async deleteCustomFieldContext( + parameters: Parameters.DeleteCustomFieldContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds issue types to a custom field context, appending the issue types to the issue types list. + * + * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom + * field context would result in it applying to only the listed issue types. + * + * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addIssueTypesToContext( + parameters: Parameters.AddIssueTypesToContext, + callback: Callback, + ): Promise; + /** + * Adds issue types to a custom field context, appending the issue types to the issue types list. + * + * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom + * field context would result in it applying to only the listed issue types. + * + * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addIssueTypesToContext(parameters: Parameters.AddIssueTypesToContext, callback?: never): Promise; + async addIssueTypesToContext( + parameters: Parameters.AddIssueTypesToContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype`, + method: 'PUT', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes issue types from a custom field context. + * + * A custom field context without any issue types applies to all issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypesFromContext( + parameters: Parameters.RemoveIssueTypesFromContext, + callback: Callback, + ): Promise; + /** + * Removes issue types from a custom field context. + * + * A custom field context without any issue types applies to all issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypesFromContext( + parameters: Parameters.RemoveIssueTypesFromContext, + callback?: never, + ): Promise; + async removeIssueTypesFromContext( + parameters: Parameters.RemoveIssueTypesFromContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype/remove`, + method: 'POST', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns a custom field context to projects. + * + * If any project in the request is assigned to any context of the custom field, the operation fails. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignProjectsToCustomFieldContext( + parameters: Parameters.AssignProjectsToCustomFieldContext, + callback: Callback, + ): Promise; + /** + * Assigns a custom field context to projects. + * + * If any project in the request is assigned to any context of the custom field, the operation fails. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignProjectsToCustomFieldContext( + parameters: Parameters.AssignProjectsToCustomFieldContext, + callback?: never, + ): Promise; + async assignProjectsToCustomFieldContext( + parameters: Parameters.AssignProjectsToCustomFieldContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/project`, + method: 'PUT', + data: { + projectIds: parameters.projectIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a custom field context from projects. + * + * A custom field context without any projects applies to all projects. Removing all projects from a custom field + * context would result in it applying to all projects. + * + * If any project in the request is not assigned to the context, or the operation would result in two global contexts + * for the field, the operation fails. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeCustomFieldContextFromProjects( + parameters: Parameters.RemoveCustomFieldContextFromProjects, + callback: Callback, + ): Promise; + /** + * Removes a custom field context from projects. + * + * A custom field context without any projects applies to all projects. Removing all projects from a custom field + * context would result in it applying to all projects. + * + * If any project in the request is not assigned to the context, or the operation would result in two global contexts + * for the field, the operation fails. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeCustomFieldContextFromProjects( + parameters: Parameters.RemoveCustomFieldContextFromProjects, + callback?: never, + ): Promise; + async removeCustomFieldContextFromProjects( + parameters: Parameters.RemoveCustomFieldContextFromProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/project/remove`, + method: 'POST', + data: { + projectIds: parameters.projectIds, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueCustomFieldContexts.ts b/src/version2/issueCustomFieldContexts.ts deleted file mode 100644 index 8c499242b..000000000 --- a/src/version2/issueCustomFieldContexts.ts +++ /dev/null @@ -1,724 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueCustomFieldContexts { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of [ - * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a - * custom field. Contexts can be returned as follows: - * - * - With no other parameters set, all contexts. - * - By defining `id` only, all contexts from the list of IDs. - * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types - * (true) or those that apply to only a subset of issue types (false) - * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global - * contexts) (true) or those that apply to only a subset of projects (false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getContextsForField( - parameters: Parameters.GetContextsForField | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of [ - * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a - * custom field. Contexts can be returned as follows: - * - * - With no other parameters set, all contexts. - * - By defining `id` only, all contexts from the list of IDs. - * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types - * (true) or those that apply to only a subset of issue types (false) - * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global - * contexts) (true) or those that apply to only a subset of projects (false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getContextsForField( - parameters: Parameters.GetContextsForField | string, - callback?: never, - ): Promise; - async getContextsForField( - parameters: Parameters.GetContextsForField | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldId}/context`, - method: 'GET', - params: { - isAnyIssueType: typeof parameters !== 'string' && parameters.isAnyIssueType, - isGlobalContext: typeof parameters !== 'string' && parameters.isGlobalContext, - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a custom field context. - * - * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If - * `issueTypeIds` is empty, the context applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldContext( - parameters: Parameters.CreateCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Creates a custom field context. - * - * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If - * `issueTypeIds` is empty, the context applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldContext( - parameters: Parameters.CreateCustomFieldContext, - callback?: never, - ): Promise; - async createCustomFieldContext( - parameters: Parameters.CreateCustomFieldContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context`, - method: 'POST', - data: { - id: parameters.id, - name: parameters.name, - description: parameters.description, - projectIds: parameters.projectIds, - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * defaults for a custom field. The results can be filtered by `contextId`, otherwise all values are returned. If no - * defaults are set for a context, nothing is returned. The returned object depends on type of the custom field: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultValues( - parameters: Parameters.GetDefaultValues | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * defaults for a custom field. The results can be filtered by `contextId`, otherwise all values are returned. If no - * defaults are set for a context, nothing is returned. The returned object depends on type of the custom field: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultValues( - parameters: Parameters.GetDefaultValues | string, - callback?: never, - ): Promise; - async getDefaultValues( - parameters: Parameters.GetDefaultValues | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldId}/context/defaultValue`, - method: 'GET', - params: { - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets default for contexts of a custom field. Default are defined using these objects: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * Only one type of default object can be included in a request. To remove a default for a context, set the default - * parameter to `null`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultValues(parameters: Parameters.SetDefaultValues, callback: Callback): Promise; - /** - * Sets default for contexts of a custom field. Default are defined using these objects: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * Only one type of default object can be included in a request. To remove a default for a context, set the default - * parameter to `null`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: never): Promise; - async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/defaultValue`, - method: 'PUT', - data: { - defaultValues: parameters.defaultValues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. - * Mappings are ordered first by context ID and then by issue type ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeMappingsForContexts( - parameters: Parameters.GetIssueTypeMappingsForContexts | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. - * Mappings are ordered first by context ID and then by issue type ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeMappingsForContexts( - parameters: Parameters.GetIssueTypeMappingsForContexts | string, - callback?: never, - ): Promise; - async getIssueTypeMappingsForContexts( - parameters: Parameters.GetIssueTypeMappingsForContexts | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldId}/context/issuetypemapping`, - method: 'GET', - params: { - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * project and issue type mappings and, for each mapping, the ID of a [custom field - * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. - * - * If there is no custom field context assigned to the project then, if present, the custom field context that applies - * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is - * not found, the returned custom field context ID is `null`. - * - * Duplicate project and issue type mappings cannot be provided in the request. - * - * The order of the returned values is the same as provided in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getCustomFieldContextsForProjectsAndIssueTypes( - parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * project and issue type mappings and, for each mapping, the ID of a [custom field - * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. - * - * If there is no custom field context assigned to the project then, if present, the custom field context that applies - * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is - * not found, the returned custom field context ID is `null`. - * - * Duplicate project and issue type mappings cannot be provided in the request. - * - * The order of the returned values is the same as provided in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getCustomFieldContextsForProjectsAndIssueTypes( - parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, - callback?: never, - ): Promise; - async getCustomFieldContextsForProjectsAndIssueTypes( - parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/mapping`, - method: 'POST', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - data: { - mappings: parameters.mappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings - * are returned. Invalid IDs are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectContextMapping( - parameters: Parameters.GetProjectContextMapping | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings - * are returned. Invalid IDs are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectContextMapping( - parameters: Parameters.GetProjectContextMapping | string, - callback?: never, - ): Promise; - async getProjectContextMapping( - parameters: Parameters.GetProjectContextMapping | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldId}/context/projectmapping`, - method: 'GET', - params: { - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a [ custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomFieldContext( - parameters: Parameters.UpdateCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Updates a [ custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomFieldContext( - parameters: Parameters.UpdateCustomFieldContext, - callback?: never, - ): Promise; - async updateCustomFieldContext( - parameters: Parameters.UpdateCustomFieldContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a [custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldContext( - parameters: Parameters.DeleteCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Deletes a [custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldContext( - parameters: Parameters.DeleteCustomFieldContext, - callback?: never, - ): Promise; - async deleteCustomFieldContext( - parameters: Parameters.DeleteCustomFieldContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds issue types to a custom field context, appending the issue types to the issue types list. - * - * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom - * field context would result in it applying to only the listed issue types. - * - * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToContext( - parameters: Parameters.AddIssueTypesToContext, - callback: Callback, - ): Promise; - /** - * Adds issue types to a custom field context, appending the issue types to the issue types list. - * - * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom - * field context would result in it applying to only the listed issue types. - * - * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToContext(parameters: Parameters.AddIssueTypesToContext, callback?: never): Promise; - async addIssueTypesToContext( - parameters: Parameters.AddIssueTypesToContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype`, - method: 'PUT', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes issue types from a custom field context. - * - * A custom field context without any issue types applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromContext( - parameters: Parameters.RemoveIssueTypesFromContext, - callback: Callback, - ): Promise; - /** - * Removes issue types from a custom field context. - * - * A custom field context without any issue types applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromContext( - parameters: Parameters.RemoveIssueTypesFromContext, - callback?: never, - ): Promise; - async removeIssueTypesFromContext( - parameters: Parameters.RemoveIssueTypesFromContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype/remove`, - method: 'POST', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns a custom field context to projects. - * - * If any project in the request is assigned to any context of the custom field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignProjectsToCustomFieldContext( - parameters: Parameters.AssignProjectsToCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Assigns a custom field context to projects. - * - * If any project in the request is assigned to any context of the custom field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignProjectsToCustomFieldContext( - parameters: Parameters.AssignProjectsToCustomFieldContext, - callback?: never, - ): Promise; - async assignProjectsToCustomFieldContext( - parameters: Parameters.AssignProjectsToCustomFieldContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/project`, - method: 'PUT', - data: { - projectIds: parameters.projectIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a custom field context from projects. - * - * A custom field context without any projects applies to all projects. Removing all projects from a custom field - * context would result in it applying to all projects. - * - * If any project in the request is not assigned to the context, or the operation would result in two global contexts - * for the field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeCustomFieldContextFromProjects( - parameters: Parameters.RemoveCustomFieldContextFromProjects, - callback: Callback, - ): Promise; - /** - * Removes a custom field context from projects. - * - * A custom field context without any projects applies to all projects. Removing all projects from a custom field - * context would result in it applying to all projects. - * - * If any project in the request is not assigned to the context, or the operation would result in two global contexts - * for the field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeCustomFieldContextFromProjects( - parameters: Parameters.RemoveCustomFieldContextFromProjects, - callback?: never, - ): Promise; - async removeCustomFieldContextFromProjects( - parameters: Parameters.RemoveCustomFieldContextFromProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/project/remove`, - method: 'POST', - data: { - projectIds: parameters.projectIds, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueCustomFieldOptions.mts b/src/version2/issueCustomFieldOptions.mts new file mode 100644 index 000000000..f864b895e --- /dev/null +++ b/src/version2/issueCustomFieldOptions.mts @@ -0,0 +1,301 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldOptions { + constructor(private client: Client) {} + + /** + * Returns a custom field option. For example, an option in a select list. + * + * Note that this operation **only works for issue field select list options created in Jira or using operations from + * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue + * field select list options created by Connect apps. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * custom field option is returned as follows: + * + * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least + * one project the custom field is used in, and the field is visible in at least one layout the user has permission + * to view. + */ + async getCustomFieldOption( + parameters: Parameters.GetCustomFieldOption | string, + callback: Callback, + ): Promise; + /** + * Returns a custom field option. For example, an option in a select list. + * + * Note that this operation **only works for issue field select list options created in Jira or using operations from + * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue + * field select list options created by Connect apps. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * custom field option is returned as follows: + * + * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least + * one project the custom field is used in, and the field is visible in at least one layout the user has permission + * to view. + */ + async getCustomFieldOption( + parameters: Parameters.GetCustomFieldOption | string, + callback?: never, + ): Promise; + async getCustomFieldOption( + parameters: Parameters.GetCustomFieldOption | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/customFieldOption/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * custom field option for a context. Options are returned first then cascading options, in the order they display in + * Jira. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getOptionsForContext( + parameters: Parameters.GetOptionsForContext, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * custom field option for a context. Options are returned first then cascading options, in the order they display in + * Jira. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getOptionsForContext( + parameters: Parameters.GetOptionsForContext, + callback?: never, + ): Promise; + async getOptionsForContext( + parameters: Parameters.GetOptionsForContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option`, + method: 'GET', + params: { + optionId: parameters.optionId, + onlyOptions: parameters.onlyOptions, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a + * custom select field. The options are added to a context of the field. + * + * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 + * options. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomFieldOption( + parameters: Parameters.CreateCustomFieldOption, + callback: Callback, + ): Promise; + /** + * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a + * custom select field. The options are added to a context of the field. + * + * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 + * options. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomFieldOption( + parameters: Parameters.CreateCustomFieldOption, + callback?: never, + ): Promise; + async createCustomFieldOption( + parameters: Parameters.CreateCustomFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option`, + method: 'POST', + data: { + options: parameters.options, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the options of a custom field. + * + * If any of the options are not found, no options are updated. Options where the values in the request match the + * current values aren't updated and aren't reported in the response. + * + * Note that this operation **only works for issue field select list options created in Jira or using operations from + * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue + * field select list options created by Connect apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomFieldOption( + parameters: Parameters.UpdateCustomFieldOption, + callback: Callback, + ): Promise; + /** + * Updates the options of a custom field. + * + * If any of the options are not found, no options are updated. Options where the values in the request match the + * current values aren't updated and aren't reported in the response. + * + * Note that this operation **only works for issue field select list options created in Jira or using operations from + * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue + * field select list options created by Connect apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomFieldOption( + parameters: Parameters.UpdateCustomFieldOption, + callback?: never, + ): Promise; + async updateCustomFieldOption( + parameters: Parameters.UpdateCustomFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option`, + method: 'PUT', + data: { + options: parameters.options, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the order of custom field options or cascading options in a context. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async reorderCustomFieldOptions( + parameters: Parameters.ReorderCustomFieldOptions, + callback: Callback, + ): Promise; + /** + * Changes the order of custom field options or cascading options in a context. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async reorderCustomFieldOptions( + parameters: Parameters.ReorderCustomFieldOptions, + callback?: never, + ): Promise; + async reorderCustomFieldOptions( + parameters: Parameters.ReorderCustomFieldOptions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option/move`, + method: 'PUT', + data: { + customFieldOptionIds: parameters.customFieldOptionIds, + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a custom field option. + * + * Options with cascading options cannot be deleted without deleting the cascading options first. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomFieldOption( + parameters: Parameters.DeleteCustomFieldOption, + callback: Callback, + ): Promise; + /** + * Deletes a custom field option. + * + * Options with cascading options cannot be deleted without deleting the cascading options first. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomFieldOption(parameters: Parameters.DeleteCustomFieldOption, callback?: never): Promise; + async deleteCustomFieldOption( + parameters: Parameters.DeleteCustomFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option/${parameters.optionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueCustomFieldOptions.ts b/src/version2/issueCustomFieldOptions.ts deleted file mode 100644 index 62ea4fbd6..000000000 --- a/src/version2/issueCustomFieldOptions.ts +++ /dev/null @@ -1,301 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueCustomFieldOptions { - constructor(private client: Client) {} - - /** - * Returns a custom field option. For example, an option in a select list. - * - * Note that this operation **only works for issue field select list options created in Jira or using operations from - * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue - * field select list options created by Connect apps. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * custom field option is returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least - * one project the custom field is used in, and the field is visible in at least one layout the user has permission - * to view. - */ - async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, - callback: Callback, - ): Promise; - /** - * Returns a custom field option. For example, an option in a select list. - * - * Note that this operation **only works for issue field select list options created in Jira or using operations from - * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue - * field select list options created by Connect apps. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * custom field option is returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least - * one project the custom field is used in, and the field is visible in at least one layout the user has permission - * to view. - */ - async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, - callback?: never, - ): Promise; - async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/customFieldOption/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * custom field option for a context. Options are returned first then cascading options, in the order they display in - * Jira. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getOptionsForContext( - parameters: Parameters.GetOptionsForContext, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * custom field option for a context. Options are returned first then cascading options, in the order they display in - * Jira. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getOptionsForContext( - parameters: Parameters.GetOptionsForContext, - callback?: never, - ): Promise; - async getOptionsForContext( - parameters: Parameters.GetOptionsForContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option`, - method: 'GET', - params: { - optionId: parameters.optionId, - onlyOptions: parameters.onlyOptions, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a - * custom select field. The options are added to a context of the field. - * - * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 - * options. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldOption( - parameters: Parameters.CreateCustomFieldOption, - callback: Callback, - ): Promise; - /** - * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a - * custom select field. The options are added to a context of the field. - * - * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 - * options. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldOption( - parameters: Parameters.CreateCustomFieldOption, - callback?: never, - ): Promise; - async createCustomFieldOption( - parameters: Parameters.CreateCustomFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option`, - method: 'POST', - data: { - options: parameters.options, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the options of a custom field. - * - * If any of the options are not found, no options are updated. Options where the values in the request match the - * current values aren't updated and aren't reported in the response. - * - * Note that this operation **only works for issue field select list options created in Jira or using operations from - * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue - * field select list options created by Connect apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomFieldOption( - parameters: Parameters.UpdateCustomFieldOption, - callback: Callback, - ): Promise; - /** - * Updates the options of a custom field. - * - * If any of the options are not found, no options are updated. Options where the values in the request match the - * current values aren't updated and aren't reported in the response. - * - * Note that this operation **only works for issue field select list options created in Jira or using operations from - * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue - * field select list options created by Connect apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomFieldOption( - parameters: Parameters.UpdateCustomFieldOption, - callback?: never, - ): Promise; - async updateCustomFieldOption( - parameters: Parameters.UpdateCustomFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option`, - method: 'PUT', - data: { - options: parameters.options, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the order of custom field options or cascading options in a context. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderCustomFieldOptions( - parameters: Parameters.ReorderCustomFieldOptions, - callback: Callback, - ): Promise; - /** - * Changes the order of custom field options or cascading options in a context. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderCustomFieldOptions( - parameters: Parameters.ReorderCustomFieldOptions, - callback?: never, - ): Promise; - async reorderCustomFieldOptions( - parameters: Parameters.ReorderCustomFieldOptions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option/move`, - method: 'PUT', - data: { - customFieldOptionIds: parameters.customFieldOptionIds, - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a custom field option. - * - * Options with cascading options cannot be deleted without deleting the cascading options first. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldOption( - parameters: Parameters.DeleteCustomFieldOption, - callback: Callback, - ): Promise; - /** - * Deletes a custom field option. - * - * Options with cascading options cannot be deleted without deleting the cascading options first. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldOption(parameters: Parameters.DeleteCustomFieldOption, callback?: never): Promise; - async deleteCustomFieldOption( - parameters: Parameters.DeleteCustomFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option/${parameters.optionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueCustomFieldOptionsApps.mts b/src/version2/issueCustomFieldOptionsApps.mts new file mode 100644 index 000000000..e82356c1d --- /dev/null +++ b/src/version2/issueCustomFieldOptionsApps.mts @@ -0,0 +1,407 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldOptionsApps { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * the options of a select list issue field. A select list issue field is a type of [issue + * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a + * value from a list of options. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async getAllIssueFieldOptions( + parameters: Parameters.GetAllIssueFieldOptions | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * the options of a select list issue field. A select list issue field is a type of [issue + * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a + * value from a list of options. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async getAllIssueFieldOptions( + parameters: Parameters.GetAllIssueFieldOptions | string, + callback?: never, + ): Promise; + async getAllIssueFieldOptions( + parameters: Parameters.GetAllIssueFieldOptions | string, + callback?: Callback, + ): Promise { + const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; + + const config: RequestConfig = { + url: `/rest/api/2/field/${fieldKey}/option`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an option for a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async createIssueFieldOption( + parameters: Parameters.CreateIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Creates an option for a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async createIssueFieldOption( + parameters: Parameters.CreateIssueFieldOption, + callback?: never, + ): Promise; + async createIssueFieldOption( + parameters: Parameters.CreateIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldKey}/option`, + method: 'POST', + data: { + value: parameters.value, + properties: parameters.properties, + config: parameters.config, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * options for a select list issue field that can be viewed and selected by the user. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getSelectableIssueFieldOptions( + parameters: Parameters.GetSelectableIssueFieldOptions | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * options for a select list issue field that can be viewed and selected by the user. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getSelectableIssueFieldOptions( + parameters: Parameters.GetSelectableIssueFieldOptions | string, + callback?: never, + ): Promise; + async getSelectableIssueFieldOptions( + parameters: Parameters.GetSelectableIssueFieldOptions | string, + callback?: Callback, + ): Promise { + const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; + + const config: RequestConfig = { + url: `/rest/api/2/field/${fieldKey}/option/suggestions/edit`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + projectId: typeof parameters !== 'string' && parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * options for a select list issue field that can be viewed by the user. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getVisibleIssueFieldOptions( + parameters: Parameters.GetVisibleIssueFieldOptions | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * options for a select list issue field that can be viewed by the user. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getVisibleIssueFieldOptions( + parameters: Parameters.GetVisibleIssueFieldOptions | string, + callback?: never, + ): Promise; + async getVisibleIssueFieldOptions( + parameters: Parameters.GetVisibleIssueFieldOptions | string, + callback?: Callback, + ): Promise { + const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; + + const config: RequestConfig = { + url: `/rest/api/2/field/${fieldKey}/option/suggestions/search`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + projectId: typeof parameters !== 'string' && parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an option from a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async getIssueFieldOption( + parameters: Parameters.GetIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Returns an option from a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async getIssueFieldOption( + parameters: Parameters.GetIssueFieldOption, + callback?: never, + ): Promise; + async getIssueFieldOption( + parameters: Parameters.GetIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided + * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID + * provided in the path and body must be identical. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async updateIssueFieldOption( + parameters: Parameters.UpdateIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided + * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID + * provided in the path and body must be identical. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async updateIssueFieldOption( + parameters: Parameters.UpdateIssueFieldOption, + callback?: never, + ): Promise; + async updateIssueFieldOption( + parameters: Parameters.UpdateIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, + method: 'PUT', + data: { + id: parameters.id, + value: parameters.value, + properties: parameters.properties, + config: parameters.config, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an option from a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async deleteIssueFieldOption( + parameters: Parameters.DeleteIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Deletes an option from a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async deleteIssueFieldOption(parameters: Parameters.DeleteIssueFieldOption, callback?: never): Promise; + async deleteIssueFieldOption( + parameters: Parameters.DeleteIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deselects an issue-field select-list option from all issues where it is selected. A different option can be + * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a Jql + * query. + * + * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + * can override the screen security configuration using `overrideScreenSecurity` and `overrideEditableFlag`. + * + * This is an [asynchronous + * operation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). The response + * object contains a link to the long-running task. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async replaceIssueFieldOption( + parameters: Parameters.ReplaceIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Deselects an issue-field select-list option from all issues where it is selected. A different option can be + * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a Jql + * query. + * + * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + * can override the screen security configuration using `overrideScreenSecurity` and `overrideEditableFlag`. + * + * This is an [asynchronous + * operation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). The response + * object contains a link to the long-running task. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async replaceIssueFieldOption( + parameters: Parameters.ReplaceIssueFieldOption, + callback?: never, + ): Promise; + async replaceIssueFieldOption( + parameters: Parameters.ReplaceIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}/issue`, + method: 'DELETE', + params: { + replaceWith: parameters.replaceWith, + jql: parameters.jql, + overrideScreenSecurity: parameters.overrideScreenSecurity, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueCustomFieldOptionsApps.ts b/src/version2/issueCustomFieldOptionsApps.ts deleted file mode 100644 index f69906d57..000000000 --- a/src/version2/issueCustomFieldOptionsApps.ts +++ /dev/null @@ -1,407 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueCustomFieldOptionsApps { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * the options of a select list issue field. A select list issue field is a type of [issue - * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a - * value from a list of options. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * the options of a select list issue field. A select list issue field is a type of [issue - * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a - * value from a list of options. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, - callback?: never, - ): Promise; - async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, - callback?: Callback, - ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldKey}/option`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an option for a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async createIssueFieldOption( - parameters: Parameters.CreateIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Creates an option for a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async createIssueFieldOption( - parameters: Parameters.CreateIssueFieldOption, - callback?: never, - ): Promise; - async createIssueFieldOption( - parameters: Parameters.CreateIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldKey}/option`, - method: 'POST', - data: { - value: parameters.value, - properties: parameters.properties, - config: parameters.config, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * options for a select list issue field that can be viewed and selected by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * options for a select list issue field that can be viewed and selected by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, - callback?: never, - ): Promise; - async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, - callback?: Callback, - ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldKey}/option/suggestions/edit`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - projectId: typeof parameters !== 'string' && parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * options for a select list issue field that can be viewed by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * options for a select list issue field that can be viewed by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, - callback?: never, - ): Promise; - async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, - callback?: Callback, - ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldKey}/option/suggestions/search`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - projectId: typeof parameters !== 'string' && parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async getIssueFieldOption( - parameters: Parameters.GetIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Returns an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async getIssueFieldOption( - parameters: Parameters.GetIssueFieldOption, - callback?: never, - ): Promise; - async getIssueFieldOption( - parameters: Parameters.GetIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided - * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID - * provided in the path and body must be identical. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async updateIssueFieldOption( - parameters: Parameters.UpdateIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided - * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID - * provided in the path and body must be identical. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async updateIssueFieldOption( - parameters: Parameters.UpdateIssueFieldOption, - callback?: never, - ): Promise; - async updateIssueFieldOption( - parameters: Parameters.UpdateIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, - method: 'PUT', - data: { - id: parameters.id, - value: parameters.value, - properties: parameters.properties, - config: parameters.config, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async deleteIssueFieldOption( - parameters: Parameters.DeleteIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Deletes an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async deleteIssueFieldOption(parameters: Parameters.DeleteIssueFieldOption, callback?: never): Promise; - async deleteIssueFieldOption( - parameters: Parameters.DeleteIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deselects an issue-field select-list option from all issues where it is selected. A different option can be - * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a JQL - * query. - * - * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - * can override the screen security configuration using `overrideScreenSecurity` and `overrideEditableFlag`. - * - * This is an [asynchronous - * operation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). The response - * object contains a link to the long-running task. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async replaceIssueFieldOption( - parameters: Parameters.ReplaceIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Deselects an issue-field select-list option from all issues where it is selected. A different option can be - * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a JQL - * query. - * - * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - * can override the screen security configuration using `overrideScreenSecurity` and `overrideEditableFlag`. - * - * This is an [asynchronous - * operation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). The response - * object contains a link to the long-running task. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async replaceIssueFieldOption( - parameters: Parameters.ReplaceIssueFieldOption, - callback?: never, - ): Promise; - async replaceIssueFieldOption( - parameters: Parameters.ReplaceIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}/issue`, - method: 'DELETE', - params: { - replaceWith: parameters.replaceWith, - jql: parameters.jql, - overrideScreenSecurity: parameters.overrideScreenSecurity, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueCustomFieldValuesApps.mts b/src/version2/issueCustomFieldValuesApps.mts new file mode 100644 index 000000000..f60d2ad49 --- /dev/null +++ b/src/version2/issueCustomFieldValuesApps.mts @@ -0,0 +1,85 @@ +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldValuesApps { + constructor(private client: Client) {} + + /** + * Updates the value of one or more custom fields on one or more issues. Combinations of custom field and issue should + * be unique within the request. Custom fields can only be updated by the Forge app that created them. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * the app that created the custom field can update its values with this operation. + */ + async updateMultipleCustomFieldValues( + parameters: Parameters.UpdateMultipleCustomFieldValues, + callback: Callback, + ): Promise; + /** + * Updates the value of one or more custom fields on one or more issues. Combinations of custom field and issue should + * be unique within the request. Custom fields can only be updated by the Forge app that created them. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * the app that created the custom field can update its values with this operation. + */ + async updateMultipleCustomFieldValues( + parameters: Parameters.UpdateMultipleCustomFieldValues, + callback?: never, + ): Promise; + async updateMultipleCustomFieldValues( + parameters: Parameters.UpdateMultipleCustomFieldValues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/app/field/value', + method: 'POST', + params: { + generateChangelog: parameters.generateChangelog, + }, + data: { + updates: parameters.updates, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the value of a custom field on one or more issues. Custom fields can only be updated by the Forge app that + * created them. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * the app that created the custom field can update its values with this operation. + */ + async updateCustomFieldValue( + parameters: Parameters.UpdateCustomFieldValue, + callback: Callback, + ): Promise; + /** + * Updates the value of a custom field on one or more issues. Custom fields can only be updated by the Forge app that + * created them. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * the app that created the custom field can update its values with this operation. + */ + async updateCustomFieldValue(parameters: Parameters.UpdateCustomFieldValue, callback?: never): Promise; + async updateCustomFieldValue( + parameters: Parameters.UpdateCustomFieldValue, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/app/field/${parameters.fieldIdOrKey}/value`, + method: 'PUT', + params: { + generateChangelog: parameters.generateChangelog, + }, + data: { + updates: parameters.updates, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueCustomFieldValuesApps.ts b/src/version2/issueCustomFieldValuesApps.ts deleted file mode 100644 index ccc05e445..000000000 --- a/src/version2/issueCustomFieldValuesApps.ts +++ /dev/null @@ -1,85 +0,0 @@ -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueCustomFieldValuesApps { - constructor(private client: Client) {} - - /** - * Updates the value of one or more custom fields on one or more issues. Combinations of custom field and issue should - * be unique within the request. Custom fields can only be updated by the Forge app that created them. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. - */ - async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues, - callback: Callback, - ): Promise; - /** - * Updates the value of one or more custom fields on one or more issues. Combinations of custom field and issue should - * be unique within the request. Custom fields can only be updated by the Forge app that created them. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. - */ - async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues, - callback?: never, - ): Promise; - async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/app/field/value', - method: 'POST', - params: { - generateChangelog: parameters.generateChangelog, - }, - data: { - updates: parameters.updates, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the value of a custom field on one or more issues. Custom fields can only be updated by the Forge app that - * created them. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. - */ - async updateCustomFieldValue( - parameters: Parameters.UpdateCustomFieldValue, - callback: Callback, - ): Promise; - /** - * Updates the value of a custom field on one or more issues. Custom fields can only be updated by the Forge app that - * created them. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. - */ - async updateCustomFieldValue(parameters: Parameters.UpdateCustomFieldValue, callback?: never): Promise; - async updateCustomFieldValue( - parameters: Parameters.UpdateCustomFieldValue, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/app/field/${parameters.fieldIdOrKey}/value`, - method: 'PUT', - params: { - generateChangelog: parameters.generateChangelog, - }, - data: { - updates: parameters.updates, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueFieldConfigurations.mts b/src/version2/issueFieldConfigurations.mts new file mode 100644 index 000000000..deac64265 --- /dev/null +++ b/src/version2/issueFieldConfigurations.mts @@ -0,0 +1,650 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueFieldConfigurations { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field + * configurations. The list can be for all field configurations or a subset determined by any combination of these + * criteria: + * + * - A list of field configuration item IDs. + * - Whether the field configuration is a default. + * - Whether the field configuration name or description contains a query string. + * + * Only field configurations used in company-managed (classic) projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllFieldConfigurations( + parameters: Parameters.GetAllFieldConfigurations | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field + * configurations. The list can be for all field configurations or a subset determined by any combination of these + * criteria: + * + * - A list of field configuration item IDs. + * - Whether the field configuration is a default. + * - Whether the field configuration name or description contains a query string. + * + * Only field configurations used in company-managed (classic) projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllFieldConfigurations( + parameters?: Parameters.GetAllFieldConfigurations, + callback?: never, + ): Promise; + async getAllFieldConfigurations( + parameters?: Parameters.GetAllFieldConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/fieldconfiguration', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + isDefault: parameters?.isDefault, + query: parameters?.query, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a field configuration. The field configuration is created with the same field properties as the default + * configuration, with all the fields being optional. + * + * This operation can only create configurations for use in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createFieldConfiguration( + parameters: Parameters.CreateFieldConfiguration | undefined, + callback: Callback, + ): Promise; + /** + * Creates a field configuration. The field configuration is created with the same field properties as the default + * configuration, with all the fields being optional. + * + * This operation can only create configurations for use in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createFieldConfiguration( + parameters?: Parameters.CreateFieldConfiguration, + callback?: never, + ): Promise; + async createFieldConfiguration( + parameters?: Parameters.CreateFieldConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/fieldconfiguration', + method: 'POST', + data: { + name: parameters?.name, + description: parameters?.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a field configuration. The name and the description provided in the request override the existing values. + * + * This operation can only update configurations used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfiguration( + parameters: Parameters.UpdateFieldConfiguration, + callback: Callback, + ): Promise; + /** + * Updates a field configuration. The name and the description provided in the request override the existing values. + * + * This operation can only update configurations used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfiguration( + parameters: Parameters.UpdateFieldConfiguration, + callback?: never, + ): Promise; + async updateFieldConfiguration( + parameters: Parameters.UpdateFieldConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/fieldconfiguration/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a field configuration. + * + * This operation can only delete configurations used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFieldConfiguration( + parameters: Parameters.DeleteFieldConfiguration | string, + callback: Callback, + ): Promise; + /** + * Deletes a field configuration. + * + * This operation can only delete configurations used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFieldConfiguration( + parameters: Parameters.DeleteFieldConfiguration | string, + callback?: never, + ): Promise; + async deleteFieldConfiguration( + parameters: Parameters.DeleteFieldConfiguration | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/fieldconfiguration/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * fields for a configuration. + * + * Only the fields from configurations used in company-managed (classic) projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldConfigurationItems( + parameters: Parameters.GetFieldConfigurationItems | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * fields for a configuration. + * + * Only the fields from configurations used in company-managed (classic) projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldConfigurationItems( + parameters: Parameters.GetFieldConfigurationItems | string, + callback?: never, + ): Promise; + async getFieldConfigurationItems( + parameters: Parameters.GetFieldConfigurationItems | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/fieldconfiguration/${id}/fields`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates fields in a field configuration. The properties of the field configuration fields provided override the + * existing values. + * + * This operation can only update field configurations used in company-managed (classic) projects. + * + * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style + * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer + * (`autocomplete-renderer`). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfigurationItems( + parameters: Parameters.UpdateFieldConfigurationItems, + callback: Callback, + ): Promise; + /** + * Updates fields in a field configuration. The properties of the field configuration fields provided override the + * existing values. + * + * This operation can only update field configurations used in company-managed (classic) projects. + * + * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style + * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer + * (`autocomplete-renderer`). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfigurationItems( + parameters: Parameters.UpdateFieldConfigurationItems, + callback?: never, + ): Promise; + async updateFieldConfigurationItems( + parameters: Parameters.UpdateFieldConfigurationItems, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/fieldconfiguration/${parameters.id}/fields`, + method: 'PUT', + data: { + fieldConfigurationItems: parameters.fieldConfigurationItems, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field + * configuration schemes. + * + * Only field configuration schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllFieldConfigurationSchemes( + parameters: Parameters.GetAllFieldConfigurationSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field + * configuration schemes. + * + * Only field configuration schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllFieldConfigurationSchemes( + parameters?: Parameters.GetAllFieldConfigurationSchemes, + callback?: never, + ): Promise; + async getAllFieldConfigurationSchemes( + parameters?: Parameters.GetAllFieldConfigurationSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/fieldconfigurationscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a field configuration scheme. + * + * This operation can only create field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createFieldConfigurationScheme( + parameters: Parameters.CreateFieldConfigurationScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates a field configuration scheme. + * + * This operation can only create field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createFieldConfigurationScheme( + parameters?: Parameters.CreateFieldConfigurationScheme, + callback?: never, + ): Promise; + async createFieldConfigurationScheme( + parameters?: Parameters.CreateFieldConfigurationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/fieldconfigurationscheme', + method: 'POST', + data: { + name: parameters?.name, + description: parameters?.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field + * configuration issue type items. + * + * Only items used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldConfigurationSchemeMappings( + parameters: Parameters.GetFieldConfigurationSchemeMappings | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field + * configuration issue type items. + * + * Only items used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldConfigurationSchemeMappings( + parameters?: Parameters.GetFieldConfigurationSchemeMappings, + callback?: never, + ): Promise; + async getFieldConfigurationSchemeMappings( + parameters?: Parameters.GetFieldConfigurationSchemeMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/fieldconfigurationscheme/mapping', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + fieldConfigurationSchemeId: parameters?.fieldConfigurationSchemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field + * configuration schemes and, for each scheme, a list of the projects that use it. + * + * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to + * the default field configuration scheme. + * + * Only field configuration schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldConfigurationSchemeProjectMapping( + parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field + * configuration schemes and, for each scheme, a list of the projects that use it. + * + * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to + * the default field configuration scheme. + * + * Only field configuration schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldConfigurationSchemeProjectMapping( + parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, + callback?: never, + ): Promise; + async getFieldConfigurationSchemeProjectMapping( + parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/fieldconfigurationscheme/project', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation + * assigns the default field configuration scheme. + * + * Field configuration schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignFieldConfigurationSchemeToProject( + parameters: Parameters.AssignFieldConfigurationSchemeToProject, + callback: Callback, + ): Promise; + /** + * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation + * assigns the default field configuration scheme. + * + * Field configuration schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignFieldConfigurationSchemeToProject( + parameters: Parameters.AssignFieldConfigurationSchemeToProject, + callback?: never, + ): Promise; + async assignFieldConfigurationSchemeToProject( + parameters: Parameters.AssignFieldConfigurationSchemeToProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/fieldconfigurationscheme/project', + method: 'PUT', + data: { + fieldConfigurationSchemeId: parameters.fieldConfigurationSchemeId, + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a field configuration scheme. + * + * This operation can only update field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfigurationScheme( + parameters: Parameters.UpdateFieldConfigurationScheme, + callback: Callback, + ): Promise; + /** + * Updates a field configuration scheme. + * + * This operation can only update field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfigurationScheme( + parameters: Parameters.UpdateFieldConfigurationScheme, + callback?: never, + ): Promise; + async updateFieldConfigurationScheme( + parameters: Parameters.UpdateFieldConfigurationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/fieldconfigurationscheme/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a field configuration scheme. + * + * This operation can only delete field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFieldConfigurationScheme( + parameters: Parameters.DeleteFieldConfigurationScheme | string, + callback: Callback, + ): Promise; + /** + * Deletes a field configuration scheme. + * + * This operation can only delete field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFieldConfigurationScheme( + parameters: Parameters.DeleteFieldConfigurationScheme | string, + callback?: never, + ): Promise; + async deleteFieldConfigurationScheme( + parameters: Parameters.DeleteFieldConfigurationScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/fieldconfigurationscheme/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns issue types to field configurations on field configuration scheme. + * + * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setFieldConfigurationSchemeMapping( + parameters: Parameters.SetFieldConfigurationSchemeMapping, + callback: Callback, + ): Promise; + /** + * Assigns issue types to field configurations on field configuration scheme. + * + * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setFieldConfigurationSchemeMapping( + parameters: Parameters.SetFieldConfigurationSchemeMapping, + callback?: never, + ): Promise; + async setFieldConfigurationSchemeMapping( + parameters: Parameters.SetFieldConfigurationSchemeMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/fieldconfigurationscheme/${parameters.id}/mapping`, + method: 'PUT', + data: { + mappings: parameters.mappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes issue types from the field configuration scheme. + * + * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypesFromGlobalFieldConfigurationScheme( + parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, + callback: Callback, + ): Promise; + /** + * Removes issue types from the field configuration scheme. + * + * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypesFromGlobalFieldConfigurationScheme( + parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, + callback?: never, + ): Promise; + async removeIssueTypesFromGlobalFieldConfigurationScheme( + parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/fieldconfigurationscheme/${parameters.id}/mapping/delete`, + method: 'POST', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueFieldConfigurations.ts b/src/version2/issueFieldConfigurations.ts deleted file mode 100644 index 56896b936..000000000 --- a/src/version2/issueFieldConfigurations.ts +++ /dev/null @@ -1,650 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueFieldConfigurations { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configurations. The list can be for all field configurations or a subset determined by any combination of these - * criteria: - * - * - A list of field configuration item IDs. - * - Whether the field configuration is a default. - * - Whether the field configuration name or description contains a query string. - * - * Only field configurations used in company-managed (classic) projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllFieldConfigurations( - parameters: Parameters.GetAllFieldConfigurations | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configurations. The list can be for all field configurations or a subset determined by any combination of these - * criteria: - * - * - A list of field configuration item IDs. - * - Whether the field configuration is a default. - * - Whether the field configuration name or description contains a query string. - * - * Only field configurations used in company-managed (classic) projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllFieldConfigurations( - parameters?: Parameters.GetAllFieldConfigurations, - callback?: never, - ): Promise; - async getAllFieldConfigurations( - parameters?: Parameters.GetAllFieldConfigurations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/fieldconfiguration', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - isDefault: parameters?.isDefault, - query: parameters?.query, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a field configuration. The field configuration is created with the same field properties as the default - * configuration, with all the fields being optional. - * - * This operation can only create configurations for use in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfiguration( - parameters: Parameters.CreateFieldConfiguration | undefined, - callback: Callback, - ): Promise; - /** - * Creates a field configuration. The field configuration is created with the same field properties as the default - * configuration, with all the fields being optional. - * - * This operation can only create configurations for use in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfiguration( - parameters?: Parameters.CreateFieldConfiguration, - callback?: never, - ): Promise; - async createFieldConfiguration( - parameters?: Parameters.CreateFieldConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/fieldconfiguration', - method: 'POST', - data: { - name: parameters?.name, - description: parameters?.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a field configuration. The name and the description provided in the request override the existing values. - * - * This operation can only update configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfiguration( - parameters: Parameters.UpdateFieldConfiguration, - callback: Callback, - ): Promise; - /** - * Updates a field configuration. The name and the description provided in the request override the existing values. - * - * This operation can only update configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfiguration( - parameters: Parameters.UpdateFieldConfiguration, - callback?: never, - ): Promise; - async updateFieldConfiguration( - parameters: Parameters.UpdateFieldConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/fieldconfiguration/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a field configuration. - * - * This operation can only delete configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfiguration( - parameters: Parameters.DeleteFieldConfiguration | string, - callback: Callback, - ): Promise; - /** - * Deletes a field configuration. - * - * This operation can only delete configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfiguration( - parameters: Parameters.DeleteFieldConfiguration | string, - callback?: never, - ): Promise; - async deleteFieldConfiguration( - parameters: Parameters.DeleteFieldConfiguration | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/fieldconfiguration/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * fields for a configuration. - * - * Only the fields from configurations used in company-managed (classic) projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldConfigurationItems( - parameters: Parameters.GetFieldConfigurationItems | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * fields for a configuration. - * - * Only the fields from configurations used in company-managed (classic) projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldConfigurationItems( - parameters: Parameters.GetFieldConfigurationItems | string, - callback?: never, - ): Promise; - async getFieldConfigurationItems( - parameters: Parameters.GetFieldConfigurationItems | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/fieldconfiguration/${id}/fields`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates fields in a field configuration. The properties of the field configuration fields provided override the - * existing values. - * - * This operation can only update field configurations used in company-managed (classic) projects. - * - * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style - * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer - * (`autocomplete-renderer`). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationItems( - parameters: Parameters.UpdateFieldConfigurationItems, - callback: Callback, - ): Promise; - /** - * Updates fields in a field configuration. The properties of the field configuration fields provided override the - * existing values. - * - * This operation can only update field configurations used in company-managed (classic) projects. - * - * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style - * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer - * (`autocomplete-renderer`). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationItems( - parameters: Parameters.UpdateFieldConfigurationItems, - callback?: never, - ): Promise; - async updateFieldConfigurationItems( - parameters: Parameters.UpdateFieldConfigurationItems, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/fieldconfiguration/${parameters.id}/fields`, - method: 'PUT', - data: { - fieldConfigurationItems: parameters.fieldConfigurationItems, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration schemes. - * - * Only field configuration schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllFieldConfigurationSchemes( - parameters: Parameters.GetAllFieldConfigurationSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration schemes. - * - * Only field configuration schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllFieldConfigurationSchemes( - parameters?: Parameters.GetAllFieldConfigurationSchemes, - callback?: never, - ): Promise; - async getAllFieldConfigurationSchemes( - parameters?: Parameters.GetAllFieldConfigurationSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/fieldconfigurationscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a field configuration scheme. - * - * This operation can only create field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfigurationScheme( - parameters: Parameters.CreateFieldConfigurationScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates a field configuration scheme. - * - * This operation can only create field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfigurationScheme( - parameters?: Parameters.CreateFieldConfigurationScheme, - callback?: never, - ): Promise; - async createFieldConfigurationScheme( - parameters?: Parameters.CreateFieldConfigurationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/fieldconfigurationscheme', - method: 'POST', - data: { - name: parameters?.name, - description: parameters?.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration issue type items. - * - * Only items used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldConfigurationSchemeMappings( - parameters: Parameters.GetFieldConfigurationSchemeMappings | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration issue type items. - * - * Only items used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldConfigurationSchemeMappings( - parameters?: Parameters.GetFieldConfigurationSchemeMappings, - callback?: never, - ): Promise; - async getFieldConfigurationSchemeMappings( - parameters?: Parameters.GetFieldConfigurationSchemeMappings, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/fieldconfigurationscheme/mapping', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - fieldConfigurationSchemeId: parameters?.fieldConfigurationSchemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration schemes and, for each scheme, a list of the projects that use it. - * - * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to - * the default field configuration scheme. - * - * Only field configuration schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldConfigurationSchemeProjectMapping( - parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration schemes and, for each scheme, a list of the projects that use it. - * - * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to - * the default field configuration scheme. - * - * Only field configuration schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldConfigurationSchemeProjectMapping( - parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, - callback?: never, - ): Promise; - async getFieldConfigurationSchemeProjectMapping( - parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/fieldconfigurationscheme/project', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation - * assigns the default field configuration scheme. - * - * Field configuration schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignFieldConfigurationSchemeToProject( - parameters: Parameters.AssignFieldConfigurationSchemeToProject, - callback: Callback, - ): Promise; - /** - * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation - * assigns the default field configuration scheme. - * - * Field configuration schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignFieldConfigurationSchemeToProject( - parameters: Parameters.AssignFieldConfigurationSchemeToProject, - callback?: never, - ): Promise; - async assignFieldConfigurationSchemeToProject( - parameters: Parameters.AssignFieldConfigurationSchemeToProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/fieldconfigurationscheme/project', - method: 'PUT', - data: { - fieldConfigurationSchemeId: parameters.fieldConfigurationSchemeId, - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a field configuration scheme. - * - * This operation can only update field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationScheme( - parameters: Parameters.UpdateFieldConfigurationScheme, - callback: Callback, - ): Promise; - /** - * Updates a field configuration scheme. - * - * This operation can only update field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationScheme( - parameters: Parameters.UpdateFieldConfigurationScheme, - callback?: never, - ): Promise; - async updateFieldConfigurationScheme( - parameters: Parameters.UpdateFieldConfigurationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/fieldconfigurationscheme/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a field configuration scheme. - * - * This operation can only delete field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfigurationScheme( - parameters: Parameters.DeleteFieldConfigurationScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes a field configuration scheme. - * - * This operation can only delete field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfigurationScheme( - parameters: Parameters.DeleteFieldConfigurationScheme | string, - callback?: never, - ): Promise; - async deleteFieldConfigurationScheme( - parameters: Parameters.DeleteFieldConfigurationScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/fieldconfigurationscheme/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns issue types to field configurations on field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setFieldConfigurationSchemeMapping( - parameters: Parameters.SetFieldConfigurationSchemeMapping, - callback: Callback, - ): Promise; - /** - * Assigns issue types to field configurations on field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setFieldConfigurationSchemeMapping( - parameters: Parameters.SetFieldConfigurationSchemeMapping, - callback?: never, - ): Promise; - async setFieldConfigurationSchemeMapping( - parameters: Parameters.SetFieldConfigurationSchemeMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/fieldconfigurationscheme/${parameters.id}/mapping`, - method: 'PUT', - data: { - mappings: parameters.mappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes issue types from the field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromGlobalFieldConfigurationScheme( - parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, - callback: Callback, - ): Promise; - /** - * Removes issue types from the field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromGlobalFieldConfigurationScheme( - parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, - callback?: never, - ): Promise; - async removeIssueTypesFromGlobalFieldConfigurationScheme( - parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/fieldconfigurationscheme/${parameters.id}/mapping/delete`, - method: 'POST', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueFields.mts b/src/version2/issueFields.mts new file mode 100644 index 000000000..64d559e9e --- /dev/null +++ b/src/version2/issueFields.mts @@ -0,0 +1,319 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueFields { + constructor(private client: Client) {} + + /** + * Returns system and custom issue fields according to the following rules: + * + * - Fields that cannot be added to the issue navigator are always returned. + * - Fields that cannot be placed on an issue screen are always returned. + * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking + * fields, subtasks, votes, and watches. + * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the + * field is used in at least one project that the user has _Browse Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for.) + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getFields(callback: Callback): Promise; + /** + * Returns system and custom issue fields according to the following rules: + * + * - Fields that cannot be added to the issue navigator are always returned. + * - Fields that cannot be placed on an issue screen are always returned. + * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking + * fields, subtasks, votes, and watches. + * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the + * field is used in at least one project that the user has _Browse Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for.) + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getFields(callback?: never): Promise; + async getFields(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/field', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a custom field. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomField( + parameters: Parameters.CreateCustomField | undefined, + callback: Callback, + ): Promise; + /** + * Creates a custom field. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomField( + parameters?: Parameters.CreateCustomField, + callback?: never, + ): Promise; + async createCustomField( + parameters?: Parameters.CreateCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/field', + method: 'POST', + data: { + name: parameters?.name, + description: parameters?.description, + type: parameters?.type, + searcherKey: parameters?.searcherKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields + * for Classic Jira projects. The list can include: + * + * - All fields + * - Specific fields, by defining `id` + * - Fields that contain a string in the field name or description, by defining `query` + * - Specific fields that contain a string in the field name or description, by defining `id` and `query` + * + * Only custom fields can be queried, `type` must be set to `custom`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldsPaginated( + parameters: Parameters.GetFieldsPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields + * for Classic Jira projects. The list can include: + * + * - All fields + * - Specific fields, by defining `id` + * - Fields that contain a string in the field name or description, by defining `query` + * - Specific fields that contain a string in the field name or description, by defining `id` and `query` + * + * Only custom fields can be queried, `type` must be set to `custom`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldsPaginated( + parameters?: Parameters.GetFieldsPaginated, + callback?: never, + ): Promise; + async getFieldsPaginated( + parameters?: Parameters.GetFieldsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/field/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + type: parameters?.type, + id: parameters?.id, + query: parameters?.query, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields + * in the trash. The list may be restricted to fields whose field name or description partially match a string. + * + * Only custom fields can be queried, `type` must be set to `custom`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getTrashedFieldsPaginated( + parameters: Parameters.GetTrashedFieldsPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields + * in the trash. The list may be restricted to fields whose field name or description partially match a string. + * + * Only custom fields can be queried, `type` must be set to `custom`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getTrashedFieldsPaginated( + parameters?: Parameters.GetTrashedFieldsPaginated, + callback?: never, + ): Promise; + async getTrashedFieldsPaginated( + parameters?: Parameters.GetTrashedFieldsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/field/search/trashed', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + query: parameters?.query, + expand: parameters?.expand, + orderBy: parameters?.orderBy, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a custom field. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomField(parameters: Parameters.UpdateCustomField, callback: Callback): Promise; + /** + * Updates a custom field. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomField(parameters: Parameters.UpdateCustomField, callback?: never): Promise; + async updateCustomField( + parameters: Parameters.UpdateCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + searcherKey: parameters.searcherKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom + * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomField(parameters: Parameters.DeleteCustomField, callback: Callback): Promise; + /** + * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom + * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomField(parameters: Parameters.DeleteCustomField, callback?: never): Promise; + async deleteCustomField( + parameters: Parameters.DeleteCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) + * for more information on trashing and deleting custom fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async restoreCustomField( + parameters: Parameters.RestoreCustomField, + callback: Callback, + ): Promise; + /** + * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) + * for more information on trashing and deleting custom fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async restoreCustomField(parameters: Parameters.RestoreCustomField, callback?: never): Promise; + async restoreCustomField( + parameters: Parameters.RestoreCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.id}/restore`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for + * more information on trashing and deleting custom fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async trashCustomField(parameters: Parameters.TrashCustomField, callback: Callback): Promise; + /** + * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for + * more information on trashing and deleting custom fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async trashCustomField(parameters: Parameters.TrashCustomField, callback?: never): Promise; + async trashCustomField( + parameters: Parameters.TrashCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.id}/trash`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueFields.ts b/src/version2/issueFields.ts deleted file mode 100644 index ae82e7640..000000000 --- a/src/version2/issueFields.ts +++ /dev/null @@ -1,319 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueFields { - constructor(private client: Client) {} - - /** - * Returns system and custom issue fields according to the following rules: - * - * - Fields that cannot be added to the issue navigator are always returned. - * - Fields that cannot be placed on an issue screen are always returned. - * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking - * fields, subtasks, votes, and watches. - * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the - * field is used in at least one project that the user has _Browse Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for.) - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getFields(callback: Callback): Promise; - /** - * Returns system and custom issue fields according to the following rules: - * - * - Fields that cannot be added to the issue navigator are always returned. - * - Fields that cannot be placed on an issue screen are always returned. - * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking - * fields, subtasks, votes, and watches. - * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the - * field is used in at least one project that the user has _Browse Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for.) - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getFields(callback?: never): Promise; - async getFields(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/field', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomField( - parameters: Parameters.CreateCustomField | undefined, - callback: Callback, - ): Promise; - /** - * Creates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomField( - parameters?: Parameters.CreateCustomField, - callback?: never, - ): Promise; - async createCustomField( - parameters?: Parameters.CreateCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/field', - method: 'POST', - data: { - name: parameters?.name, - description: parameters?.description, - type: parameters?.type, - searcherKey: parameters?.searcherKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields - * for Classic Jira projects. The list can include: - * - * - All fields - * - Specific fields, by defining `id` - * - Fields that contain a string in the field name or description, by defining `query` - * - Specific fields that contain a string in the field name or description, by defining `id` and `query` - * - * Only custom fields can be queried, `type` must be set to `custom`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldsPaginated( - parameters: Parameters.GetFieldsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields - * for Classic Jira projects. The list can include: - * - * - All fields - * - Specific fields, by defining `id` - * - Fields that contain a string in the field name or description, by defining `query` - * - Specific fields that contain a string in the field name or description, by defining `id` and `query` - * - * Only custom fields can be queried, `type` must be set to `custom`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldsPaginated( - parameters?: Parameters.GetFieldsPaginated, - callback?: never, - ): Promise; - async getFieldsPaginated( - parameters?: Parameters.GetFieldsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/field/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - type: parameters?.type, - id: parameters?.id, - query: parameters?.query, - orderBy: parameters?.orderBy, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields - * in the trash. The list may be restricted to fields whose field name or description partially match a string. - * - * Only custom fields can be queried, `type` must be set to `custom`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getTrashedFieldsPaginated( - parameters: Parameters.GetTrashedFieldsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields - * in the trash. The list may be restricted to fields whose field name or description partially match a string. - * - * Only custom fields can be queried, `type` must be set to `custom`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getTrashedFieldsPaginated( - parameters?: Parameters.GetTrashedFieldsPaginated, - callback?: never, - ): Promise; - async getTrashedFieldsPaginated( - parameters?: Parameters.GetTrashedFieldsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/field/search/trashed', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - query: parameters?.query, - expand: parameters?.expand, - orderBy: parameters?.orderBy, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomField(parameters: Parameters.UpdateCustomField, callback: Callback): Promise; - /** - * Updates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomField(parameters: Parameters.UpdateCustomField, callback?: never): Promise; - async updateCustomField( - parameters: Parameters.UpdateCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - searcherKey: parameters.searcherKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom - * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomField(parameters: Parameters.DeleteCustomField, callback: Callback): Promise; - /** - * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom - * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomField(parameters: Parameters.DeleteCustomField, callback?: never): Promise; - async deleteCustomField( - parameters: Parameters.DeleteCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) - * for more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async restoreCustomField( - parameters: Parameters.RestoreCustomField, - callback: Callback, - ): Promise; - /** - * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) - * for more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async restoreCustomField(parameters: Parameters.RestoreCustomField, callback?: never): Promise; - async restoreCustomField( - parameters: Parameters.RestoreCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.id}/restore`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for - * more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async trashCustomField(parameters: Parameters.TrashCustomField, callback: Callback): Promise; - /** - * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for - * more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async trashCustomField(parameters: Parameters.TrashCustomField, callback?: never): Promise; - async trashCustomField( - parameters: Parameters.TrashCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.id}/trash`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueLinkTypes.mts b/src/version2/issueLinkTypes.mts new file mode 100644 index 000000000..70c5a4484 --- /dev/null +++ b/src/version2/issueLinkTypes.mts @@ -0,0 +1,208 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueLinkTypes { + constructor(private client: Client) {} + + /** + * Returns a list of all issue link types. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. + */ + async getIssueLinkTypes(callback: Callback): Promise; + /** + * Returns a list of all issue link types. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. + */ + async getIssueLinkTypes(callback?: never): Promise; + async getIssueLinkTypes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issueLinkType', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The + * issue link type consists of a name and descriptions for a link's inward and outward relationships. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueLinkType( + parameters: Parameters.CreateIssueLinkType, + callback: Callback, + ): Promise; + /** + * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The + * issue link type consists of a name and descriptions for a link's inward and outward relationships. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueLinkType( + parameters: Parameters.CreateIssueLinkType, + callback?: never, + ): Promise; + async createIssueLinkType( + parameters: Parameters.CreateIssueLinkType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issueLinkType', + method: 'POST', + data: { + id: parameters.id, + inward: parameters.inward, + name: parameters.name, + outward: parameters.outward, + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. + */ + async getIssueLinkType( + parameters: Parameters.GetIssueLinkType | string, + callback: Callback, + ): Promise; + /** + * Returns an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. + */ + async getIssueLinkType( + parameters: Parameters.GetIssueLinkType | string, + callback?: never, + ): Promise; + async getIssueLinkType( + parameters: Parameters.GetIssueLinkType | string, + callback?: Callback, + ): Promise { + const issueLinkTypeId = typeof parameters === 'string' ? parameters : parameters.issueLinkTypeId; + + const config: RequestConfig = { + url: `/rest/api/2/issueLinkType/${issueLinkTypeId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueLinkType( + parameters: Parameters.UpdateIssueLinkType, + callback: Callback, + ): Promise; + /** + * Updates an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueLinkType( + parameters: Parameters.UpdateIssueLinkType, + callback?: never, + ): Promise; + async updateIssueLinkType( + parameters: Parameters.UpdateIssueLinkType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issueLinkType/${parameters.issueLinkTypeId}`, + method: 'PUT', + data: { + id: parameters.id, + inward: parameters.inward, + name: parameters.name, + outward: parameters.outward, + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueLinkType( + parameters: Parameters.DeleteIssueLinkType | string, + callback: Callback, + ): Promise; + /** + * Deletes an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueLinkType( + parameters: Parameters.DeleteIssueLinkType | string, + callback?: never, + ): Promise; + async deleteIssueLinkType( + parameters: Parameters.DeleteIssueLinkType | string, + callback?: Callback, + ): Promise { + const issueLinkTypeId = typeof parameters === 'string' ? parameters : parameters.issueLinkTypeId; + + const config: RequestConfig = { + url: `/rest/api/2/issueLinkType/${issueLinkTypeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueLinkTypes.ts b/src/version2/issueLinkTypes.ts deleted file mode 100644 index f0171687a..000000000 --- a/src/version2/issueLinkTypes.ts +++ /dev/null @@ -1,208 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueLinkTypes { - constructor(private client: Client) {} - - /** - * Returns a list of all issue link types. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. - */ - async getIssueLinkTypes(callback: Callback): Promise; - /** - * Returns a list of all issue link types. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. - */ - async getIssueLinkTypes(callback?: never): Promise; - async getIssueLinkTypes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issueLinkType', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The - * issue link type consists of a name and descriptions for a link's inward and outward relationships. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueLinkType( - parameters: Parameters.CreateIssueLinkType, - callback: Callback, - ): Promise; - /** - * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The - * issue link type consists of a name and descriptions for a link's inward and outward relationships. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueLinkType( - parameters: Parameters.CreateIssueLinkType, - callback?: never, - ): Promise; - async createIssueLinkType( - parameters: Parameters.CreateIssueLinkType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issueLinkType', - method: 'POST', - data: { - id: parameters.id, - inward: parameters.inward, - name: parameters.name, - outward: parameters.outward, - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. - */ - async getIssueLinkType( - parameters: Parameters.GetIssueLinkType | string, - callback: Callback, - ): Promise; - /** - * Returns an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. - */ - async getIssueLinkType( - parameters: Parameters.GetIssueLinkType | string, - callback?: never, - ): Promise; - async getIssueLinkType( - parameters: Parameters.GetIssueLinkType | string, - callback?: Callback, - ): Promise { - const issueLinkTypeId = typeof parameters === 'string' ? parameters : parameters.issueLinkTypeId; - - const config: RequestConfig = { - url: `/rest/api/2/issueLinkType/${issueLinkTypeId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueLinkType( - parameters: Parameters.UpdateIssueLinkType, - callback: Callback, - ): Promise; - /** - * Updates an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueLinkType( - parameters: Parameters.UpdateIssueLinkType, - callback?: never, - ): Promise; - async updateIssueLinkType( - parameters: Parameters.UpdateIssueLinkType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issueLinkType/${parameters.issueLinkTypeId}`, - method: 'PUT', - data: { - id: parameters.id, - inward: parameters.inward, - name: parameters.name, - outward: parameters.outward, - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueLinkType( - parameters: Parameters.DeleteIssueLinkType | string, - callback: Callback, - ): Promise; - /** - * Deletes an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueLinkType( - parameters: Parameters.DeleteIssueLinkType | string, - callback?: never, - ): Promise; - async deleteIssueLinkType( - parameters: Parameters.DeleteIssueLinkType | string, - callback?: Callback, - ): Promise { - const issueLinkTypeId = typeof parameters === 'string' ? parameters : parameters.issueLinkTypeId; - - const config: RequestConfig = { - url: `/rest/api/2/issueLinkType/${issueLinkTypeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueLinks.mts b/src/version2/issueLinks.mts new file mode 100644 index 000000000..496269123 --- /dev/null +++ b/src/version2/issueLinks.mts @@ -0,0 +1,162 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueLinks { + constructor(private client: Client) {} + + /** + * Creates a link between two issues. Use this operation to indicate a relationship between two issues and optionally + * add a comment to the from (outward) issue. To use this resource the site must have [Issue + * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use + * `https://your-domain.atlassian.net/rest/api/2/issue/[linked issue key]?fields=issuelinks`. + * + * If the link request duplicates a link, the response indicates that the issue link was created. If the request + * included a comment, the comment is added. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the issues to be linked, + * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from + * (outward) issue, + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async linkIssues(parameters: Parameters.LinkIssues, callback: Callback): Promise; + /** + * Creates a link between two issues. Use this operation to indicate a relationship between two issues and optionally + * add a comment to the from (outward) issue. To use this resource the site must have [Issue + * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use + * `https://your-domain.atlassian.net/rest/api/2/issue/[linked issue key]?fields=issuelinks`. + * + * If the link request duplicates a link, the response indicates that the issue link was created. If the request + * included a comment, the comment is added. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the issues to be linked, + * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from + * (outward) issue, + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async linkIssues(parameters: Parameters.LinkIssues, callback?: never): Promise; + async linkIssues(parameters: Parameters.LinkIssues, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issueLink', + method: 'POST', + data: { + type: parameters.type, + inwardIssue: parameters.inwardIssue, + outwardIssue: parameters.outwardIssue, + comment: parameters.comment, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue link. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the linked issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. + */ + async getIssueLink( + parameters: Parameters.GetIssueLink | string, + callback: Callback, + ): Promise; + /** + * Returns an issue link. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the linked issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. + */ + async getIssueLink(parameters: Parameters.GetIssueLink | string, callback?: never): Promise; + async getIssueLink( + parameters: Parameters.GetIssueLink | string, + callback?: Callback, + ): Promise { + const linkId = typeof parameters === 'string' ? parameters : parameters.linkId; + + const config: RequestConfig = { + url: `/rest/api/2/issueLink/${linkId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue link. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the + * issues in the link. + * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects + * containing issues in the link. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. + */ + async deleteIssueLink( + parameters: Parameters.DeleteIssueLink | string, + callback: Callback, + ): Promise; + /** + * Deletes an issue link. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the + * issues in the link. + * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects + * containing issues in the link. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. + */ + async deleteIssueLink(parameters: Parameters.DeleteIssueLink | string, callback?: never): Promise; + async deleteIssueLink( + parameters: Parameters.DeleteIssueLink | string, + callback?: Callback, + ): Promise { + const linkId = typeof parameters === 'string' ? parameters : parameters.linkId; + + const config: RequestConfig = { + url: `/rest/api/2/issueLink/${linkId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueLinks.ts b/src/version2/issueLinks.ts deleted file mode 100644 index 54aded304..000000000 --- a/src/version2/issueLinks.ts +++ /dev/null @@ -1,162 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueLinks { - constructor(private client: Client) {} - - /** - * Creates a link between two issues. Use this operation to indicate a relationship between two issues and optionally - * add a comment to the from (outward) issue. To use this resource the site must have [Issue - * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use - * `https://your-domain.atlassian.net/rest/api/2/issue/[linked issue key]?fields=issuelinks`. - * - * If the link request duplicates a link, the response indicates that the issue link was created. If the request - * included a comment, the comment is added. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the issues to be linked, - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from - * (outward) issue, - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async linkIssues(parameters: Parameters.LinkIssues, callback: Callback): Promise; - /** - * Creates a link between two issues. Use this operation to indicate a relationship between two issues and optionally - * add a comment to the from (outward) issue. To use this resource the site must have [Issue - * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use - * `https://your-domain.atlassian.net/rest/api/2/issue/[linked issue key]?fields=issuelinks`. - * - * If the link request duplicates a link, the response indicates that the issue link was created. If the request - * included a comment, the comment is added. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the issues to be linked, - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from - * (outward) issue, - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async linkIssues(parameters: Parameters.LinkIssues, callback?: never): Promise; - async linkIssues(parameters: Parameters.LinkIssues, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issueLink', - method: 'POST', - data: { - type: parameters.type, - inwardIssue: parameters.inwardIssue, - outwardIssue: parameters.outwardIssue, - comment: parameters.comment, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the linked issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async getIssueLink( - parameters: Parameters.GetIssueLink | string, - callback: Callback, - ): Promise; - /** - * Returns an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the linked issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async getIssueLink(parameters: Parameters.GetIssueLink | string, callback?: never): Promise; - async getIssueLink( - parameters: Parameters.GetIssueLink | string, - callback?: Callback, - ): Promise { - const linkId = typeof parameters === 'string' ? parameters : parameters.linkId; - - const config: RequestConfig = { - url: `/rest/api/2/issueLink/${linkId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the - * issues in the link. - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects - * containing issues in the link. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async deleteIssueLink( - parameters: Parameters.DeleteIssueLink | string, - callback: Callback, - ): Promise; - /** - * Deletes an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the - * issues in the link. - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects - * containing issues in the link. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async deleteIssueLink(parameters: Parameters.DeleteIssueLink | string, callback?: never): Promise; - async deleteIssueLink( - parameters: Parameters.DeleteIssueLink | string, - callback?: Callback, - ): Promise { - const linkId = typeof parameters === 'string' ? parameters : parameters.linkId; - - const config: RequestConfig = { - url: `/rest/api/2/issueLink/${linkId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueNavigatorSettings.mts b/src/version2/issueNavigatorSettings.mts new file mode 100644 index 000000000..1099b5330 --- /dev/null +++ b/src/version2/issueNavigatorSettings.mts @@ -0,0 +1,76 @@ +import * as Models from './models/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueNavigatorSettings { + constructor(private client: Client) {} + + /** + * Returns the default issue navigator columns. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueNavigatorDefaultColumns(callback: Callback): Promise; + /** + * Returns the default issue navigator columns. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueNavigatorDefaultColumns(callback?: never): Promise; + async getIssueNavigatorDefaultColumns(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/settings/columns', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default issue navigator columns. + * + * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple + * columns, pass multiple `columns` parameters. For example, in curl: + * + * `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/2/settings/columns` + * + * If no column details are sent, then all default columns are removed. + * + * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue + * columns using [Get fields](#api-rest-api-2-field-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setIssueNavigatorDefaultColumns(callback: Callback): Promise; + /** + * Sets the default issue navigator columns. + * + * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple + * columns, pass multiple `columns` parameters. For example, in curl: + * + * `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/2/settings/columns` + * + * If no column details are sent, then all default columns are removed. + * + * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue + * columns using [Get fields](#api-rest-api-2-field-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setIssueNavigatorDefaultColumns(callback?: never): Promise; + async setIssueNavigatorDefaultColumns(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/settings/columns', + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueNavigatorSettings.ts b/src/version2/issueNavigatorSettings.ts deleted file mode 100644 index 73739ba86..000000000 --- a/src/version2/issueNavigatorSettings.ts +++ /dev/null @@ -1,76 +0,0 @@ -import * as Models from './models/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueNavigatorSettings { - constructor(private client: Client) {} - - /** - * Returns the default issue navigator columns. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueNavigatorDefaultColumns(callback: Callback): Promise; - /** - * Returns the default issue navigator columns. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueNavigatorDefaultColumns(callback?: never): Promise; - async getIssueNavigatorDefaultColumns(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/settings/columns', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default issue navigator columns. - * - * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple - * columns, pass multiple `columns` parameters. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/2/settings/columns` - * - * If no column details are sent, then all default columns are removed. - * - * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue - * columns using [Get fields](#api-rest-api-2-field-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueNavigatorDefaultColumns(callback: Callback): Promise; - /** - * Sets the default issue navigator columns. - * - * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple - * columns, pass multiple `columns` parameters. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/2/settings/columns` - * - * If no column details are sent, then all default columns are removed. - * - * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue - * columns using [Get fields](#api-rest-api-2-field-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueNavigatorDefaultColumns(callback?: never): Promise; - async setIssueNavigatorDefaultColumns(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/settings/columns', - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueNotificationSchemes.mts b/src/version2/issueNotificationSchemes.mts new file mode 100644 index 000000000..abca8a1fb --- /dev/null +++ b/src/version2/issueNotificationSchemes.mts @@ -0,0 +1,281 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueNotificationSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. + * + * _Note that you should allow for events without recipients to appear in responses._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with a notification scheme for it to be returned. + */ + async getNotificationSchemes( + parameters: Parameters.GetNotificationSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. + * + * _Note that you should allow for events without recipients to appear in responses._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with a notification scheme for it to be returned. + */ + async getNotificationSchemes( + parameters?: Parameters.GetNotificationSchemes, + callback?: never, + ): Promise; + async getNotificationSchemes( + parameters?: Parameters.GetNotificationSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/notificationscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + projectId: parameters?.projectId, + onlyDefault: parameters?.onlyDefault, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createNotificationScheme( + parameters: Parameters.CreateNotificationScheme, + callback: Callback, + ): Promise; + /** + * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createNotificationScheme( + parameters: Parameters.CreateNotificationScheme, + callback?: never, + ): Promise; + async createNotificationScheme( + parameters: Parameters.CreateNotificationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/notificationscheme', + method: 'POST', + data: { + description: parameters.description, + name: parameters.name, + notificationSchemeEvents: parameters.notificationSchemeEvents, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of + * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or + * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only + * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a + * default notification scheme. The mappings are ordered by projectId. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getNotificationSchemeToProjectMappings( + parameters: Parameters.GetNotificationSchemeToProjectMappings | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of + * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or + * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only + * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a + * default notification scheme. The mappings are ordered by projectId. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getNotificationSchemeToProjectMappings( + parameters?: Parameters.GetNotificationSchemeToProjectMappings, + callback?: never, + ): Promise; + async getNotificationSchemeToProjectMappings( + parameters?: Parameters.GetNotificationSchemeToProjectMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/notificationscheme/project', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + notificationSchemeId: parameters?.notificationSchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the + * recipients who will receive notifications for those events. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with the notification scheme. + */ + async getNotificationScheme( + parameters: Parameters.GetNotificationScheme | string, + callback: Callback, + ): Promise; + /** + * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the + * recipients who will receive notifications for those events. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with the notification scheme. + */ + async getNotificationScheme( + parameters: Parameters.GetNotificationScheme | string, + callback?: never, + ): Promise; + async getNotificationScheme( + parameters: Parameters.GetNotificationScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/notificationscheme/${id}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a notification scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateNotificationScheme( + parameters: Parameters.UpdateNotificationScheme, + callback: Callback, + ): Promise; + /** + * Updates a notification scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateNotificationScheme( + parameters: Parameters.UpdateNotificationScheme, + callback?: never, + ): Promise; + async updateNotificationScheme( + parameters: Parameters.UpdateNotificationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/notificationscheme/${parameters.id}`, + method: 'PUT', + data: { + description: parameters.description, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a notification scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteNotificationScheme( + parameters: Parameters.DeleteNotificationScheme, + callback: Callback, + ): Promise; + /** + * Deletes a notification scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteNotificationScheme( + parameters: Parameters.DeleteNotificationScheme, + callback?: never, + ): Promise; + async deleteNotificationScheme( + parameters: Parameters.DeleteNotificationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/notificationscheme/${parameters.notificationSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a notification from a notification scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeNotificationFromNotificationScheme( + parameters: Parameters.RemoveNotificationFromNotificationScheme, + callback: Callback, + ): Promise; + /** + * Removes a notification from a notification scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeNotificationFromNotificationScheme( + parameters: Parameters.RemoveNotificationFromNotificationScheme, + callback?: never, + ): Promise; + async removeNotificationFromNotificationScheme( + parameters: Parameters.RemoveNotificationFromNotificationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/notificationscheme/${parameters.notificationSchemeId}/notification/${parameters.notificationId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueNotificationSchemes.ts b/src/version2/issueNotificationSchemes.ts deleted file mode 100644 index 1c84afea3..000000000 --- a/src/version2/issueNotificationSchemes.ts +++ /dev/null @@ -1,281 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueNotificationSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. - * - * _Note that you should allow for events without recipients to appear in responses._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with a notification scheme for it to be returned. - */ - async getNotificationSchemes( - parameters: Parameters.GetNotificationSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. - * - * _Note that you should allow for events without recipients to appear in responses._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with a notification scheme for it to be returned. - */ - async getNotificationSchemes( - parameters?: Parameters.GetNotificationSchemes, - callback?: never, - ): Promise; - async getNotificationSchemes( - parameters?: Parameters.GetNotificationSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/notificationscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - projectId: parameters?.projectId, - onlyDefault: parameters?.onlyDefault, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, - callback: Callback, - ): Promise; - /** - * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, - callback?: never, - ): Promise; - async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/notificationscheme', - method: 'POST', - data: { - description: parameters.description, - name: parameters.name, - notificationSchemeEvents: parameters.notificationSchemeEvents, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of - * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or - * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only - * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a - * default notification scheme. The mappings are ordered by projectId. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getNotificationSchemeToProjectMappings( - parameters: Parameters.GetNotificationSchemeToProjectMappings | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of - * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or - * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only - * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a - * default notification scheme. The mappings are ordered by projectId. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getNotificationSchemeToProjectMappings( - parameters?: Parameters.GetNotificationSchemeToProjectMappings, - callback?: never, - ): Promise; - async getNotificationSchemeToProjectMappings( - parameters?: Parameters.GetNotificationSchemeToProjectMappings, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/notificationscheme/project', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - notificationSchemeId: parameters?.notificationSchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the - * recipients who will receive notifications for those events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with the notification scheme. - */ - async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, - callback: Callback, - ): Promise; - /** - * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the - * recipients who will receive notifications for those events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with the notification scheme. - */ - async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, - callback?: never, - ): Promise; - async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/notificationscheme/${id}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a notification scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateNotificationScheme( - parameters: Parameters.UpdateNotificationScheme, - callback: Callback, - ): Promise; - /** - * Updates a notification scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateNotificationScheme( - parameters: Parameters.UpdateNotificationScheme, - callback?: never, - ): Promise; - async updateNotificationScheme( - parameters: Parameters.UpdateNotificationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/notificationscheme/${parameters.id}`, - method: 'PUT', - data: { - description: parameters.description, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a notification scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteNotificationScheme( - parameters: Parameters.DeleteNotificationScheme, - callback: Callback, - ): Promise; - /** - * Deletes a notification scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteNotificationScheme( - parameters: Parameters.DeleteNotificationScheme, - callback?: never, - ): Promise; - async deleteNotificationScheme( - parameters: Parameters.DeleteNotificationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/notificationscheme/${parameters.notificationSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a notification from a notification scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeNotificationFromNotificationScheme( - parameters: Parameters.RemoveNotificationFromNotificationScheme, - callback: Callback, - ): Promise; - /** - * Removes a notification from a notification scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeNotificationFromNotificationScheme( - parameters: Parameters.RemoveNotificationFromNotificationScheme, - callback?: never, - ): Promise; - async removeNotificationFromNotificationScheme( - parameters: Parameters.RemoveNotificationFromNotificationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/notificationscheme/${parameters.notificationSchemeId}/notification/${parameters.notificationId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issuePriorities.mts b/src/version2/issuePriorities.mts new file mode 100644 index 000000000..933027451 --- /dev/null +++ b/src/version2/issuePriorities.mts @@ -0,0 +1,241 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { paramSerializer } from '@/paramSerializer.mjs'; +import { RequestConfig } from '../requestConfig.mjs'; + +export class IssuePriorities { + constructor(private client: Client) {} + + /** + * Returns the list of all issue priorities. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPriorities(callback: Callback): Promise; + /** + * Returns the list of all issue priorities. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPriorities(callback?: never): Promise; + async getPriorities(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priority', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPriority( + parameters: Parameters.CreatePriority, + callback: Callback, + ): Promise; + /** + * Creates an issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPriority(parameters: Parameters.CreatePriority, callback?: never): Promise; + async createPriority( + parameters: Parameters.CreatePriority, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priority', + method: 'POST', + data: { + description: parameters.description, + iconUrl: parameters.iconUrl, + name: parameters.name, + statusColor: parameters.statusColor, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets default issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultPriority( + parameters: Parameters.SetDefaultPriority | undefined, + callback: Callback, + ): Promise; + /** + * Sets default issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultPriority(parameters?: Parameters.SetDefaultPriority, callback?: never): Promise; + async setDefaultPriority( + parameters?: Parameters.SetDefaultPriority, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priority/default', + method: 'PUT', + data: { + id: parameters?.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the order of issue priorities. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async movePriorities(parameters: Parameters.MovePriorities, callback: Callback): Promise; + /** + * Changes the order of issue priorities. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async movePriorities(parameters: Parameters.MovePriorities, callback?: never): Promise; + async movePriorities(parameters: Parameters.MovePriorities, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priority/move', + method: 'PUT', + data: { + ids: parameters.ids, + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: + * + * - A list of priority IDs. Any invalid priority IDs are ignored. + * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project + * IDs are ignored. + * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, + * as there is no concept of default priorities in team-managed projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async searchPriorities( + parameters: Parameters.SearchPriorities | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: + * + * - A list of priority IDs. Any invalid priority IDs are ignored. + * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project + * IDs are ignored. + * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, + * as there is no concept of default priorities in team-managed projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async searchPriorities( + parameters?: Parameters.SearchPriorities, + callback?: never, + ): Promise; + async searchPriorities( + parameters?: Parameters.SearchPriorities, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priority/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + projectId: paramSerializer('projectId', parameters?.projectId), + onlyDefault: parameters?.onlyDefault, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPriority( + parameters: Parameters.GetPriority | string, + callback: Callback, + ): Promise; + /** + * Returns an issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPriority(parameters: Parameters.GetPriority | string, callback?: never): Promise; + async getPriority( + parameters: Parameters.GetPriority | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/priority/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updatePriority(parameters: Parameters.UpdatePriority, callback: Callback): Promise; + /** + * Updates an issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updatePriority(parameters: Parameters.UpdatePriority, callback?: never): Promise; + async updatePriority(parameters: Parameters.UpdatePriority, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/priority/${parameters.id}`, + method: 'PUT', + data: { + description: parameters.description, + iconUrl: parameters.iconUrl, + name: parameters.name, + statusColor: parameters.statusColor, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issuePriorities.ts b/src/version2/issuePriorities.ts deleted file mode 100644 index 055c03039..000000000 --- a/src/version2/issuePriorities.ts +++ /dev/null @@ -1,241 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import { paramSerializer } from '../paramSerializer.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssuePriorities { - constructor(private client: Client) {} - - /** - * Returns the list of all issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriorities(callback: Callback): Promise; - /** - * Returns the list of all issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriorities(callback?: never): Promise; - async getPriorities(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/priority', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPriority( - parameters: Parameters.CreatePriority, - callback: Callback, - ): Promise; - /** - * Creates an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPriority(parameters: Parameters.CreatePriority, callback?: never): Promise; - async createPriority( - parameters: Parameters.CreatePriority, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/priority', - method: 'POST', - data: { - description: parameters.description, - iconUrl: parameters.iconUrl, - name: parameters.name, - statusColor: parameters.statusColor, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets default issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultPriority( - parameters: Parameters.SetDefaultPriority | undefined, - callback: Callback, - ): Promise; - /** - * Sets default issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultPriority(parameters?: Parameters.SetDefaultPriority, callback?: never): Promise; - async setDefaultPriority( - parameters?: Parameters.SetDefaultPriority, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/priority/default', - method: 'PUT', - data: { - id: parameters?.id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the order of issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async movePriorities(parameters: Parameters.MovePriorities, callback: Callback): Promise; - /** - * Changes the order of issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async movePriorities(parameters: Parameters.MovePriorities, callback?: never): Promise; - async movePriorities(parameters: Parameters.MovePriorities, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/priority/move', - method: 'PUT', - data: { - ids: parameters.ids, - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: - * - * - A list of priority IDs. Any invalid priority IDs are ignored. - * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project - * IDs are ignored. - * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, - * as there is no concept of default priorities in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchPriorities( - parameters: Parameters.SearchPriorities | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: - * - * - A list of priority IDs. Any invalid priority IDs are ignored. - * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project - * IDs are ignored. - * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, - * as there is no concept of default priorities in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchPriorities( - parameters?: Parameters.SearchPriorities, - callback?: never, - ): Promise; - async searchPriorities( - parameters?: Parameters.SearchPriorities, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/priority/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - projectId: paramSerializer('projectId', parameters?.projectId), - onlyDefault: parameters?.onlyDefault, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriority( - parameters: Parameters.GetPriority | string, - callback: Callback, - ): Promise; - /** - * Returns an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriority(parameters: Parameters.GetPriority | string, callback?: never): Promise; - async getPriority( - parameters: Parameters.GetPriority | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/priority/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updatePriority(parameters: Parameters.UpdatePriority, callback: Callback): Promise; - /** - * Updates an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updatePriority(parameters: Parameters.UpdatePriority, callback?: never): Promise; - async updatePriority(parameters: Parameters.UpdatePriority, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/priority/${parameters.id}`, - method: 'PUT', - data: { - description: parameters.description, - iconUrl: parameters.iconUrl, - name: parameters.name, - statusColor: parameters.statusColor, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueProperties.mts b/src/version2/issueProperties.mts new file mode 100644 index 000000000..583eac81f --- /dev/null +++ b/src/version2/issueProperties.mts @@ -0,0 +1,511 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueProperties { + constructor(private client: Client) {} + + /** + * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified + * along with up to 10,000 issues on which to set or update that list of entity properties. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum + * length of single issue property value is 32768 characters. This operation can be accessed anonymously. + * + * This operation is: + * + * - Transactional, either all properties are updated in all eligible issues or, when errors occur, no properties are + * updated. + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async bulkSetIssuesProperties( + parameters: Parameters.BulkSetIssuesProperties | undefined, + callback: Callback, + ): Promise; + /** + * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified + * along with up to 10,000 issues on which to set or update that list of entity properties. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum + * length of single issue property value is 32768 characters. This operation can be accessed anonymously. + * + * This operation is: + * + * - Transactional, either all properties are updated in all eligible issues or, when errors occur, no properties are + * updated. + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async bulkSetIssuesProperties( + parameters?: Parameters.BulkSetIssuesProperties, + callback?: never, + ): Promise; + async bulkSetIssuesProperties( + parameters?: Parameters.BulkSetIssuesProperties, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/properties', + method: 'POST', + data: { + entitiesIds: parameters?.entitiesIds, + properties: parameters?.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up + * to 100 issues included in the request. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. + * + * This operation is: + * + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * - Non-transactional. Updating some entities may fail. Such information will available in the task result. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async bulkSetIssuePropertiesByIssue( + parameters: Parameters.BulkSetIssuePropertiesByIssue | undefined, + callback: Callback, + ): Promise; + /** + * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up + * to 100 issues included in the request. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. + * + * This operation is: + * + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * - Non-transactional. Updating some entities may fail. Such information will available in the task result. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async bulkSetIssuePropertiesByIssue( + parameters?: Parameters.BulkSetIssuePropertiesByIssue, + callback?: never, + ): Promise; + async bulkSetIssuePropertiesByIssue( + parameters?: Parameters.BulkSetIssuePropertiesByIssue, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/properties/multi', + method: 'POST', + data: { + issues: parameters?.issues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets a property value on multiple issues. + * + * The value set can be a constant or determined by a [Jira + * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable + * with constant complexity when applied to a set of issues. Expressions must also comply with the + * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to + * all Jira expressions. + * + * The issues to be updated can be specified by a filter. + * + * The filter identifies issues eligible for update using these criteria: + * + * - `entityIds` Only issues from this list are eligible. + * - `currentValue` Only issues with the property set to this value are eligible. + * - `hasProperty`: + * + * - If _true_, only issues with the property are eligible. + * - If _false_, only issues without the property are eligible. + * + * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all + * criteria are eligible. + * + * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` + * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a + * value). + * + * The filter is optional. Without the filter all the issues visible to the user and where the user has the + * EDIT_ISSUES permission for the issue are considered eligible. + * + * This operation is: + * + * - Transactional, either all eligible issues are updated or, when errors occur, none are updated. + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + */ + async bulkSetIssueProperty( + parameters: Parameters.BulkSetIssueProperty, + callback: Callback, + ): Promise; + /** + * Sets a property value on multiple issues. + * + * The value set can be a constant or determined by a [Jira + * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable + * with constant complexity when applied to a set of issues. Expressions must also comply with the + * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to + * all Jira expressions. + * + * The issues to be updated can be specified by a filter. + * + * The filter identifies issues eligible for update using these criteria: + * + * - `entityIds` Only issues from this list are eligible. + * - `currentValue` Only issues with the property set to this value are eligible. + * - `hasProperty`: + * + * - If _true_, only issues with the property are eligible. + * - If _false_, only issues without the property are eligible. + * + * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all + * criteria are eligible. + * + * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` + * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a + * value). + * + * The filter is optional. Without the filter all the issues visible to the user and where the user has the + * EDIT_ISSUES permission for the issue are considered eligible. + * + * This operation is: + * + * - Transactional, either all eligible issues are updated or, when errors occur, none are updated. + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + */ + async bulkSetIssueProperty(parameters: Parameters.BulkSetIssueProperty, callback?: never): Promise; + async bulkSetIssueProperty( + parameters: Parameters.BulkSetIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/properties/${parameters.propertyKey}`, + method: 'PUT', + data: { + value: parameters.value, + expression: parameters.expression, + filter: parameters.filter, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. + * + * The criteria the filter used to identify eligible issues are: + * + * - `entityIds` Only issues from this list are eligible. + * - `currentValue` Only issues with the property set to this value are eligible. + * + * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are + * considered eligible. + * + * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES + * permission for the issue are considered eligible. + * + * This operation is: + * + * - Transactional, either the property is deleted from all eligible issues or, when errors occur, no properties are + * deleted. + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + */ + async bulkDeleteIssueProperty( + parameters: Parameters.BulkDeleteIssueProperty, + callback: Callback, + ): Promise; + /** + * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. + * + * The criteria the filter used to identify eligible issues are: + * + * - `entityIds` Only issues from this list are eligible. + * - `currentValue` Only issues with the property set to this value are eligible. + * + * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are + * considered eligible. + * + * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES + * permission for the issue are considered eligible. + * + * This operation is: + * + * - Transactional, either the property is deleted from all eligible issues or, when errors occur, no properties are + * deleted. + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + */ + async bulkDeleteIssueProperty( + parameters: Parameters.BulkDeleteIssueProperty, + callback?: never, + ): Promise; + async bulkDeleteIssueProperty( + parameters: Parameters.BulkDeleteIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/properties/${parameters.propertyKey}`, + method: 'DELETE', + data: { + entityIds: parameters.entityIds, + currentValue: parameters.currentValue, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the URLs and keys of an issue's properties. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Property details are only returned where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIssuePropertyKeys( + parameters: Parameters.GetIssuePropertyKeys | string, + callback: Callback, + ): Promise; + /** + * Returns the URLs and keys of an issue's properties. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Property details are only returned where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIssuePropertyKeys( + parameters: Parameters.GetIssuePropertyKeys | string, + callback?: never, + ): Promise; + async getIssuePropertyKeys( + parameters: Parameters.GetIssuePropertyKeys | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the key and value of an issue's property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIssueProperty( + parameters: Parameters.GetIssueProperty, + callback: Callback, + ): Promise; + /** + * Returns the key and value of an issue's property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIssueProperty( + parameters: Parameters.GetIssueProperty, + callback?: never, + ): Promise; + async getIssueProperty( + parameters: Parameters.GetIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of an issue's property. Use this resource to store custom data against an issue. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async setIssueProperty(parameters: Parameters.SetIssueProperty, callback: Callback): Promise; + /** + * Sets the value of an issue's property. Use this resource to store custom data against an issue. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async setIssueProperty(parameters: Parameters.SetIssueProperty, callback?: never): Promise; + async setIssueProperty( + parameters: Parameters.SetIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue's property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback: Callback): Promise; + /** + * Deletes an issue's property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback?: never): Promise; + async deleteIssueProperty( + parameters: Parameters.DeleteIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueProperties.ts b/src/version2/issueProperties.ts deleted file mode 100644 index cfeb863c6..000000000 --- a/src/version2/issueProperties.ts +++ /dev/null @@ -1,511 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueProperties { - constructor(private client: Client) {} - - /** - * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified - * along with up to 10,000 issues on which to set or update that list of entity properties. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum - * length of single issue property value is 32768 characters. This operation can be accessed anonymously. - * - * This operation is: - * - * - Transactional, either all properties are updated in all eligible issues or, when errors occur, no properties are - * updated. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async bulkSetIssuesProperties( - parameters: Parameters.BulkSetIssuesProperties | undefined, - callback: Callback, - ): Promise; - /** - * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified - * along with up to 10,000 issues on which to set or update that list of entity properties. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum - * length of single issue property value is 32768 characters. This operation can be accessed anonymously. - * - * This operation is: - * - * - Transactional, either all properties are updated in all eligible issues or, when errors occur, no properties are - * updated. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async bulkSetIssuesProperties( - parameters?: Parameters.BulkSetIssuesProperties, - callback?: never, - ): Promise; - async bulkSetIssuesProperties( - parameters?: Parameters.BulkSetIssuesProperties, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/properties', - method: 'POST', - data: { - entitiesIds: parameters?.entitiesIds, - properties: parameters?.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up - * to 100 issues included in the request. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. - * - * This operation is: - * - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - Non-transactional. Updating some entities may fail. Such information will available in the task result. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async bulkSetIssuePropertiesByIssue( - parameters: Parameters.BulkSetIssuePropertiesByIssue | undefined, - callback: Callback, - ): Promise; - /** - * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up - * to 100 issues included in the request. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. - * - * This operation is: - * - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - Non-transactional. Updating some entities may fail. Such information will available in the task result. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async bulkSetIssuePropertiesByIssue( - parameters?: Parameters.BulkSetIssuePropertiesByIssue, - callback?: never, - ): Promise; - async bulkSetIssuePropertiesByIssue( - parameters?: Parameters.BulkSetIssuePropertiesByIssue, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/properties/multi', - method: 'POST', - data: { - issues: parameters?.issues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets a property value on multiple issues. - * - * The value set can be a constant or determined by a [Jira - * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable - * with constant complexity when applied to a set of issues. Expressions must also comply with the - * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to - * all Jira expressions. - * - * The issues to be updated can be specified by a filter. - * - * The filter identifies issues eligible for update using these criteria: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - `hasProperty`: - * - * - If _true_, only issues with the property are eligible. - * - If _false_, only issues without the property are eligible. - * - * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all - * criteria are eligible. - * - * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` - * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a - * value). - * - * The filter is optional. Without the filter all the issues visible to the user and where the user has the - * EDIT_ISSUES permission for the issue are considered eligible. - * - * This operation is: - * - * - Transactional, either all eligible issues are updated or, when errors occur, none are updated. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkSetIssueProperty( - parameters: Parameters.BulkSetIssueProperty, - callback: Callback, - ): Promise; - /** - * Sets a property value on multiple issues. - * - * The value set can be a constant or determined by a [Jira - * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable - * with constant complexity when applied to a set of issues. Expressions must also comply with the - * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to - * all Jira expressions. - * - * The issues to be updated can be specified by a filter. - * - * The filter identifies issues eligible for update using these criteria: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - `hasProperty`: - * - * - If _true_, only issues with the property are eligible. - * - If _false_, only issues without the property are eligible. - * - * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all - * criteria are eligible. - * - * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` - * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a - * value). - * - * The filter is optional. Without the filter all the issues visible to the user and where the user has the - * EDIT_ISSUES permission for the issue are considered eligible. - * - * This operation is: - * - * - Transactional, either all eligible issues are updated or, when errors occur, none are updated. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkSetIssueProperty(parameters: Parameters.BulkSetIssueProperty, callback?: never): Promise; - async bulkSetIssueProperty( - parameters: Parameters.BulkSetIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/properties/${parameters.propertyKey}`, - method: 'PUT', - data: { - value: parameters.value, - expression: parameters.expression, - filter: parameters.filter, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. - * - * The criteria the filter used to identify eligible issues are: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are - * considered eligible. - * - * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES - * permission for the issue are considered eligible. - * - * This operation is: - * - * - Transactional, either the property is deleted from all eligible issues or, when errors occur, no properties are - * deleted. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkDeleteIssueProperty( - parameters: Parameters.BulkDeleteIssueProperty, - callback: Callback, - ): Promise; - /** - * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. - * - * The criteria the filter used to identify eligible issues are: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are - * considered eligible. - * - * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES - * permission for the issue are considered eligible. - * - * This operation is: - * - * - Transactional, either the property is deleted from all eligible issues or, when errors occur, no properties are - * deleted. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkDeleteIssueProperty( - parameters: Parameters.BulkDeleteIssueProperty, - callback?: never, - ): Promise; - async bulkDeleteIssueProperty( - parameters: Parameters.BulkDeleteIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/properties/${parameters.propertyKey}`, - method: 'DELETE', - data: { - entityIds: parameters.entityIds, - currentValue: parameters.currentValue, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the URLs and keys of an issue's properties. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Property details are only returned where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssuePropertyKeys( - parameters: Parameters.GetIssuePropertyKeys | string, - callback: Callback, - ): Promise; - /** - * Returns the URLs and keys of an issue's properties. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Property details are only returned where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssuePropertyKeys( - parameters: Parameters.GetIssuePropertyKeys | string, - callback?: never, - ): Promise; - async getIssuePropertyKeys( - parameters: Parameters.GetIssuePropertyKeys | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the key and value of an issue's property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssueProperty( - parameters: Parameters.GetIssueProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of an issue's property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssueProperty( - parameters: Parameters.GetIssueProperty, - callback?: never, - ): Promise; - async getIssueProperty( - parameters: Parameters.GetIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of an issue's property. Use this resource to store custom data against an issue. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async setIssueProperty(parameters: Parameters.SetIssueProperty, callback: Callback): Promise; - /** - * Sets the value of an issue's property. Use this resource to store custom data against an issue. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async setIssueProperty(parameters: Parameters.SetIssueProperty, callback?: never): Promise; - async setIssueProperty( - parameters: Parameters.SetIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue's property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback: Callback): Promise; - /** - * Deletes an issue's property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback?: never): Promise; - async deleteIssueProperty( - parameters: Parameters.DeleteIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueRemoteLinks.mts b/src/version2/issueRemoteLinks.mts new file mode 100644 index 000000000..3f7071480 --- /dev/null +++ b/src/version2/issueRemoteLinks.mts @@ -0,0 +1,336 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueRemoteLinks { + constructor(private client: Client) {} + + /** + * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that + * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL + * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getRemoteIssueLinks( + parameters: Parameters.GetRemoteIssueLinks | string, + callback: Callback, + ): Promise; + /** + * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that + * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL + * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getRemoteIssueLinks( + parameters: Parameters.GetRemoteIssueLinks | string, + callback?: never, + ): Promise; + async getRemoteIssueLinks( + parameters: Parameters.GetRemoteIssueLinks | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/remotelink`, + method: 'GET', + params: { + globalId: typeof parameters !== 'string' && parameters.globalId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates or updates a remote issue link for an issue. + * + * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without + * values in the request are set to null. Otherwise, the remote issue link is created. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async createOrUpdateRemoteIssueLink( + parameters: Parameters.CreateOrUpdateRemoteIssueLink, + callback: Callback, + ): Promise; + /** + * Creates or updates a remote issue link for an issue. + * + * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without + * values in the request are set to null. Otherwise, the remote issue link is created. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async createOrUpdateRemoteIssueLink( + parameters: Parameters.CreateOrUpdateRemoteIssueLink, + callback?: never, + ): Promise; + async createOrUpdateRemoteIssueLink( + parameters: Parameters.CreateOrUpdateRemoteIssueLink, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink`, + method: 'POST', + data: { + globalId: parameters.globalId, + application: parameters.application, + relationship: parameters.relationship, + object: parameters.object, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL + * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is implemented, issue-level security + * permission to view the issue. + */ + async deleteRemoteIssueLinkByGlobalId( + parameters: Parameters.DeleteRemoteIssueLinkByGlobalId | string, + callback: Callback, + ): Promise; + /** + * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL + * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is implemented, issue-level security + * permission to view the issue. + */ + async deleteRemoteIssueLinkByGlobalId( + parameters: Parameters.DeleteRemoteIssueLinkByGlobalId | string, + callback?: never, + ): Promise; + async deleteRemoteIssueLinkByGlobalId( + parameters: Parameters.DeleteRemoteIssueLinkByGlobalId | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/remotelink`, + method: 'DELETE', + params: { + globalId: typeof parameters !== 'string' && parameters.globalId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a remote issue link for an issue. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getRemoteIssueLinkById( + parameters: Parameters.GetRemoteIssueLinkById, + callback: Callback, + ): Promise; + /** + * Returns a remote issue link for an issue. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getRemoteIssueLinkById( + parameters: Parameters.GetRemoteIssueLinkById, + callback?: never, + ): Promise; + async getRemoteIssueLinkById( + parameters: Parameters.GetRemoteIssueLinkById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a remote issue link for an issue. + * + * Note: Fields without values in the request are set to null. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async updateRemoteIssueLink( + parameters: Parameters.UpdateRemoteIssueLink, + callback: Callback, + ): Promise; + /** + * Updates a remote issue link for an issue. + * + * Note: Fields without values in the request are set to null. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async updateRemoteIssueLink(parameters: Parameters.UpdateRemoteIssueLink, callback?: never): Promise; + async updateRemoteIssueLink( + parameters: Parameters.UpdateRemoteIssueLink, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, + method: 'PUT', + data: { + globalId: parameters.globalId, + application: parameters.application, + relationship: parameters.relationship, + object: parameters.object, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a remote issue link from an issue. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_, _Edit issues_, and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for the project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async deleteRemoteIssueLinkById( + parameters: Parameters.DeleteRemoteIssueLinkById, + callback: Callback, + ): Promise; + /** + * Deletes a remote issue link from an issue. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_, _Edit issues_, and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for the project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async deleteRemoteIssueLinkById( + parameters: Parameters.DeleteRemoteIssueLinkById, + callback?: never, + ): Promise; + async deleteRemoteIssueLinkById( + parameters: Parameters.DeleteRemoteIssueLinkById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueRemoteLinks.ts b/src/version2/issueRemoteLinks.ts deleted file mode 100644 index 3a7b92269..000000000 --- a/src/version2/issueRemoteLinks.ts +++ /dev/null @@ -1,336 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueRemoteLinks { - constructor(private client: Client) {} - - /** - * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that - * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getRemoteIssueLinks( - parameters: Parameters.GetRemoteIssueLinks | string, - callback: Callback, - ): Promise; - /** - * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that - * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getRemoteIssueLinks( - parameters: Parameters.GetRemoteIssueLinks | string, - callback?: never, - ): Promise; - async getRemoteIssueLinks( - parameters: Parameters.GetRemoteIssueLinks | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/remotelink`, - method: 'GET', - params: { - globalId: typeof parameters !== 'string' && parameters.globalId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates or updates a remote issue link for an issue. - * - * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without - * values in the request are set to null. Otherwise, the remote issue link is created. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async createOrUpdateRemoteIssueLink( - parameters: Parameters.CreateOrUpdateRemoteIssueLink, - callback: Callback, - ): Promise; - /** - * Creates or updates a remote issue link for an issue. - * - * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without - * values in the request are set to null. Otherwise, the remote issue link is created. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async createOrUpdateRemoteIssueLink( - parameters: Parameters.CreateOrUpdateRemoteIssueLink, - callback?: never, - ): Promise; - async createOrUpdateRemoteIssueLink( - parameters: Parameters.CreateOrUpdateRemoteIssueLink, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink`, - method: 'POST', - data: { - globalId: parameters.globalId, - application: parameters.application, - relationship: parameters.relationship, - object: parameters.object, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is implemented, issue-level security - * permission to view the issue. - */ - async deleteRemoteIssueLinkByGlobalId( - parameters: Parameters.DeleteRemoteIssueLinkByGlobalId | string, - callback: Callback, - ): Promise; - /** - * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is implemented, issue-level security - * permission to view the issue. - */ - async deleteRemoteIssueLinkByGlobalId( - parameters: Parameters.DeleteRemoteIssueLinkByGlobalId | string, - callback?: never, - ): Promise; - async deleteRemoteIssueLinkByGlobalId( - parameters: Parameters.DeleteRemoteIssueLinkByGlobalId | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/remotelink`, - method: 'DELETE', - params: { - globalId: typeof parameters !== 'string' && parameters.globalId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a remote issue link for an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getRemoteIssueLinkById( - parameters: Parameters.GetRemoteIssueLinkById, - callback: Callback, - ): Promise; - /** - * Returns a remote issue link for an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getRemoteIssueLinkById( - parameters: Parameters.GetRemoteIssueLinkById, - callback?: never, - ): Promise; - async getRemoteIssueLinkById( - parameters: Parameters.GetRemoteIssueLinkById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a remote issue link for an issue. - * - * Note: Fields without values in the request are set to null. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async updateRemoteIssueLink( - parameters: Parameters.UpdateRemoteIssueLink, - callback: Callback, - ): Promise; - /** - * Updates a remote issue link for an issue. - * - * Note: Fields without values in the request are set to null. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async updateRemoteIssueLink(parameters: Parameters.UpdateRemoteIssueLink, callback?: never): Promise; - async updateRemoteIssueLink( - parameters: Parameters.UpdateRemoteIssueLink, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, - method: 'PUT', - data: { - globalId: parameters.globalId, - application: parameters.application, - relationship: parameters.relationship, - object: parameters.object, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a remote issue link from an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_, _Edit issues_, and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for the project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteRemoteIssueLinkById( - parameters: Parameters.DeleteRemoteIssueLinkById, - callback: Callback, - ): Promise; - /** - * Deletes a remote issue link from an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_, _Edit issues_, and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for the project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteRemoteIssueLinkById( - parameters: Parameters.DeleteRemoteIssueLinkById, - callback?: never, - ): Promise; - async deleteRemoteIssueLinkById( - parameters: Parameters.DeleteRemoteIssueLinkById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueResolutions.mts b/src/version2/issueResolutions.mts new file mode 100644 index 000000000..23858540c --- /dev/null +++ b/src/version2/issueResolutions.mts @@ -0,0 +1,224 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueResolutions { + constructor(private client: Client) {} + + /** + * Creates an issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createResolution( + parameters: Parameters.CreateResolution, + callback: Callback, + ): Promise; + /** + * Creates an issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createResolution( + parameters: Parameters.CreateResolution, + callback?: never, + ): Promise; + async createResolution( + parameters: Parameters.CreateResolution, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/resolution', + method: 'POST', + data: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets default issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultResolution( + parameters: Parameters.SetDefaultResolution, + callback: Callback, + ): Promise; + /** + * Sets default issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultResolution(parameters: Parameters.SetDefaultResolution, callback?: never): Promise; + async setDefaultResolution( + parameters: Parameters.SetDefaultResolution, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/resolution/default', + method: 'PUT', + data: { + id: parameters.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the order of issue resolutions. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveResolutions(parameters: Parameters.MoveResolutions, callback: Callback): Promise; + /** + * Changes the order of issue resolutions. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveResolutions(parameters: Parameters.MoveResolutions, callback?: never): Promise; + async moveResolutions(parameters: Parameters.MoveResolutions, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/resolution/move', + method: 'PUT', + data: { + ids: parameters.ids, + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: + * + * - A list of resolutions IDs. + * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects + * only, as there is no concept of default resolutions in team-managed projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async searchResolutions( + parameters: Parameters.SearchResolutions | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: + * + * - A list of resolutions IDs. + * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects + * only, as there is no concept of default resolutions in team-managed projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async searchResolutions( + parameters?: Parameters.SearchResolutions, + callback?: never, + ): Promise; + async searchResolutions( + parameters?: Parameters.SearchResolutions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/resolution/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + onlyDefault: parameters?.onlyDefault, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateResolution(parameters: Parameters.UpdateResolution, callback: Callback): Promise; + /** + * Updates an issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateResolution(parameters: Parameters.UpdateResolution, callback?: never): Promise; + async updateResolution(parameters: Parameters.UpdateResolution, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/resolution/${parameters.id}`, + method: 'PUT', + data: { + ...parameters, + name: parameters.name, + description: parameters.description, + id: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue resolution. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteResolution( + parameters: Parameters.DeleteResolution, + callback: Callback, + ): Promise; + /** + * Deletes an issue resolution. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteResolution( + parameters: Parameters.DeleteResolution, + callback?: never, + ): Promise; + async deleteResolution( + parameters: Parameters.DeleteResolution, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/resolution/${parameters.id}`, + method: 'DELETE', + params: { + replaceWith: parameters.replaceWith, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueResolutions.ts b/src/version2/issueResolutions.ts deleted file mode 100644 index c839661b4..000000000 --- a/src/version2/issueResolutions.ts +++ /dev/null @@ -1,224 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueResolutions { - constructor(private client: Client) {} - - /** - * Creates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createResolution( - parameters: Parameters.CreateResolution, - callback: Callback, - ): Promise; - /** - * Creates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createResolution( - parameters: Parameters.CreateResolution, - callback?: never, - ): Promise; - async createResolution( - parameters: Parameters.CreateResolution, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/resolution', - method: 'POST', - data: parameters, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets default issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultResolution( - parameters: Parameters.SetDefaultResolution, - callback: Callback, - ): Promise; - /** - * Sets default issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultResolution(parameters: Parameters.SetDefaultResolution, callback?: never): Promise; - async setDefaultResolution( - parameters: Parameters.SetDefaultResolution, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/resolution/default', - method: 'PUT', - data: { - id: parameters.id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the order of issue resolutions. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveResolutions(parameters: Parameters.MoveResolutions, callback: Callback): Promise; - /** - * Changes the order of issue resolutions. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveResolutions(parameters: Parameters.MoveResolutions, callback?: never): Promise; - async moveResolutions(parameters: Parameters.MoveResolutions, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/resolution/move', - method: 'PUT', - data: { - ids: parameters.ids, - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: - * - * - A list of resolutions IDs. - * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects - * only, as there is no concept of default resolutions in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchResolutions( - parameters: Parameters.SearchResolutions | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: - * - * - A list of resolutions IDs. - * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects - * only, as there is no concept of default resolutions in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchResolutions( - parameters?: Parameters.SearchResolutions, - callback?: never, - ): Promise; - async searchResolutions( - parameters?: Parameters.SearchResolutions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/resolution/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - onlyDefault: parameters?.onlyDefault, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateResolution(parameters: Parameters.UpdateResolution, callback: Callback): Promise; - /** - * Updates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateResolution(parameters: Parameters.UpdateResolution, callback?: never): Promise; - async updateResolution(parameters: Parameters.UpdateResolution, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/resolution/${parameters.id}`, - method: 'PUT', - data: { - ...parameters, - name: parameters.name, - description: parameters.description, - id: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue resolution. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteResolution( - parameters: Parameters.DeleteResolution, - callback: Callback, - ): Promise; - /** - * Deletes an issue resolution. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteResolution( - parameters: Parameters.DeleteResolution, - callback?: never, - ): Promise; - async deleteResolution( - parameters: Parameters.DeleteResolution, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/resolution/${parameters.id}`, - method: 'DELETE', - params: { - replaceWith: parameters.replaceWith, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueSearch.mts b/src/version2/issueSearch.mts new file mode 100644 index 000000000..b3ecbd444 --- /dev/null +++ b/src/version2/issueSearch.mts @@ -0,0 +1,234 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueSearch { + constructor(private client: Client) {} + + /** + * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the + * user is looking for an issue using a word or string. + * + * This operation returns two lists: + * + * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain + * the string in the `query` parameter. + * - `Current Search` which includes issues that match the Jql expression in `currentJQL` and contain the string in the + * `query` parameter. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getIssuePickerResource( + parameters: Parameters.GetIssuePickerResource | undefined, + callback: Callback, + ): Promise; + /** + * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the + * user is looking for an issue using a word or string. + * + * This operation returns two lists: + * + * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain + * the string in the `query` parameter. + * - `Current Search` which includes issues that match the Jql expression in `currentJQL` and contain the string in the + * `query` parameter. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getIssuePickerResource( + parameters?: Parameters.GetIssuePickerResource, + callback?: never, + ): Promise; + async getIssuePickerResource( + parameters?: Parameters.GetIssuePickerResource, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/picker', + method: 'GET', + params: { + query: parameters?.query, + currentJQL: parameters?.currentJQL, + currentIssueKey: parameters?.currentIssueKey, + currentProjectId: parameters?.currentProjectId, + showSubTasks: parameters?.showSubTasks, + showSubTaskParent: parameters?.showSubTaskParent, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Checks whether one or more issues would be returned by one or more Jql queries. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, issues are only matched against Jql queries where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async matchIssues( + parameters: Parameters.MatchIssues | undefined, + callback: Callback, + ): Promise; + /** + * Checks whether one or more issues would be returned by one or more Jql queries. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, issues are only matched against Jql queries where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async matchIssues(parameters?: Parameters.MatchIssues, callback?: never): Promise; + async matchIssues( + parameters?: Parameters.MatchIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/match', + method: 'POST', + data: { + jqls: parameters?.jqls, + issueIds: parameters?.issueIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Searches for issues using [Jql](https://confluence.atlassian.com/x/egORLQ). + * + * If the Jql query expression is too large to be encoded as a query parameter, use the + * [POST](#api-rest-api-2-search-post) version of this resource. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesUsingJql( + parameters: Parameters.SearchForIssuesUsingJql | undefined, + callback: Callback, + ): Promise; + /** + * Searches for issues using [Jql](https://confluence.atlassian.com/x/egORLQ). + * + * If the Jql query expression is too large to be encoded as a query parameter, use the + * [POST](#api-rest-api-2-search-post) version of this resource. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesUsingJql( + parameters?: Parameters.SearchForIssuesUsingJql, + callback?: never, + ): Promise; + async searchForIssuesUsingJql( + parameters?: Parameters.SearchForIssuesUsingJql, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/search', + method: 'GET', + params: { + jql: parameters?.jql, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + validateQuery: parameters?.validateQuery, + fields: parameters?.fields, + expand: parameters?.expand, + properties: parameters?.properties, + fieldsByKeys: parameters?.fieldsByKeys, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Searches for issues using [Jql](https://confluence.atlassian.com/x/egORLQ). + * + * There is a [GET](#api-rest-api-2-search-get) version of this resource that can be used for smaller Jql query + * expressions. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesUsingJqlPost( + parameters: Parameters.SearchForIssuesUsingJqlPost | undefined, + callback: Callback, + ): Promise; + /** + * Searches for issues using [Jql](https://confluence.atlassian.com/x/egORLQ). + * + * There is a [GET](#api-rest-api-2-search-get) version of this resource that can be used for smaller Jql query + * expressions. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesUsingJqlPost( + parameters?: Parameters.SearchForIssuesUsingJqlPost, + callback?: never, + ): Promise; + async searchForIssuesUsingJqlPost( + parameters?: Parameters.SearchForIssuesUsingJqlPost, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/search', + method: 'POST', + data: { + jql: parameters?.jql, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + fields: parameters?.fields, + validateQuery: parameters?.validateQuery, + expand: parameters?.expand, + properties: parameters?.properties, + fieldsByKeys: parameters?.fieldsByKeys, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueSearch.ts b/src/version2/issueSearch.ts deleted file mode 100644 index 2da9483e0..000000000 --- a/src/version2/issueSearch.ts +++ /dev/null @@ -1,234 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueSearch { - constructor(private client: Client) {} - - /** - * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the - * user is looking for an issue using a word or string. - * - * This operation returns two lists: - * - * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain - * the string in the `query` parameter. - * - `Current Search` which includes issues that match the JQL expression in `currentJQL` and contain the string in the - * `query` parameter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getIssuePickerResource( - parameters: Parameters.GetIssuePickerResource | undefined, - callback: Callback, - ): Promise; - /** - * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the - * user is looking for an issue using a word or string. - * - * This operation returns two lists: - * - * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain - * the string in the `query` parameter. - * - `Current Search` which includes issues that match the JQL expression in `currentJQL` and contain the string in the - * `query` parameter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getIssuePickerResource( - parameters?: Parameters.GetIssuePickerResource, - callback?: never, - ): Promise; - async getIssuePickerResource( - parameters?: Parameters.GetIssuePickerResource, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/picker', - method: 'GET', - params: { - query: parameters?.query, - currentJQL: parameters?.currentJQL, - currentIssueKey: parameters?.currentIssueKey, - currentProjectId: parameters?.currentProjectId, - showSubTasks: parameters?.showSubTasks, - showSubTaskParent: parameters?.showSubTaskParent, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Checks whether one or more issues would be returned by one or more JQL queries. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, issues are only matched against JQL queries where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async matchIssues( - parameters: Parameters.MatchIssues | undefined, - callback: Callback, - ): Promise; - /** - * Checks whether one or more issues would be returned by one or more JQL queries. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, issues are only matched against JQL queries where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async matchIssues(parameters?: Parameters.MatchIssues, callback?: never): Promise; - async matchIssues( - parameters?: Parameters.MatchIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/match', - method: 'POST', - data: { - jqls: parameters?.jqls, - issueIds: parameters?.issueIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * If the JQL query expression is too large to be encoded as a query parameter, use the - * [POST](#api-rest-api-2-search-post) version of this resource. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async searchForIssuesUsingJql( - parameters: Parameters.SearchForIssuesUsingJql | undefined, - callback: Callback, - ): Promise; - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * If the JQL query expression is too large to be encoded as a query parameter, use the - * [POST](#api-rest-api-2-search-post) version of this resource. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async searchForIssuesUsingJql( - parameters?: Parameters.SearchForIssuesUsingJql, - callback?: never, - ): Promise; - async searchForIssuesUsingJql( - parameters?: Parameters.SearchForIssuesUsingJql, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/search', - method: 'GET', - params: { - jql: parameters?.jql, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - validateQuery: parameters?.validateQuery, - fields: parameters?.fields, - expand: parameters?.expand, - properties: parameters?.properties, - fieldsByKeys: parameters?.fieldsByKeys, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * There is a [GET](#api-rest-api-2-search-get) version of this resource that can be used for smaller JQL query - * expressions. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async searchForIssuesUsingJqlPost( - parameters: Parameters.SearchForIssuesUsingJqlPost | undefined, - callback: Callback, - ): Promise; - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * There is a [GET](#api-rest-api-2-search-get) version of this resource that can be used for smaller JQL query - * expressions. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async searchForIssuesUsingJqlPost( - parameters?: Parameters.SearchForIssuesUsingJqlPost, - callback?: never, - ): Promise; - async searchForIssuesUsingJqlPost( - parameters?: Parameters.SearchForIssuesUsingJqlPost, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/search', - method: 'POST', - data: { - jql: parameters?.jql, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - fields: parameters?.fields, - validateQuery: parameters?.validateQuery, - expand: parameters?.expand, - properties: parameters?.properties, - fieldsByKeys: parameters?.fieldsByKeys, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueSecurityLevel.mts b/src/version2/issueSecurityLevel.mts new file mode 100644 index 000000000..a4a00d91c --- /dev/null +++ b/src/version2/issueSecurityLevel.mts @@ -0,0 +1,95 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueSecurityLevel { + constructor(private client: Client) {} + + /** + * Returns issue security level members. + * + * Only issue security level members in context of classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueSecurityLevelMembers( + parameters: Parameters.GetIssueSecurityLevelMembers | string, + callback: Callback, + ): Promise; + /** + * Returns issue security level members. + * + * Only issue security level members in context of classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueSecurityLevelMembers( + parameters: Parameters.GetIssueSecurityLevelMembers | string, + callback?: never, + ): Promise; + async getIssueSecurityLevelMembers( + parameters: Parameters.GetIssueSecurityLevelMembers | string, + callback?: Callback, + ): Promise { + const issueSecuritySchemeId = typeof parameters === 'string' ? parameters : parameters.issueSecuritySchemeId; + + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${issueSecuritySchemeId}/members`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + issueSecurityLevelId: typeof parameters !== 'string' && parameters.issueSecurityLevelId, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns details of an issue security level. + * + * Use [Get issue security scheme](#api-rest-api-2-issuesecurityschemes-id-get) to obtain the IDs of issue security + * levels associated with the issue security scheme. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getIssueSecurityLevel( + parameters: Parameters.GetIssueSecurityLevel | string, + callback: Callback, + ): Promise; + /** + * Returns details of an issue security level. + * + * Use [Get issue security scheme](#api-rest-api-2-issuesecurityschemes-id-get) to obtain the IDs of issue security + * levels associated with the issue security scheme. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getIssueSecurityLevel( + parameters: Parameters.GetIssueSecurityLevel | string, + callback?: never, + ): Promise; + async getIssueSecurityLevel( + parameters: Parameters.GetIssueSecurityLevel | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/securitylevel/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueSecurityLevel.ts b/src/version2/issueSecurityLevel.ts deleted file mode 100644 index 9f6215b3c..000000000 --- a/src/version2/issueSecurityLevel.ts +++ /dev/null @@ -1,95 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueSecurityLevel { - constructor(private client: Client) {} - - /** - * Returns issue security level members. - * - * Only issue security level members in context of classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueSecurityLevelMembers( - parameters: Parameters.GetIssueSecurityLevelMembers | string, - callback: Callback, - ): Promise; - /** - * Returns issue security level members. - * - * Only issue security level members in context of classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueSecurityLevelMembers( - parameters: Parameters.GetIssueSecurityLevelMembers | string, - callback?: never, - ): Promise; - async getIssueSecurityLevelMembers( - parameters: Parameters.GetIssueSecurityLevelMembers | string, - callback?: Callback, - ): Promise { - const issueSecuritySchemeId = typeof parameters === 'string' ? parameters : parameters.issueSecuritySchemeId; - - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${issueSecuritySchemeId}/members`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - issueSecurityLevelId: typeof parameters !== 'string' && parameters.issueSecurityLevelId, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns details of an issue security level. - * - * Use [Get issue security scheme](#api-rest-api-2-issuesecurityschemes-id-get) to obtain the IDs of issue security - * levels associated with the issue security scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getIssueSecurityLevel( - parameters: Parameters.GetIssueSecurityLevel | string, - callback: Callback, - ): Promise; - /** - * Returns details of an issue security level. - * - * Use [Get issue security scheme](#api-rest-api-2-issuesecurityschemes-id-get) to obtain the IDs of issue security - * levels associated with the issue security scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getIssueSecurityLevel( - parameters: Parameters.GetIssueSecurityLevel | string, - callback?: never, - ): Promise; - async getIssueSecurityLevel( - parameters: Parameters.GetIssueSecurityLevel | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/securitylevel/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueSecuritySchemes.mts b/src/version2/issueSecuritySchemes.mts new file mode 100644 index 000000000..51af4394b --- /dev/null +++ b/src/version2/issueSecuritySchemes.mts @@ -0,0 +1,605 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '@/clients/index.mjs'; +import { paramSerializer } from '@/paramSerializer.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueSecuritySchemes { + constructor(private client: Client) {} + + /** + * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueSecuritySchemes(callback: Callback): Promise; + /** + * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueSecuritySchemes(callback?: never): Promise; + async getIssueSecuritySchemes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuesecurityschemes', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme + * levels and security scheme levels' members per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueSecurityScheme( + parameters: Parameters.CreateIssueSecurityScheme, + callback: Callback, + ): Promise; + /** + * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme + * levels and security scheme levels' members per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueSecurityScheme( + parameters: Parameters.CreateIssueSecurityScheme, + callback?: never, + ): Promise; + async createIssueSecurityScheme( + parameters: Parameters.CreateIssueSecurityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuesecurityschemes', + method: 'POST', + data: { + description: parameters.description, + levels: parameters.levels, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * security levels. + * + * Only issue security levels in the context of classic projects are returned. + * + * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include + * both specified issue security levels and all issue security levels from the specified schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevels( + parameters: Parameters.GetSecurityLevels | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * security levels. + * + * Only issue security levels in the context of classic projects are returned. + * + * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include + * both specified issue security levels and all issue security levels from the specified schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevels( + parameters?: Parameters.GetSecurityLevels, + callback?: never, + ): Promise; + async getSecurityLevels( + parameters?: Parameters.GetSecurityLevels, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuesecurityschemes/level', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: paramSerializer('id', parameters?.id), + schemeId: paramSerializer('schemeId', parameters?.schemeId), + onlyDefault: parameters?.onlyDefault, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets default issue security levels for schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultLevels( + parameters: Parameters.SetDefaultLevels | undefined, + callback: Callback, + ): Promise; + /** + * Sets default issue security levels for schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultLevels(parameters?: Parameters.SetDefaultLevels, callback?: never): Promise; + async setDefaultLevels( + parameters?: Parameters.SetDefaultLevels, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuesecurityschemes/level/default', + method: 'PUT', + data: { + defaultValues: parameters?.defaultValues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * security level members. + * + * Only issue security level members in the context of classic projects are returned. + * + * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will + * include all issue security level members from the specified schemes and levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevelMembers( + parameters: Parameters.GetSecurityLevelMembers | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * security level members. + * + * Only issue security level members in the context of classic projects are returned. + * + * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will + * include all issue security level members from the specified schemes and levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevelMembers( + parameters?: Parameters.GetSecurityLevelMembers, + callback?: never, + ): Promise; + async getSecurityLevelMembers( + parameters?: Parameters.GetSecurityLevelMembers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuesecurityschemes/level/member', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: paramSerializer('id', parameters?.id), + schemeId: paramSerializer('schemeId', parameters?.schemeId), + levelId: paramSerializer('levelId', parameters?.levelId), + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of + * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs + * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the + * context of classic projects are supported. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchProjectsUsingSecuritySchemes( + parameters: Parameters.SearchProjectsUsingSecuritySchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of + * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs + * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the + * context of classic projects are supported. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchProjectsUsingSecuritySchemes( + parameters?: Parameters.SearchProjectsUsingSecuritySchemes, + callback?: never, + ): Promise; + async searchProjectsUsingSecuritySchemes( + parameters?: Parameters.SearchProjectsUsingSecuritySchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuesecurityschemes/project', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + issueSecuritySchemeId: parameters?.issueSecuritySchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if + * provided. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async associateSchemesToProjects( + parameters: Parameters.AssociateSchemesToProjects, + callback: Callback, + ): Promise; + /** + * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if + * provided. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async associateSchemesToProjects( + parameters: Parameters.AssociateSchemesToProjects, + callback?: never, + ): Promise; + async associateSchemesToProjects( + parameters: Parameters.AssociateSchemesToProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuesecurityschemes/project', + method: 'PUT', + data: { + oldToNewSecurityLevelMappings: parameters.oldToNewSecurityLevelMappings, + projectId: parameters.projectId, + schemeId: parameters.schemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * security schemes. If you specify the project ID parameter, the result will contain issue security schemes and + * related project IDs you filter by. + * + * Only issue security schemes in the context of classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchSecuritySchemes( + parameters: Parameters.SearchSecuritySchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * security schemes. If you specify the project ID parameter, the result will contain issue security schemes and + * related project IDs you filter by. + * + * Only issue security schemes in the context of classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchSecuritySchemes( + parameters?: Parameters.SearchSecuritySchemes, + callback?: never, + ): Promise; + async searchSecuritySchemes( + parameters?: Parameters.SearchSecuritySchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuesecurityschemes/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: paramSerializer('id', parameters?.id), + projectId: paramSerializer('projectId', parameters?.projectId), + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue security scheme along with its security levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the + * requested issue security scheme. + */ + async getIssueSecurityScheme( + parameters: Parameters.GetIssueSecurityScheme | string, + callback: Callback, + ): Promise; + /** + * Returns an issue security scheme along with its security levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the + * requested issue security scheme. + */ + async getIssueSecurityScheme( + parameters: Parameters.GetIssueSecurityScheme | string, + callback?: never, + ): Promise; + async getIssueSecurityScheme( + parameters: Parameters.GetIssueSecurityScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the issue security scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueSecurityScheme( + parameters: Parameters.UpdateIssueSecurityScheme, + callback: Callback, + ): Promise; + /** + * Updates the issue security scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueSecurityScheme( + parameters: Parameters.UpdateIssueSecurityScheme, + callback?: never, + ): Promise; + async updateIssueSecurityScheme( + parameters: Parameters.UpdateIssueSecurityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${parameters.id}`, + method: 'PUT', + data: { + description: parameters.description, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue security scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteSecurityScheme( + parameters: Parameters.DeleteSecurityScheme, + callback: Callback, + ): Promise; + /** + * Deletes an issue security scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteSecurityScheme(parameters: Parameters.DeleteSecurityScheme, callback?: never): Promise; + async deleteSecurityScheme( + parameters: Parameters.DeleteSecurityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback: Callback): Promise; + /** + * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: never): Promise; + async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level`, + method: 'PUT', + data: { + levels: parameters.levels, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the issue security level. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback: Callback): Promise; + /** + * Updates the issue security level. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback?: never): Promise; + async updateSecurityLevel( + parameters: Parameters.UpdateSecurityLevel, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, + method: 'PUT', + data: { + description: parameters.description, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue security level. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeLevel(parameters: Parameters.RemoveLevel, callback: Callback): Promise; + /** + * Deletes an issue security level. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeLevel(parameters: Parameters.RemoveLevel, callback?: never): Promise; + async removeLevel(parameters: Parameters.RemoveLevel, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, + method: 'DELETE', + params: { + replaceWith: parameters.replaceWith, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds members to the issue security level. You can add up to 100 members per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addSecurityLevelMembers( + parameters: Parameters.AddSecurityLevelMembers, + callback: Callback, + ): Promise; + /** + * Adds members to the issue security level. You can add up to 100 members per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addSecurityLevelMembers(parameters: Parameters.AddSecurityLevelMembers, callback?: never): Promise; + async addSecurityLevelMembers( + parameters: Parameters.AddSecurityLevelMembers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member`, + method: 'PUT', + data: { + members: parameters.members, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes an issue security level member from an issue security scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeMemberFromSecurityLevel( + parameters: Parameters.RemoveMemberFromSecurityLevel, + callback: Callback, + ): Promise; + /** + * Removes an issue security level member from an issue security scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeMemberFromSecurityLevel( + parameters: Parameters.RemoveMemberFromSecurityLevel, + callback?: never, + ): Promise; + async removeMemberFromSecurityLevel( + parameters: Parameters.RemoveMemberFromSecurityLevel, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member/${parameters.memberId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueSecuritySchemes.ts b/src/version2/issueSecuritySchemes.ts deleted file mode 100644 index efd64e330..000000000 --- a/src/version2/issueSecuritySchemes.ts +++ /dev/null @@ -1,605 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import { paramSerializer } from '../paramSerializer.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueSecuritySchemes { - constructor(private client: Client) {} - - /** - * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueSecuritySchemes(callback: Callback): Promise; - /** - * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueSecuritySchemes(callback?: never): Promise; - async getIssueSecuritySchemes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuesecurityschemes', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme - * levels and security scheme levels' members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueSecurityScheme( - parameters: Parameters.CreateIssueSecurityScheme, - callback: Callback, - ): Promise; - /** - * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme - * levels and security scheme levels' members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueSecurityScheme( - parameters: Parameters.CreateIssueSecurityScheme, - callback?: never, - ): Promise; - async createIssueSecurityScheme( - parameters: Parameters.CreateIssueSecurityScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuesecurityschemes', - method: 'POST', - data: { - description: parameters.description, - levels: parameters.levels, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * security levels. - * - * Only issue security levels in the context of classic projects are returned. - * - * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include - * both specified issue security levels and all issue security levels from the specified schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevels( - parameters: Parameters.GetSecurityLevels | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * security levels. - * - * Only issue security levels in the context of classic projects are returned. - * - * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include - * both specified issue security levels and all issue security levels from the specified schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevels( - parameters?: Parameters.GetSecurityLevels, - callback?: never, - ): Promise; - async getSecurityLevels( - parameters?: Parameters.GetSecurityLevels, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuesecurityschemes/level', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: paramSerializer('id', parameters?.id), - schemeId: paramSerializer('schemeId', parameters?.schemeId), - onlyDefault: parameters?.onlyDefault, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets default issue security levels for schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultLevels( - parameters: Parameters.SetDefaultLevels | undefined, - callback: Callback, - ): Promise; - /** - * Sets default issue security levels for schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultLevels(parameters?: Parameters.SetDefaultLevels, callback?: never): Promise; - async setDefaultLevels( - parameters?: Parameters.SetDefaultLevels, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuesecurityschemes/level/default', - method: 'PUT', - data: { - defaultValues: parameters?.defaultValues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * security level members. - * - * Only issue security level members in the context of classic projects are returned. - * - * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will - * include all issue security level members from the specified schemes and levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevelMembers( - parameters: Parameters.GetSecurityLevelMembers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * security level members. - * - * Only issue security level members in the context of classic projects are returned. - * - * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will - * include all issue security level members from the specified schemes and levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevelMembers( - parameters?: Parameters.GetSecurityLevelMembers, - callback?: never, - ): Promise; - async getSecurityLevelMembers( - parameters?: Parameters.GetSecurityLevelMembers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuesecurityschemes/level/member', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: paramSerializer('id', parameters?.id), - schemeId: paramSerializer('schemeId', parameters?.schemeId), - levelId: paramSerializer('levelId', parameters?.levelId), - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of - * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs - * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the - * context of classic projects are supported. - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchProjectsUsingSecuritySchemes( - parameters: Parameters.SearchProjectsUsingSecuritySchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of - * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs - * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the - * context of classic projects are supported. - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchProjectsUsingSecuritySchemes( - parameters?: Parameters.SearchProjectsUsingSecuritySchemes, - callback?: never, - ): Promise; - async searchProjectsUsingSecuritySchemes( - parameters?: Parameters.SearchProjectsUsingSecuritySchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuesecurityschemes/project', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - issueSecuritySchemeId: parameters?.issueSecuritySchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if - * provided. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async associateSchemesToProjects( - parameters: Parameters.AssociateSchemesToProjects, - callback: Callback, - ): Promise; - /** - * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if - * provided. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async associateSchemesToProjects( - parameters: Parameters.AssociateSchemesToProjects, - callback?: never, - ): Promise; - async associateSchemesToProjects( - parameters: Parameters.AssociateSchemesToProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuesecurityschemes/project', - method: 'PUT', - data: { - oldToNewSecurityLevelMappings: parameters.oldToNewSecurityLevelMappings, - projectId: parameters.projectId, - schemeId: parameters.schemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * security schemes. If you specify the project ID parameter, the result will contain issue security schemes and - * related project IDs you filter by. - * - * Only issue security schemes in the context of classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchSecuritySchemes( - parameters: Parameters.SearchSecuritySchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * security schemes. If you specify the project ID parameter, the result will contain issue security schemes and - * related project IDs you filter by. - * - * Only issue security schemes in the context of classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchSecuritySchemes( - parameters?: Parameters.SearchSecuritySchemes, - callback?: never, - ): Promise; - async searchSecuritySchemes( - parameters?: Parameters.SearchSecuritySchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuesecurityschemes/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: paramSerializer('id', parameters?.id), - projectId: paramSerializer('projectId', parameters?.projectId), - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue security scheme along with its security levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the - * requested issue security scheme. - */ - async getIssueSecurityScheme( - parameters: Parameters.GetIssueSecurityScheme | string, - callback: Callback, - ): Promise; - /** - * Returns an issue security scheme along with its security levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the - * requested issue security scheme. - */ - async getIssueSecurityScheme( - parameters: Parameters.GetIssueSecurityScheme | string, - callback?: never, - ): Promise; - async getIssueSecurityScheme( - parameters: Parameters.GetIssueSecurityScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the issue security scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueSecurityScheme( - parameters: Parameters.UpdateIssueSecurityScheme, - callback: Callback, - ): Promise; - /** - * Updates the issue security scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueSecurityScheme( - parameters: Parameters.UpdateIssueSecurityScheme, - callback?: never, - ): Promise; - async updateIssueSecurityScheme( - parameters: Parameters.UpdateIssueSecurityScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${parameters.id}`, - method: 'PUT', - data: { - description: parameters.description, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue security scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteSecurityScheme( - parameters: Parameters.DeleteSecurityScheme, - callback: Callback, - ): Promise; - /** - * Deletes an issue security scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteSecurityScheme(parameters: Parameters.DeleteSecurityScheme, callback?: never): Promise; - async deleteSecurityScheme( - parameters: Parameters.DeleteSecurityScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback: Callback): Promise; - /** - * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: never): Promise; - async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level`, - method: 'PUT', - data: { - levels: parameters.levels, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the issue security level. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback: Callback): Promise; - /** - * Updates the issue security level. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback?: never): Promise; - async updateSecurityLevel( - parameters: Parameters.UpdateSecurityLevel, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, - method: 'PUT', - data: { - description: parameters.description, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue security level. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeLevel(parameters: Parameters.RemoveLevel, callback: Callback): Promise; - /** - * Deletes an issue security level. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeLevel(parameters: Parameters.RemoveLevel, callback?: never): Promise; - async removeLevel(parameters: Parameters.RemoveLevel, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, - method: 'DELETE', - params: { - replaceWith: parameters.replaceWith, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds members to the issue security level. You can add up to 100 members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevelMembers( - parameters: Parameters.AddSecurityLevelMembers, - callback: Callback, - ): Promise; - /** - * Adds members to the issue security level. You can add up to 100 members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevelMembers(parameters: Parameters.AddSecurityLevelMembers, callback?: never): Promise; - async addSecurityLevelMembers( - parameters: Parameters.AddSecurityLevelMembers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member`, - method: 'PUT', - data: { - members: parameters.members, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes an issue security level member from an issue security scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeMemberFromSecurityLevel( - parameters: Parameters.RemoveMemberFromSecurityLevel, - callback: Callback, - ): Promise; - /** - * Removes an issue security level member from an issue security scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeMemberFromSecurityLevel( - parameters: Parameters.RemoveMemberFromSecurityLevel, - callback?: never, - ): Promise; - async removeMemberFromSecurityLevel( - parameters: Parameters.RemoveMemberFromSecurityLevel, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member/${parameters.memberId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueTypeProperties.mts b/src/version2/issueTypeProperties.mts new file mode 100644 index 000000000..d3cfa102a --- /dev/null +++ b/src/version2/issueTypeProperties.mts @@ -0,0 +1,176 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueTypeProperties { + constructor(private client: Client) {} + + /** + * Returns all the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * keys of the issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any + * issue type. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any + * issue types associated with the projects the user has permission to browse. + */ + async getIssueTypePropertyKeys( + parameters: Parameters.GetIssueTypePropertyKeys | string, + callback: Callback, + ): Promise; + /** + * Returns all the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * keys of the issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any + * issue type. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any + * issue types associated with the projects the user has permission to browse. + */ + async getIssueTypePropertyKeys( + parameters: Parameters.GetIssueTypePropertyKeys | string, + callback?: never, + ): Promise; + async getIssueTypePropertyKeys( + parameters: Parameters.GetIssueTypePropertyKeys | string, + callback?: Callback, + ): Promise { + const issueTypeId = typeof parameters === 'string' ? parameters : parameters.issueTypeId; + + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${issueTypeId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the key and value of the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue + * type. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue + * types associated with the projects the user has permission to browse. + */ + async getIssueTypeProperty( + parameters: Parameters.GetIssueTypeProperty, + callback: Callback, + ): Promise; + /** + * Returns the key and value of the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue + * type. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue + * types associated with the projects the user has permission to browse. + */ + async getIssueTypeProperty( + parameters: Parameters.GetIssueTypeProperty, + callback?: never, + ): Promise; + async getIssueTypeProperty( + parameters: Parameters.GetIssueTypeProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates or updates the value of the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * Use this resource to store and update data against an issue type. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setIssueTypeProperty( + parameters: Parameters.SetIssueTypeProperty, + callback: Callback, + ): Promise; + /** + * Creates or updates the value of the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * Use this resource to store and update data against an issue type. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setIssueTypeProperty(parameters: Parameters.SetIssueTypeProperty, callback?: never): Promise; + async setIssueTypeProperty( + parameters: Parameters.SetIssueTypeProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueTypeProperty( + parameters: Parameters.DeleteIssueTypeProperty, + callback: Callback, + ): Promise; + /** + * Deletes the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueTypeProperty(parameters: Parameters.DeleteIssueTypeProperty, callback?: never): Promise; + async deleteIssueTypeProperty( + parameters: Parameters.DeleteIssueTypeProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueTypeProperties.ts b/src/version2/issueTypeProperties.ts deleted file mode 100644 index 92ee33c62..000000000 --- a/src/version2/issueTypeProperties.ts +++ /dev/null @@ -1,176 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueTypeProperties { - constructor(private client: Client) {} - - /** - * Returns all the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys of the issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any - * issue type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any - * issue types associated with the projects the user has permission to browse. - */ - async getIssueTypePropertyKeys( - parameters: Parameters.GetIssueTypePropertyKeys | string, - callback: Callback, - ): Promise; - /** - * Returns all the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys of the issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any - * issue type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any - * issue types associated with the projects the user has permission to browse. - */ - async getIssueTypePropertyKeys( - parameters: Parameters.GetIssueTypePropertyKeys | string, - callback?: never, - ): Promise; - async getIssueTypePropertyKeys( - parameters: Parameters.GetIssueTypePropertyKeys | string, - callback?: Callback, - ): Promise { - const issueTypeId = typeof parameters === 'string' ? parameters : parameters.issueTypeId; - - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${issueTypeId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the key and value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue - * type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue - * types associated with the projects the user has permission to browse. - */ - async getIssueTypeProperty( - parameters: Parameters.GetIssueTypeProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue - * type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue - * types associated with the projects the user has permission to browse. - */ - async getIssueTypeProperty( - parameters: Parameters.GetIssueTypeProperty, - callback?: never, - ): Promise; - async getIssueTypeProperty( - parameters: Parameters.GetIssueTypeProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates or updates the value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * Use this resource to store and update data against an issue type. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueTypeProperty( - parameters: Parameters.SetIssueTypeProperty, - callback: Callback, - ): Promise; - /** - * Creates or updates the value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * Use this resource to store and update data against an issue type. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueTypeProperty(parameters: Parameters.SetIssueTypeProperty, callback?: never): Promise; - async setIssueTypeProperty( - parameters: Parameters.SetIssueTypeProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeProperty( - parameters: Parameters.DeleteIssueTypeProperty, - callback: Callback, - ): Promise; - /** - * Deletes the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeProperty(parameters: Parameters.DeleteIssueTypeProperty, callback?: never): Promise; - async deleteIssueTypeProperty( - parameters: Parameters.DeleteIssueTypeProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueTypeSchemes.mts b/src/version2/issueTypeSchemes.mts new file mode 100644 index 000000000..6650604d2 --- /dev/null +++ b/src/version2/issueTypeSchemes.mts @@ -0,0 +1,437 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueTypeSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type schemes. + * + * Only issue type schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllIssueTypeSchemes( + parameters: Parameters.GetAllIssueTypeSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type schemes. + * + * Only issue type schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllIssueTypeSchemes( + parameters?: Parameters.GetAllIssueTypeSchemes, + callback?: never, + ): Promise; + async getAllIssueTypeSchemes( + parameters?: Parameters.GetAllIssueTypeSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + queryString: parameters?.queryString, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueTypeScheme( + parameters: Parameters.CreateIssueTypeScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates an issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueTypeScheme( + parameters?: Parameters.CreateIssueTypeScheme, + callback?: never, + ): Promise; + async createIssueTypeScheme( + parameters?: Parameters.CreateIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescheme', + method: 'POST', + data: { + name: parameters?.name, + description: parameters?.description, + defaultIssueTypeId: parameters?.defaultIssueTypeId, + issueTypeIds: parameters?.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type scheme items. + * + * Only issue type scheme items used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeSchemesMapping( + parameters: Parameters.GetIssueTypeSchemesMapping | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type scheme items. + * + * Only issue type scheme items used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeSchemesMapping( + parameters?: Parameters.GetIssueTypeSchemesMapping, + callback?: never, + ): Promise; + async getIssueTypeSchemesMapping( + parameters?: Parameters.GetIssueTypeSchemesMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescheme/mapping', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + issueTypeSchemeId: parameters?.issueTypeSchemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type schemes and, for each issue type scheme, a list of the projects that use it. + * + * Only issue type schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeSchemeForProjects( + parameters: Parameters.GetIssueTypeSchemeForProjects, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type schemes and, for each issue type scheme, a list of the projects that use it. + * + * Only issue type schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeSchemeForProjects( + parameters: Parameters.GetIssueTypeSchemeForProjects, + callback?: never, + ): Promise; + async getIssueTypeSchemeForProjects( + parameters: Parameters.GetIssueTypeSchemeForProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescheme/project', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns an issue type scheme to a project. + * + * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To + * complete the assignment those issues must be updated to use issue types in the new scheme. + * + * Issue type schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignIssueTypeSchemeToProject( + parameters: Parameters.AssignIssueTypeSchemeToProject | undefined, + callback: Callback, + ): Promise; + /** + * Assigns an issue type scheme to a project. + * + * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To + * complete the assignment those issues must be updated to use issue types in the new scheme. + * + * Issue type schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignIssueTypeSchemeToProject( + parameters?: Parameters.AssignIssueTypeSchemeToProject, + callback?: never, + ): Promise; + async assignIssueTypeSchemeToProject( + parameters?: Parameters.AssignIssueTypeSchemeToProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescheme/project', + method: 'PUT', + data: { + issueTypeSchemeId: parameters?.issueTypeSchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueTypeScheme( + parameters: Parameters.UpdateIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Updates an issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueTypeScheme(parameters: Parameters.UpdateIssueTypeScheme, callback?: never): Promise; + async updateIssueTypeScheme( + parameters: Parameters.UpdateIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + defaultIssueTypeId: parameters.defaultIssueTypeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue type scheme. + * + * Only issue type schemes used in classic projects can be deleted. + * + * Any projects assigned to the scheme are reassigned to the default issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueTypeScheme( + parameters: Parameters.DeleteIssueTypeScheme | string, + callback: Callback, + ): Promise; + /** + * Deletes an issue type scheme. + * + * Only issue type schemes used in classic projects can be deleted. + * + * Any projects assigned to the scheme are reassigned to the default issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueTypeScheme( + parameters: Parameters.DeleteIssueTypeScheme | string, + callback?: never, + ): Promise; + async deleteIssueTypeScheme( + parameters: Parameters.DeleteIssueTypeScheme | string, + callback?: Callback, + ): Promise { + const issueTypeSchemeId = typeof parameters === 'string' ? parameters : parameters.issueTypeSchemeId; + + const config: RequestConfig = { + url: `/rest/api/2/issuetypescheme/${issueTypeSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds issue types to an issue type scheme. + * + * The added issue types are appended to the issue types list. + * + * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addIssueTypesToIssueTypeScheme( + parameters: Parameters.AddIssueTypesToIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Adds issue types to an issue type scheme. + * + * The added issue types are appended to the issue types list. + * + * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addIssueTypesToIssueTypeScheme( + parameters: Parameters.AddIssueTypesToIssueTypeScheme, + callback?: never, + ): Promise; + async addIssueTypesToIssueTypeScheme( + parameters: Parameters.AddIssueTypesToIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype`, + method: 'PUT', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the order of issue types in an issue type scheme. + * + * The request body parameters must meet the following requirements: + * + * - All of the issue types must belong to the issue type scheme. + * - Either `after` or `position` must be provided. + * - The issue type in `after` must not be in the issue type list. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async reorderIssueTypesInIssueTypeScheme( + parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Changes the order of issue types in an issue type scheme. + * + * The request body parameters must meet the following requirements: + * + * - All of the issue types must belong to the issue type scheme. + * - Either `after` or `position` must be provided. + * - The issue type in `after` must not be in the issue type list. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async reorderIssueTypesInIssueTypeScheme( + parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, + callback?: never, + ): Promise; + async reorderIssueTypesInIssueTypeScheme( + parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/move`, + method: 'PUT', + data: { + issueTypeIds: parameters.issueTypeIds, + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes an issue type from an issue type scheme. + * + * This operation cannot remove: + * + * - Any issue type used by issues. + * - Any issue types from the default issue type scheme. + * - The last standard issue type from an issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypeFromIssueTypeScheme( + parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Removes an issue type from an issue type scheme. + * + * This operation cannot remove: + * + * - Any issue type used by issues. + * - Any issue types from the default issue type scheme. + * - The last standard issue type from an issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypeFromIssueTypeScheme( + parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, + callback?: never, + ): Promise; + async removeIssueTypeFromIssueTypeScheme( + parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/${parameters.issueTypeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueTypeSchemes.ts b/src/version2/issueTypeSchemes.ts deleted file mode 100644 index b7fd780aa..000000000 --- a/src/version2/issueTypeSchemes.ts +++ /dev/null @@ -1,437 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueTypeSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type schemes. - * - * Only issue type schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllIssueTypeSchemes( - parameters: Parameters.GetAllIssueTypeSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type schemes. - * - * Only issue type schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllIssueTypeSchemes( - parameters?: Parameters.GetAllIssueTypeSchemes, - callback?: never, - ): Promise; - async getAllIssueTypeSchemes( - parameters?: Parameters.GetAllIssueTypeSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - orderBy: parameters?.orderBy, - expand: parameters?.expand, - queryString: parameters?.queryString, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeScheme( - parameters: Parameters.CreateIssueTypeScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates an issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeScheme( - parameters?: Parameters.CreateIssueTypeScheme, - callback?: never, - ): Promise; - async createIssueTypeScheme( - parameters?: Parameters.CreateIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescheme', - method: 'POST', - data: { - name: parameters?.name, - description: parameters?.description, - defaultIssueTypeId: parameters?.defaultIssueTypeId, - issueTypeIds: parameters?.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type scheme items. - * - * Only issue type scheme items used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeSchemesMapping( - parameters: Parameters.GetIssueTypeSchemesMapping | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type scheme items. - * - * Only issue type scheme items used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeSchemesMapping( - parameters?: Parameters.GetIssueTypeSchemesMapping, - callback?: never, - ): Promise; - async getIssueTypeSchemesMapping( - parameters?: Parameters.GetIssueTypeSchemesMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescheme/mapping', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - issueTypeSchemeId: parameters?.issueTypeSchemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type schemes and, for each issue type scheme, a list of the projects that use it. - * - * Only issue type schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeSchemeForProjects( - parameters: Parameters.GetIssueTypeSchemeForProjects, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type schemes and, for each issue type scheme, a list of the projects that use it. - * - * Only issue type schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeSchemeForProjects( - parameters: Parameters.GetIssueTypeSchemeForProjects, - callback?: never, - ): Promise; - async getIssueTypeSchemeForProjects( - parameters: Parameters.GetIssueTypeSchemeForProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescheme/project', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns an issue type scheme to a project. - * - * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To - * complete the assignment those issues must be updated to use issue types in the new scheme. - * - * Issue type schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeSchemeToProject( - parameters: Parameters.AssignIssueTypeSchemeToProject | undefined, - callback: Callback, - ): Promise; - /** - * Assigns an issue type scheme to a project. - * - * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To - * complete the assignment those issues must be updated to use issue types in the new scheme. - * - * Issue type schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeSchemeToProject( - parameters?: Parameters.AssignIssueTypeSchemeToProject, - callback?: never, - ): Promise; - async assignIssueTypeSchemeToProject( - parameters?: Parameters.AssignIssueTypeSchemeToProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescheme/project', - method: 'PUT', - data: { - issueTypeSchemeId: parameters?.issueTypeSchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueTypeScheme( - parameters: Parameters.UpdateIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Updates an issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueTypeScheme(parameters: Parameters.UpdateIssueTypeScheme, callback?: never): Promise; - async updateIssueTypeScheme( - parameters: Parameters.UpdateIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - defaultIssueTypeId: parameters.defaultIssueTypeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue type scheme. - * - * Only issue type schemes used in classic projects can be deleted. - * - * Any projects assigned to the scheme are reassigned to the default issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeScheme( - parameters: Parameters.DeleteIssueTypeScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes an issue type scheme. - * - * Only issue type schemes used in classic projects can be deleted. - * - * Any projects assigned to the scheme are reassigned to the default issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeScheme( - parameters: Parameters.DeleteIssueTypeScheme | string, - callback?: never, - ): Promise; - async deleteIssueTypeScheme( - parameters: Parameters.DeleteIssueTypeScheme | string, - callback?: Callback, - ): Promise { - const issueTypeSchemeId = typeof parameters === 'string' ? parameters : parameters.issueTypeSchemeId; - - const config: RequestConfig = { - url: `/rest/api/2/issuetypescheme/${issueTypeSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds issue types to an issue type scheme. - * - * The added issue types are appended to the issue types list. - * - * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToIssueTypeScheme( - parameters: Parameters.AddIssueTypesToIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Adds issue types to an issue type scheme. - * - * The added issue types are appended to the issue types list. - * - * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToIssueTypeScheme( - parameters: Parameters.AddIssueTypesToIssueTypeScheme, - callback?: never, - ): Promise; - async addIssueTypesToIssueTypeScheme( - parameters: Parameters.AddIssueTypesToIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype`, - method: 'PUT', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the order of issue types in an issue type scheme. - * - * The request body parameters must meet the following requirements: - * - * - All of the issue types must belong to the issue type scheme. - * - Either `after` or `position` must be provided. - * - The issue type in `after` must not be in the issue type list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderIssueTypesInIssueTypeScheme( - parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Changes the order of issue types in an issue type scheme. - * - * The request body parameters must meet the following requirements: - * - * - All of the issue types must belong to the issue type scheme. - * - Either `after` or `position` must be provided. - * - The issue type in `after` must not be in the issue type list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderIssueTypesInIssueTypeScheme( - parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, - callback?: never, - ): Promise; - async reorderIssueTypesInIssueTypeScheme( - parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/move`, - method: 'PUT', - data: { - issueTypeIds: parameters.issueTypeIds, - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes an issue type from an issue type scheme. - * - * This operation cannot remove: - * - * - Any issue type used by issues. - * - Any issue types from the default issue type scheme. - * - The last standard issue type from an issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypeFromIssueTypeScheme( - parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Removes an issue type from an issue type scheme. - * - * This operation cannot remove: - * - * - Any issue type used by issues. - * - Any issue types from the default issue type scheme. - * - The last standard issue type from an issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypeFromIssueTypeScheme( - parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, - callback?: never, - ): Promise; - async removeIssueTypeFromIssueTypeScheme( - parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/${parameters.issueTypeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueTypeScreenSchemes.mts b/src/version2/issueTypeScreenSchemes.mts new file mode 100644 index 000000000..76fd27b99 --- /dev/null +++ b/src/version2/issueTypeScreenSchemes.mts @@ -0,0 +1,440 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueTypeScreenSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type screen schemes. + * + * Only issue type screen schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeScreenSchemes( + parameters: Parameters.GetIssueTypeScreenSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type screen schemes. + * + * Only issue type screen schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeScreenSchemes( + parameters?: Parameters.GetIssueTypeScreenSchemes, + callback?: never, + ): Promise; + async getIssueTypeScreenSchemes( + parameters?: Parameters.GetIssueTypeScreenSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescreenscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + queryString: parameters?.queryString, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueTypeScreenScheme( + parameters: Parameters.CreateIssueTypeScreenScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueTypeScreenScheme( + parameters?: Parameters.CreateIssueTypeScreenScheme, + callback?: never, + ): Promise; + async createIssueTypeScreenScheme( + parameters?: Parameters.CreateIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescreenscheme', + method: 'POST', + data: { + name: parameters?.name, + description: parameters?.description, + issueTypeMappings: parameters?.issueTypeMappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type screen scheme items. + * + * Only issue type screen schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeScreenSchemeMappings( + parameters: Parameters.GetIssueTypeScreenSchemeMappings | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type screen scheme items. + * + * Only issue type screen schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeScreenSchemeMappings( + parameters?: Parameters.GetIssueTypeScreenSchemeMappings, + callback?: never, + ): Promise; + async getIssueTypeScreenSchemeMappings( + parameters?: Parameters.GetIssueTypeScreenSchemeMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescreenscheme/mapping', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. + * + * Only issue type screen schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeScreenSchemeProjectAssociations( + parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. + * + * Only issue type screen schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeScreenSchemeProjectAssociations( + parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, + callback?: never, + ): Promise; + async getIssueTypeScreenSchemeProjectAssociations( + parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescreenscheme/project', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns an issue type screen scheme to a project. + * + * Issue type screen schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignIssueTypeScreenSchemeToProject( + parameters: Parameters.AssignIssueTypeScreenSchemeToProject | undefined, + callback: Callback, + ): Promise; + /** + * Assigns an issue type screen scheme to a project. + * + * Issue type screen schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignIssueTypeScreenSchemeToProject( + parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, + callback?: never, + ): Promise; + async assignIssueTypeScreenSchemeToProject( + parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescreenscheme/project', + method: 'PUT', + data: { + issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueTypeScreenScheme( + parameters: Parameters.UpdateIssueTypeScreenScheme, + callback: Callback, + ): Promise; + /** + * Updates an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueTypeScreenScheme( + parameters: Parameters.UpdateIssueTypeScreenScheme, + callback?: never, + ): Promise; + async updateIssueTypeScreenScheme( + parameters: Parameters.UpdateIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueTypeScreenScheme( + parameters: Parameters.DeleteIssueTypeScreenScheme | string, + callback: Callback, + ): Promise; + /** + * Deletes an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueTypeScreenScheme( + parameters: Parameters.DeleteIssueTypeScreenScheme | string, + callback?: never, + ): Promise; + async deleteIssueTypeScreenScheme( + parameters: Parameters.DeleteIssueTypeScreenScheme | string, + callback?: Callback, + ): Promise { + const issueTypeScreenSchemeId = typeof parameters === 'string' ? parameters : parameters.issueTypeScreenSchemeId; + + const config: RequestConfig = { + url: `/rest/api/2/issuetypescreenscheme/${issueTypeScreenSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Appends issue type to screen scheme mappings to an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async appendMappingsForIssueTypeScreenScheme( + parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, + callback: Callback, + ): Promise; + /** + * Appends issue type to screen scheme mappings to an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async appendMappingsForIssueTypeScreenScheme( + parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, + callback?: never, + ): Promise; + async appendMappingsForIssueTypeScreenScheme( + parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping`, + method: 'PUT', + data: { + issueTypeMappings: parameters.issueTypeMappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all + * unmapped issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultScreenScheme( + parameters: Parameters.UpdateDefaultScreenScheme, + callback: Callback, + ): Promise; + /** + * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all + * unmapped issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultScreenScheme( + parameters: Parameters.UpdateDefaultScreenScheme, + callback?: never, + ): Promise; + async updateDefaultScreenScheme( + parameters: Parameters.UpdateDefaultScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/default`, + method: 'PUT', + data: { + screenSchemeId: parameters.screenSchemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes issue type to screen scheme mappings from an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeMappingsFromIssueTypeScreenScheme( + parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, + callback: Callback, + ): Promise; + /** + * Removes issue type to screen scheme mappings from an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeMappingsFromIssueTypeScreenScheme( + parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, + callback?: never, + ): Promise; + async removeMappingsFromIssueTypeScreenScheme( + parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/remove`, + method: 'POST', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * projects associated with an issue type screen scheme. + * + * Only company-managed projects associated with an issue type screen scheme are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectsForIssueTypeScreenScheme( + parameters: Parameters.GetProjectsForIssueTypeScreenScheme | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * projects associated with an issue type screen scheme. + * + * Only company-managed projects associated with an issue type screen scheme are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectsForIssueTypeScreenScheme( + parameters: Parameters.GetProjectsForIssueTypeScreenScheme | string, + callback?: never, + ): Promise; + async getProjectsForIssueTypeScreenScheme( + parameters: Parameters.GetProjectsForIssueTypeScreenScheme | string, + callback?: Callback, + ): Promise { + const issueTypeScreenSchemeId = typeof parameters === 'string' ? parameters : parameters.issueTypeScreenSchemeId; + + const config: RequestConfig = { + url: `/rest/api/2/issuetypescreenscheme/${issueTypeScreenSchemeId}/project`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + query: typeof parameters !== 'string' && parameters.query, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueTypeScreenSchemes.ts b/src/version2/issueTypeScreenSchemes.ts deleted file mode 100644 index 4c41ecb5b..000000000 --- a/src/version2/issueTypeScreenSchemes.ts +++ /dev/null @@ -1,440 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueTypeScreenSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen schemes. - * - * Only issue type screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeScreenSchemes( - parameters: Parameters.GetIssueTypeScreenSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen schemes. - * - * Only issue type screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeScreenSchemes( - parameters?: Parameters.GetIssueTypeScreenSchemes, - callback?: never, - ): Promise; - async getIssueTypeScreenSchemes( - parameters?: Parameters.GetIssueTypeScreenSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescreenscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - queryString: parameters?.queryString, - orderBy: parameters?.orderBy, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeScreenScheme( - parameters: Parameters.CreateIssueTypeScreenScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeScreenScheme( - parameters?: Parameters.CreateIssueTypeScreenScheme, - callback?: never, - ): Promise; - async createIssueTypeScreenScheme( - parameters?: Parameters.CreateIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescreenscheme', - method: 'POST', - data: { - name: parameters?.name, - description: parameters?.description, - issueTypeMappings: parameters?.issueTypeMappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen scheme items. - * - * Only issue type screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeScreenSchemeMappings( - parameters: Parameters.GetIssueTypeScreenSchemeMappings | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen scheme items. - * - * Only issue type screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeScreenSchemeMappings( - parameters?: Parameters.GetIssueTypeScreenSchemeMappings, - callback?: never, - ): Promise; - async getIssueTypeScreenSchemeMappings( - parameters?: Parameters.GetIssueTypeScreenSchemeMappings, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescreenscheme/mapping', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. - * - * Only issue type screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeScreenSchemeProjectAssociations( - parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. - * - * Only issue type screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeScreenSchemeProjectAssociations( - parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, - callback?: never, - ): Promise; - async getIssueTypeScreenSchemeProjectAssociations( - parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescreenscheme/project', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns an issue type screen scheme to a project. - * - * Issue type screen schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeScreenSchemeToProject( - parameters: Parameters.AssignIssueTypeScreenSchemeToProject | undefined, - callback: Callback, - ): Promise; - /** - * Assigns an issue type screen scheme to a project. - * - * Issue type screen schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeScreenSchemeToProject( - parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, - callback?: never, - ): Promise; - async assignIssueTypeScreenSchemeToProject( - parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescreenscheme/project', - method: 'PUT', - data: { - issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueTypeScreenScheme( - parameters: Parameters.UpdateIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Updates an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueTypeScreenScheme( - parameters: Parameters.UpdateIssueTypeScreenScheme, - callback?: never, - ): Promise; - async updateIssueTypeScreenScheme( - parameters: Parameters.UpdateIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeScreenScheme( - parameters: Parameters.DeleteIssueTypeScreenScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeScreenScheme( - parameters: Parameters.DeleteIssueTypeScreenScheme | string, - callback?: never, - ): Promise; - async deleteIssueTypeScreenScheme( - parameters: Parameters.DeleteIssueTypeScreenScheme | string, - callback?: Callback, - ): Promise { - const issueTypeScreenSchemeId = typeof parameters === 'string' ? parameters : parameters.issueTypeScreenSchemeId; - - const config: RequestConfig = { - url: `/rest/api/2/issuetypescreenscheme/${issueTypeScreenSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Appends issue type to screen scheme mappings to an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async appendMappingsForIssueTypeScreenScheme( - parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Appends issue type to screen scheme mappings to an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async appendMappingsForIssueTypeScreenScheme( - parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, - callback?: never, - ): Promise; - async appendMappingsForIssueTypeScreenScheme( - parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping`, - method: 'PUT', - data: { - issueTypeMappings: parameters.issueTypeMappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all - * unmapped issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultScreenScheme( - parameters: Parameters.UpdateDefaultScreenScheme, - callback: Callback, - ): Promise; - /** - * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all - * unmapped issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultScreenScheme( - parameters: Parameters.UpdateDefaultScreenScheme, - callback?: never, - ): Promise; - async updateDefaultScreenScheme( - parameters: Parameters.UpdateDefaultScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/default`, - method: 'PUT', - data: { - screenSchemeId: parameters.screenSchemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes issue type to screen scheme mappings from an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeMappingsFromIssueTypeScreenScheme( - parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Removes issue type to screen scheme mappings from an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeMappingsFromIssueTypeScreenScheme( - parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, - callback?: never, - ): Promise; - async removeMappingsFromIssueTypeScreenScheme( - parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/remove`, - method: 'POST', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * projects associated with an issue type screen scheme. - * - * Only company-managed projects associated with an issue type screen scheme are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectsForIssueTypeScreenScheme( - parameters: Parameters.GetProjectsForIssueTypeScreenScheme | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * projects associated with an issue type screen scheme. - * - * Only company-managed projects associated with an issue type screen scheme are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectsForIssueTypeScreenScheme( - parameters: Parameters.GetProjectsForIssueTypeScreenScheme | string, - callback?: never, - ): Promise; - async getProjectsForIssueTypeScreenScheme( - parameters: Parameters.GetProjectsForIssueTypeScreenScheme | string, - callback?: Callback, - ): Promise { - const issueTypeScreenSchemeId = typeof parameters === 'string' ? parameters : parameters.issueTypeScreenSchemeId; - - const config: RequestConfig = { - url: `/rest/api/2/issuetypescreenscheme/${issueTypeScreenSchemeId}/project`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - query: typeof parameters !== 'string' && parameters.query, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueTypes.mts b/src/version2/issueTypes.mts new file mode 100644 index 000000000..c8b9e12fb --- /dev/null +++ b/src/version2/issueTypes.mts @@ -0,0 +1,351 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueTypes { + constructor(private client: Client) {} + + /** + * Returns all issue types. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issue + * types are only returned as follows: + * + * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue + * types are returned. + * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or + * more projects, the issue types associated with the projects the user has permission to browse are returned. + */ + async getIssueAllTypes(callback: Callback): Promise; + /** + * Returns all issue types. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issue + * types are only returned as follows: + * + * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue + * types are returned. + * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or + * more projects, the issue types associated with the projects the user has permission to browse are returned. + */ + async getIssueAllTypes(callback?: never): Promise; + async getIssueAllTypes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetype', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue type and adds it to the default issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueType( + parameters: Parameters.CreateIssueType | undefined, + callback: Callback, + ): Promise; + /** + * Creates an issue type and adds it to the default issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueType( + parameters?: Parameters.CreateIssueType, + callback?: never, + ): Promise; + async createIssueType( + parameters?: Parameters.CreateIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetype', + method: 'POST', + data: { + name: parameters?.name, + description: parameters?.description, + hierarchyLevel: parameters?.hierarchyLevel, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns issue types for a project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the relevant project or _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypesForProject( + parameters: Parameters.GetIssueTypesForProject, + callback: Callback, + ): Promise; + /** + * Returns issue types for a project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the relevant project or _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypesForProject( + parameters: Parameters.GetIssueTypesForProject, + callback?: never, + ): Promise; + async getIssueTypesForProject( + parameters: Parameters.GetIssueTypesForProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetype/project', + method: 'GET', + params: { + projectId: parameters.projectId, + level: parameters.level, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in a project the issue type is associated + * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueType( + parameters: Parameters.GetIssueType | string, + callback: Callback, + ): Promise; + /** + * Returns an issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in a project the issue type is associated + * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueType( + parameters: Parameters.GetIssueType | string, + callback?: never, + ): Promise; + async getIssueType( + parameters: Parameters.GetIssueType | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the issue type. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueType( + parameters: Parameters.UpdateIssueType, + callback: Callback, + ): Promise; + /** + * Updates the issue type. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueType( + parameters: Parameters.UpdateIssueType, + callback?: never, + ): Promise; + async updateIssueType( + parameters: Parameters.UpdateIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + avatarId: parameters.avatarId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type + * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue + * types](#api-rest-api-2-issuetype-id-alternatives-get) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueType( + parameters: Parameters.DeleteIssueType | string, + callback: Callback, + ): Promise; + /** + * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type + * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue + * types](#api-rest-api-2-issuetype-id-alternatives-get) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueType(parameters: Parameters.DeleteIssueType | string, callback?: never): Promise; + async deleteIssueType( + parameters: Parameters.DeleteIssueType | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${id}`, + method: 'DELETE', + params: { + alternativeIssueTypeId: typeof parameters !== 'string' && parameters.alternativeIssueTypeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those + * assigned to the same workflow scheme, field configuration scheme, and screen scheme. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAlternativeIssueTypes( + parameters: Parameters.GetAlternativeIssueTypes | string, + callback: Callback, + ): Promise; + /** + * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those + * assigned to the same workflow scheme, field configuration scheme, and screen scheme. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAlternativeIssueTypes( + parameters: Parameters.GetAlternativeIssueTypes | string, + callback?: never, + ): Promise; + async getAlternativeIssueTypes( + parameters: Parameters.GetAlternativeIssueTypes | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${id}/alternatives`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Loads an avatar for the issue type. + * + * Specify the avatar's local file location in the body of the request. Also, include the following headers: + * + * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special + * Headers](#special-request-headers). + * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * + * For example: `curl --request POST \ --user email@example.com: \ --header 'X-Atlassian-Token: no-check'\ + * --header 'Content-Type: image/< image_type>' \ --data-binary "<@/path/to/file/with/your/avatar>" \ --url + * 'https://your-domain.atlassian.net/rest/api/2/issuetype/{issueTypeId}'This` + * + * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of + * the image. The length of the square's sides is set to the smaller of the height or width of the image. + * + * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. + * + * After creating the avatar, use [ Update issue type](#api-rest-api-2-issuetype-id-put) to set it as the issue type's + * displayed avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueTypeAvatar( + parameters: Parameters.CreateIssueTypeAvatar, + callback: Callback, + ): Promise; + /** + * Loads an avatar for the issue type. + * + * Specify the avatar's local file location in the body of the request. Also, include the following headers: + * + * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special + * Headers](#special-request-headers). + * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * + * For example: `curl --request POST \ --user email@example.com: \ --header 'X-Atlassian-Token: no-check'\ + * --header 'Content-Type: image/< image_type>' \ --data-binary "<@/path/to/file/with/your/avatar>" \ --url + * 'https://your-domain.atlassian.net/rest/api/2/issuetype/{issueTypeId}'This` + * + * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of + * the image. The length of the square's sides is set to the smaller of the height or width of the image. + * + * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. + * + * After creating the avatar, use [ Update issue type](#api-rest-api-2-issuetype-id-put) to set it as the issue type's + * displayed avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueTypeAvatar( + parameters: Parameters.CreateIssueTypeAvatar, + callback?: never, + ): Promise; + async createIssueTypeAvatar( + parameters: Parameters.CreateIssueTypeAvatar, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${parameters.id}/avatar2`, + method: 'POST', + params: { + x: parameters.x, + y: parameters.y, + size: parameters.size, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueTypes.ts b/src/version2/issueTypes.ts deleted file mode 100644 index 2c77b1b18..000000000 --- a/src/version2/issueTypes.ts +++ /dev/null @@ -1,351 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueTypes { - constructor(private client: Client) {} - - /** - * Returns all issue types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issue - * types are only returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue - * types are returned. - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or - * more projects, the issue types associated with the projects the user has permission to browse are returned. - */ - async getIssueAllTypes(callback: Callback): Promise; - /** - * Returns all issue types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issue - * types are only returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue - * types are returned. - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or - * more projects, the issue types associated with the projects the user has permission to browse are returned. - */ - async getIssueAllTypes(callback?: never): Promise; - async getIssueAllTypes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetype', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue type and adds it to the default issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueType( - parameters: Parameters.CreateIssueType | undefined, - callback: Callback, - ): Promise; - /** - * Creates an issue type and adds it to the default issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueType( - parameters?: Parameters.CreateIssueType, - callback?: never, - ): Promise; - async createIssueType( - parameters?: Parameters.CreateIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetype', - method: 'POST', - data: { - name: parameters?.name, - description: parameters?.description, - hierarchyLevel: parameters?.hierarchyLevel, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns issue types for a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the relevant project or _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypesForProject( - parameters: Parameters.GetIssueTypesForProject, - callback: Callback, - ): Promise; - /** - * Returns issue types for a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the relevant project or _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypesForProject( - parameters: Parameters.GetIssueTypesForProject, - callback?: never, - ): Promise; - async getIssueTypesForProject( - parameters: Parameters.GetIssueTypesForProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetype/project', - method: 'GET', - params: { - projectId: parameters.projectId, - level: parameters.level, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in a project the issue type is associated - * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueType( - parameters: Parameters.GetIssueType | string, - callback: Callback, - ): Promise; - /** - * Returns an issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in a project the issue type is associated - * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueType( - parameters: Parameters.GetIssueType | string, - callback?: never, - ): Promise; - async getIssueType( - parameters: Parameters.GetIssueType | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the issue type. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueType( - parameters: Parameters.UpdateIssueType, - callback: Callback, - ): Promise; - /** - * Updates the issue type. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueType( - parameters: Parameters.UpdateIssueType, - callback?: never, - ): Promise; - async updateIssueType( - parameters: Parameters.UpdateIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - avatarId: parameters.avatarId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type - * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue - * types](#api-rest-api-2-issuetype-id-alternatives-get) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueType( - parameters: Parameters.DeleteIssueType | string, - callback: Callback, - ): Promise; - /** - * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type - * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue - * types](#api-rest-api-2-issuetype-id-alternatives-get) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueType(parameters: Parameters.DeleteIssueType | string, callback?: never): Promise; - async deleteIssueType( - parameters: Parameters.DeleteIssueType | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${id}`, - method: 'DELETE', - params: { - alternativeIssueTypeId: typeof parameters !== 'string' && parameters.alternativeIssueTypeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those - * assigned to the same workflow scheme, field configuration scheme, and screen scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes | string, - callback: Callback, - ): Promise; - /** - * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those - * assigned to the same workflow scheme, field configuration scheme, and screen scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes | string, - callback?: never, - ): Promise; - async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${id}/alternatives`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Loads an avatar for the issue type. - * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * For example: `curl --request POST \ --user email@example.com: \ --header 'X-Atlassian-Token: no-check'\ - * --header 'Content-Type: image/< image_type>' \ --data-binary "<@/path/to/file/with/your/avatar>" \ --url - * 'https://your-domain.atlassian.net/rest/api/2/issuetype/{issueTypeId}'This` - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar, use [ Update issue type](#api-rest-api-2-issuetype-id-put) to set it as the issue type's - * displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeAvatar( - parameters: Parameters.CreateIssueTypeAvatar, - callback: Callback, - ): Promise; - /** - * Loads an avatar for the issue type. - * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * For example: `curl --request POST \ --user email@example.com: \ --header 'X-Atlassian-Token: no-check'\ - * --header 'Content-Type: image/< image_type>' \ --data-binary "<@/path/to/file/with/your/avatar>" \ --url - * 'https://your-domain.atlassian.net/rest/api/2/issuetype/{issueTypeId}'This` - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar, use [ Update issue type](#api-rest-api-2-issuetype-id-put) to set it as the issue type's - * displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeAvatar( - parameters: Parameters.CreateIssueTypeAvatar, - callback?: never, - ): Promise; - async createIssueTypeAvatar( - parameters: Parameters.CreateIssueTypeAvatar, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${parameters.id}/avatar2`, - method: 'POST', - params: { - x: parameters.x, - y: parameters.y, - size: parameters.size, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueVotes.mts b/src/version2/issueVotes.mts new file mode 100644 index 000000000..e4882b421 --- /dev/null +++ b/src/version2/issueVotes.mts @@ -0,0 +1,148 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueVotes { + constructor(private client: Client) {} + + /** + * Returns details about the votes on an issue. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * ini + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * + * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ + * project permissions are not returned details in the `voters` field. + */ + async getVotes(parameters: Parameters.GetVotes | string, callback: Callback): Promise; + /** + * Returns details about the votes on an issue. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * ini + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * + * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ + * project permissions are not returned details in the `voters` field. + */ + async getVotes(parameters: Parameters.GetVotes | string, callback?: never): Promise; + async getVotes( + parameters: Parameters.GetVotes | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/votes`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addVote(parameters: Parameters.AddVote | string, callback: Callback): Promise; + /** + * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addVote(parameters: Parameters.AddVote | string, callback?: never): Promise; + async addVote(parameters: Parameters.AddVote | string, callback?: Callback): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/votes`, + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async removeVote(parameters: Parameters.RemoveVote | string, callback: Callback): Promise; + /** + * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async removeVote(parameters: Parameters.RemoveVote | string, callback?: never): Promise; + async removeVote(parameters: Parameters.RemoveVote | string, callback?: Callback): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/votes`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueVotes.ts b/src/version2/issueVotes.ts deleted file mode 100644 index 5911ac639..000000000 --- a/src/version2/issueVotes.ts +++ /dev/null @@ -1,148 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueVotes { - constructor(private client: Client) {} - - /** - * Returns details about the votes on an issue. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ - * project permissions are not returned details in the `voters` field. - */ - async getVotes(parameters: Parameters.GetVotes | string, callback: Callback): Promise; - /** - * Returns details about the votes on an issue. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ - * project permissions are not returned details in the `voters` field. - */ - async getVotes(parameters: Parameters.GetVotes | string, callback?: never): Promise; - async getVotes( - parameters: Parameters.GetVotes | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/votes`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addVote(parameters: Parameters.AddVote | string, callback: Callback): Promise; - /** - * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addVote(parameters: Parameters.AddVote | string, callback?: never): Promise; - async addVote(parameters: Parameters.AddVote | string, callback?: Callback): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/votes`, - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async removeVote(parameters: Parameters.RemoveVote | string, callback: Callback): Promise; - /** - * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async removeVote(parameters: Parameters.RemoveVote | string, callback?: never): Promise; - async removeVote(parameters: Parameters.RemoveVote | string, callback?: Callback): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/votes`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueWatchers.mts b/src/version2/issueWatchers.mts new file mode 100644 index 000000000..8d862f2ed --- /dev/null +++ b/src/version2/issueWatchers.mts @@ -0,0 +1,215 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueWatchers { + constructor(private client: Client) {} + + /** + * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned + * watched status is `false`. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIsWatchingIssueBulk( + parameters: Parameters.GetIsWatchingIssueBulk | undefined, + callback: Callback, + ): Promise; + /** + * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned + * watched status is `false`. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIsWatchingIssueBulk( + parameters?: Parameters.GetIsWatchingIssueBulk, + callback?: never, + ): Promise; + async getIsWatchingIssueBulk( + parameters?: Parameters.GetIsWatchingIssueBulk, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/watching', + method: 'POST', + data: { + issueIds: parameters?.issueIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the watchers for an issue. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * ini + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async getIssueWatchers( + parameters: Parameters.GetIssueWatchers | string, + callback: Callback, + ): Promise; + /** + * Returns the watchers for an issue. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * ini + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async getIssueWatchers( + parameters: Parameters.GetIssueWatchers | string, + callback?: never, + ): Promise; + async getIssueWatchers( + parameters: Parameters.GetIssueWatchers | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/watchers`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a user as a watcher of an issue by passing the account ID of the user. For example, + * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - To add users other than themselves to the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async addWatcher(parameters: Parameters.AddWatcher, callback: Callback): Promise; + /** + * Adds a user as a watcher of an issue by passing the account ID of the user. For example, + * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - To add users other than themselves to the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async addWatcher(parameters: Parameters.AddWatcher, callback?: never): Promise; + async addWatcher(parameters: Parameters.AddWatcher, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/watchers`, + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: parameters.accountId, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a user as a watcher of an issue. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async removeWatcher(parameters: Parameters.RemoveWatcher, callback: Callback): Promise; + /** + * Deletes a user as a watcher of an issue. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: never): Promise; + async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/watchers`, + method: 'DELETE', + params: { + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueWatchers.ts b/src/version2/issueWatchers.ts deleted file mode 100644 index d6bc6ea64..000000000 --- a/src/version2/issueWatchers.ts +++ /dev/null @@ -1,215 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueWatchers { - constructor(private client: Client) {} - - /** - * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned - * watched status is `false`. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIsWatchingIssueBulk( - parameters: Parameters.GetIsWatchingIssueBulk | undefined, - callback: Callback, - ): Promise; - /** - * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned - * watched status is `false`. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIsWatchingIssueBulk( - parameters?: Parameters.GetIsWatchingIssueBulk, - callback?: never, - ): Promise; - async getIsWatchingIssueBulk( - parameters?: Parameters.GetIsWatchingIssueBulk, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/watching', - method: 'POST', - data: { - issueIds: parameters?.issueIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the watchers for an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async getIssueWatchers( - parameters: Parameters.GetIssueWatchers | string, - callback: Callback, - ): Promise; - /** - * Returns the watchers for an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async getIssueWatchers( - parameters: Parameters.GetIssueWatchers | string, - callback?: never, - ): Promise; - async getIssueWatchers( - parameters: Parameters.GetIssueWatchers | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/watchers`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a user as a watcher of an issue by passing the account ID of the user. For example, - * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To add users other than themselves to the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async addWatcher(parameters: Parameters.AddWatcher, callback: Callback): Promise; - /** - * Adds a user as a watcher of an issue by passing the account ID of the user. For example, - * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To add users other than themselves to the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async addWatcher(parameters: Parameters.AddWatcher, callback?: never): Promise; - async addWatcher(parameters: Parameters.AddWatcher, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/watchers`, - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - data: parameters.accountId, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a user as a watcher of an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async removeWatcher(parameters: Parameters.RemoveWatcher, callback: Callback): Promise; - /** - * Deletes a user as a watcher of an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: never): Promise; - async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/watchers`, - method: 'DELETE', - params: { - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueWorklogProperties.mts b/src/version2/issueWorklogProperties.mts new file mode 100644 index 000000000..043b1b430 --- /dev/null +++ b/src/version2/issueWorklogProperties.mts @@ -0,0 +1,197 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueWorklogProperties { + constructor(private client: Client) {} + + /** + * Returns the keys of all properties for a worklog. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklogPropertyKeys( + parameters: Parameters.GetWorklogPropertyKeys, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for a worklog. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklogPropertyKeys( + parameters: Parameters.GetWorklogPropertyKeys, + callback?: never, + ): Promise; + async getWorklogPropertyKeys( + parameters: Parameters.GetWorklogPropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a worklog property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklogProperty( + parameters: Parameters.GetWorklogProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a worklog property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklogProperty( + parameters: Parameters.GetWorklogProperty, + callback?: never, + ): Promise; + async getWorklogProperty( + parameters: Parameters.GetWorklogProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a worklog property. Use this operation to store custom data against the worklog. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async setWorklogProperty( + parameters: Parameters.SetWorklogProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of a worklog property. Use this operation to store custom data against the worklog. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async setWorklogProperty(parameters: Parameters.SetWorklogProperty, callback?: never): Promise; + async setWorklogProperty( + parameters: Parameters.SetWorklogProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a worklog property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async deleteWorklogProperty( + parameters: Parameters.DeleteWorklogProperty, + callback: Callback, + ): Promise; + /** + * Deletes a worklog property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async deleteWorklogProperty(parameters: Parameters.DeleteWorklogProperty, callback?: never): Promise; + async deleteWorklogProperty( + parameters: Parameters.DeleteWorklogProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueWorklogProperties.ts b/src/version2/issueWorklogProperties.ts deleted file mode 100644 index ae07d564e..000000000 --- a/src/version2/issueWorklogProperties.ts +++ /dev/null @@ -1,197 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueWorklogProperties { - constructor(private client: Client) {} - - /** - * Returns the keys of all properties for a worklog. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogPropertyKeys( - parameters: Parameters.GetWorklogPropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for a worklog. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogPropertyKeys( - parameters: Parameters.GetWorklogPropertyKeys, - callback?: never, - ): Promise; - async getWorklogPropertyKeys( - parameters: Parameters.GetWorklogPropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a worklog property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogProperty( - parameters: Parameters.GetWorklogProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a worklog property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogProperty( - parameters: Parameters.GetWorklogProperty, - callback?: never, - ): Promise; - async getWorklogProperty( - parameters: Parameters.GetWorklogProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a worklog property. Use this operation to store custom data against the worklog. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async setWorklogProperty( - parameters: Parameters.SetWorklogProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of a worklog property. Use this operation to store custom data against the worklog. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async setWorklogProperty(parameters: Parameters.SetWorklogProperty, callback?: never): Promise; - async setWorklogProperty( - parameters: Parameters.SetWorklogProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a worklog property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklogProperty( - parameters: Parameters.DeleteWorklogProperty, - callback: Callback, - ): Promise; - /** - * Deletes a worklog property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklogProperty(parameters: Parameters.DeleteWorklogProperty, callback?: never): Promise; - async deleteWorklogProperty( - parameters: Parameters.DeleteWorklogProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueWorklogs.mts b/src/version2/issueWorklogs.mts new file mode 100644 index 000000000..6b8d24eaf --- /dev/null +++ b/src/version2/issueWorklogs.mts @@ -0,0 +1,456 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueWorklogs { + constructor(private client: Client) {} + + /** + * Returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and + * time. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Workloads are only returned where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getIssueWorklog( + parameters: Parameters.GetIssueWorklog | string, + callback: Callback, + ): Promise; + /** + * Returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and + * time. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Workloads are only returned where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getIssueWorklog( + parameters: Parameters.GetIssueWorklog | string, + callback?: never, + ): Promise; + async getIssueWorklog( + parameters: Parameters.GetIssueWorklog | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/worklog`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + startedAfter: typeof parameters !== 'string' && parameters.startedAfter, + startedBefore: typeof parameters !== 'string' && parameters.startedBefore, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a worklog to an issue. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Work on issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addWorklog(parameters: Parameters.AddWorklog, callback: Callback): Promise; + /** + * Adds a worklog to an issue. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Work on issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addWorklog(parameters: Parameters.AddWorklog, callback?: never): Promise; + async addWorklog(parameters: Parameters.AddWorklog, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog`, + method: 'POST', + params: { + notifyUsers: parameters.notifyUsers, + adjustEstimate: parameters.adjustEstimate, + newEstimate: parameters.newEstimate, + reduceBy: parameters.reduceBy, + expand: parameters.expand, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + data: { + self: parameters.self, + author: parameters.author, + updateAuthor: parameters.updateAuthor, + comment: parameters.comment, + created: parameters.created, + updated: parameters.updated, + visibility: parameters.visibility, + started: parameters.started, + timeSpent: parameters.timeSpent, + timeSpentSeconds: parameters.timeSpentSeconds, + id: parameters.id, + issueId: parameters.issueId, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a worklog. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklog(parameters: Parameters.GetWorklog, callback: Callback): Promise; + /** + * Returns a worklog. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklog(parameters: Parameters.GetWorklog, callback?: never): Promise; + async getWorklog(parameters: Parameters.GetWorklog, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a worklog. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async updateWorklog(parameters: Parameters.UpdateWorklog, callback: Callback): Promise; + /** + * Updates a worklog. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async updateWorklog(parameters: Parameters.UpdateWorklog, callback?: never): Promise; + async updateWorklog( + parameters: Parameters.UpdateWorklog, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, + method: 'PUT', + params: { + notifyUsers: parameters.notifyUsers, + adjustEstimate: parameters.adjustEstimate, + newEstimate: parameters.newEstimate, + expand: parameters.expand, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + data: { + comment: parameters.comment, + visibility: parameters.visibility, + started: parameters.started, + timeSpent: parameters.timeSpent, + timeSpentSeconds: parameters.timeSpentSeconds, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a worklog from an issue. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or + * _Delete own worklogs_ to delete worklogs created by the user, + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async deleteWorklog(parameters: Parameters.DeleteWorklog, callback: Callback): Promise; + /** + * Deletes a worklog from an issue. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or + * _Delete own worklogs_ to delete worklogs created by the user, + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: never): Promise; + async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, + method: 'DELETE', + params: { + notifyUsers: parameters.notifyUsers, + adjustEstimate: parameters.adjustEstimate, + newEstimate: parameters.newEstimate, + increaseBy: parameters.increaseBy, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. + * + * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set + * to true on the last page of worklogs. + * + * This resource does not return worklogs deleted during the minute preceding the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getIdsOfWorklogsDeletedSince( + parameters: Parameters.GetIdsOfWorklogsDeletedSince | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. + * + * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set + * to true on the last page of worklogs. + * + * This resource does not return worklogs deleted during the minute preceding the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getIdsOfWorklogsDeletedSince( + parameters?: Parameters.GetIdsOfWorklogsDeletedSince, + callback?: never, + ): Promise; + async getIdsOfWorklogsDeletedSince( + parameters?: Parameters.GetIdsOfWorklogsDeletedSince, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/worklog/deleted', + method: 'GET', + params: { + since: parameters?.since, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns worklog details for a list of worklog IDs. + * + * The returned list of worklogs is limited to 1000 items. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * + * - The worklog is set as _Viewable by All Users_. + * - The user is a member of a project role or group with permission to view the worklog. + */ + async getWorklogsForIds( + parameters: Parameters.GetWorklogsForIds | undefined, + callback: Callback, + ): Promise; + /** + * Returns worklog details for a list of worklog IDs. + * + * The returned list of worklogs is limited to 1000 items. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * + * - The worklog is set as _Viewable by All Users_. + * - The user is a member of a project role or group with permission to view the worklog. + */ + async getWorklogsForIds( + parameters?: Parameters.GetWorklogsForIds, + callback?: never, + ): Promise; + async getWorklogsForIds( + parameters?: Parameters.GetWorklogsForIds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/worklog/list', + method: 'POST', + params: { + expand: parameters?.expand, + }, + data: { + ids: parameters?.ids, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of IDs and update timestamps for worklogs updated after a date and time. + * + * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set + * to true on the last page of worklogs. + * + * This resource does not return worklogs updated during the minute preceding the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * + * - The worklog is set as _Viewable by All Users_. + * - The user is a member of a project role or group with permission to view the worklog. + */ + async getIdsOfWorklogsModifiedSince( + parameters: Parameters.GetIdsOfWorklogsModifiedSince | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of IDs and update timestamps for worklogs updated after a date and time. + * + * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set + * to true on the last page of worklogs. + * + * This resource does not return worklogs updated during the minute preceding the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * + * - The worklog is set as _Viewable by All Users_. + * - The user is a member of a project role or group with permission to view the worklog. + */ + async getIdsOfWorklogsModifiedSince( + parameters?: Parameters.GetIdsOfWorklogsModifiedSince, + callback?: never, + ): Promise; + async getIdsOfWorklogsModifiedSince( + parameters?: Parameters.GetIdsOfWorklogsModifiedSince, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/worklog/updated', + method: 'GET', + params: { + since: parameters?.since, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueWorklogs.ts b/src/version2/issueWorklogs.ts deleted file mode 100644 index c54e66bf3..000000000 --- a/src/version2/issueWorklogs.ts +++ /dev/null @@ -1,456 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueWorklogs { - constructor(private client: Client) {} - - /** - * Returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and - * time. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Workloads are only returned where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getIssueWorklog( - parameters: Parameters.GetIssueWorklog | string, - callback: Callback, - ): Promise; - /** - * Returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and - * time. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Workloads are only returned where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getIssueWorklog( - parameters: Parameters.GetIssueWorklog | string, - callback?: never, - ): Promise; - async getIssueWorklog( - parameters: Parameters.GetIssueWorklog | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/worklog`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - startedAfter: typeof parameters !== 'string' && parameters.startedAfter, - startedBefore: typeof parameters !== 'string' && parameters.startedBefore, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a worklog to an issue. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Work on issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addWorklog(parameters: Parameters.AddWorklog, callback: Callback): Promise; - /** - * Adds a worklog to an issue. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Work on issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addWorklog(parameters: Parameters.AddWorklog, callback?: never): Promise; - async addWorklog(parameters: Parameters.AddWorklog, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog`, - method: 'POST', - params: { - notifyUsers: parameters.notifyUsers, - adjustEstimate: parameters.adjustEstimate, - newEstimate: parameters.newEstimate, - reduceBy: parameters.reduceBy, - expand: parameters.expand, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - data: { - self: parameters.self, - author: parameters.author, - updateAuthor: parameters.updateAuthor, - comment: parameters.comment, - created: parameters.created, - updated: parameters.updated, - visibility: parameters.visibility, - started: parameters.started, - timeSpent: parameters.timeSpent, - timeSpentSeconds: parameters.timeSpentSeconds, - id: parameters.id, - issueId: parameters.issueId, - properties: parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a worklog. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklog(parameters: Parameters.GetWorklog, callback: Callback): Promise; - /** - * Returns a worklog. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklog(parameters: Parameters.GetWorklog, callback?: never): Promise; - async getWorklog(parameters: Parameters.GetWorklog, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a worklog. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async updateWorklog(parameters: Parameters.UpdateWorklog, callback: Callback): Promise; - /** - * Updates a worklog. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async updateWorklog(parameters: Parameters.UpdateWorklog, callback?: never): Promise; - async updateWorklog( - parameters: Parameters.UpdateWorklog, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, - method: 'PUT', - params: { - notifyUsers: parameters.notifyUsers, - adjustEstimate: parameters.adjustEstimate, - newEstimate: parameters.newEstimate, - expand: parameters.expand, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - data: { - comment: parameters.comment, - visibility: parameters.visibility, - started: parameters.started, - timeSpent: parameters.timeSpent, - timeSpentSeconds: parameters.timeSpentSeconds, - properties: parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a worklog from an issue. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or - * _Delete own worklogs_ to delete worklogs created by the user, - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklog(parameters: Parameters.DeleteWorklog, callback: Callback): Promise; - /** - * Deletes a worklog from an issue. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or - * _Delete own worklogs_ to delete worklogs created by the user, - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: never): Promise; - async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, - method: 'DELETE', - params: { - notifyUsers: parameters.notifyUsers, - adjustEstimate: parameters.adjustEstimate, - newEstimate: parameters.newEstimate, - increaseBy: parameters.increaseBy, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs deleted during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getIdsOfWorklogsDeletedSince( - parameters: Parameters.GetIdsOfWorklogsDeletedSince | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs deleted during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getIdsOfWorklogsDeletedSince( - parameters?: Parameters.GetIdsOfWorklogsDeletedSince, - callback?: never, - ): Promise; - async getIdsOfWorklogsDeletedSince( - parameters?: Parameters.GetIdsOfWorklogsDeletedSince, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/worklog/deleted', - method: 'GET', - params: { - since: parameters?.since, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns worklog details for a list of worklog IDs. - * - * The returned list of worklogs is limited to 1000 items. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getWorklogsForIds( - parameters: Parameters.GetWorklogsForIds | undefined, - callback: Callback, - ): Promise; - /** - * Returns worklog details for a list of worklog IDs. - * - * The returned list of worklogs is limited to 1000 items. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getWorklogsForIds( - parameters?: Parameters.GetWorklogsForIds, - callback?: never, - ): Promise; - async getWorklogsForIds( - parameters?: Parameters.GetWorklogsForIds, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/worklog/list', - method: 'POST', - params: { - expand: parameters?.expand, - }, - data: { - ids: parameters?.ids, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of IDs and update timestamps for worklogs updated after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs updated during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getIdsOfWorklogsModifiedSince( - parameters: Parameters.GetIdsOfWorklogsModifiedSince | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of IDs and update timestamps for worklogs updated after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs updated during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getIdsOfWorklogsModifiedSince( - parameters?: Parameters.GetIdsOfWorklogsModifiedSince, - callback?: never, - ): Promise; - async getIdsOfWorklogsModifiedSince( - parameters?: Parameters.GetIdsOfWorklogsModifiedSince, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/worklog/updated', - method: 'GET', - params: { - since: parameters?.since, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issues.mts b/src/version2/issues.mts new file mode 100644 index 000000000..05e833208 --- /dev/null +++ b/src/version2/issues.mts @@ -0,0 +1,1062 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Issues { + constructor(private client: Client) {} + + /** + * Returns all issue events. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getEvents(callback: Callback): Promise; + /** + * Returns all issue events. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getEvents(callback?: never): Promise; + async getEvents(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/events', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be + * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties + * set. + * + * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue + * or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These are + * the same fields that appear on the issue's create screen. + * + * Creating a subtask differs from creating an issue as follows: + * + * - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). + * - `parent` must contain the ID or key of the parent issue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which the issue or subtask is created. + */ + async createIssue(parameters: Parameters.CreateIssue, callback: Callback): Promise; + /** + * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be + * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties + * set. + * + * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue + * or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These are + * the same fields that appear on the issue's create screen. + * + * Creating a subtask differs from creating an issue as follows: + * + * - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). + * - `parent` must contain the ID or key of the parent issue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which the issue or subtask is created. + */ + async createIssue(parameters: Parameters.CreateIssue, callback?: never): Promise; + async createIssue( + parameters: Parameters.CreateIssue, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue', + method: 'POST', + params: { + updateHistory: parameters.updateHistory, + }, + data: { + fields: parameters.fields, + historyMetadata: parameters.historyMetadata, + properties: parameters.properties, + transition: parameters.transition, + update: parameters.update, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Enables admins to archive up to 100,000 issues in a single request using Jql, returning the URL to check the status + * of the submitted request. + * + * You can use the [get + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-get) + * and [cancel + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) + * APIs to manage the request. + * + * **Note that:** + * + * - You can't archive subtasks directly, only through their parent issues + * - You can only archive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + * + * **Rate limiting:** Only a single request per user can be active at any given time. + */ + async archiveIssuesAsync( + parameters: Parameters.ArchiveIssuesAsync, + callback: Callback, + ): Promise; + /** + * Enables admins to archive up to 100,000 issues in a single request using Jql, returning the URL to check the status + * of the submitted request. + * + * You can use the [get + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-get) + * and [cancel + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) + * APIs to manage the request. + * + * **Note that:** + * + * - You can't archive subtasks directly, only through their parent issues + * - You can only archive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + * + * **Rate limiting:** Only a single request per user can be active at any given time. + */ + async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback?: never): Promise; + async archiveIssuesAsync( + parameters: Parameters.ArchiveIssuesAsync, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/archive', + method: 'POST', + data: { + jql: parameters.jql, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the + * issue(s) archived in the process and the errors encountered, if any. + * + * **Note that:** + * + * - You can't archive subtasks directly, only through their parent issues + * - You can only archive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + */ + async archiveIssues( + parameters: Parameters.ArchiveIssues, + callback: Callback, + ): Promise; + /** + * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the + * issue(s) archived in the process and the errors encountered, if any. + * + * **Note that:** + * + * - You can't archive subtasks directly, only through their parent issues + * - You can only archive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + */ + async archiveIssues(parameters: Parameters.ArchiveIssues, callback?: never): Promise; + async archiveIssues( + parameters: Parameters.ArchiveIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/archive', + method: 'PUT', + data: { + issueIdsOrKeys: parameters.issueIdsOrKeys, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may + * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue + * properties set. + * + * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the + * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These + * are the same fields that appear on the issues' create screens. + * + * Creating a subtask differs from creating an issue as follows: + * + * - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). + * - `parent` the must contain the ID or key of the parent issue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which each issue or subtask is created. + */ + async createIssues( + parameters: Parameters.CreateIssues | undefined, + callback: Callback, + ): Promise; + /** + * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may + * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue + * properties set. + * + * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the + * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These + * are the same fields that appear on the issues' create screens. + * + * Creating a subtask differs from creating an issue as follows: + * + * - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). + * - `parent` the must contain the ID or key of the parent issue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which each issue or subtask is created. + */ + async createIssues(parameters?: Parameters.CreateIssues, callback?: never): Promise; + async createIssues( + parameters?: Parameters.CreateIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/bulk', + method: 'POST', + data: { + issueUpdates: parameters?.issueUpdates, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each + * issue type for the user. Use the information to populate the requests in [ Create + * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). + * + * The request can be restricted to specific projects or issue types using the query parameters. The response will + * contain information for the valid projects, issue types, or project and issue type combinations requested. Note + * that invalid project, issue type, or project and issue type combinations do not generate errors. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + */ + async getCreateIssueMeta( + parameters: Parameters.GetCreateIssueMeta | undefined, + callback: Callback, + ): Promise; + /** + * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each + * issue type for the user. Use the information to populate the requests in [ Create + * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). + * + * The request can be restricted to specific projects or issue types using the query parameters. The response will + * contain information for the valid projects, issue types, or project and issue type combinations requested. Note + * that invalid project, issue type, or project and issue type combinations do not generate errors. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + */ + async getCreateIssueMeta( + parameters?: Parameters.GetCreateIssueMeta, + callback?: never, + ): Promise; + async getCreateIssueMeta( + parameters?: Parameters.GetCreateIssueMeta, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/createmeta', + method: 'GET', + params: { + projectIds: parameters?.projectIds, + projectKeys: parameters?.projectKeys, + issuetypeIds: parameters?.issuetypeIds, + issuetypeNames: parameters?.issuetypeNames, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Enables admins to unarchive up to 1000 issues in a single request using issue ID/key, returning details of the + * issue(s) unarchived in the process and the errors encountered, if any. + * + * **Note that:** + * + * - You can't unarchive subtasks directly, only through their parent issues + * - You can only unarchive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + */ + async unarchiveIssues( + parameters: Parameters.UnarchiveIssues, + callback: Callback, + ): Promise; + /** + * Enables admins to unarchive up to 1000 issues in a single request using issue ID/key, returning details of the + * issue(s) unarchived in the process and the errors encountered, if any. + * + * **Note that:** + * + * - You can't unarchive subtasks directly, only through their parent issues + * - You can only unarchive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + */ + async unarchiveIssues( + parameters: Parameters.UnarchiveIssues, + callback?: never, + ): Promise; + async unarchiveIssues( + parameters: Parameters.UnarchiveIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/unarchive', + method: 'PUT', + data: { + issueIdsOrKeys: parameters.issueIdsOrKeys, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the details for an issue. + * + * The issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive + * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or + * other redirect is **not** returned. The issue key returned in the response is the key of the issue found. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIssue(parameters: Parameters.GetIssue | string, callback: Callback): Promise; + /** + * Returns the details for an issue. + * + * The issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive + * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or + * other redirect is **not** returned. The issue key returned in the response is the key of the issue found. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIssue(parameters: Parameters.GetIssue | string, callback?: never): Promise; + async getIssue( + parameters: Parameters.GetIssue | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}`, + method: 'GET', + params: { + fields: typeof parameters !== 'string' && parameters.fields, + fieldsByKeys: typeof parameters !== 'string' && parameters.fieldsByKeys, + expand: typeof parameters !== 'string' && parameters.expand, + properties: typeof parameters !== 'string' && parameters.properties, + updateHistory: typeof parameters !== 'string' && parameters.updateHistory, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Edits an issue. A transition may be applied and issue properties updated as part of the edit. + * + * The edits to the issue's fields are defined using `update` and `fields`. The fields that can be edited are + * determined using [ Get edit issue metadata](#api-rest-api-2-issue-issueIdOrKey-editmeta-get). + * + * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting + * `update.parent.set.none` to _true_. + * + * Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security + * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async editIssue(parameters: Parameters.EditIssue, callback: Callback): Promise; + /** + * Edits an issue. A transition may be applied and issue properties updated as part of the edit. + * + * The edits to the issue's fields are defined using `update` and `fields`. The fields that can be edited are + * determined using [ Get edit issue metadata](#api-rest-api-2-issue-issueIdOrKey-editmeta-get). + * + * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting + * `update.parent.set.none` to _true_. + * + * Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security + * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async editIssue(parameters: Parameters.EditIssue, callback?: never): Promise; + async editIssue(parameters: Parameters.EditIssue, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}`, + method: 'PUT', + params: { + notifyUsers: parameters.notifyUsers, + overrideScreenSecurity: parameters.overrideScreenSecurity, + overrideEditableFlag: parameters.overrideEditableFlag, + returnIssue: parameters.returnIssue, + expand: parameters.expand, + }, + data: { + fields: parameters.fields, + historyMetadata: parameters.historyMetadata, + properties: parameters.properties, + transition: parameters.transition, + update: parameters.update, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue. + * + * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. + * This causes the issue's subtasks to be deleted with the issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Delete issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async deleteIssue(parameters: Parameters.DeleteIssue | string, callback: Callback): Promise; + /** + * Deletes an issue. + * + * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. + * This causes the issue's subtasks to be deleted with the issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Delete issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async deleteIssue(parameters: Parameters.DeleteIssue | string, callback?: never): Promise; + async deleteIssue(parameters: Parameters.DeleteIssue | string, callback?: Callback): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}`, + method: 'DELETE', + params: { + deleteSubtasks: typeof parameters !== 'string' && parameters.deleteSubtasks, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but + * has the _Assign issue_ permission for the project that the issue is in. + * + * If `name` or `accountId` is set to: + * + * - `"-1"`, the issue is assigned to the default assignee for the project. + * - `null`, the issue is set to unassigned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse Projects_ and _Assign Issues_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async assignIssue(parameters: Parameters.AssignIssue, callback: Callback): Promise; + /** + * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but + * has the _Assign issue_ permission for the project that the issue is in. + * + * If `name` or `accountId` is set to: + * + * - `"-1"`, the issue is assigned to the default assignee for the project. + * - `null`, the issue is set to unassigned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse Projects_ and _Assign Issues_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async assignIssue(parameters: Parameters.AssignIssue, callback?: never): Promise; + async assignIssue(parameters: Parameters.AssignIssue, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/assignee`, + method: 'PUT', + data: { + accountId: parameters.accountId, + accountType: parameters.accountType, + active: parameters.active, + applicationRoles: parameters.applicationRoles, + avatarUrls: parameters.avatarUrls, + displayName: parameters.displayName, + emailAddress: parameters.emailAddress, + expand: parameters.expand, + groups: parameters.groups, + key: parameters.key, + locale: parameters.locale, + name: parameters.name, + self: parameters.self, + timeZone: parameters.timeZone, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * changelogs for an issue sorted by date, starting from the oldest. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getChangeLogs( + parameters: Parameters.GetChangeLogs | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * changelogs for an issue sorted by date, starting from the oldest. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getChangeLogs( + parameters: Parameters.GetChangeLogs | string, + callback?: never, + ): Promise; + async getChangeLogs( + parameters: Parameters.GetChangeLogs | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/changelog`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns changelogs for an issue specified by a list of changelog IDs. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getChangeLogsByIds( + parameters: Parameters.GetChangeLogsByIds, + callback: Callback, + ): Promise; + /** + * Returns changelogs for an issue specified by a list of changelog IDs. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getChangeLogsByIds( + parameters: Parameters.GetChangeLogsByIds, + callback?: never, + ): Promise; + async getChangeLogsByIds( + parameters: Parameters.GetChangeLogsByIds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/changelog/list`, + method: 'POST', + data: { + changelogIds: parameters.changelogIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to + * populate the requests in [Edit issue](#api-rest-api-2-issue-issueIdOrKey-put). + * + * This endpoint will check for these conditions: + * + * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type + * scheme configuration. `overrideScreenSecurity=true` skips this condition. + * 2. Field is visible in the [field + * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). + * `overrideScreenSecurity=true` skips this condition. + * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if + * attachments are enabled. Assignee only shows if user has permissions to assign the issue. + * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All + * system fields are assumed to have context in all projects and all issue types. + * 5. Issue has a project, issue type, and status defined. + * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. + * `overrideEditableFlag=true` skips this condition. + * 7. The current workflow step is editable. This is true by default, but [can be disabled by + * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the + * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. + * 8. User has [Edit issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). + * 9. Workflow permissions allow editing a field. This is true by default but [can be + * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using + * `jira.permission.*` workflow properties. + * + * Fields hidden using [Issue layout settings + * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain + * editable. + * + * Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: + * + * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available + * through screens, and field configuration (conditions 1. and 2. from the list above). + * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if + * the current step is editable (conditions 6. and 7. from the list above). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * + * Note: For any fields to be editable the user must have the _Edit issues_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. + */ + async getEditIssueMeta( + parameters: Parameters.GetEditIssueMeta | string, + callback: Callback, + ): Promise; + /** + * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to + * populate the requests in [Edit issue](#api-rest-api-2-issue-issueIdOrKey-put). + * + * This endpoint will check for these conditions: + * + * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type + * scheme configuration. `overrideScreenSecurity=true` skips this condition. + * 2. Field is visible in the [field + * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). + * `overrideScreenSecurity=true` skips this condition. + * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if + * attachments are enabled. Assignee only shows if user has permissions to assign the issue. + * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All + * system fields are assumed to have context in all projects and all issue types. + * 5. Issue has a project, issue type, and status defined. + * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. + * `overrideEditableFlag=true` skips this condition. + * 7. The current workflow step is editable. This is true by default, but [can be disabled by + * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the + * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. + * 8. User has [Edit issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). + * 9. Workflow permissions allow editing a field. This is true by default but [can be + * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using + * `jira.permission.*` workflow properties. + * + * Fields hidden using [Issue layout settings + * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain + * editable. + * + * Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: + * + * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available + * through screens, and field configuration (conditions 1. and 2. from the list above). + * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if + * the current step is editable (conditions 6. and 7. from the list above). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * + * Note: For any fields to be editable the user must have the _Edit issues_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. + */ + async getEditIssueMeta( + parameters: Parameters.GetEditIssueMeta | string, + callback?: never, + ): Promise; + async getEditIssueMeta( + parameters: Parameters.GetEditIssueMeta | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/editmeta`, + method: 'GET', + params: { + overrideScreenSecurity: typeof parameters !== 'string' && parameters.overrideScreenSecurity, + overrideEditableFlag: typeof parameters !== 'string' && parameters.overrideEditableFlag, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an email notification for an issue and adds it to the mail queue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async notify(parameters: Parameters.Notify, callback: Callback): Promise; + /** + * Creates an email notification for an issue and adds it to the mail queue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async notify(parameters: Parameters.Notify, callback?: never): Promise; + async notify(parameters: Parameters.Notify, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/notify`, + method: 'POST', + data: { + htmlBody: parameters.htmlBody, + restrict: parameters.restrict, + subject: parameters.subject, + textBody: parameters.textBody, + to: parameters.to, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's + * status. + * + * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its + * status, the response will return any empty transitions list. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: A list or + * transition is returned only when the user has:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * + * However, if the user does not have the _Transition issues_ [ project + * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. + */ + async getTransitions( + parameters: Parameters.GetTransitions | string, + callback: Callback, + ): Promise; + /** + * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's + * status. + * + * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its + * status, the response will return any empty transitions list. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: A list or + * transition is returned only when the user has:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * + * However, if the user does not have the _Transition issues_ [ project + * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. + */ + async getTransitions( + parameters: Parameters.GetTransitions | string, + callback?: never, + ): Promise; + async getTransitions( + parameters: Parameters.GetTransitions | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/transitions`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + transitionId: typeof parameters !== 'string' && parameters.transitionId, + skipRemoteOnlyCondition: typeof parameters !== 'string' && parameters.skipRemoteOnlyCondition, + includeUnavailableTransitions: typeof parameters !== 'string' && parameters.includeUnavailableTransitions, + sortByOpsBarAndStatus: typeof parameters !== 'string' && parameters.sortByOpsBarAndStatus, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. + * + * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` + * parameters in the request body. Get details about the fields using [ Get + * transitions](#api-rest-api-2-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Transition issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async doTransition(parameters: Parameters.DoTransition, callback: Callback): Promise; + /** + * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. + * + * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` + * parameters in the request body. Get details about the fields using [ Get + * transitions](#api-rest-api-2-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Transition issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async doTransition(parameters: Parameters.DoTransition, callback?: never): Promise; + async doTransition(parameters: Parameters.DoTransition, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/transitions`, + method: 'POST', + data: { + fields: parameters.fields, + historyMetadata: parameters.historyMetadata, + properties: parameters.properties, + transition: parameters.transition, + update: parameters.update, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it + * will receive an email with a link to download a CSV file with the issue details. + * + * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and + * `ArchivedDate`). Custom fields aren't supported. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + * + * **Rate limiting:** Only a single request can be active at any given time. + */ + async exportArchivedIssues( + parameters: Parameters.ExportArchivedIssues, + callback: Callback, + ): Promise; + /** + * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it + * will receive an email with a link to download a CSV file with the issue details. + * + * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and + * `ArchivedDate`). Custom fields aren't supported. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + * + * **Rate limiting:** Only a single request can be active at any given time. + */ + async exportArchivedIssues( + parameters: Parameters.ExportArchivedIssues, + callback?: never, + ): Promise; + async exportArchivedIssues( + parameters: Parameters.ExportArchivedIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issues/archive/export', + method: 'PUT', + data: { + archivedBy: parameters.archivedBy, + archivedDateRange: parameters.archivedDateRange, + issueTypes: parameters.issueTypes, + projects: parameters.projects, + reporters: parameters.reporters, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issues.ts b/src/version2/issues.ts deleted file mode 100644 index f6711f3d9..000000000 --- a/src/version2/issues.ts +++ /dev/null @@ -1,1062 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Issues { - constructor(private client: Client) {} - - /** - * Returns all issue events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getEvents(callback: Callback): Promise; - /** - * Returns all issue events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getEvents(callback?: never): Promise; - async getEvents(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/events', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be - * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties - * set. - * - * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue - * or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These are - * the same fields that appear on the issue's create screen. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). - * - `parent` must contain the ID or key of the parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which the issue or subtask is created. - */ - async createIssue(parameters: Parameters.CreateIssue, callback: Callback): Promise; - /** - * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be - * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties - * set. - * - * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue - * or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These are - * the same fields that appear on the issue's create screen. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). - * - `parent` must contain the ID or key of the parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which the issue or subtask is created. - */ - async createIssue(parameters: Parameters.CreateIssue, callback?: never): Promise; - async createIssue( - parameters: Parameters.CreateIssue, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue', - method: 'POST', - params: { - updateHistory: parameters.updateHistory, - }, - data: { - fields: parameters.fields, - historyMetadata: parameters.historyMetadata, - properties: parameters.properties, - transition: parameters.transition, - update: parameters.update, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Enables admins to archive up to 100,000 issues in a single request using JQL, returning the URL to check the status - * of the submitted request. - * - * You can use the [get - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-get) - * and [cancel - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) - * APIs to manage the request. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - * - * **Rate limiting:** Only a single request per user can be active at any given time. - */ - async archiveIssuesAsync( - parameters: Parameters.ArchiveIssuesAsync, - callback: Callback, - ): Promise; - /** - * Enables admins to archive up to 100,000 issues in a single request using JQL, returning the URL to check the status - * of the submitted request. - * - * You can use the [get - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-get) - * and [cancel - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) - * APIs to manage the request. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - * - * **Rate limiting:** Only a single request per user can be active at any given time. - */ - async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback?: never): Promise; - async archiveIssuesAsync( - parameters: Parameters.ArchiveIssuesAsync, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/archive', - method: 'POST', - data: { - jql: parameters.jql, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the - * issue(s) archived in the process and the errors encountered, if any. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async archiveIssues( - parameters: Parameters.ArchiveIssues, - callback: Callback, - ): Promise; - /** - * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the - * issue(s) archived in the process and the errors encountered, if any. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async archiveIssues(parameters: Parameters.ArchiveIssues, callback?: never): Promise; - async archiveIssues( - parameters: Parameters.ArchiveIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/archive', - method: 'PUT', - data: { - issueIdsOrKeys: parameters.issueIdsOrKeys, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may - * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue - * properties set. - * - * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the - * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These - * are the same fields that appear on the issues' create screens. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). - * - `parent` the must contain the ID or key of the parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which each issue or subtask is created. - */ - async createIssues( - parameters: Parameters.CreateIssues | undefined, - callback: Callback, - ): Promise; - /** - * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may - * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue - * properties set. - * - * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the - * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These - * are the same fields that appear on the issues' create screens. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). - * - `parent` the must contain the ID or key of the parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which each issue or subtask is created. - */ - async createIssues(parameters?: Parameters.CreateIssues, callback?: never): Promise; - async createIssues( - parameters?: Parameters.CreateIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/bulk', - method: 'POST', - data: { - issueUpdates: parameters?.issueUpdates, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each - * issue type for the user. Use the information to populate the requests in [ Create - * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). - * - * The request can be restricted to specific projects or issue types using the query parameters. The response will - * contain information for the valid projects, issue types, or project and issue type combinations requested. Note - * that invalid project, issue type, or project and issue type combinations do not generate errors. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create - * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. - */ - async getCreateIssueMeta( - parameters: Parameters.GetCreateIssueMeta | undefined, - callback: Callback, - ): Promise; - /** - * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each - * issue type for the user. Use the information to populate the requests in [ Create - * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). - * - * The request can be restricted to specific projects or issue types using the query parameters. The response will - * contain information for the valid projects, issue types, or project and issue type combinations requested. Note - * that invalid project, issue type, or project and issue type combinations do not generate errors. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create - * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. - */ - async getCreateIssueMeta( - parameters?: Parameters.GetCreateIssueMeta, - callback?: never, - ): Promise; - async getCreateIssueMeta( - parameters?: Parameters.GetCreateIssueMeta, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/createmeta', - method: 'GET', - params: { - projectIds: parameters?.projectIds, - projectKeys: parameters?.projectKeys, - issuetypeIds: parameters?.issuetypeIds, - issuetypeNames: parameters?.issuetypeNames, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Enables admins to unarchive up to 1000 issues in a single request using issue ID/key, returning details of the - * issue(s) unarchived in the process and the errors encountered, if any. - * - * **Note that:** - * - * - You can't unarchive subtasks directly, only through their parent issues - * - You can only unarchive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, - callback: Callback, - ): Promise; - /** - * Enables admins to unarchive up to 1000 issues in a single request using issue ID/key, returning details of the - * issue(s) unarchived in the process and the errors encountered, if any. - * - * **Note that:** - * - * - You can't unarchive subtasks directly, only through their parent issues - * - You can only unarchive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, - callback?: never, - ): Promise; - async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/unarchive', - method: 'PUT', - data: { - issueIdsOrKeys: parameters.issueIdsOrKeys, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the details for an issue. - * - * The issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive - * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or - * other redirect is **not** returned. The issue key returned in the response is the key of the issue found. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssue(parameters: Parameters.GetIssue | string, callback: Callback): Promise; - /** - * Returns the details for an issue. - * - * The issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive - * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or - * other redirect is **not** returned. The issue key returned in the response is the key of the issue found. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssue(parameters: Parameters.GetIssue | string, callback?: never): Promise; - async getIssue( - parameters: Parameters.GetIssue | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}`, - method: 'GET', - params: { - fields: typeof parameters !== 'string' && parameters.fields, - fieldsByKeys: typeof parameters !== 'string' && parameters.fieldsByKeys, - expand: typeof parameters !== 'string' && parameters.expand, - properties: typeof parameters !== 'string' && parameters.properties, - updateHistory: typeof parameters !== 'string' && parameters.updateHistory, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Edits an issue. A transition may be applied and issue properties updated as part of the edit. - * - * The edits to the issue's fields are defined using `update` and `fields`. The fields that can be edited are - * determined using [ Get edit issue metadata](#api-rest-api-2-issue-issueIdOrKey-editmeta-get). - * - * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting - * `update.parent.set.none` to _true_. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security - * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async editIssue(parameters: Parameters.EditIssue, callback: Callback): Promise; - /** - * Edits an issue. A transition may be applied and issue properties updated as part of the edit. - * - * The edits to the issue's fields are defined using `update` and `fields`. The fields that can be edited are - * determined using [ Get edit issue metadata](#api-rest-api-2-issue-issueIdOrKey-editmeta-get). - * - * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting - * `update.parent.set.none` to _true_. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security - * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async editIssue(parameters: Parameters.EditIssue, callback?: never): Promise; - async editIssue(parameters: Parameters.EditIssue, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}`, - method: 'PUT', - params: { - notifyUsers: parameters.notifyUsers, - overrideScreenSecurity: parameters.overrideScreenSecurity, - overrideEditableFlag: parameters.overrideEditableFlag, - returnIssue: parameters.returnIssue, - expand: parameters.expand, - }, - data: { - fields: parameters.fields, - historyMetadata: parameters.historyMetadata, - properties: parameters.properties, - transition: parameters.transition, - update: parameters.update, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue. - * - * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. - * This causes the issue's subtasks to be deleted with the issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Delete issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteIssue(parameters: Parameters.DeleteIssue | string, callback: Callback): Promise; - /** - * Deletes an issue. - * - * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. - * This causes the issue's subtasks to be deleted with the issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Delete issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteIssue(parameters: Parameters.DeleteIssue | string, callback?: never): Promise; - async deleteIssue(parameters: Parameters.DeleteIssue | string, callback?: Callback): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}`, - method: 'DELETE', - params: { - deleteSubtasks: typeof parameters !== 'string' && parameters.deleteSubtasks, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but - * has the _Assign issue_ permission for the project that the issue is in. - * - * If `name` or `accountId` is set to: - * - * - `"-1"`, the issue is assigned to the default assignee for the project. - * - `null`, the issue is set to unassigned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse Projects_ and _Assign Issues_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async assignIssue(parameters: Parameters.AssignIssue, callback: Callback): Promise; - /** - * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but - * has the _Assign issue_ permission for the project that the issue is in. - * - * If `name` or `accountId` is set to: - * - * - `"-1"`, the issue is assigned to the default assignee for the project. - * - `null`, the issue is set to unassigned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse Projects_ and _Assign Issues_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async assignIssue(parameters: Parameters.AssignIssue, callback?: never): Promise; - async assignIssue(parameters: Parameters.AssignIssue, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/assignee`, - method: 'PUT', - data: { - accountId: parameters.accountId, - accountType: parameters.accountType, - active: parameters.active, - applicationRoles: parameters.applicationRoles, - avatarUrls: parameters.avatarUrls, - displayName: parameters.displayName, - emailAddress: parameters.emailAddress, - expand: parameters.expand, - groups: parameters.groups, - key: parameters.key, - locale: parameters.locale, - name: parameters.name, - self: parameters.self, - timeZone: parameters.timeZone, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * changelogs for an issue sorted by date, starting from the oldest. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getChangeLogs( - parameters: Parameters.GetChangeLogs | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * changelogs for an issue sorted by date, starting from the oldest. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getChangeLogs( - parameters: Parameters.GetChangeLogs | string, - callback?: never, - ): Promise; - async getChangeLogs( - parameters: Parameters.GetChangeLogs | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/changelog`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns changelogs for an issue specified by a list of changelog IDs. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getChangeLogsByIds( - parameters: Parameters.GetChangeLogsByIds, - callback: Callback, - ): Promise; - /** - * Returns changelogs for an issue specified by a list of changelog IDs. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getChangeLogsByIds( - parameters: Parameters.GetChangeLogsByIds, - callback?: never, - ): Promise; - async getChangeLogsByIds( - parameters: Parameters.GetChangeLogsByIds, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/changelog/list`, - method: 'POST', - data: { - changelogIds: parameters.changelogIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to - * populate the requests in [Edit issue](#api-rest-api-2-issue-issueIdOrKey-put). - * - * This endpoint will check for these conditions: - * - * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type - * scheme configuration. `overrideScreenSecurity=true` skips this condition. - * 2. Field is visible in the [field - * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). - * `overrideScreenSecurity=true` skips this condition. - * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if - * attachments are enabled. Assignee only shows if user has permissions to assign the issue. - * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All - * system fields are assumed to have context in all projects and all issue types. - * 5. Issue has a project, issue type, and status defined. - * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. - * `overrideEditableFlag=true` skips this condition. - * 7. The current workflow step is editable. This is true by default, but [can be disabled by - * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the - * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. - * 8. User has [Edit issues - * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). - * 9. Workflow permissions allow editing a field. This is true by default but [can be - * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using - * `jira.permission.*` workflow properties. - * - * Fields hidden using [Issue layout settings - * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain - * editable. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: - * - * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available - * through screens, and field configuration (conditions 1. and 2. from the list above). - * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if - * the current step is editable (conditions 6. and 7. from the list above). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * Note: For any fields to be editable the user must have the _Edit issues_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. - */ - async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta | string, - callback: Callback, - ): Promise; - /** - * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to - * populate the requests in [Edit issue](#api-rest-api-2-issue-issueIdOrKey-put). - * - * This endpoint will check for these conditions: - * - * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type - * scheme configuration. `overrideScreenSecurity=true` skips this condition. - * 2. Field is visible in the [field - * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). - * `overrideScreenSecurity=true` skips this condition. - * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if - * attachments are enabled. Assignee only shows if user has permissions to assign the issue. - * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All - * system fields are assumed to have context in all projects and all issue types. - * 5. Issue has a project, issue type, and status defined. - * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. - * `overrideEditableFlag=true` skips this condition. - * 7. The current workflow step is editable. This is true by default, but [can be disabled by - * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the - * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. - * 8. User has [Edit issues - * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). - * 9. Workflow permissions allow editing a field. This is true by default but [can be - * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using - * `jira.permission.*` workflow properties. - * - * Fields hidden using [Issue layout settings - * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain - * editable. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: - * - * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available - * through screens, and field configuration (conditions 1. and 2. from the list above). - * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if - * the current step is editable (conditions 6. and 7. from the list above). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * Note: For any fields to be editable the user must have the _Edit issues_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. - */ - async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta | string, - callback?: never, - ): Promise; - async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/editmeta`, - method: 'GET', - params: { - overrideScreenSecurity: typeof parameters !== 'string' && parameters.overrideScreenSecurity, - overrideEditableFlag: typeof parameters !== 'string' && parameters.overrideEditableFlag, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an email notification for an issue and adds it to the mail queue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async notify(parameters: Parameters.Notify, callback: Callback): Promise; - /** - * Creates an email notification for an issue and adds it to the mail queue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async notify(parameters: Parameters.Notify, callback?: never): Promise; - async notify(parameters: Parameters.Notify, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/notify`, - method: 'POST', - data: { - htmlBody: parameters.htmlBody, - restrict: parameters.restrict, - subject: parameters.subject, - textBody: parameters.textBody, - to: parameters.to, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's - * status. - * - * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its - * status, the response will return any empty transitions list. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: A list or - * transition is returned only when the user has:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * However, if the user does not have the _Transition issues_ [ project - * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. - */ - async getTransitions( - parameters: Parameters.GetTransitions | string, - callback: Callback, - ): Promise; - /** - * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's - * status. - * - * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its - * status, the response will return any empty transitions list. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: A list or - * transition is returned only when the user has:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * However, if the user does not have the _Transition issues_ [ project - * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. - */ - async getTransitions( - parameters: Parameters.GetTransitions | string, - callback?: never, - ): Promise; - async getTransitions( - parameters: Parameters.GetTransitions | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/transitions`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - transitionId: typeof parameters !== 'string' && parameters.transitionId, - skipRemoteOnlyCondition: typeof parameters !== 'string' && parameters.skipRemoteOnlyCondition, - includeUnavailableTransitions: typeof parameters !== 'string' && parameters.includeUnavailableTransitions, - sortByOpsBarAndStatus: typeof parameters !== 'string' && parameters.sortByOpsBarAndStatus, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. - * - * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` - * parameters in the request body. Get details about the fields using [ Get - * transitions](#api-rest-api-2-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Transition issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async doTransition(parameters: Parameters.DoTransition, callback: Callback): Promise; - /** - * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. - * - * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` - * parameters in the request body. Get details about the fields using [ Get - * transitions](#api-rest-api-2-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Transition issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async doTransition(parameters: Parameters.DoTransition, callback?: never): Promise; - async doTransition(parameters: Parameters.DoTransition, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/transitions`, - method: 'POST', - data: { - fields: parameters.fields, - historyMetadata: parameters.historyMetadata, - properties: parameters.properties, - transition: parameters.transition, - update: parameters.update, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it - * will receive an email with a link to download a CSV file with the issue details. - * - * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and - * `ArchivedDate`). Custom fields aren't supported. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - * - * **Rate limiting:** Only a single request can be active at any given time. - */ - async exportArchivedIssues( - parameters: Parameters.ExportArchivedIssues, - callback: Callback, - ): Promise; - /** - * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it - * will receive an email with a link to download a CSV file with the issue details. - * - * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and - * `ArchivedDate`). Custom fields aren't supported. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - * - * **Rate limiting:** Only a single request can be active at any given time. - */ - async exportArchivedIssues( - parameters: Parameters.ExportArchivedIssues, - callback?: never, - ): Promise; - async exportArchivedIssues( - parameters: Parameters.ExportArchivedIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issues/archive/export', - method: 'PUT', - data: { - archivedBy: parameters.archivedBy, - archivedDateRange: parameters.archivedDateRange, - issueTypes: parameters.issueTypes, - projects: parameters.projects, - reporters: parameters.reporters, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/jQL.ts b/src/version2/jQL.ts deleted file mode 100644 index 0831bc100..000000000 --- a/src/version2/jQL.ts +++ /dev/null @@ -1,312 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class JQL { - constructor(private client: Client) {} - - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference - * data (POST)](#api-rest-api-2-jql-autocompletedata-post) can be used. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAutoComplete(callback: Callback): Promise; - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference - * data (POST)](#api-rest-api-2-jql-autocompletedata-post) can be used. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAutoComplete(callback?: never): Promise; - async getAutoComplete(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/autocompletedata', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. - * System fields are always returned. - * - * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across - * all fields with the same name and of the same field type. For example, the collapsed field `Component - - * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched - * simultaneously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAutoCompletePost( - parameters: Parameters.GetAutoCompletePost | undefined, - callback: Callback, - ): Promise; - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. - * System fields are always returned. - * - * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across - * all fields with the same name and of the same field type. For example, the collapsed field `Component - - * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched - * simultaneously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAutoCompletePost( - parameters?: Parameters.GetAutoCompletePost, - callback?: never, - ): Promise; - async getAutoCompletePost( - parameters?: Parameters.GetAutoCompletePost, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/autocompletedata', - method: 'POST', - data: { - includeCollapsedFields: parameters?.includeCollapsedFields, - projectIds: parameters?.projectIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the JQL search auto complete suggestions for a field. - * - * Suggestions can be obtained by providing: - * - * - `fieldName` to get a list of all values for the field. - * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. - * - `fieldName` and `predicateName` to get a list of all predicate values for the field. - * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in - * `predicateValue`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getFieldAutoCompleteForQueryString( - parameters: Parameters.GetFieldAutoCompleteForQueryString | undefined, - callback: Callback, - ): Promise; - /** - * Returns the JQL search auto complete suggestions for a field. - * - * Suggestions can be obtained by providing: - * - * - `fieldName` to get a list of all values for the field. - * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. - * - `fieldName` and `predicateName` to get a list of all predicate values for the field. - * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in - * `predicateValue`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getFieldAutoCompleteForQueryString( - parameters?: Parameters.GetFieldAutoCompleteForQueryString, - callback?: never, - ): Promise; - async getFieldAutoCompleteForQueryString( - parameters?: Parameters.GetFieldAutoCompleteForQueryString, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/autocompletedata/suggestions', - method: 'GET', - params: { - fieldName: parameters?.fieldName, - fieldValue: parameters?.fieldValue, - predicateName: parameters?.predicateName, - predicateValue: parameters?.predicateValue, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Parses and validates JQL queries. - * - * Validation is performed in context of the current user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async parseJqlQueries( - parameters: Parameters.ParseJqlQueries | undefined, - callback: Callback, - ): Promise; - /** - * Parses and validates JQL queries. - * - * Validation is performed in context of the current user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async parseJqlQueries( - parameters?: Parameters.ParseJqlQueries, - callback?: never, - ): Promise; - async parseJqlQueries( - parameters?: Parameters.ParseJqlQueries, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/parse', - method: 'POST', - params: { - validation: parameters?.validation, - }, - data: { - queries: parameters?.queries, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Converts one or more JQL queries with user identifiers (username or user key) to equivalent JQL queries with - * account IDs. - * - * You may wish to use this operation if your system stores JQL queries and you want to make them GDPR-compliant. For - * more information about GDPR-related changes, see the [migration - * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async migrateQueries( - parameters: Parameters.MigrateQueries | undefined, - callback: Callback, - ): Promise; - /** - * Converts one or more JQL queries with user identifiers (username or user key) to equivalent JQL queries with - * account IDs. - * - * You may wish to use this operation if your system stores JQL queries and you want to make them GDPR-compliant. For - * more information about GDPR-related changes, see the [migration - * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async migrateQueries( - parameters?: Parameters.MigrateQueries, - callback?: never, - ): Promise; - async migrateQueries( - parameters?: Parameters.MigrateQueries, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/pdcleaner', - method: 'POST', - data: { - queryStrings: parameters?.queryStrings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sanitizes one or more JQL queries by converting readable details into IDs where a user doesn't have permission to - * view the entity. - * - * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse - * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where - * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account - * ID is null, sanitizing is performed for an anonymous user. - * - * Note that sanitization doesn't make the queries GDPR-compliant, because it doesn't remove user identifiers - * (username or user key). If you need to make queries GDPR-compliant, use [Convert user identifiers to account IDs in - * JQL - * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/#api-rest-api-3-jql-sanitize-post). - * - * Before sanitization each JQL query is parsed. The queries are returned in the same order that they were passed. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async sanitiseJqlQueries( - parameters: Parameters.SanitiseJqlQueries | undefined, - callback: Callback, - ): Promise; - /** - * Sanitizes one or more JQL queries by converting readable details into IDs where a user doesn't have permission to - * view the entity. - * - * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse - * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where - * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account - * ID is null, sanitizing is performed for an anonymous user. - * - * Note that sanitization doesn't make the queries GDPR-compliant, because it doesn't remove user identifiers - * (username or user key). If you need to make queries GDPR-compliant, use [Convert user identifiers to account IDs in - * JQL - * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/#api-rest-api-3-jql-sanitize-post). - * - * Before sanitization each JQL query is parsed. The queries are returned in the same order that they were passed. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async sanitiseJqlQueries( - parameters?: Parameters.SanitiseJqlQueries, - callback?: never, - ): Promise; - async sanitiseJqlQueries( - parameters?: Parameters.SanitiseJqlQueries, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/sanitize', - method: 'POST', - data: { - queries: parameters?.queries, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/jiraExpressions.mts b/src/version2/jiraExpressions.mts new file mode 100644 index 000000000..b83c2510b --- /dev/null +++ b/src/version2/jiraExpressions.mts @@ -0,0 +1,193 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class JiraExpressions { + constructor(private client: Client) {} + + /** + * Analyses and validates Jira expressions. + * + * As an experimental feature, this operation can also attempt to type-check the expressions. + * + * Learn more about Jira expressions in the + * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. + */ + async analyseExpression( + parameters: Parameters.AnalyseExpression | undefined, + callback: Callback, + ): Promise; + /** + * Analyses and validates Jira expressions. + * + * As an experimental feature, this operation can also attempt to type-check the expressions. + * + * Learn more about Jira expressions in the + * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. + */ + async analyseExpression( + parameters?: Parameters.AnalyseExpression, + callback?: never, + ): Promise; + async analyseExpression( + parameters?: Parameters.AnalyseExpression, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/expression/analyse', + method: 'POST', + params: { + check: parameters?.check, + }, + data: { + expressions: parameters?.expressions, + contextVariables: parameters?.contextVariables, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Evaluates a Jira expression and returns its value. + * + * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible + * way. Consult the [Jira expressions + * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. + * + * #### Context variables + * + * The following context variables are available to Jira expressions evaluated by this resource. Their presence + * depends on various factors; usually you need to manually request them in the context object sent in the payload, + * but some of them are added automatically under certain conditions. + * + * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The + * current user. Always available and equal to `null` if the request is anonymous. + * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The + * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. + * Available only for authenticated requests made by Connect Apps (read more here: [Authentication for Connect + * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). + * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The + * current issue. Available only when the issue is provided in the request context object. + * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of + * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A + * collection of issues matching a Jql query. Available only when Jql is provided in the request context object. + * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): + * The current project. Available only when the project is provided in the request context object. + * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): + * The current sprint. Available only when the sprint is provided in the request context object. + * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The + * current board. Available only when the board is provided in the request context object. + * - `serviceDesk` + * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): + * The current service desk. Available only when the service desk is provided in the request context object. + * - `customerRequest` + * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): + * The current customer request. Available only when the customer request is provided in the request context + * object. + * + * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by + * key in the Jira expression. These variable types are available for use in a custom context: + * + * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) + * specified as an Atlassian account ID. + * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) + * specified by ID or key. All the fields of the issue object are available in the Jira expression. + * - `json`: A JSON object containing custom content. + * - `list`: A JSON list of `user`, `issue`, or `json` variable types. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. + * However, an expression may return different results for different users depending on their permissions. For + * example, different users may see different comments on the same issue. Permission to access Jira Software is + * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). + */ + async evaluateJiraExpression( + parameters: Parameters.EvaluateJiraExpression | undefined, + callback: Callback, + ): Promise; + /** + * Evaluates a Jira expression and returns its value. + * + * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible + * way. Consult the [Jira expressions + * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. + * + * #### Context variables + * + * The following context variables are available to Jira expressions evaluated by this resource. Their presence + * depends on various factors; usually you need to manually request them in the context object sent in the payload, + * but some of them are added automatically under certain conditions. + * + * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The + * current user. Always available and equal to `null` if the request is anonymous. + * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The + * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. + * Available only for authenticated requests made by Connect Apps (read more here: [Authentication for Connect + * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). + * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The + * current issue. Available only when the issue is provided in the request context object. + * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of + * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A + * collection of issues matching a Jql query. Available only when Jql is provided in the request context object. + * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): + * The current project. Available only when the project is provided in the request context object. + * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): + * The current sprint. Available only when the sprint is provided in the request context object. + * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The + * current board. Available only when the board is provided in the request context object. + * - `serviceDesk` + * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): + * The current service desk. Available only when the service desk is provided in the request context object. + * - `customerRequest` + * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): + * The current customer request. Available only when the customer request is provided in the request context + * object. + * + * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by + * key in the Jira expression. These variable types are available for use in a custom context: + * + * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) + * specified as an Atlassian account ID. + * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) + * specified by ID or key. All the fields of the issue object are available in the Jira expression. + * - `json`: A JSON object containing custom content. + * - `list`: A JSON list of `user`, `issue`, or `json` variable types. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. + * However, an expression may return different results for different users depending on their permissions. For + * example, different users may see different comments on the same issue. Permission to access Jira Software is + * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). + */ + async evaluateJiraExpression( + parameters?: Parameters.EvaluateJiraExpression, + callback?: never, + ): Promise; + async evaluateJiraExpression( + parameters?: Parameters.EvaluateJiraExpression, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/expression/eval', + method: 'POST', + params: { + expand: parameters?.expand, + }, + data: { + expression: parameters?.expression, + context: parameters?.context, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/jiraExpressions.ts b/src/version2/jiraExpressions.ts deleted file mode 100644 index cff85ca69..000000000 --- a/src/version2/jiraExpressions.ts +++ /dev/null @@ -1,193 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class JiraExpressions { - constructor(private client: Client) {} - - /** - * Analyses and validates Jira expressions. - * - * As an experimental feature, this operation can also attempt to type-check the expressions. - * - * Learn more about Jira expressions in the - * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. - */ - async analyseExpression( - parameters: Parameters.AnalyseExpression | undefined, - callback: Callback, - ): Promise; - /** - * Analyses and validates Jira expressions. - * - * As an experimental feature, this operation can also attempt to type-check the expressions. - * - * Learn more about Jira expressions in the - * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. - */ - async analyseExpression( - parameters?: Parameters.AnalyseExpression, - callback?: never, - ): Promise; - async analyseExpression( - parameters?: Parameters.AnalyseExpression, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/expression/analyse', - method: 'POST', - params: { - check: parameters?.check, - }, - data: { - expressions: parameters?.expressions, - contextVariables: parameters?.contextVariables, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Evaluates a Jira expression and returns its value. - * - * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible - * way. Consult the [Jira expressions - * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. - * - * #### Context variables - * - * The following context variables are available to Jira expressions evaluated by this resource. Their presence - * depends on various factors; usually you need to manually request them in the context object sent in the payload, - * but some of them are added automatically under certain conditions. - * - * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The - * current user. Always available and equal to `null` if the request is anonymous. - * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The - * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. - * Available only for authenticated requests made by Connect Apps (read more here: [Authentication for Connect - * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). - * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The - * current issue. Available only when the issue is provided in the request context object. - * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of - * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A - * collection of issues matching a JQL query. Available only when JQL is provided in the request context object. - * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): - * The current project. Available only when the project is provided in the request context object. - * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): - * The current sprint. Available only when the sprint is provided in the request context object. - * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The - * current board. Available only when the board is provided in the request context object. - * - `serviceDesk` - * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): - * The current service desk. Available only when the service desk is provided in the request context object. - * - `customerRequest` - * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): - * The current customer request. Available only when the customer request is provided in the request context - * object. - * - * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by - * key in the Jira expression. These variable types are available for use in a custom context: - * - * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) - * specified as an Atlassian account ID. - * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) - * specified by ID or key. All the fields of the issue object are available in the Jira expression. - * - `json`: A JSON object containing custom content. - * - `list`: A JSON list of `user`, `issue`, or `json` variable types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. - * However, an expression may return different results for different users depending on their permissions. For - * example, different users may see different comments on the same issue. Permission to access Jira Software is - * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). - */ - async evaluateJiraExpression( - parameters: Parameters.EvaluateJiraExpression | undefined, - callback: Callback, - ): Promise; - /** - * Evaluates a Jira expression and returns its value. - * - * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible - * way. Consult the [Jira expressions - * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. - * - * #### Context variables - * - * The following context variables are available to Jira expressions evaluated by this resource. Their presence - * depends on various factors; usually you need to manually request them in the context object sent in the payload, - * but some of them are added automatically under certain conditions. - * - * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The - * current user. Always available and equal to `null` if the request is anonymous. - * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The - * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. - * Available only for authenticated requests made by Connect Apps (read more here: [Authentication for Connect - * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). - * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The - * current issue. Available only when the issue is provided in the request context object. - * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of - * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A - * collection of issues matching a JQL query. Available only when JQL is provided in the request context object. - * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): - * The current project. Available only when the project is provided in the request context object. - * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): - * The current sprint. Available only when the sprint is provided in the request context object. - * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The - * current board. Available only when the board is provided in the request context object. - * - `serviceDesk` - * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): - * The current service desk. Available only when the service desk is provided in the request context object. - * - `customerRequest` - * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): - * The current customer request. Available only when the customer request is provided in the request context - * object. - * - * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by - * key in the Jira expression. These variable types are available for use in a custom context: - * - * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) - * specified as an Atlassian account ID. - * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) - * specified by ID or key. All the fields of the issue object are available in the Jira expression. - * - `json`: A JSON object containing custom content. - * - `list`: A JSON list of `user`, `issue`, or `json` variable types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. - * However, an expression may return different results for different users depending on their permissions. For - * example, different users may see different comments on the same issue. Permission to access Jira Software is - * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). - */ - async evaluateJiraExpression( - parameters?: Parameters.EvaluateJiraExpression, - callback?: never, - ): Promise; - async evaluateJiraExpression( - parameters?: Parameters.EvaluateJiraExpression, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/expression/eval', - method: 'POST', - params: { - expand: parameters?.expand, - }, - data: { - expression: parameters?.expression, - context: parameters?.context, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/jiraSettings.mts b/src/version2/jiraSettings.mts new file mode 100644 index 000000000..686219483 --- /dev/null +++ b/src/version2/jiraSettings.mts @@ -0,0 +1,241 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class JiraSettings { + constructor(private client: Client) {} + + /** + * Returns all application properties or an application property. + * + * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an + * array). Otherwise, an array of all editable application properties is returned. See [Set application + * property](#api-rest-api-2-application-properties-id-put) for descriptions of editable properties. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApplicationProperty( + parameters: Parameters.GetApplicationProperty | undefined, + callback: Callback, + ): Promise; + /** + * Returns all application properties or an application property. + * + * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an + * array). Otherwise, an array of all editable application properties is returned. See [Set application + * property](#api-rest-api-2-application-properties-id-put) for descriptions of editable properties. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApplicationProperty( + parameters?: Parameters.GetApplicationProperty, + callback?: never, + ): Promise; + async getApplicationProperty( + parameters?: Parameters.GetApplicationProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/application-properties', + method: 'GET', + params: { + key: parameters?.key, + permissionLevel: parameters?.permissionLevel, + keyFilter: parameters?.keyFilter, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the + * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** + * and then click **Advanced Settings** (in the upper right). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAdvancedSettings(callback: Callback): Promise; + /** + * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the + * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** + * and then click **Advanced Settings** (in the upper right). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAdvancedSettings(callback?: never): Promise; + async getAdvancedSettings(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/application-properties/advanced-settings', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from + * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are + * described below along with their default values. + * + * #### Advanced settings + * + * The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). + * + * | Key | Description | Default value | + * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | + * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | + * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | + * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | + * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | + * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | + * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | + * | `jira.table.cols.subtasks` | The columns to show while viewing subtask issues in a table. For example, a list of subtasks on an issue. | `issuetype, status, assignee, progress` | + * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | + * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | + * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | + * + * #### Look and feel + * + * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). + * + * | Key | Description | Default value | + * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | + * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | + * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | + * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | + * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | + * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | + * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | + * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | + * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | + * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | + * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | + * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | + * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | + * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | + * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | + * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | + * + * #### Other settings + * + * | Key | Description | Default value | + * | ----------------------------------- | ----------------------------------------------------- | ------------- | + * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | + * + * _Note: Be careful when changing [application properties and advanced + * settings](https://confluence.atlassian.com/x/vYXKM)._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setApplicationProperty( + parameters: Parameters.SetApplicationProperty, + callback: Callback, + ): Promise; + /** + * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from + * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are + * described below along with their default values. + * + * #### Advanced settings + * + * The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). + * + * | Key | Description | Default value | + * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | + * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | + * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | + * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | + * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | + * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | + * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | + * | `jira.table.cols.subtasks` | The columns to show while viewing subtask issues in a table. For example, a list of subtasks on an issue. | `issuetype, status, assignee, progress` | + * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | + * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | + * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | + * + * #### Look and feel + * + * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). + * + * | Key | Description | Default value | + * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | + * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | + * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | + * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | + * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | + * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | + * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | + * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | + * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | + * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | + * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | + * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | + * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | + * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | + * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | + * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | + * + * #### Other settings + * + * | Key | Description | Default value | + * | ----------------------------------- | ----------------------------------------------------- | ------------- | + * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | + * + * _Note: Be careful when changing [application properties and advanced + * settings](https://confluence.atlassian.com/x/vYXKM)._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setApplicationProperty( + parameters: Parameters.SetApplicationProperty, + callback?: never, + ): Promise; + async setApplicationProperty( + parameters: Parameters.SetApplicationProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/application-properties/${parameters.id}`, + method: 'PUT', + data: parameters.body, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether + * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this + * operation also returns the time tracking configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getConfiguration(callback: Callback): Promise; + /** + * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether + * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this + * operation also returns the time tracking configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getConfiguration(callback?: never): Promise; + async getConfiguration(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/configuration', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/jiraSettings.ts b/src/version2/jiraSettings.ts deleted file mode 100644 index af9c8f51e..000000000 --- a/src/version2/jiraSettings.ts +++ /dev/null @@ -1,241 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class JiraSettings { - constructor(private client: Client) {} - - /** - * Returns all application properties or an application property. - * - * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an - * array). Otherwise, an array of all editable application properties is returned. See [Set application - * property](#api-rest-api-2-application-properties-id-put) for descriptions of editable properties. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationProperty( - parameters: Parameters.GetApplicationProperty | undefined, - callback: Callback, - ): Promise; - /** - * Returns all application properties or an application property. - * - * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an - * array). Otherwise, an array of all editable application properties is returned. See [Set application - * property](#api-rest-api-2-application-properties-id-put) for descriptions of editable properties. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationProperty( - parameters?: Parameters.GetApplicationProperty, - callback?: never, - ): Promise; - async getApplicationProperty( - parameters?: Parameters.GetApplicationProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/application-properties', - method: 'GET', - params: { - key: parameters?.key, - permissionLevel: parameters?.permissionLevel, - keyFilter: parameters?.keyFilter, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the - * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** - * and then click **Advanced Settings** (in the upper right). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAdvancedSettings(callback: Callback): Promise; - /** - * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the - * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** - * and then click **Advanced Settings** (in the upper right). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAdvancedSettings(callback?: never): Promise; - async getAdvancedSettings(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/application-properties/advanced-settings', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from - * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are - * described below along with their default values. - * - * #### Advanced settings - * - * The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). - * - * | Key | Description | Default value | - * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | - * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | - * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | - * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | - * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | - * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | - * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | - * | `jira.table.cols.subtasks` | The columns to show while viewing subtask issues in a table. For example, a list of subtasks on an issue. | `issuetype, status, assignee, progress` | - * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | - * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | - * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | - * - * #### Look and feel - * - * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). - * - * | Key | Description | Default value | - * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | - * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | - * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | - * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | - * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | - * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | - * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | - * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | - * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | - * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | - * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | - * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | - * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | - * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | - * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | - * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | - * - * #### Other settings - * - * | Key | Description | Default value | - * | ----------------------------------- | ----------------------------------------------------- | ------------- | - * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | - * - * _Note: Be careful when changing [application properties and advanced - * settings](https://confluence.atlassian.com/x/vYXKM)._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setApplicationProperty( - parameters: Parameters.SetApplicationProperty, - callback: Callback, - ): Promise; - /** - * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from - * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are - * described below along with their default values. - * - * #### Advanced settings - * - * The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). - * - * | Key | Description | Default value | - * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | - * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | - * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | - * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | - * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | - * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | - * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | - * | `jira.table.cols.subtasks` | The columns to show while viewing subtask issues in a table. For example, a list of subtasks on an issue. | `issuetype, status, assignee, progress` | - * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | - * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | - * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | - * - * #### Look and feel - * - * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). - * - * | Key | Description | Default value | - * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | - * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | - * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | - * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | - * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | - * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | - * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | - * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | - * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | - * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | - * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | - * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | - * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | - * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | - * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | - * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | - * - * #### Other settings - * - * | Key | Description | Default value | - * | ----------------------------------- | ----------------------------------------------------- | ------------- | - * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | - * - * _Note: Be careful when changing [application properties and advanced - * settings](https://confluence.atlassian.com/x/vYXKM)._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setApplicationProperty( - parameters: Parameters.SetApplicationProperty, - callback?: never, - ): Promise; - async setApplicationProperty( - parameters: Parameters.SetApplicationProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/application-properties/${parameters.id}`, - method: 'PUT', - data: parameters.body, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether - * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this - * operation also returns the time tracking configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getConfiguration(callback: Callback): Promise; - /** - * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether - * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this - * operation also returns the time tracking configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getConfiguration(callback?: never): Promise; - async getConfiguration(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/configuration', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/jql.mts b/src/version2/jql.mts new file mode 100644 index 000000000..8d2bd3fd5 --- /dev/null +++ b/src/version2/jql.mts @@ -0,0 +1,312 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class JQL { + constructor(private client: Client) {} + + /** + * Returns reference data for Jql searches. This is a downloadable version of the documentation provided in [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of Jql-reserved words. Use this + * information to assist with the programmatic creation of Jql queries or the validation of queries built in a custom + * query builder. + * + * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference + * data (POST)](#api-rest-api-2-jql-autocompletedata-post) can be used. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAutoComplete(callback: Callback): Promise; + /** + * Returns reference data for Jql searches. This is a downloadable version of the documentation provided in [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of Jql-reserved words. Use this + * information to assist with the programmatic creation of Jql queries or the validation of queries built in a custom + * query builder. + * + * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference + * data (POST)](#api-rest-api-2-jql-autocompletedata-post) can be used. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAutoComplete(callback?: never): Promise; + async getAutoComplete(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/autocompletedata', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns reference data for Jql searches. This is a downloadable version of the documentation provided in [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of Jql-reserved words. Use this + * information to assist with the programmatic creation of Jql queries or the validation of queries built in a custom + * query builder. + * + * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. + * System fields are always returned. + * + * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across + * all fields with the same name and of the same field type. For example, the collapsed field `Component - + * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched + * simultaneously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAutoCompletePost( + parameters: Parameters.GetAutoCompletePost | undefined, + callback: Callback, + ): Promise; + /** + * Returns reference data for Jql searches. This is a downloadable version of the documentation provided in [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of Jql-reserved words. Use this + * information to assist with the programmatic creation of Jql queries or the validation of queries built in a custom + * query builder. + * + * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. + * System fields are always returned. + * + * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across + * all fields with the same name and of the same field type. For example, the collapsed field `Component - + * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched + * simultaneously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAutoCompletePost( + parameters?: Parameters.GetAutoCompletePost, + callback?: never, + ): Promise; + async getAutoCompletePost( + parameters?: Parameters.GetAutoCompletePost, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/autocompletedata', + method: 'POST', + data: { + includeCollapsedFields: parameters?.includeCollapsedFields, + projectIds: parameters?.projectIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the Jql search auto complete suggestions for a field. + * + * Suggestions can be obtained by providing: + * + * - `fieldName` to get a list of all values for the field. + * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. + * - `fieldName` and `predicateName` to get a list of all predicate values for the field. + * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in + * `predicateValue`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getFieldAutoCompleteForQueryString( + parameters: Parameters.GetFieldAutoCompleteForQueryString | undefined, + callback: Callback, + ): Promise; + /** + * Returns the Jql search auto complete suggestions for a field. + * + * Suggestions can be obtained by providing: + * + * - `fieldName` to get a list of all values for the field. + * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. + * - `fieldName` and `predicateName` to get a list of all predicate values for the field. + * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in + * `predicateValue`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getFieldAutoCompleteForQueryString( + parameters?: Parameters.GetFieldAutoCompleteForQueryString, + callback?: never, + ): Promise; + async getFieldAutoCompleteForQueryString( + parameters?: Parameters.GetFieldAutoCompleteForQueryString, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/autocompletedata/suggestions', + method: 'GET', + params: { + fieldName: parameters?.fieldName, + fieldValue: parameters?.fieldValue, + predicateName: parameters?.predicateName, + predicateValue: parameters?.predicateValue, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Parses and validates Jql queries. + * + * Validation is performed in context of the current user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async parseJqlQueries( + parameters: Parameters.ParseJqlQueries | undefined, + callback: Callback, + ): Promise; + /** + * Parses and validates Jql queries. + * + * Validation is performed in context of the current user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async parseJqlQueries( + parameters?: Parameters.ParseJqlQueries, + callback?: never, + ): Promise; + async parseJqlQueries( + parameters?: Parameters.ParseJqlQueries, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/parse', + method: 'POST', + params: { + validation: parameters?.validation, + }, + data: { + queries: parameters?.queries, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Converts one or more Jql queries with user identifiers (username or user key) to equivalent Jql queries with + * account IDs. + * + * You may wish to use this operation if your system stores Jql queries and you want to make them GDPR-compliant. For + * more information about GDPR-related changes, see the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async migrateQueries( + parameters: Parameters.MigrateQueries | undefined, + callback: Callback, + ): Promise; + /** + * Converts one or more Jql queries with user identifiers (username or user key) to equivalent Jql queries with + * account IDs. + * + * You may wish to use this operation if your system stores Jql queries and you want to make them GDPR-compliant. For + * more information about GDPR-related changes, see the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async migrateQueries( + parameters?: Parameters.MigrateQueries, + callback?: never, + ): Promise; + async migrateQueries( + parameters?: Parameters.MigrateQueries, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/pdcleaner', + method: 'POST', + data: { + queryStrings: parameters?.queryStrings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sanitizes one or more Jql queries by converting readable details into IDs where a user doesn't have permission to + * view the entity. + * + * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse + * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where + * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account + * ID is null, sanitizing is performed for an anonymous user. + * + * Note that sanitization doesn't make the queries GDPR-compliant, because it doesn't remove user identifiers + * (username or user key). If you need to make queries GDPR-compliant, use [Convert user identifiers to account IDs in + * Jql + * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/#api-rest-api-3-jql-sanitize-post). + * + * Before sanitization each Jql query is parsed. The queries are returned in the same order that they were passed. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async sanitiseJqlQueries( + parameters: Parameters.SanitiseJqlQueries | undefined, + callback: Callback, + ): Promise; + /** + * Sanitizes one or more Jql queries by converting readable details into IDs where a user doesn't have permission to + * view the entity. + * + * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse + * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where + * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account + * ID is null, sanitizing is performed for an anonymous user. + * + * Note that sanitization doesn't make the queries GDPR-compliant, because it doesn't remove user identifiers + * (username or user key). If you need to make queries GDPR-compliant, use [Convert user identifiers to account IDs in + * Jql + * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/#api-rest-api-3-jql-sanitize-post). + * + * Before sanitization each Jql query is parsed. The queries are returned in the same order that they were passed. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async sanitiseJqlQueries( + parameters?: Parameters.SanitiseJqlQueries, + callback?: never, + ): Promise; + async sanitiseJqlQueries( + parameters?: Parameters.SanitiseJqlQueries, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/sanitize', + method: 'POST', + data: { + queries: parameters?.queries, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/jqlFunctionsApps.mts b/src/version2/jqlFunctionsApps.mts new file mode 100644 index 000000000..475ebe05d --- /dev/null +++ b/src/version2/jqlFunctionsApps.mts @@ -0,0 +1,82 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class JqlFunctionsApps { + constructor(private client: Client) {} + + /** + * Returns the list of a function's precomputations along with information about when they were created, updated, and + * last used. Each precomputation has a `value` - the Jql fragment to replace the custom function clause with. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** This + * API is only accessible to apps and apps can only inspect their own functions. + */ + async getPrecomputations( + parameters: Parameters.GetPrecomputations | undefined, + callback: Callback, + ): Promise; + /** + * Returns the list of a function's precomputations along with information about when they were created, updated, and + * last used. Each precomputation has a `value` - the Jql fragment to replace the custom function clause with. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** This + * API is only accessible to apps and apps can only inspect their own functions. + */ + async getPrecomputations( + parameters?: Parameters.GetPrecomputations, + callback?: never, + ): Promise; + async getPrecomputations( + parameters?: Parameters.GetPrecomputations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/function/computation', + method: 'GET', + params: { + functionKey: parameters?.functionKey, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + orderBy: parameters?.orderBy, + filter: parameters?.filter, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update the precomputation value of a function created by a Forge/Connect app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** An API + * for apps to update their own precomputations. + */ + async updatePrecomputations( + parameters: Parameters.UpdatePrecomputations | undefined, + callback: Callback, + ): Promise; + /** + * Update the precomputation value of a function created by a Forge/Connect app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** An API + * for apps to update their own precomputations. + */ + async updatePrecomputations(parameters?: Parameters.UpdatePrecomputations, callback?: never): Promise; + async updatePrecomputations( + parameters?: Parameters.UpdatePrecomputations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/function/computation', + method: 'POST', + data: { + values: parameters?.values, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/jqlFunctionsApps.ts b/src/version2/jqlFunctionsApps.ts deleted file mode 100644 index 26edd478d..000000000 --- a/src/version2/jqlFunctionsApps.ts +++ /dev/null @@ -1,82 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class JqlFunctionsApps { - constructor(private client: Client) {} - - /** - * Returns the list of a function's precomputations along with information about when they were created, updated, and - * last used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** This - * API is only accessible to apps and apps can only inspect their own functions. - */ - async getPrecomputations( - parameters: Parameters.GetPrecomputations | undefined, - callback: Callback, - ): Promise; - /** - * Returns the list of a function's precomputations along with information about when they were created, updated, and - * last used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** This - * API is only accessible to apps and apps can only inspect their own functions. - */ - async getPrecomputations( - parameters?: Parameters.GetPrecomputations, - callback?: never, - ): Promise; - async getPrecomputations( - parameters?: Parameters.GetPrecomputations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/function/computation', - method: 'GET', - params: { - functionKey: parameters?.functionKey, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - orderBy: parameters?.orderBy, - filter: parameters?.filter, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Update the precomputation value of a function created by a Forge/Connect app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** An API - * for apps to update their own precomputations. - */ - async updatePrecomputations( - parameters: Parameters.UpdatePrecomputations | undefined, - callback: Callback, - ): Promise; - /** - * Update the precomputation value of a function created by a Forge/Connect app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** An API - * for apps to update their own precomputations. - */ - async updatePrecomputations(parameters?: Parameters.UpdatePrecomputations, callback?: never): Promise; - async updatePrecomputations( - parameters?: Parameters.UpdatePrecomputations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/function/computation', - method: 'POST', - data: { - values: parameters?.values, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/labels.mts b/src/version2/labels.mts new file mode 100644 index 000000000..df17f5855 --- /dev/null +++ b/src/version2/labels.mts @@ -0,0 +1,38 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Labels { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * labels. + */ + async getAllLabels( + parameters: Parameters.GetAllLabels | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * labels. + */ + async getAllLabels(parameters?: Parameters.GetAllLabels, callback?: never): Promise; + async getAllLabels( + parameters?: Parameters.GetAllLabels, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/label', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/labels.ts b/src/version2/labels.ts deleted file mode 100644 index 801717bf5..000000000 --- a/src/version2/labels.ts +++ /dev/null @@ -1,38 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Labels { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * labels. - */ - async getAllLabels( - parameters: Parameters.GetAllLabels | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * labels. - */ - async getAllLabels(parameters?: Parameters.GetAllLabels, callback?: never): Promise; - async getAllLabels( - parameters?: Parameters.GetAllLabels, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/label', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/licenseMetrics.mts b/src/version2/licenseMetrics.mts new file mode 100644 index 000000000..6a20bc175 --- /dev/null +++ b/src/version2/licenseMetrics.mts @@ -0,0 +1,88 @@ +import * as Models from './models/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class LicenseMetrics { + constructor(private client: Client) {} + + /** + * Returns licensing information about the Jira instance. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getLicense(callback: Callback): Promise; + /** + * Returns licensing information about the Jira instance. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getLicense(callback?: never): Promise; + async getLicense(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/instance/license', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with + * a 7-day lifecycle and could be stale at the time of call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApproximateLicenseCount(callback: Callback): Promise; + /** + * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with + * a 7-day lifecycle and could be stale at the time of call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApproximateLicenseCount(callback?: never): Promise; + async getApproximateLicenseCount(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/license/approximateLicenseCount', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the total approximate number of user accounts for a single Jira license. Note that this information is + * cached with a 7-day lifecycle and could be stale at the time of call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApproximateApplicationLicenseCount( + applicationKey: string, + callback: Callback, + ): Promise; + /** + * Returns the total approximate number of user accounts for a single Jira license. Note that this information is + * cached with a 7-day lifecycle and could be stale at the time of call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApproximateApplicationLicenseCount( + applicationKey: string, + callback?: never, + ): Promise; + async getApproximateApplicationLicenseCount( + applicationKey: string, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/license/approximateLicenseCount/product/${applicationKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/licenseMetrics.ts b/src/version2/licenseMetrics.ts deleted file mode 100644 index 674531880..000000000 --- a/src/version2/licenseMetrics.ts +++ /dev/null @@ -1,88 +0,0 @@ -import * as Models from './models/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class LicenseMetrics { - constructor(private client: Client) {} - - /** - * Returns licensing information about the Jira instance. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getLicense(callback: Callback): Promise; - /** - * Returns licensing information about the Jira instance. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getLicense(callback?: never): Promise; - async getLicense(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/instance/license', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with - * a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateLicenseCount(callback: Callback): Promise; - /** - * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with - * a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateLicenseCount(callback?: never): Promise; - async getApproximateLicenseCount(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/license/approximateLicenseCount', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the total approximate number of user accounts for a single Jira license. Note that this information is - * cached with a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateApplicationLicenseCount( - applicationKey: string, - callback: Callback, - ): Promise; - /** - * Returns the total approximate number of user accounts for a single Jira license. Note that this information is - * cached with a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateApplicationLicenseCount( - applicationKey: string, - callback?: never, - ): Promise; - async getApproximateApplicationLicenseCount( - applicationKey: string, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/license/approximateLicenseCount/product/${applicationKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/models/actorInput.ts b/src/version2/models/actorInput.mts similarity index 100% rename from src/version2/models/actorInput.ts rename to src/version2/models/actorInput.mts diff --git a/src/version2/models/actorsMap.ts b/src/version2/models/actorsMap.mts similarity index 100% rename from src/version2/models/actorsMap.ts rename to src/version2/models/actorsMap.mts diff --git a/src/version2/models/addField.ts b/src/version2/models/addField.mts similarity index 100% rename from src/version2/models/addField.ts rename to src/version2/models/addField.mts diff --git a/src/version2/models/addGroup.ts b/src/version2/models/addGroup.mts similarity index 100% rename from src/version2/models/addGroup.ts rename to src/version2/models/addGroup.mts diff --git a/src/version2/models/addSecuritySchemeLevelsRequest.mts b/src/version2/models/addSecuritySchemeLevelsRequest.mts new file mode 100644 index 000000000..30f8898c5 --- /dev/null +++ b/src/version2/models/addSecuritySchemeLevelsRequest.mts @@ -0,0 +1,6 @@ +import { SecuritySchemeLevel } from './securitySchemeLevel.mjs'; + +export interface AddSecuritySchemeLevelsRequest { + /** The list of scheme levels which should be added to the security scheme. */ + levels: SecuritySchemeLevel[]; +} diff --git a/src/version2/models/addSecuritySchemeLevelsRequest.ts b/src/version2/models/addSecuritySchemeLevelsRequest.ts deleted file mode 100644 index 18375aca2..000000000 --- a/src/version2/models/addSecuritySchemeLevelsRequest.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { SecuritySchemeLevel } from './securitySchemeLevel.js'; - -export interface AddSecuritySchemeLevelsRequest { - /** The list of scheme levels which should be added to the security scheme. */ - levels: SecuritySchemeLevel[]; -} diff --git a/src/version2/models/announcementBannerConfiguration.ts b/src/version2/models/announcementBannerConfiguration.mts similarity index 100% rename from src/version2/models/announcementBannerConfiguration.ts rename to src/version2/models/announcementBannerConfiguration.mts diff --git a/src/version2/models/announcementBannerConfigurationUpdate.ts b/src/version2/models/announcementBannerConfigurationUpdate.mts similarity index 100% rename from src/version2/models/announcementBannerConfigurationUpdate.ts rename to src/version2/models/announcementBannerConfigurationUpdate.mts diff --git a/src/version2/models/application.ts b/src/version2/models/application.mts similarity index 100% rename from src/version2/models/application.ts rename to src/version2/models/application.mts diff --git a/src/version2/models/applicationProperty.ts b/src/version2/models/applicationProperty.mts similarity index 100% rename from src/version2/models/applicationProperty.ts rename to src/version2/models/applicationProperty.mts diff --git a/src/version2/models/applicationRole.mts b/src/version2/models/applicationRole.mts new file mode 100644 index 000000000..da65b66b3 --- /dev/null +++ b/src/version2/models/applicationRole.mts @@ -0,0 +1,36 @@ +import type { GroupName } from './groupName.mjs'; + +/** Details of an application role. */ +export interface ApplicationRole { + /** + * The groups that are granted default access for this application role. As a group's name can change, use of + * `defaultGroupsDetails` is recommended to identify a groups. + */ + defaultGroups?: string[]; + /** The groups that are granted default access for this application role. */ + defaultGroupsDetails?: GroupName[]; + /** The groups associated with the application role. */ + groupDetails?: GroupName[]; + /** + * The groups associated with the application role. As a group's name can change, use of `groupDetails` is recommended + * to identify a groups. + */ + groups?: string[]; + hasUnlimitedSeats?: boolean; + /** The key of the application role. */ + key?: string; + /** The display name of the application role. */ + name?: string; + /** The maximum count of users on your license. */ + numberOfSeats?: number; + /** Indicates if the application role belongs to Jira platform (`jira-core`). */ + platform?: boolean; + /** The count of users remaining on your license. */ + remainingSeats?: number; + /** Determines whether this application role should be selected by default on user creation. */ + selectedByDefault?: boolean; + /** The number of users counting against your license. */ + userCount?: number; + /** The [type of users](https://confluence.atlassian.com/x/lRW3Ng) being counted against your license. */ + userCountDescription?: string; +} diff --git a/src/version2/models/applicationRole.ts b/src/version2/models/applicationRole.ts deleted file mode 100644 index 564a74612..000000000 --- a/src/version2/models/applicationRole.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { GroupName } from './groupName.js'; - -/** Details of an application role. */ -export interface ApplicationRole { - /** - * The groups that are granted default access for this application role. As a group's name can change, use of - * `defaultGroupsDetails` is recommended to identify a groups. - */ - defaultGroups?: string[]; - /** The groups that are granted default access for this application role. */ - defaultGroupsDetails?: GroupName[]; - /** The groups associated with the application role. */ - groupDetails?: GroupName[]; - /** - * The groups associated with the application role. As a group's name can change, use of `groupDetails` is recommended - * to identify a groups. - */ - groups?: string[]; - hasUnlimitedSeats?: boolean; - /** The key of the application role. */ - key?: string; - /** The display name of the application role. */ - name?: string; - /** The maximum count of users on your license. */ - numberOfSeats?: number; - /** Indicates if the application role belongs to Jira platform (`jira-core`). */ - platform?: boolean; - /** The count of users remaining on your license. */ - remainingSeats?: number; - /** Determines whether this application role should be selected by default on user creation. */ - selectedByDefault?: boolean; - /** The number of users counting against your license. */ - userCount?: number; - /** The [type of users](https://confluence.atlassian.com/x/lRW3Ng) being counted against your license. */ - userCountDescription?: string; -} diff --git a/src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.mts b/src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.mts new file mode 100644 index 000000000..f829c744b --- /dev/null +++ b/src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.mts @@ -0,0 +1,7 @@ +import { FieldConfigurationToIssueTypeMapping } from './fieldConfigurationToIssueTypeMapping.mjs'; + +/** Details of a field configuration to issue type mappings. */ +export interface AssociateFieldConfigurationsWithIssueTypesRequest { + /** Field configuration to issue type mappings. */ + mappings: FieldConfigurationToIssueTypeMapping[]; +} diff --git a/src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.ts b/src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.ts deleted file mode 100644 index 6754b859e..000000000 --- a/src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { FieldConfigurationToIssueTypeMapping } from './fieldConfigurationToIssueTypeMapping.js'; - -/** Details of a field configuration to issue type mappings. */ -export interface AssociateFieldConfigurationsWithIssueTypesRequest { - /** Field configuration to issue type mappings. */ - mappings: FieldConfigurationToIssueTypeMapping[]; -} diff --git a/src/version2/models/associatedItem.ts b/src/version2/models/associatedItem.mts similarity index 100% rename from src/version2/models/associatedItem.ts rename to src/version2/models/associatedItem.mts diff --git a/src/version2/models/attachment.mts b/src/version2/models/attachment.mts new file mode 100644 index 000000000..3a2da45f9 --- /dev/null +++ b/src/version2/models/attachment.mts @@ -0,0 +1,22 @@ +import { UserDetails } from './userDetails.mjs'; + +/** Details about an attachment. */ +export interface Attachment { + author?: UserDetails; + /** The content of the attachment. */ + content?: string; + /** The datetime the attachment was created. */ + created?: string; + /** The file name of the attachment. */ + filename?: string; + /** The ID of the attachment. */ + id: string; + /** The MIME type of the attachment. */ + mimeType?: string; + /** The URL of the attachment details response. */ + self?: string; + /** The size of the attachment. */ + size?: number; + /** The URL of a thumbnail representing the attachment. */ + thumbnail?: string; +} diff --git a/src/version2/models/attachment.ts b/src/version2/models/attachment.ts deleted file mode 100644 index 2262faeaf..000000000 --- a/src/version2/models/attachment.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { UserDetails } from './userDetails.js'; - -/** Details about an attachment. */ -export interface Attachment { - author?: UserDetails; - /** The content of the attachment. */ - content?: string; - /** The datetime the attachment was created. */ - created?: string; - /** The file name of the attachment. */ - filename?: string; - /** The ID of the attachment. */ - id: string; - /** The MIME type of the attachment. */ - mimeType?: string; - /** The URL of the attachment details response. */ - self?: string; - /** The size of the attachment. */ - size?: number; - /** The URL of a thumbnail representing the attachment. */ - thumbnail?: string; -} diff --git a/src/version2/models/attachmentArchiveEntry.ts b/src/version2/models/attachmentArchiveEntry.mts similarity index 100% rename from src/version2/models/attachmentArchiveEntry.ts rename to src/version2/models/attachmentArchiveEntry.mts diff --git a/src/version2/models/attachmentArchiveImpl.mts b/src/version2/models/attachmentArchiveImpl.mts new file mode 100644 index 000000000..05d3d8c9b --- /dev/null +++ b/src/version2/models/attachmentArchiveImpl.mts @@ -0,0 +1,8 @@ +import { AttachmentArchiveEntry } from './attachmentArchiveEntry.mjs'; + +export interface AttachmentArchiveImpl { + /** The list of the items included in the archive. */ + entries?: AttachmentArchiveEntry[]; + /** The number of items in the archive. */ + totalEntryCount?: number; +} diff --git a/src/version2/models/attachmentArchiveImpl.ts b/src/version2/models/attachmentArchiveImpl.ts deleted file mode 100644 index 59188896a..000000000 --- a/src/version2/models/attachmentArchiveImpl.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { AttachmentArchiveEntry } from './attachmentArchiveEntry.js'; - -export interface AttachmentArchiveImpl { - /** The list of the items included in the archive. */ - entries?: AttachmentArchiveEntry[]; - /** The number of items in the archive. */ - totalEntryCount?: number; -} diff --git a/src/version2/models/attachmentArchiveItemReadable.ts b/src/version2/models/attachmentArchiveItemReadable.mts similarity index 100% rename from src/version2/models/attachmentArchiveItemReadable.ts rename to src/version2/models/attachmentArchiveItemReadable.mts diff --git a/src/version2/models/attachmentArchiveMetadataReadable.mts b/src/version2/models/attachmentArchiveMetadataReadable.mts new file mode 100644 index 000000000..a29af8ab0 --- /dev/null +++ b/src/version2/models/attachmentArchiveMetadataReadable.mts @@ -0,0 +1,15 @@ +import { AttachmentArchiveItemReadable } from './attachmentArchiveItemReadable.mjs'; + +/** Metadata for an archive (for example a zip) and its contents. */ +export interface AttachmentArchiveMetadataReadable { + /** The list of the items included in the archive. */ + entries?: AttachmentArchiveItemReadable[]; + /** The ID of the attachment. */ + id?: number; + /** The MIME type of the attachment. */ + mediaType?: string; + /** The name of the archive file. */ + name?: string; + /** The number of items included in the archive. */ + totalEntryCount?: number; +} diff --git a/src/version2/models/attachmentArchiveMetadataReadable.ts b/src/version2/models/attachmentArchiveMetadataReadable.ts deleted file mode 100644 index 5576fa38a..000000000 --- a/src/version2/models/attachmentArchiveMetadataReadable.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { AttachmentArchiveItemReadable } from './attachmentArchiveItemReadable.js'; - -/** Metadata for an archive (for example a zip) and its contents. */ -export interface AttachmentArchiveMetadataReadable { - /** The list of the items included in the archive. */ - entries?: AttachmentArchiveItemReadable[]; - /** The ID of the attachment. */ - id?: number; - /** The MIME type of the attachment. */ - mediaType?: string; - /** The name of the archive file. */ - name?: string; - /** The number of items included in the archive. */ - totalEntryCount?: number; -} diff --git a/src/version2/models/attachmentMetadata.mts b/src/version2/models/attachmentMetadata.mts new file mode 100644 index 000000000..2af5c89fd --- /dev/null +++ b/src/version2/models/attachmentMetadata.mts @@ -0,0 +1,29 @@ +import { User } from './user.mjs'; + +/** Metadata for an issue attachment. */ +export interface AttachmentMetadata { + /** The ID of the attachment. */ + id?: number; + /** The URL of the attachment metadata details. */ + self?: string; + /** The name of the attachment file. */ + filename?: string; + author?: User; + /** The datetime the attachment was created. */ + created?: string; + /** The size of the attachment. */ + size?: number; + /** The MIME type of the attachment. */ + mimeType?: string; + /** Additional properties of the attachment. */ + properties?: {}; + /** The URL of the attachment. */ + content?: string; + /** The URL of a thumbnail representing the attachment. */ + thumbnail?: string; + /** + * The file ID of the attachment in the media store. See the [Media + * API](https://developer.atlassian.com/platform/media/) documentation for more details. + */ + mediaApiFileId?: string; +} diff --git a/src/version2/models/attachmentMetadata.ts b/src/version2/models/attachmentMetadata.ts deleted file mode 100644 index 20240c4aa..000000000 --- a/src/version2/models/attachmentMetadata.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { User } from './user.js'; - -/** Metadata for an issue attachment. */ -export interface AttachmentMetadata { - /** The ID of the attachment. */ - id?: number; - /** The URL of the attachment metadata details. */ - self?: string; - /** The name of the attachment file. */ - filename?: string; - author?: User; - /** The datetime the attachment was created. */ - created?: string; - /** The size of the attachment. */ - size?: number; - /** The MIME type of the attachment. */ - mimeType?: string; - /** Additional properties of the attachment. */ - properties?: {}; - /** The URL of the attachment. */ - content?: string; - /** The URL of a thumbnail representing the attachment. */ - thumbnail?: string; - /** - * The file ID of the attachment in the media store. See the [Media - * API](https://developer.atlassian.com/platform/media/) documentation for more details. - */ - mediaApiFileId?: string; -} diff --git a/src/version2/models/attachmentSettings.ts b/src/version2/models/attachmentSettings.mts similarity index 100% rename from src/version2/models/attachmentSettings.ts rename to src/version2/models/attachmentSettings.mts diff --git a/src/version2/models/auditRecord.mts b/src/version2/models/auditRecord.mts new file mode 100644 index 000000000..771cc5b91 --- /dev/null +++ b/src/version2/models/auditRecord.mts @@ -0,0 +1,28 @@ +import { AssociatedItem } from './associatedItem.mjs'; +import { ChangedValue } from './changedValue.mjs'; + +/** An audit record. */ +export interface AuditRecord { + /** The ID of the audit record. */ + id?: number; + /** The summary of the audit record. */ + summary?: string; + /** The URL of the computer where the creation of the audit record was initiated. */ + remoteAddress?: string; + /** The date and time on which the audit record was created. */ + created?: string; + /** + * The category of the audit record. For a list of these categories, see the help article [Auditing in Jira + * applications](https://confluence.atlassian.com/x/noXKM). + */ + category?: string; + /** The event the audit record originated from. */ + eventSource?: string; + /** The description of the audit record. */ + description?: string; + objectItem?: AssociatedItem; + /** The list of values changed in the record event. */ + changedValues?: ChangedValue[]; + /** The list of items associated with the changed record. */ + associatedItems?: AssociatedItem[]; +} diff --git a/src/version2/models/auditRecord.ts b/src/version2/models/auditRecord.ts deleted file mode 100644 index ffecfda2d..000000000 --- a/src/version2/models/auditRecord.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { AssociatedItem } from './associatedItem.js'; -import type { ChangedValue } from './changedValue.js'; - -/** An audit record. */ -export interface AuditRecord { - /** The ID of the audit record. */ - id?: number; - /** The summary of the audit record. */ - summary?: string; - /** The URL of the computer where the creation of the audit record was initiated. */ - remoteAddress?: string; - /** The date and time on which the audit record was created. */ - created?: string; - /** - * The category of the audit record. For a list of these categories, see the help article [Auditing in Jira - * applications](https://confluence.atlassian.com/x/noXKM). - */ - category?: string; - /** The event the audit record originated from. */ - eventSource?: string; - /** The description of the audit record. */ - description?: string; - objectItem?: AssociatedItem; - /** The list of values changed in the record event. */ - changedValues?: ChangedValue[]; - /** The list of items associated with the changed record. */ - associatedItems?: AssociatedItem[]; -} diff --git a/src/version2/models/auditRecords.mts b/src/version2/models/auditRecords.mts new file mode 100644 index 000000000..42632a705 --- /dev/null +++ b/src/version2/models/auditRecords.mts @@ -0,0 +1,13 @@ +import { AuditRecord } from './auditRecord.mjs'; + +/** Container for a list of audit records. */ +export interface AuditRecords { + /** The requested or default limit on the number of audit items to be returned. */ + limit?: number; + /** The number of audit items skipped before the first item in this list. */ + offset?: number; + /** The list of audit items. */ + records?: AuditRecord[]; + /** The total number of audit items returned. */ + total?: number; +} diff --git a/src/version2/models/auditRecords.ts b/src/version2/models/auditRecords.ts deleted file mode 100644 index 3b3531206..000000000 --- a/src/version2/models/auditRecords.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { AuditRecord } from './auditRecord.js'; - -/** Container for a list of audit records. */ -export interface AuditRecords { - /** The requested or default limit on the number of audit items to be returned. */ - limit?: number; - /** The number of audit items skipped before the first item in this list. */ - offset?: number; - /** The list of audit items. */ - records?: AuditRecord[]; - /** The total number of audit items returned. */ - total?: number; -} diff --git a/src/version2/models/autoCompleteSuggestion.ts b/src/version2/models/autoCompleteSuggestion.mts similarity index 100% rename from src/version2/models/autoCompleteSuggestion.ts rename to src/version2/models/autoCompleteSuggestion.mts diff --git a/src/version2/models/autoCompleteSuggestions.mts b/src/version2/models/autoCompleteSuggestions.mts new file mode 100644 index 000000000..c170b32c1 --- /dev/null +++ b/src/version2/models/autoCompleteSuggestions.mts @@ -0,0 +1,7 @@ +import { AutoCompleteSuggestion } from './autoCompleteSuggestion.mjs'; + +/** The results from a Jql query. */ +export interface AutoCompleteSuggestions { + /** The list of suggested item. */ + results?: AutoCompleteSuggestion[]; +} diff --git a/src/version2/models/autoCompleteSuggestions.ts b/src/version2/models/autoCompleteSuggestions.ts deleted file mode 100644 index 1dd1179a3..000000000 --- a/src/version2/models/autoCompleteSuggestions.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { AutoCompleteSuggestion } from './autoCompleteSuggestion.js'; - -/** The results from a JQL query. */ -export interface AutoCompleteSuggestions { - /** The list of suggested item. */ - results?: AutoCompleteSuggestion[]; -} diff --git a/src/version2/models/availableDashboardGadget.ts b/src/version2/models/availableDashboardGadget.mts similarity index 100% rename from src/version2/models/availableDashboardGadget.ts rename to src/version2/models/availableDashboardGadget.mts diff --git a/src/version2/models/availableDashboardGadgetsResponse.mts b/src/version2/models/availableDashboardGadgetsResponse.mts new file mode 100644 index 000000000..5f40eeae3 --- /dev/null +++ b/src/version2/models/availableDashboardGadgetsResponse.mts @@ -0,0 +1,7 @@ +import { AvailableDashboardGadget } from './availableDashboardGadget.mjs'; + +/** The list of available gadgets. */ +export interface AvailableDashboardGadgetsResponse { + /** The list of available gadgets. */ + gadgets: AvailableDashboardGadget[]; +} diff --git a/src/version2/models/availableDashboardGadgetsResponse.ts b/src/version2/models/availableDashboardGadgetsResponse.ts deleted file mode 100644 index 343598134..000000000 --- a/src/version2/models/availableDashboardGadgetsResponse.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { AvailableDashboardGadget } from './availableDashboardGadget.js'; - -/** The list of available gadgets. */ -export interface AvailableDashboardGadgetsResponse { - /** The list of available gadgets. */ - gadgets: AvailableDashboardGadget[]; -} diff --git a/src/version2/models/availableWorkflowConnectRule.ts b/src/version2/models/availableWorkflowConnectRule.mts similarity index 100% rename from src/version2/models/availableWorkflowConnectRule.ts rename to src/version2/models/availableWorkflowConnectRule.mts diff --git a/src/version2/models/availableWorkflowForgeRule.ts b/src/version2/models/availableWorkflowForgeRule.mts similarity index 100% rename from src/version2/models/availableWorkflowForgeRule.ts rename to src/version2/models/availableWorkflowForgeRule.mts diff --git a/src/version2/models/availableWorkflowSystemRule.ts b/src/version2/models/availableWorkflowSystemRule.mts similarity index 100% rename from src/version2/models/availableWorkflowSystemRule.ts rename to src/version2/models/availableWorkflowSystemRule.mts diff --git a/src/version2/models/availableWorkflowTriggerTypes.ts b/src/version2/models/availableWorkflowTriggerTypes.mts similarity index 100% rename from src/version2/models/availableWorkflowTriggerTypes.ts rename to src/version2/models/availableWorkflowTriggerTypes.mts diff --git a/src/version2/models/availableWorkflowTriggers.mts b/src/version2/models/availableWorkflowTriggers.mts new file mode 100644 index 000000000..e7895b429 --- /dev/null +++ b/src/version2/models/availableWorkflowTriggers.mts @@ -0,0 +1,9 @@ +import { AvailableWorkflowTriggerTypes } from './availableWorkflowTriggerTypes.mjs'; + +/** The trigger rules available. */ +export interface AvailableWorkflowTriggers { + /** The list of available trigger types. */ + availableTypes: AvailableWorkflowTriggerTypes[]; + /** The rule key of the rule. */ + ruleKey: string; +} diff --git a/src/version2/models/availableWorkflowTriggers.ts b/src/version2/models/availableWorkflowTriggers.ts deleted file mode 100644 index 51c70e80d..000000000 --- a/src/version2/models/availableWorkflowTriggers.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { AvailableWorkflowTriggerTypes } from './availableWorkflowTriggerTypes.js'; - -/** The trigger rules available. */ -export interface AvailableWorkflowTriggers { - /** The list of available trigger types. */ - availableTypes: AvailableWorkflowTriggerTypes[]; - /** The rule key of the rule. */ - ruleKey: string; -} diff --git a/src/version2/models/avatar.ts b/src/version2/models/avatar.mts similarity index 100% rename from src/version2/models/avatar.ts rename to src/version2/models/avatar.mts diff --git a/src/version2/models/avatarUrls.ts b/src/version2/models/avatarUrls.mts similarity index 100% rename from src/version2/models/avatarUrls.ts rename to src/version2/models/avatarUrls.mts diff --git a/src/version2/models/avatarWithDetails.ts b/src/version2/models/avatarWithDetails.mts similarity index 100% rename from src/version2/models/avatarWithDetails.ts rename to src/version2/models/avatarWithDetails.mts diff --git a/src/version2/models/avatars.mts b/src/version2/models/avatars.mts new file mode 100644 index 000000000..4bcb38893 --- /dev/null +++ b/src/version2/models/avatars.mts @@ -0,0 +1,9 @@ +import type { Avatar } from './avatar.mjs'; + +/** Details about system and custom avatars. */ +export interface Avatars { + /** Custom avatars list. */ + custom?: Avatar[]; + /** System avatars list. */ + system?: Avatar[]; +} diff --git a/src/version2/models/avatars.ts b/src/version2/models/avatars.ts deleted file mode 100644 index ebb3751fd..000000000 --- a/src/version2/models/avatars.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Avatar } from './avatar.js'; - -/** Details about system and custom avatars. */ -export interface Avatars { - /** Custom avatars list. */ - custom?: Avatar[]; - /** System avatars list. */ - system?: Avatar[]; -} diff --git a/src/version2/models/bulkChangeOwnerDetails.ts b/src/version2/models/bulkChangeOwnerDetails.mts similarity index 100% rename from src/version2/models/bulkChangeOwnerDetails.ts rename to src/version2/models/bulkChangeOwnerDetails.mts diff --git a/src/version2/models/bulkCustomFieldOptionCreateRequest.mts b/src/version2/models/bulkCustomFieldOptionCreateRequest.mts new file mode 100644 index 000000000..9374a43cc --- /dev/null +++ b/src/version2/models/bulkCustomFieldOptionCreateRequest.mts @@ -0,0 +1,7 @@ +import { CustomFieldOptionCreate } from './customFieldOptionCreate.mjs'; + +/** Details of the options to create for a custom field. */ +export interface BulkCustomFieldOptionCreateRequest { + /** Details of options to create. */ + options?: CustomFieldOptionCreate[]; +} diff --git a/src/version2/models/bulkCustomFieldOptionCreateRequest.ts b/src/version2/models/bulkCustomFieldOptionCreateRequest.ts deleted file mode 100644 index fc9734cde..000000000 --- a/src/version2/models/bulkCustomFieldOptionCreateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CustomFieldOptionCreate } from './customFieldOptionCreate.js'; - -/** Details of the options to create for a custom field. */ -export interface BulkCustomFieldOptionCreateRequest { - /** Details of options to create. */ - options?: CustomFieldOptionCreate[]; -} diff --git a/src/version2/models/bulkCustomFieldOptionUpdateRequest.mts b/src/version2/models/bulkCustomFieldOptionUpdateRequest.mts new file mode 100644 index 000000000..952315da4 --- /dev/null +++ b/src/version2/models/bulkCustomFieldOptionUpdateRequest.mts @@ -0,0 +1,7 @@ +import { CustomFieldOptionUpdate } from './customFieldOptionUpdate.mjs'; + +/** Details of the options to update for a custom field. */ +export interface BulkCustomFieldOptionUpdateRequest { + /** Details of the options to update. */ + options?: CustomFieldOptionUpdate[]; +} diff --git a/src/version2/models/bulkCustomFieldOptionUpdateRequest.ts b/src/version2/models/bulkCustomFieldOptionUpdateRequest.ts deleted file mode 100644 index a9d185d58..000000000 --- a/src/version2/models/bulkCustomFieldOptionUpdateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CustomFieldOptionUpdate } from './customFieldOptionUpdate.js'; - -/** Details of the options to update for a custom field. */ -export interface BulkCustomFieldOptionUpdateRequest { - /** Details of the options to update. */ - options?: CustomFieldOptionUpdate[]; -} diff --git a/src/version2/models/bulkEditShareableEntity.ts b/src/version2/models/bulkEditShareableEntity.mts similarity index 100% rename from src/version2/models/bulkEditShareableEntity.ts rename to src/version2/models/bulkEditShareableEntity.mts diff --git a/src/version2/models/bulkIssueIsWatching.ts b/src/version2/models/bulkIssueIsWatching.mts similarity index 100% rename from src/version2/models/bulkIssueIsWatching.ts rename to src/version2/models/bulkIssueIsWatching.mts diff --git a/src/version2/models/bulkIssuePropertyUpdateRequest.mts b/src/version2/models/bulkIssuePropertyUpdateRequest.mts new file mode 100644 index 000000000..8adaefd12 --- /dev/null +++ b/src/version2/models/bulkIssuePropertyUpdateRequest.mts @@ -0,0 +1,18 @@ +import { IssueFilterForBulkPropertySet } from './issueFilterForBulkPropertySet.mjs'; + +/** Bulk issue property update request details. */ +export interface BulkIssuePropertyUpdateRequest { + /** + * EXPERIMENTAL. The Jira expression to calculate the value of the property. The value of the expression must be an + * object that can be converted to JSON, such as a number, boolean, string, list, or map. The context variables + * available to the expression are `issue` and `user`. Issues for which the expression returns a value whose JSON + * representation is longer than 32768 characters are ignored. + */ + expression?: string; + filter?: IssueFilterForBulkPropertySet; + /** + * The value of the property. The value must be a [valid](https://tools.ietf.org/html/rfc4627), non-empty JSON blob. + * The maximum length is 32768 characters. + */ + value?: any; +} diff --git a/src/version2/models/bulkIssuePropertyUpdateRequest.ts b/src/version2/models/bulkIssuePropertyUpdateRequest.ts deleted file mode 100644 index cf13b6d8a..000000000 --- a/src/version2/models/bulkIssuePropertyUpdateRequest.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { IssueFilterForBulkPropertySet } from './issueFilterForBulkPropertySet.js'; - -/** Bulk issue property update request details. */ -export interface BulkIssuePropertyUpdateRequest { - /** - * EXPERIMENTAL. The Jira expression to calculate the value of the property. The value of the expression must be an - * object that can be converted to JSON, such as a number, boolean, string, list, or map. The context variables - * available to the expression are `issue` and `user`. Issues for which the expression returns a value whose JSON - * representation is longer than 32768 characters are ignored. - */ - expression?: string; - filter?: IssueFilterForBulkPropertySet; - /** - * The value of the property. The value must be a [valid](https://tools.ietf.org/html/rfc4627), non-empty JSON blob. - * The maximum length is 32768 characters. - */ - value?: any; -} diff --git a/src/version2/models/bulkOperationErrorResult.mts b/src/version2/models/bulkOperationErrorResult.mts new file mode 100644 index 000000000..55f9a0a4c --- /dev/null +++ b/src/version2/models/bulkOperationErrorResult.mts @@ -0,0 +1,7 @@ +import type { ErrorCollection } from './errorCollection.mjs'; + +export interface BulkOperationErrorResult { + elementErrors?: ErrorCollection; + failedElementNumber?: number; + status?: number; +} diff --git a/src/version2/models/bulkOperationErrorResult.ts b/src/version2/models/bulkOperationErrorResult.ts deleted file mode 100644 index 3caf6f560..000000000 --- a/src/version2/models/bulkOperationErrorResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ErrorCollection } from './errorCollection.js'; - -export interface BulkOperationErrorResult { - elementErrors?: ErrorCollection; - failedElementNumber?: number; - status?: number; -} diff --git a/src/version2/models/bulkPermissionGrants.mts b/src/version2/models/bulkPermissionGrants.mts new file mode 100644 index 000000000..21ccbf956 --- /dev/null +++ b/src/version2/models/bulkPermissionGrants.mts @@ -0,0 +1,9 @@ +import { BulkProjectPermissionGrants } from './bulkProjectPermissionGrants.mjs'; + +/** Details of global and project permissions granted to the user. */ +export interface BulkPermissionGrants { + /** List of permissions granted to the user. */ + globalPermissions: string[]; + /** List of project permissions and the projects and issues those permissions provide access to. */ + projectPermissions: BulkProjectPermissionGrants[]; +} diff --git a/src/version2/models/bulkPermissionGrants.ts b/src/version2/models/bulkPermissionGrants.ts deleted file mode 100644 index 43ef985bf..000000000 --- a/src/version2/models/bulkPermissionGrants.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { BulkProjectPermissionGrants } from './bulkProjectPermissionGrants.js'; - -/** Details of global and project permissions granted to the user. */ -export interface BulkPermissionGrants { - /** List of permissions granted to the user. */ - globalPermissions: string[]; - /** List of project permissions and the projects and issues those permissions provide access to. */ - projectPermissions: BulkProjectPermissionGrants[]; -} diff --git a/src/version2/models/bulkPermissionsRequest.mts b/src/version2/models/bulkPermissionsRequest.mts new file mode 100644 index 000000000..15655fa2f --- /dev/null +++ b/src/version2/models/bulkPermissionsRequest.mts @@ -0,0 +1,11 @@ +import { BulkProjectPermissions } from './bulkProjectPermissions.mjs'; + +/** Details of global permissions to look up and project permissions with associated projects and issues to look up. */ +export interface BulkPermissionsRequest { + /** The account ID of a user. */ + accountId?: string; + /** Global permissions to look up. */ + globalPermissions?: string[]; + /** Project permissions with associated projects and issues to look up. */ + projectPermissions?: BulkProjectPermissions[]; +} diff --git a/src/version2/models/bulkPermissionsRequest.ts b/src/version2/models/bulkPermissionsRequest.ts deleted file mode 100644 index 9a9467b31..000000000 --- a/src/version2/models/bulkPermissionsRequest.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { BulkProjectPermissions } from './bulkProjectPermissions.js'; - -/** Details of global permissions to look up and project permissions with associated projects and issues to look up. */ -export interface BulkPermissionsRequest { - /** The account ID of a user. */ - accountId?: string; - /** Global permissions to look up. */ - globalPermissions?: string[]; - /** Project permissions with associated projects and issues to look up. */ - projectPermissions?: BulkProjectPermissions[]; -} diff --git a/src/version2/models/bulkProjectPermissionGrants.ts b/src/version2/models/bulkProjectPermissionGrants.mts similarity index 100% rename from src/version2/models/bulkProjectPermissionGrants.ts rename to src/version2/models/bulkProjectPermissionGrants.mts diff --git a/src/version2/models/bulkProjectPermissions.ts b/src/version2/models/bulkProjectPermissions.mts similarity index 100% rename from src/version2/models/bulkProjectPermissions.ts rename to src/version2/models/bulkProjectPermissions.mts diff --git a/src/version2/models/changeDetails.ts b/src/version2/models/changeDetails.mts similarity index 100% rename from src/version2/models/changeDetails.ts rename to src/version2/models/changeDetails.mts diff --git a/src/version2/models/changedValue.ts b/src/version2/models/changedValue.mts similarity index 100% rename from src/version2/models/changedValue.ts rename to src/version2/models/changedValue.mts diff --git a/src/version2/models/changedWorklog.mts b/src/version2/models/changedWorklog.mts new file mode 100644 index 000000000..ed50e11b4 --- /dev/null +++ b/src/version2/models/changedWorklog.mts @@ -0,0 +1,11 @@ +import { EntityProperty } from './entityProperty.mjs'; + +/** Details of a changed worklog. */ +export interface ChangedWorklog { + /** Details of properties associated with the change. */ + properties?: EntityProperty[]; + /** The datetime of the change. */ + updatedTime?: number; + /** The ID of the worklog. */ + worklogId?: number; +} diff --git a/src/version2/models/changedWorklog.ts b/src/version2/models/changedWorklog.ts deleted file mode 100644 index 91828d394..000000000 --- a/src/version2/models/changedWorklog.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { EntityProperty } from './entityProperty.js'; - -/** Details of a changed worklog. */ -export interface ChangedWorklog { - /** Details of properties associated with the change. */ - properties?: EntityProperty[]; - /** The datetime of the change. */ - updatedTime?: number; - /** The ID of the worklog. */ - worklogId?: number; -} diff --git a/src/version2/models/changedWorklogs.mts b/src/version2/models/changedWorklogs.mts new file mode 100644 index 000000000..58a8d2142 --- /dev/null +++ b/src/version2/models/changedWorklogs.mts @@ -0,0 +1,16 @@ +import { ChangedWorklog } from './changedWorklog.mjs'; + +/** List of changed worklogs. */ +export interface ChangedWorklogs { + lastPage?: boolean; + /** The URL of the next list of changed worklogs. */ + nextPage?: string; + /** The URL of this changed worklogs list. */ + self?: string; + /** The datetime of the first worklog item in the list. */ + since?: number; + /** The datetime of the last worklog item in the list. */ + until?: number; + /** Changed worklog list. */ + values?: ChangedWorklog[]; +} diff --git a/src/version2/models/changedWorklogs.ts b/src/version2/models/changedWorklogs.ts deleted file mode 100644 index db0a4459a..000000000 --- a/src/version2/models/changedWorklogs.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { ChangedWorklog } from './changedWorklog.js'; - -/** List of changed worklogs. */ -export interface ChangedWorklogs { - lastPage?: boolean; - /** The URL of the next list of changed worklogs. */ - nextPage?: string; - /** The URL of this changed worklogs list. */ - self?: string; - /** The datetime of the first worklog item in the list. */ - since?: number; - /** The datetime of the last worklog item in the list. */ - until?: number; - /** Changed worklog list. */ - values?: ChangedWorklog[]; -} diff --git a/src/version2/models/changelog.mts b/src/version2/models/changelog.mts new file mode 100644 index 000000000..4917522f1 --- /dev/null +++ b/src/version2/models/changelog.mts @@ -0,0 +1,15 @@ +import { ChangeDetails } from './changeDetails.mjs'; +import { HistoryMetadata } from './historyMetadata.mjs'; +import { UserDetails } from './userDetails.mjs'; + +/** A log of changes made to issue fields. Changelogs related to workflow associations are currently being deprecated. */ +export interface Changelog { + author?: UserDetails; + /** The date on which the change took place. */ + created?: string; + historyMetadata?: HistoryMetadata; + /** The ID of the changelog. */ + id?: string; + /** The list of items changed. */ + items?: ChangeDetails[]; +} diff --git a/src/version2/models/changelog.ts b/src/version2/models/changelog.ts deleted file mode 100644 index 2a51f28c5..000000000 --- a/src/version2/models/changelog.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { ChangeDetails } from './changeDetails.js'; -import type { HistoryMetadata } from './historyMetadata.js'; -import type { UserDetails } from './userDetails.js'; - -/** A log of changes made to issue fields. Changelogs related to workflow associations are currently being deprecated. */ -export interface Changelog { - author?: UserDetails; - /** The date on which the change took place. */ - created?: string; - historyMetadata?: HistoryMetadata; - /** The ID of the changelog. */ - id?: string; - /** The list of items changed. */ - items?: ChangeDetails[]; -} diff --git a/src/version2/models/columnItem.ts b/src/version2/models/columnItem.mts similarity index 100% rename from src/version2/models/columnItem.ts rename to src/version2/models/columnItem.mts diff --git a/src/version2/models/comment.mts b/src/version2/models/comment.mts new file mode 100644 index 000000000..07e4aa232 --- /dev/null +++ b/src/version2/models/comment.mts @@ -0,0 +1,40 @@ +import { EntityProperty } from './entityProperty.mjs'; +import { UserDetails } from './userDetails.mjs'; +import { Visibility } from './visibility.mjs'; + +/** A comment. */ +export interface Comment { + author?: UserDetails; + /** The comment text. */ + comment?: string; + /** The date and time at which the comment was created. */ + created?: string; + /** The ID of the comment. */ + id?: string; + /** + * Whether the comment was added from an email sent by a person who is not part of the issue. See [Allow external + * emails to be added as comments on + * issues](https://support.atlassian.com/jira-service-management-cloud/docs/allow-external-emails-to-be-added-as-comments-on-issues/)for + * information on setting up this feature. + */ + jsdAuthorCanSeeRequest?: boolean; + /** + * Whether the comment is visible in Jira Service Desk. Defaults to true when comments are created in the Jira Cloud + * Platform. This includes when the site doesn't use Jira Service Desk or the project isn't a Jira Service Desk + * project and, therefore, there is no Jira Service Desk for the issue to be visible on. To create a comment with its + * visibility in Jira Service Desk set to false, use the Jira Service Desk REST API [Create request + * comment](https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-request-issueIdOrKey-comment-post) + * operation. + */ + jsdPublic?: boolean; + /** A list of comment properties. Optional on create and update. */ + properties?: EntityProperty[]; + /** The rendered version of the comment. */ + renderedBody?: string; + /** The URL of the comment. */ + self?: string; + updateAuthor?: UserDetails; + /** The date and time at which the comment was updated last. */ + updated?: string; + visibility?: Visibility; +} diff --git a/src/version2/models/comment.ts b/src/version2/models/comment.ts deleted file mode 100644 index d29afb052..000000000 --- a/src/version2/models/comment.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { EntityProperty } from './entityProperty.js'; -import type { UserDetails } from './userDetails.js'; -import type { Visibility } from './visibility.js'; - -/** A comment. */ -export interface Comment { - author?: UserDetails; - /** The comment text. */ - comment?: string; - /** The date and time at which the comment was created. */ - created?: string; - /** The ID of the comment. */ - id?: string; - /** - * Whether the comment was added from an email sent by a person who is not part of the issue. See [Allow external - * emails to be added as comments on - * issues](https://support.atlassian.com/jira-service-management-cloud/docs/allow-external-emails-to-be-added-as-comments-on-issues/)for - * information on setting up this feature. - */ - jsdAuthorCanSeeRequest?: boolean; - /** - * Whether the comment is visible in Jira Service Desk. Defaults to true when comments are created in the Jira Cloud - * Platform. This includes when the site doesn't use Jira Service Desk or the project isn't a Jira Service Desk - * project and, therefore, there is no Jira Service Desk for the issue to be visible on. To create a comment with its - * visibility in Jira Service Desk set to false, use the Jira Service Desk REST API [Create request - * comment](https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-request-issueIdOrKey-comment-post) - * operation. - */ - jsdPublic?: boolean; - /** A list of comment properties. Optional on create and update. */ - properties?: EntityProperty[]; - /** The rendered version of the comment. */ - renderedBody?: string; - /** The URL of the comment. */ - self?: string; - updateAuthor?: UserDetails; - /** The date and time at which the comment was updated last. */ - updated?: string; - visibility?: Visibility; -} diff --git a/src/version2/models/componentIssuesCount.ts b/src/version2/models/componentIssuesCount.mts similarity index 100% rename from src/version2/models/componentIssuesCount.ts rename to src/version2/models/componentIssuesCount.mts diff --git a/src/version2/models/componentWithIssueCount.mts b/src/version2/models/componentWithIssueCount.mts new file mode 100644 index 000000000..40cf11a22 --- /dev/null +++ b/src/version2/models/componentWithIssueCount.mts @@ -0,0 +1,51 @@ +import { User } from './user.mjs'; + +/** Details about a component with a count of the issues it contains. */ +export interface ComponentWithIssueCount { + assignee?: User; + /** + * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` + * for details on how the type of the user, and hence the user, assigned to issues is determined. Takes the following + * values: + * + * `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the + * component is in. `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for + * the component. `UNASSIGNED` an assignee is not set for issues created with this component. `PROJECT_DEFAULT` the + * assignee to any issues created with this component is nominally the default assignee for the project that the + * component is in. + */ + assigneeType?: string; + /** The description for the component. */ + description?: string; + /** The unique identifier for the component. */ + id?: string; + /** + * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but + * the component lead is not set, then `false` is returned. + */ + isAssigneeTypeValid?: boolean; + /** Count of issues for the component. */ + issueCount?: number; + lead?: User; + /** The name for the component. */ + name?: string; + /** The key of the project to which the component is assigned. */ + project?: string; + /** Not used. */ + projectId?: number; + realAssignee?: User; + /** + * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set + * from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This + * property is set to one of the following values: + * + * `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in + * the project that the component is in. `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component + * lead has permission to be assigned issues in the project that the component is in. `UNASSIGNED` when `assigneeType` + * is `UNASSIGNED` and Jira is configured to allow unassigned issues. `PROJECT_DEFAULT` when none of the preceding + * cases are true. + */ + realAssigneeType?: string; + /** The URL for this count of the issues contained in the component. */ + self?: string; +} diff --git a/src/version2/models/componentWithIssueCount.ts b/src/version2/models/componentWithIssueCount.ts deleted file mode 100644 index fa8b50824..000000000 --- a/src/version2/models/componentWithIssueCount.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { User } from './user.js'; - -/** Details about a component with a count of the issues it contains. */ -export interface ComponentWithIssueCount { - assignee?: User; - /** - * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` - * for details on how the type of the user, and hence the user, assigned to issues is determined. Takes the following - * values: - * - * `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the - * component is in. `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for - * the component. `UNASSIGNED` an assignee is not set for issues created with this component. `PROJECT_DEFAULT` the - * assignee to any issues created with this component is nominally the default assignee for the project that the - * component is in. - */ - assigneeType?: string; - /** The description for the component. */ - description?: string; - /** The unique identifier for the component. */ - id?: string; - /** - * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but - * the component lead is not set, then `false` is returned. - */ - isAssigneeTypeValid?: boolean; - /** Count of issues for the component. */ - issueCount?: number; - lead?: User; - /** The name for the component. */ - name?: string; - /** The key of the project to which the component is assigned. */ - project?: string; - /** Not used. */ - projectId?: number; - realAssignee?: User; - /** - * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set - * from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This - * property is set to one of the following values: - * - * `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in - * the project that the component is in. `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component - * lead has permission to be assigned issues in the project that the component is in. `UNASSIGNED` when `assigneeType` - * is `UNASSIGNED` and Jira is configured to allow unassigned issues. `PROJECT_DEFAULT` when none of the preceding - * cases are true. - */ - realAssigneeType?: string; - /** The URL for this count of the issues contained in the component. */ - self?: string; -} diff --git a/src/version2/models/conditionGroupConfiguration.mts b/src/version2/models/conditionGroupConfiguration.mts new file mode 100644 index 000000000..19adfe2ff --- /dev/null +++ b/src/version2/models/conditionGroupConfiguration.mts @@ -0,0 +1,15 @@ +import { WorkflowRuleConfiguration } from './workflowRuleConfiguration.mjs'; + +/** The conditions group associated with the transition. */ +export interface ConditionGroupConfiguration { + /** The nested conditions of the condition group. */ + conditionGroups?: ConditionGroupConfiguration[]; + /** The rules for this condition. */ + conditions?: WorkflowRuleConfiguration[]; + /** + * Determines how the conditions in the group are evaluated. Accepts either `ANY` or `ALL`. If `ANY` is used, at least + * one condition in the group must be true for the group to evaluate to true. If `ALL` is used, all conditions in the + * group must be true for the group to evaluate to true. + */ + operation?: string; +} diff --git a/src/version2/models/conditionGroupConfiguration.ts b/src/version2/models/conditionGroupConfiguration.ts deleted file mode 100644 index f51499790..000000000 --- a/src/version2/models/conditionGroupConfiguration.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { WorkflowRuleConfiguration } from './workflowRuleConfiguration.js'; - -/** The conditions group associated with the transition. */ -export interface ConditionGroupConfiguration { - /** The nested conditions of the condition group. */ - conditionGroups?: ConditionGroupConfiguration[]; - /** The rules for this condition. */ - conditions?: WorkflowRuleConfiguration[]; - /** - * Determines how the conditions in the group are evaluated. Accepts either `ANY` or `ALL`. If `ANY` is used, at least - * one condition in the group must be true for the group to evaluate to true. If `ALL` is used, all conditions in the - * group must be true for the group to evaluate to true. - */ - operation?: string; -} diff --git a/src/version2/models/conditionGroupUpdate.mts b/src/version2/models/conditionGroupUpdate.mts new file mode 100644 index 000000000..75bcd8b2d --- /dev/null +++ b/src/version2/models/conditionGroupUpdate.mts @@ -0,0 +1,15 @@ +import { WorkflowRuleConfiguration } from './workflowRuleConfiguration.mjs'; + +/** The conditions group associated with the transition. */ +export interface ConditionGroupUpdate { + /** The nested conditions of the condition group. */ + conditionGroups?: ConditionGroupUpdate[]; + /** The rules for this condition. */ + conditions?: WorkflowRuleConfiguration[]; + /** + * Determines how the conditions in the group are evaluated. Accepts either `ANY` or `ALL`. If `ANY` is used, at least + * one condition in the group must be true for the group to evaluate to true. If `ALL` is used, all conditions in the + * group must be true for the group to evaluate to true. + */ + operation: string; +} diff --git a/src/version2/models/conditionGroupUpdate.ts b/src/version2/models/conditionGroupUpdate.ts deleted file mode 100644 index 9306ce922..000000000 --- a/src/version2/models/conditionGroupUpdate.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { WorkflowRuleConfiguration } from './workflowRuleConfiguration.js'; - -/** The conditions group associated with the transition. */ -export interface ConditionGroupUpdate { - /** The nested conditions of the condition group. */ - conditionGroups?: ConditionGroupUpdate[]; - /** The rules for this condition. */ - conditions?: WorkflowRuleConfiguration[]; - /** - * Determines how the conditions in the group are evaluated. Accepts either `ANY` or `ALL`. If `ANY` is used, at least - * one condition in the group must be true for the group to evaluate to true. If `ALL` is used, all conditions in the - * group must be true for the group to evaluate to true. - */ - operation: string; -} diff --git a/src/version2/models/configuration.mts b/src/version2/models/configuration.mts new file mode 100644 index 000000000..71967f12b --- /dev/null +++ b/src/version2/models/configuration.mts @@ -0,0 +1,27 @@ +import { TimeTrackingConfiguration } from './timeTrackingConfiguration.mjs'; + +/** Details about the configuration of Jira. */ +export interface Configuration { + /** Whether the ability to add attachments to issues is enabled. */ + attachmentsEnabled?: boolean; + /** Whether the ability to link issues is enabled. */ + issueLinkingEnabled?: boolean; + /** Whether the ability to create subtasks for issues is enabled. */ + subTasksEnabled?: boolean; + timeTrackingConfiguration?: TimeTrackingConfiguration; + /** + * Whether the ability to create unassigned issues is enabled. See [Configuring Jira application + * options](https://confluence.atlassian.com/x/uYXKM) for details. + */ + unassignedIssuesAllowed?: boolean; + /** + * Whether the ability for users to vote on issues is enabled. See [Configuring Jira application + * options](https://confluence.atlassian.com/x/uYXKM) for details. + */ + votingEnabled?: boolean; + /** + * Whether the ability for users to watch issues is enabled. See [Configuring Jira application + * options](https://confluence.atlassian.com/x/uYXKM) for details. + */ + watchingEnabled?: boolean; +} diff --git a/src/version2/models/configuration.ts b/src/version2/models/configuration.ts deleted file mode 100644 index 7fd929b06..000000000 --- a/src/version2/models/configuration.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { TimeTrackingConfiguration } from './timeTrackingConfiguration.js'; - -/** Details about the configuration of Jira. */ -export interface Configuration { - /** Whether the ability to add attachments to issues is enabled. */ - attachmentsEnabled?: boolean; - /** Whether the ability to link issues is enabled. */ - issueLinkingEnabled?: boolean; - /** Whether the ability to create subtasks for issues is enabled. */ - subTasksEnabled?: boolean; - timeTrackingConfiguration?: TimeTrackingConfiguration; - /** - * Whether the ability to create unassigned issues is enabled. See [Configuring Jira application - * options](https://confluence.atlassian.com/x/uYXKM) for details. - */ - unassignedIssuesAllowed?: boolean; - /** - * Whether the ability for users to vote on issues is enabled. See [Configuring Jira application - * options](https://confluence.atlassian.com/x/uYXKM) for details. - */ - votingEnabled?: boolean; - /** - * Whether the ability for users to watch issues is enabled. See [Configuring Jira application - * options](https://confluence.atlassian.com/x/uYXKM) for details. - */ - watchingEnabled?: boolean; -} diff --git a/src/version2/models/connectCustomFieldValue.ts b/src/version2/models/connectCustomFieldValue.mts similarity index 100% rename from src/version2/models/connectCustomFieldValue.ts rename to src/version2/models/connectCustomFieldValue.mts diff --git a/src/version2/models/connectCustomFieldValues.mts b/src/version2/models/connectCustomFieldValues.mts new file mode 100644 index 000000000..c9a349f47 --- /dev/null +++ b/src/version2/models/connectCustomFieldValues.mts @@ -0,0 +1,7 @@ +import { ConnectCustomFieldValue } from './connectCustomFieldValue.mjs'; + +/** Details of updates for a custom field. */ +export interface ConnectCustomFieldValues { + /** The list of custom field update details. */ + updateValueList?: ConnectCustomFieldValue[]; +} diff --git a/src/version2/models/connectCustomFieldValues.ts b/src/version2/models/connectCustomFieldValues.ts deleted file mode 100644 index 6a9c82601..000000000 --- a/src/version2/models/connectCustomFieldValues.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ConnectCustomFieldValue } from './connectCustomFieldValue.js'; - -/** Details of updates for a custom field. */ -export interface ConnectCustomFieldValues { - /** The list of custom field update details. */ - updateValueList?: ConnectCustomFieldValue[]; -} diff --git a/src/version2/models/connectModule.ts b/src/version2/models/connectModule.mts similarity index 100% rename from src/version2/models/connectModule.ts rename to src/version2/models/connectModule.mts diff --git a/src/version2/models/connectModules.mts b/src/version2/models/connectModules.mts new file mode 100644 index 000000000..4d5fe7c19 --- /dev/null +++ b/src/version2/models/connectModules.mts @@ -0,0 +1,9 @@ +import { ConnectModule } from './connectModule.mjs'; + +export interface ConnectModules { + /** + * A list of app modules in the same format as the `modules` property in the [app + * descriptor](https://developer.atlassian.com/cloud/jira/platform/app-descriptor/). + */ + modules: ConnectModule[]; +} diff --git a/src/version2/models/connectModules.ts b/src/version2/models/connectModules.ts deleted file mode 100644 index 185060e23..000000000 --- a/src/version2/models/connectModules.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ConnectModule } from './connectModule.js'; - -export interface ConnectModules { - /** - * A list of app modules in the same format as the `modules` property in the [app - * descriptor](https://developer.atlassian.com/cloud/jira/platform/app-descriptor/). - */ - modules: ConnectModule[]; -} diff --git a/src/version2/models/connectWorkflowTransitionRule.mts b/src/version2/models/connectWorkflowTransitionRule.mts new file mode 100644 index 000000000..3953e6b7c --- /dev/null +++ b/src/version2/models/connectWorkflowTransitionRule.mts @@ -0,0 +1,12 @@ +import { RuleConfiguration } from './ruleConfiguration.mjs'; +import { WorkflowTransition } from './workflowTransition.mjs'; + +/** A workflow transition rule. */ +export interface ConnectWorkflowTransitionRule { + configuration: RuleConfiguration; + /** The ID of the transition rule. */ + id: string; + /** The key of the rule, as defined in the Connect app descriptor. */ + key: string; + transition?: WorkflowTransition; +} diff --git a/src/version2/models/connectWorkflowTransitionRule.ts b/src/version2/models/connectWorkflowTransitionRule.ts deleted file mode 100644 index 7cd6784ec..000000000 --- a/src/version2/models/connectWorkflowTransitionRule.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { RuleConfiguration } from './ruleConfiguration.js'; -import type { WorkflowTransition } from './workflowTransition.js'; - -/** A workflow transition rule. */ -export interface ConnectWorkflowTransitionRule { - configuration: RuleConfiguration; - /** The ID of the transition rule. */ - id: string; - /** The key of the rule, as defined in the Connect app descriptor. */ - key: string; - transition?: WorkflowTransition; -} diff --git a/src/version2/models/containerForProjectFeatures.mts b/src/version2/models/containerForProjectFeatures.mts new file mode 100644 index 000000000..f0fd1db6a --- /dev/null +++ b/src/version2/models/containerForProjectFeatures.mts @@ -0,0 +1,7 @@ +import { ProjectFeature } from './projectFeature.mjs'; + +/** The list of features on a project. */ +export interface ContainerForProjectFeatures { + /** The project features. */ + features?: ProjectFeature[]; +} diff --git a/src/version2/models/containerForProjectFeatures.ts b/src/version2/models/containerForProjectFeatures.ts deleted file mode 100644 index 4cd842900..000000000 --- a/src/version2/models/containerForProjectFeatures.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ProjectFeature } from './projectFeature.js'; - -/** The list of features on a project. */ -export interface ContainerForProjectFeatures { - /** The project features. */ - features?: ProjectFeature[]; -} diff --git a/src/version2/models/containerForRegisteredWebhooks.mts b/src/version2/models/containerForRegisteredWebhooks.mts new file mode 100644 index 000000000..ce2973c7c --- /dev/null +++ b/src/version2/models/containerForRegisteredWebhooks.mts @@ -0,0 +1,7 @@ +import { RegisteredWebhook } from './registeredWebhook.mjs'; + +/** Container for a list of registered webhooks. Webhook details are returned in the same order as the request. */ +export interface ContainerForRegisteredWebhooks { + /** A list of registered webhooks. */ + webhookRegistrationResult?: RegisteredWebhook[]; +} diff --git a/src/version2/models/containerForRegisteredWebhooks.ts b/src/version2/models/containerForRegisteredWebhooks.ts deleted file mode 100644 index 1ccb8940c..000000000 --- a/src/version2/models/containerForRegisteredWebhooks.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { RegisteredWebhook } from './registeredWebhook.js'; - -/** Container for a list of registered webhooks. Webhook details are returned in the same order as the request. */ -export interface ContainerForRegisteredWebhooks { - /** A list of registered webhooks. */ - webhookRegistrationResult?: RegisteredWebhook[]; -} diff --git a/src/version2/models/containerForWebhookIDs.ts b/src/version2/models/containerForWebhookIDs.mts similarity index 100% rename from src/version2/models/containerForWebhookIDs.ts rename to src/version2/models/containerForWebhookIDs.mts diff --git a/src/version2/models/containerOfWorkflowSchemeAssociations.mts b/src/version2/models/containerOfWorkflowSchemeAssociations.mts new file mode 100644 index 000000000..2ecc5fc29 --- /dev/null +++ b/src/version2/models/containerOfWorkflowSchemeAssociations.mts @@ -0,0 +1,7 @@ +import { WorkflowSchemeAssociations } from './workflowSchemeAssociations.mjs'; + +/** A container for a list of workflow schemes together with the projects they are associated with. */ +export interface ContainerOfWorkflowSchemeAssociations { + /** A list of workflow schemes together with projects they are associated with. */ + values: WorkflowSchemeAssociations[]; +} diff --git a/src/version2/models/containerOfWorkflowSchemeAssociations.ts b/src/version2/models/containerOfWorkflowSchemeAssociations.ts deleted file mode 100644 index b7e156c85..000000000 --- a/src/version2/models/containerOfWorkflowSchemeAssociations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { WorkflowSchemeAssociations } from './workflowSchemeAssociations.js'; - -/** A container for a list of workflow schemes together with the projects they are associated with. */ -export interface ContainerOfWorkflowSchemeAssociations { - /** A list of workflow schemes together with projects they are associated with. */ - values: WorkflowSchemeAssociations[]; -} diff --git a/src/version2/models/contextForProjectAndIssueType.ts b/src/version2/models/contextForProjectAndIssueType.mts similarity index 100% rename from src/version2/models/contextForProjectAndIssueType.ts rename to src/version2/models/contextForProjectAndIssueType.mts diff --git a/src/version2/models/contextualConfiguration.ts b/src/version2/models/contextualConfiguration.mts similarity index 100% rename from src/version2/models/contextualConfiguration.ts rename to src/version2/models/contextualConfiguration.mts diff --git a/src/version2/models/convertedJQLQueries.mts b/src/version2/models/convertedJQLQueries.mts new file mode 100644 index 000000000..f32f08fee --- /dev/null +++ b/src/version2/models/convertedJQLQueries.mts @@ -0,0 +1,9 @@ +import { JQLQueryWithUnknownUsers } from './jQLQueryWithUnknownUsers.mjs'; + +/** The converted Jql queries. */ +export interface ConvertedJQLQueries { + /** List of queries containing user information that could not be mapped to an existing user */ + queriesWithUnknownUsers?: JQLQueryWithUnknownUsers[]; + /** The list of converted query strings with account IDs in place of user identifiers. */ + queryStrings?: string[]; +} diff --git a/src/version2/models/convertedJQLQueries.ts b/src/version2/models/convertedJQLQueries.ts deleted file mode 100644 index 9925f54ab..000000000 --- a/src/version2/models/convertedJQLQueries.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { JQLQueryWithUnknownUsers } from './jQLQueryWithUnknownUsers.js'; - -/** The converted JQL queries. */ -export interface ConvertedJQLQueries { - /** List of queries containing user information that could not be mapped to an existing user */ - queriesWithUnknownUsers?: JQLQueryWithUnknownUsers[]; - /** The list of converted query strings with account IDs in place of user identifiers. */ - queryStrings?: string[]; -} diff --git a/src/version2/models/createCustomFieldContext.ts b/src/version2/models/createCustomFieldContext.mts similarity index 100% rename from src/version2/models/createCustomFieldContext.ts rename to src/version2/models/createCustomFieldContext.mts diff --git a/src/version2/models/createIssueSecuritySchemeDetails.mts b/src/version2/models/createIssueSecuritySchemeDetails.mts new file mode 100644 index 000000000..1a5a1f711 --- /dev/null +++ b/src/version2/models/createIssueSecuritySchemeDetails.mts @@ -0,0 +1,11 @@ +import { SecuritySchemeLevel } from './securitySchemeLevel.mjs'; + +/** Issue security scheme and it's details */ +export interface CreateIssueSecuritySchemeDetails { + /** The description of the issue security scheme. */ + description?: string; + /** The list of scheme levels which should be added to the security scheme. */ + levels?: SecuritySchemeLevel[]; + /** The name of the issue security scheme. Must be unique (case-insensitive). */ + name: string; +} diff --git a/src/version2/models/createIssueSecuritySchemeDetails.ts b/src/version2/models/createIssueSecuritySchemeDetails.ts deleted file mode 100644 index 5b8a273c7..000000000 --- a/src/version2/models/createIssueSecuritySchemeDetails.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { SecuritySchemeLevel } from './securitySchemeLevel.js'; - -/** Issue security scheme and it's details */ -export interface CreateIssueSecuritySchemeDetails { - /** The description of the issue security scheme. */ - description?: string; - /** The list of scheme levels which should be added to the security scheme. */ - levels?: SecuritySchemeLevel[]; - /** The name of the issue security scheme. Must be unique (case-insensitive). */ - name: string; -} diff --git a/src/version2/models/createNotificationSchemeDetails.mts b/src/version2/models/createNotificationSchemeDetails.mts new file mode 100644 index 000000000..d76d5f6e5 --- /dev/null +++ b/src/version2/models/createNotificationSchemeDetails.mts @@ -0,0 +1,11 @@ +import { NotificationSchemeEventDetails } from './notificationSchemeEventDetails.mjs'; + +/** Details of a notification scheme. */ +export interface CreateNotificationSchemeDetails { + /** The description of the notification scheme. */ + description?: string; + /** The name of the notification scheme. Must be unique (case-insensitive). */ + name: string; + /** The list of notifications which should be added to the notification scheme. */ + notificationSchemeEvents?: NotificationSchemeEventDetails[]; +} diff --git a/src/version2/models/createNotificationSchemeDetails.ts b/src/version2/models/createNotificationSchemeDetails.ts deleted file mode 100644 index 82187b563..000000000 --- a/src/version2/models/createNotificationSchemeDetails.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { NotificationSchemeEventDetails } from './notificationSchemeEventDetails.js'; - -/** Details of a notification scheme. */ -export interface CreateNotificationSchemeDetails { - /** The description of the notification scheme. */ - description?: string; - /** The name of the notification scheme. Must be unique (case-insensitive). */ - name: string; - /** The list of notifications which should be added to the notification scheme. */ - notificationSchemeEvents?: NotificationSchemeEventDetails[]; -} diff --git a/src/version2/models/createPriorityDetails.ts b/src/version2/models/createPriorityDetails.mts similarity index 100% rename from src/version2/models/createPriorityDetails.ts rename to src/version2/models/createPriorityDetails.mts diff --git a/src/version2/models/createProjectDetails.ts b/src/version2/models/createProjectDetails.mts similarity index 100% rename from src/version2/models/createProjectDetails.ts rename to src/version2/models/createProjectDetails.mts diff --git a/src/version2/models/createResolutionDetails.ts b/src/version2/models/createResolutionDetails.mts similarity index 100% rename from src/version2/models/createResolutionDetails.ts rename to src/version2/models/createResolutionDetails.mts diff --git a/src/version2/models/createUiModificationDetails.mts b/src/version2/models/createUiModificationDetails.mts new file mode 100644 index 000000000..7a34976ca --- /dev/null +++ b/src/version2/models/createUiModificationDetails.mts @@ -0,0 +1,13 @@ +import type { UiModificationContextDetails } from './uiModificationContextDetails.mjs'; + +/** The details of a UI modification. */ +export interface CreateUiModificationDetails { + /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ + contexts?: UiModificationContextDetails[]; + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data?: string; + /** The description of the UI modification. The maximum length is 255 characters. */ + description?: string; + /** The name of the UI modification. The maximum length is 255 characters. */ + name: string; +} diff --git a/src/version2/models/createUiModificationDetails.ts b/src/version2/models/createUiModificationDetails.ts deleted file mode 100644 index f142d0129..000000000 --- a/src/version2/models/createUiModificationDetails.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { UiModificationContextDetails } from './uiModificationContextDetails.js'; - -/** The details of a UI modification. */ -export interface CreateUiModificationDetails { - /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ - contexts?: UiModificationContextDetails[]; - /** The data of the UI modification. The maximum size of the data is 50000 characters. */ - data?: string; - /** The description of the UI modification. The maximum length is 255 characters. */ - description?: string; - /** The name of the UI modification. The maximum length is 255 characters. */ - name: string; -} diff --git a/src/version2/models/createUpdateRoleRequest.ts b/src/version2/models/createUpdateRoleRequest.mts similarity index 100% rename from src/version2/models/createUpdateRoleRequest.ts rename to src/version2/models/createUpdateRoleRequest.mts diff --git a/src/version2/models/createWorkflowCondition.ts b/src/version2/models/createWorkflowCondition.mts similarity index 100% rename from src/version2/models/createWorkflowCondition.ts rename to src/version2/models/createWorkflowCondition.mts diff --git a/src/version2/models/createWorkflowDetails.mts b/src/version2/models/createWorkflowDetails.mts new file mode 100644 index 000000000..1c13694dc --- /dev/null +++ b/src/version2/models/createWorkflowDetails.mts @@ -0,0 +1,29 @@ +import { CreateWorkflowStatusDetails } from './createWorkflowStatusDetails.mjs'; +import { CreateWorkflowTransitionDetails } from './createWorkflowTransitionDetails.mjs'; + +/** The details of a workflow. */ +export interface CreateWorkflowDetails { + /** The description of the workflow. The maximum length is 1000 characters. */ + description?: string; + /** + * The name of the workflow. The name must be unique. The maximum length is 255 characters. Characters can be + * separated by a whitespace but the name cannot start or end with a whitespace. + */ + name: string; + /** + * The statuses of the workflow. Any status that does not include a transition is added to the workflow without a + * transition. + */ + statuses: CreateWorkflowStatusDetails[]; + /** + * The transitions of the workflow. For the request to be valid, these transitions must: + * + * Include one _initial_ transition. not use the same name for a _global_ and _directed_ transition. have a unique + * name for each _global_ transition. have a unique 'to' status for each _global_ transition. have unique names for + * each transition from a status. not have a 'from' status on _initial_ and _global_ transitions. have a 'from' status + * on _directed_ transitions. + * + * All the transition statuses must be included in `statuses`. + */ + transitions: CreateWorkflowTransitionDetails[]; +} diff --git a/src/version2/models/createWorkflowDetails.ts b/src/version2/models/createWorkflowDetails.ts deleted file mode 100644 index 9d8ed7813..000000000 --- a/src/version2/models/createWorkflowDetails.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { CreateWorkflowStatusDetails } from './createWorkflowStatusDetails.js'; -import type { CreateWorkflowTransitionDetails } from './createWorkflowTransitionDetails.js'; - -/** The details of a workflow. */ -export interface CreateWorkflowDetails { - /** The description of the workflow. The maximum length is 1000 characters. */ - description?: string; - /** - * The name of the workflow. The name must be unique. The maximum length is 255 characters. Characters can be - * separated by a whitespace but the name cannot start or end with a whitespace. - */ - name: string; - /** - * The statuses of the workflow. Any status that does not include a transition is added to the workflow without a - * transition. - */ - statuses: CreateWorkflowStatusDetails[]; - /** - * The transitions of the workflow. For the request to be valid, these transitions must: - * - * Include one _initial_ transition. not use the same name for a _global_ and _directed_ transition. have a unique - * name for each _global_ transition. have a unique 'to' status for each _global_ transition. have unique names for - * each transition from a status. not have a 'from' status on _initial_ and _global_ transitions. have a 'from' status - * on _directed_ transitions. - * - * All the transition statuses must be included in `statuses`. - */ - transitions: CreateWorkflowTransitionDetails[]; -} diff --git a/src/version2/models/createWorkflowStatusDetails.ts b/src/version2/models/createWorkflowStatusDetails.mts similarity index 100% rename from src/version2/models/createWorkflowStatusDetails.ts rename to src/version2/models/createWorkflowStatusDetails.mts diff --git a/src/version2/models/createWorkflowTransitionDetails.mts b/src/version2/models/createWorkflowTransitionDetails.mts new file mode 100644 index 000000000..cdecab9dd --- /dev/null +++ b/src/version2/models/createWorkflowTransitionDetails.mts @@ -0,0 +1,20 @@ +import { CreateWorkflowTransitionRulesDetails } from './createWorkflowTransitionRulesDetails.mjs'; +import { CreateWorkflowTransitionScreenDetails } from './createWorkflowTransitionScreenDetails.mjs'; + +/** The details of a workflow transition. */ +export interface CreateWorkflowTransitionDetails { + /** The description of the transition. The maximum length is 1000 characters. */ + description?: string; + /** The statuses the transition can start from. */ + from?: string[]; + /** The name of the transition. The maximum length is 60 characters. */ + name: string; + /** The properties of the transition. */ + properties?: {}; + rules?: CreateWorkflowTransitionRulesDetails; + screen?: CreateWorkflowTransitionScreenDetails; + /** The status the transition goes to. */ + to: string; + /** The type of the transition. */ + type: string; +} diff --git a/src/version2/models/createWorkflowTransitionDetails.ts b/src/version2/models/createWorkflowTransitionDetails.ts deleted file mode 100644 index 49431a2d4..000000000 --- a/src/version2/models/createWorkflowTransitionDetails.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { CreateWorkflowTransitionRulesDetails } from './createWorkflowTransitionRulesDetails.js'; -import type { CreateWorkflowTransitionScreenDetails } from './createWorkflowTransitionScreenDetails.js'; - -/** The details of a workflow transition. */ -export interface CreateWorkflowTransitionDetails { - /** The description of the transition. The maximum length is 1000 characters. */ - description?: string; - /** The statuses the transition can start from. */ - from?: string[]; - /** The name of the transition. The maximum length is 60 characters. */ - name: string; - /** The properties of the transition. */ - properties?: {}; - rules?: CreateWorkflowTransitionRulesDetails; - screen?: CreateWorkflowTransitionScreenDetails; - /** The status the transition goes to. */ - to: string; - /** The type of the transition. */ - type: string; -} diff --git a/src/version2/models/createWorkflowTransitionRule.ts b/src/version2/models/createWorkflowTransitionRule.mts similarity index 100% rename from src/version2/models/createWorkflowTransitionRule.ts rename to src/version2/models/createWorkflowTransitionRule.mts diff --git a/src/version2/models/createWorkflowTransitionRulesDetails.mts b/src/version2/models/createWorkflowTransitionRulesDetails.mts new file mode 100644 index 000000000..ad82dd900 --- /dev/null +++ b/src/version2/models/createWorkflowTransitionRulesDetails.mts @@ -0,0 +1,72 @@ +import { CreateWorkflowCondition } from './createWorkflowCondition.mjs'; +import { CreateWorkflowTransitionRule } from './createWorkflowTransitionRule.mjs'; + +/** The details of a workflow transition rules. */ +export interface CreateWorkflowTransitionRulesDetails { + conditions?: CreateWorkflowCondition; + /** + * The workflow post functions. + * + * _Note:_* The default post functions are always added to the _initial_ transition, as in: + * + * "postFunctions": [ + * { + * "type": "IssueCreateFunction" + * }, + * { + * "type": "IssueReindexFunction" + * }, + * { + * "type": "FireIssueEventFunction", + * "configuration": { + * "event": { + * "id": "1", + * "name": "issue_created" + * } + * } + * } + * ] + * + * _Note:_* The default post functions are always added to the _global_ and _directed_ transitions, as in: + * + * "postFunctions": [ + * { + * "type": "UpdateIssueStatusFunction" + * }, + * { + * "type": "CreateCommentFunction" + * }, + * { + * "type": "GenerateChangeHistoryFunction" + * }, + * { + * "type": "IssueReindexFunction" + * }, + * { + * "type": "FireIssueEventFunction", + * "configuration": { + * "event": { + * "id": "13", + * "name": "issue_generic" + * } + * } + * } + * ] + */ + postFunctions?: CreateWorkflowTransitionRule[]; + /** + * The workflow validators. + * + * _Note:_* The default permission validator is always added to the _initial_ transition, as in: + * + * "validators": [ + * { + * "type": "PermissionValidator", + * "configuration": { + * "permissionKey": "CREATE_ISSUES" + * } + * } + * ] + */ + validators?: CreateWorkflowTransitionRule[]; +} diff --git a/src/version2/models/createWorkflowTransitionRulesDetails.ts b/src/version2/models/createWorkflowTransitionRulesDetails.ts deleted file mode 100644 index 8d5e1d797..000000000 --- a/src/version2/models/createWorkflowTransitionRulesDetails.ts +++ /dev/null @@ -1,72 +0,0 @@ -import type { CreateWorkflowCondition } from './createWorkflowCondition.js'; -import type { CreateWorkflowTransitionRule } from './createWorkflowTransitionRule.js'; - -/** The details of a workflow transition rules. */ -export interface CreateWorkflowTransitionRulesDetails { - conditions?: CreateWorkflowCondition; - /** - * The workflow post functions. - * - * _Note:_* The default post functions are always added to the _initial_ transition, as in: - * - * "postFunctions": [ - * { - * "type": "IssueCreateFunction" - * }, - * { - * "type": "IssueReindexFunction" - * }, - * { - * "type": "FireIssueEventFunction", - * "configuration": { - * "event": { - * "id": "1", - * "name": "issue_created" - * } - * } - * } - * ] - * - * _Note:_* The default post functions are always added to the _global_ and _directed_ transitions, as in: - * - * "postFunctions": [ - * { - * "type": "UpdateIssueStatusFunction" - * }, - * { - * "type": "CreateCommentFunction" - * }, - * { - * "type": "GenerateChangeHistoryFunction" - * }, - * { - * "type": "IssueReindexFunction" - * }, - * { - * "type": "FireIssueEventFunction", - * "configuration": { - * "event": { - * "id": "13", - * "name": "issue_generic" - * } - * } - * } - * ] - */ - postFunctions?: CreateWorkflowTransitionRule[]; - /** - * The workflow validators. - * - * _Note:_* The default permission validator is always added to the _initial_ transition, as in: - * - * "validators": [ - * { - * "type": "PermissionValidator", - * "configuration": { - * "permissionKey": "CREATE_ISSUES" - * } - * } - * ] - */ - validators?: CreateWorkflowTransitionRule[]; -} diff --git a/src/version2/models/createWorkflowTransitionScreenDetails.ts b/src/version2/models/createWorkflowTransitionScreenDetails.mts similarity index 100% rename from src/version2/models/createWorkflowTransitionScreenDetails.ts rename to src/version2/models/createWorkflowTransitionScreenDetails.mts diff --git a/src/version2/models/createdIssue.mts b/src/version2/models/createdIssue.mts new file mode 100644 index 000000000..9c2c741b3 --- /dev/null +++ b/src/version2/models/createdIssue.mts @@ -0,0 +1,13 @@ +import { NestedResponse } from './nestedResponse.mjs'; + +/** Details about a created issue or subtask. */ +export interface CreatedIssue { + /** The ID of the created issue or subtask. */ + id: string; + /** The key of the created issue or subtask. */ + key: string; + /** The URL of the created issue or subtask. */ + self: string; + transition?: NestedResponse; + watchers?: NestedResponse; +} diff --git a/src/version2/models/createdIssue.ts b/src/version2/models/createdIssue.ts deleted file mode 100644 index 47934f044..000000000 --- a/src/version2/models/createdIssue.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { NestedResponse } from './nestedResponse.js'; - -/** Details about a created issue or subtask. */ -export interface CreatedIssue { - /** The ID of the created issue or subtask. */ - id: string; - /** The key of the created issue or subtask. */ - key: string; - /** The URL of the created issue or subtask. */ - self: string; - transition?: NestedResponse; - watchers?: NestedResponse; -} diff --git a/src/version2/models/createdIssues.mts b/src/version2/models/createdIssues.mts new file mode 100644 index 000000000..449f8f8fb --- /dev/null +++ b/src/version2/models/createdIssues.mts @@ -0,0 +1,10 @@ +import { BulkOperationErrorResult } from './bulkOperationErrorResult.mjs'; +import { CreatedIssue } from './createdIssue.mjs'; + +/** Details about the issues created and the errors for requests that failed. */ +export interface CreatedIssues { + /** Error details for failed issue creation requests. */ + errors?: BulkOperationErrorResult[]; + /** Details of the issues created. */ + issues?: CreatedIssue[]; +} diff --git a/src/version2/models/createdIssues.ts b/src/version2/models/createdIssues.ts deleted file mode 100644 index d388ef34f..000000000 --- a/src/version2/models/createdIssues.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { BulkOperationErrorResult } from './bulkOperationErrorResult.js'; -import type { CreatedIssue } from './createdIssue.js'; - -/** Details about the issues created and the errors for requests that failed. */ -export interface CreatedIssues { - /** Error details for failed issue creation requests. */ - errors?: BulkOperationErrorResult[]; - /** Details of the issues created. */ - issues?: CreatedIssue[]; -} diff --git a/src/version2/models/customContextVariable.ts b/src/version2/models/customContextVariable.mts similarity index 100% rename from src/version2/models/customContextVariable.ts rename to src/version2/models/customContextVariable.mts diff --git a/src/version2/models/customFieldConfigurations.mts b/src/version2/models/customFieldConfigurations.mts new file mode 100644 index 000000000..40575ba1e --- /dev/null +++ b/src/version2/models/customFieldConfigurations.mts @@ -0,0 +1,7 @@ +import { ContextualConfiguration } from './contextualConfiguration.mjs'; + +/** Details of configurations for a custom field. */ +export interface CustomFieldConfigurations { + /** The list of custom field configuration details. */ + configurations: ContextualConfiguration[]; +} diff --git a/src/version2/models/customFieldConfigurations.ts b/src/version2/models/customFieldConfigurations.ts deleted file mode 100644 index c82c67544..000000000 --- a/src/version2/models/customFieldConfigurations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ContextualConfiguration } from './contextualConfiguration.js'; - -/** Details of configurations for a custom field. */ -export interface CustomFieldConfigurations { - /** The list of custom field configuration details. */ - configurations: ContextualConfiguration[]; -} diff --git a/src/version2/models/customFieldContext.ts b/src/version2/models/customFieldContext.mts similarity index 100% rename from src/version2/models/customFieldContext.ts rename to src/version2/models/customFieldContext.mts diff --git a/src/version2/models/customFieldContextDefaultValue.ts b/src/version2/models/customFieldContextDefaultValue.mts similarity index 100% rename from src/version2/models/customFieldContextDefaultValue.ts rename to src/version2/models/customFieldContextDefaultValue.mts diff --git a/src/version2/models/customFieldContextDefaultValueUpdate.mts b/src/version2/models/customFieldContextDefaultValueUpdate.mts new file mode 100644 index 000000000..4247319b7 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueUpdate.mts @@ -0,0 +1,6 @@ +import { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue.mjs'; + +/** Default values to update. */ +export interface CustomFieldContextDefaultValueUpdate { + defaultValues?: CustomFieldContextDefaultValue[]; +} diff --git a/src/version2/models/customFieldContextDefaultValueUpdate.ts b/src/version2/models/customFieldContextDefaultValueUpdate.ts deleted file mode 100644 index 6b59de00e..000000000 --- a/src/version2/models/customFieldContextDefaultValueUpdate.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue.js'; - -/** Default values to update. */ -export interface CustomFieldContextDefaultValueUpdate { - defaultValues?: CustomFieldContextDefaultValue[]; -} diff --git a/src/version2/models/customFieldContextOption.ts b/src/version2/models/customFieldContextOption.mts similarity index 100% rename from src/version2/models/customFieldContextOption.ts rename to src/version2/models/customFieldContextOption.mts diff --git a/src/version2/models/customFieldContextProjectMapping.ts b/src/version2/models/customFieldContextProjectMapping.mts similarity index 100% rename from src/version2/models/customFieldContextProjectMapping.ts rename to src/version2/models/customFieldContextProjectMapping.mts diff --git a/src/version2/models/customFieldContextUpdateDetails.ts b/src/version2/models/customFieldContextUpdateDetails.mts similarity index 100% rename from src/version2/models/customFieldContextUpdateDetails.ts rename to src/version2/models/customFieldContextUpdateDetails.mts diff --git a/src/version2/models/customFieldCreatedContextOptionsList.mts b/src/version2/models/customFieldCreatedContextOptionsList.mts new file mode 100644 index 000000000..1ae6d0203 --- /dev/null +++ b/src/version2/models/customFieldCreatedContextOptionsList.mts @@ -0,0 +1,7 @@ +import { CustomFieldContextOption } from './customFieldContextOption.mjs'; + +/** A list of custom field options for a context. */ +export interface CustomFieldCreatedContextOptionsList { + /** The created custom field options. */ + options?: CustomFieldContextOption[]; +} diff --git a/src/version2/models/customFieldCreatedContextOptionsList.ts b/src/version2/models/customFieldCreatedContextOptionsList.ts deleted file mode 100644 index 9d2205e49..000000000 --- a/src/version2/models/customFieldCreatedContextOptionsList.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CustomFieldContextOption } from './customFieldContextOption.js'; - -/** A list of custom field options for a context. */ -export interface CustomFieldCreatedContextOptionsList { - /** The created custom field options. */ - options?: CustomFieldContextOption[]; -} diff --git a/src/version2/models/customFieldDefinitionJson.mts b/src/version2/models/customFieldDefinitionJson.mts new file mode 100644 index 000000000..fdb6e97f0 --- /dev/null +++ b/src/version2/models/customFieldDefinitionJson.mts @@ -0,0 +1,61 @@ +export interface CustomFieldDefinitionJson { + /** The name of the custom field, which is displayed in Jira. This is not the unique identifier. */ + name: string; + /** The description of the custom field, which is displayed in Jira. */ + description?: string; + /** + * The type of the custom field. These built-in custom field types are available: + * + * `cascadingselect`: Enables values to be selected from two levels of select lists (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect`) `datepicker`: Stores a date using a picker + * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:datepicker`) `datetime`: Stores a date with a + * time component (value: `com.atlassian.jira.plugin.system.customfieldtypes:datetime`) `float`: Stores and validates + * a numeric (floating point) input (value: `com.atlassian.jira.plugin.system.customfieldtypes:float`) `grouppicker`: + * Stores a user group using a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:grouppicker`) + * `importid`: A read-only field that stores the ID the issue had in the system it was imported from (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:importid`) `labels`: Stores labels (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:labels`) `multicheckboxes`: Stores multiple values using + * checkboxes (value: `) `multigrouppicker`: Stores multiple user groups using a picker control (value: `) + * `multiselect`: Stores multiple values using a select list (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes`) `multiuserpicker`: Stores multiple users using + * a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker`) `multiversion`: + * Stores multiple versions from the versions available in a project using a picker control (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:multiversion`) `project`: Stores a project from a list of + * projects that the user is permitted to view (value: `com.atlassian.jira.plugin.system.customfieldtypes:project`) + * `radiobuttons`: Stores a value using radio buttons (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons`) `readonlyfield`: Stores a read-only text value, + * which can only be populated via the API (value: `com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield`) + * `select`: Stores a value from a configurable list of options (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:select`) `textarea`: Stores a long text string using a multiline + * text area (value: `com.atlassian.jira.plugin.system.customfieldtypes:textarea`) `textfield`: Stores a text string + * using a single-line text box (value: `com.atlassian.jira.plugin.system.customfieldtypes:textfield`) `url`: Stores a + * URL (value: `com.atlassian.jira.plugin.system.customfieldtypes:url`) `userpicker`: Stores a user using a picker + * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:userpicker`) `version`: Stores a version using a + * picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:version`) + * + * To create a field based on a [Forge custom field + * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-), + * use the ID of the Forge custom field type as the value. For example, + * `ari:cloud:ecosystem::extension/e62f20a2-4b61-4dbe-bfb9-9a88b5e3ac84/548c5df1-24aa-4f7c-bbbb-3038d947cb05/static/my-cf-type-key`. + */ + type: string; + /** + * The searcher defines the way the field is searched in Jira. For example, + * _com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher_. The search UI (basic search and Jql + * search) will display different operations and values for the field, based on the field searcher. You must specify a + * searcher that is valid for the field type, as listed below (abbreviated values shown): + * + * `cascadingselect`: `cascadingselectsearcher` `datepicker`: `daterange` `datetime`: `datetimerange` `float`: + * `exactnumber` or `numberrange` `grouppicker`: `grouppickersearcher` `importid`: `exactnumber` or `numberrange` + * `labels`: `labelsearcher` `multicheckboxes`: `multiselectsearcher` `multigrouppicker`: `multiselectsearcher` + * `multiselect`: `multiselectsearcher` `multiuserpicker`: `userpickergroupsearcher` `multiversion`: `versionsearcher` + * `project`: `projectsearcher` `radiobuttons`: `multiselectsearcher` `readonlyfield`: `textsearcher` `select`: + * `multiselectsearcher` `textarea`: `textsearcher` `textfield`: `textsearcher` `url`: `exacttextsearcher` + * `userpicker`: `userpickergroupsearcher` `version`: `versionsearcher` + * + * If no searcher is provided, the field isn't searchable. However, [Forge custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-) + * have a searcher set automatically, so are always searchable. + */ + searcherKey?: string; +} diff --git a/src/version2/models/customFieldDefinitionJson.ts b/src/version2/models/customFieldDefinitionJson.ts deleted file mode 100644 index b55d9a816..000000000 --- a/src/version2/models/customFieldDefinitionJson.ts +++ /dev/null @@ -1,61 +0,0 @@ -export interface CustomFieldDefinitionJson { - /** The name of the custom field, which is displayed in Jira. This is not the unique identifier. */ - name: string; - /** The description of the custom field, which is displayed in Jira. */ - description?: string; - /** - * The type of the custom field. These built-in custom field types are available: - * - * `cascadingselect`: Enables values to be selected from two levels of select lists (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect`) `datepicker`: Stores a date using a picker - * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:datepicker`) `datetime`: Stores a date with a - * time component (value: `com.atlassian.jira.plugin.system.customfieldtypes:datetime`) `float`: Stores and validates - * a numeric (floating point) input (value: `com.atlassian.jira.plugin.system.customfieldtypes:float`) `grouppicker`: - * Stores a user group using a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:grouppicker`) - * `importid`: A read-only field that stores the ID the issue had in the system it was imported from (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:importid`) `labels`: Stores labels (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:labels`) `multicheckboxes`: Stores multiple values using - * checkboxes (value: `) `multigrouppicker`: Stores multiple user groups using a picker control (value: `) - * `multiselect`: Stores multiple values using a select list (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes`) `multiuserpicker`: Stores multiple users using - * a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker`) `multiversion`: - * Stores multiple versions from the versions available in a project using a picker control (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:multiversion`) `project`: Stores a project from a list of - * projects that the user is permitted to view (value: `com.atlassian.jira.plugin.system.customfieldtypes:project`) - * `radiobuttons`: Stores a value using radio buttons (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons`) `readonlyfield`: Stores a read-only text value, - * which can only be populated via the API (value: `com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield`) - * `select`: Stores a value from a configurable list of options (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:select`) `textarea`: Stores a long text string using a multiline - * text area (value: `com.atlassian.jira.plugin.system.customfieldtypes:textarea`) `textfield`: Stores a text string - * using a single-line text box (value: `com.atlassian.jira.plugin.system.customfieldtypes:textfield`) `url`: Stores a - * URL (value: `com.atlassian.jira.plugin.system.customfieldtypes:url`) `userpicker`: Stores a user using a picker - * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:userpicker`) `version`: Stores a version using a - * picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:version`) - * - * To create a field based on a [Forge custom field - * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-), - * use the ID of the Forge custom field type as the value. For example, - * `ari:cloud:ecosystem::extension/e62f20a2-4b61-4dbe-bfb9-9a88b5e3ac84/548c5df1-24aa-4f7c-bbbb-3038d947cb05/static/my-cf-type-key`. - */ - type: string; - /** - * The searcher defines the way the field is searched in Jira. For example, - * _com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher_. The search UI (basic search and JQL - * search) will display different operations and values for the field, based on the field searcher. You must specify a - * searcher that is valid for the field type, as listed below (abbreviated values shown): - * - * `cascadingselect`: `cascadingselectsearcher` `datepicker`: `daterange` `datetime`: `datetimerange` `float`: - * `exactnumber` or `numberrange` `grouppicker`: `grouppickersearcher` `importid`: `exactnumber` or `numberrange` - * `labels`: `labelsearcher` `multicheckboxes`: `multiselectsearcher` `multigrouppicker`: `multiselectsearcher` - * `multiselect`: `multiselectsearcher` `multiuserpicker`: `userpickergroupsearcher` `multiversion`: `versionsearcher` - * `project`: `projectsearcher` `radiobuttons`: `multiselectsearcher` `readonlyfield`: `textsearcher` `select`: - * `multiselectsearcher` `textarea`: `textsearcher` `textfield`: `textsearcher` `url`: `exacttextsearcher` - * `userpicker`: `userpickergroupsearcher` `version`: `versionsearcher` - * - * If no searcher is provided, the field isn't searchable. However, [Forge custom - * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-) - * have a searcher set automatically, so are always searchable. - */ - searcherKey?: string; -} diff --git a/src/version2/models/customFieldOption.ts b/src/version2/models/customFieldOption.mts similarity index 100% rename from src/version2/models/customFieldOption.ts rename to src/version2/models/customFieldOption.mts diff --git a/src/version2/models/customFieldOptionCreate.ts b/src/version2/models/customFieldOptionCreate.mts similarity index 100% rename from src/version2/models/customFieldOptionCreate.ts rename to src/version2/models/customFieldOptionCreate.mts diff --git a/src/version2/models/customFieldOptionUpdate.ts b/src/version2/models/customFieldOptionUpdate.mts similarity index 100% rename from src/version2/models/customFieldOptionUpdate.ts rename to src/version2/models/customFieldOptionUpdate.mts diff --git a/src/version2/models/customFieldReplacement.ts b/src/version2/models/customFieldReplacement.mts similarity index 100% rename from src/version2/models/customFieldReplacement.ts rename to src/version2/models/customFieldReplacement.mts diff --git a/src/version2/models/customFieldUpdatedContextOptionsList.mts b/src/version2/models/customFieldUpdatedContextOptionsList.mts new file mode 100644 index 000000000..e9d8f1478 --- /dev/null +++ b/src/version2/models/customFieldUpdatedContextOptionsList.mts @@ -0,0 +1,7 @@ +import { CustomFieldOptionUpdate } from './customFieldOptionUpdate.mjs'; + +/** A list of custom field options for a context. */ +export interface CustomFieldUpdatedContextOptionsList { + /** The updated custom field options. */ + options?: CustomFieldOptionUpdate[]; +} diff --git a/src/version2/models/customFieldUpdatedContextOptionsList.ts b/src/version2/models/customFieldUpdatedContextOptionsList.ts deleted file mode 100644 index bb8a9ee46..000000000 --- a/src/version2/models/customFieldUpdatedContextOptionsList.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CustomFieldOptionUpdate } from './customFieldOptionUpdate.js'; - -/** A list of custom field options for a context. */ -export interface CustomFieldUpdatedContextOptionsList { - /** The updated custom field options. */ - options?: CustomFieldOptionUpdate[]; -} diff --git a/src/version2/models/customFieldValueUpdate.ts b/src/version2/models/customFieldValueUpdate.mts similarity index 100% rename from src/version2/models/customFieldValueUpdate.ts rename to src/version2/models/customFieldValueUpdate.mts diff --git a/src/version2/models/customFieldValueUpdateDetails.mts b/src/version2/models/customFieldValueUpdateDetails.mts new file mode 100644 index 000000000..2f7a27f5c --- /dev/null +++ b/src/version2/models/customFieldValueUpdateDetails.mts @@ -0,0 +1,7 @@ +import { CustomFieldValueUpdate } from './customFieldValueUpdate.mjs'; + +/** Details of updates for a custom field. */ +export interface CustomFieldValueUpdateDetails { + /** The list of custom field update details. */ + updates?: CustomFieldValueUpdate[]; +} diff --git a/src/version2/models/customFieldValueUpdateDetails.ts b/src/version2/models/customFieldValueUpdateDetails.ts deleted file mode 100644 index 33b488e8a..000000000 --- a/src/version2/models/customFieldValueUpdateDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CustomFieldValueUpdate } from './customFieldValueUpdate.js'; - -/** Details of updates for a custom field. */ -export interface CustomFieldValueUpdateDetails { - /** The list of custom field update details. */ - updates?: CustomFieldValueUpdate[]; -} diff --git a/src/version2/models/dashboard.mts b/src/version2/models/dashboard.mts new file mode 100644 index 000000000..dba892cac --- /dev/null +++ b/src/version2/models/dashboard.mts @@ -0,0 +1,32 @@ +import type { DashboardUser } from './dashboardUser.mjs'; +import type { SharePermission } from './sharePermission.mjs'; + +/** Details of a dashboard. */ +export interface Dashboard { + description?: string; + /** The ID of the dashboard. */ + id: string; + /** Whether the dashboard is selected as a favorite by the user. */ + isFavourite?: boolean; + /** The name of the dashboard. */ + name?: string; + owner?: DashboardUser; + /** The number of users who have this dashboard as a favorite. */ + popularity?: number; + /** The rank of this dashboard. */ + rank?: number; + /** The URL of these dashboard details. */ + self?: string; + /** The details of any view share permissions for the dashboard. */ + sharePermissions?: SharePermission[]; + /** The details of any edit share permissions for the dashboard. */ + editPermissions?: SharePermission[]; + /** The automatic refresh interval for the dashboard in milliseconds. */ + automaticRefreshMs?: number; + /** The URL of the dashboard. */ + view?: string; + /** Whether the current user has permission to edit the dashboard. */ + isWritable?: boolean; + /** Whether the current dashboard is system dashboard. */ + systemDashboard?: boolean; +} diff --git a/src/version2/models/dashboard.ts b/src/version2/models/dashboard.ts deleted file mode 100644 index 3edd66c1c..000000000 --- a/src/version2/models/dashboard.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { DashboardUser } from './dashboardUser.js'; -import type { SharePermission } from './sharePermission.js'; - -/** Details of a dashboard. */ -export interface Dashboard { - description?: string; - /** The ID of the dashboard. */ - id: string; - /** Whether the dashboard is selected as a favorite by the user. */ - isFavourite?: boolean; - /** The name of the dashboard. */ - name?: string; - owner?: DashboardUser; - /** The number of users who have this dashboard as a favorite. */ - popularity?: number; - /** The rank of this dashboard. */ - rank?: number; - /** The URL of these dashboard details. */ - self?: string; - /** The details of any view share permissions for the dashboard. */ - sharePermissions?: SharePermission[]; - /** The details of any edit share permissions for the dashboard. */ - editPermissions?: SharePermission[]; - /** The automatic refresh interval for the dashboard in milliseconds. */ - automaticRefreshMs?: number; - /** The URL of the dashboard. */ - view?: string; - /** Whether the current user has permission to edit the dashboard. */ - isWritable?: boolean; - /** Whether the current dashboard is system dashboard. */ - systemDashboard?: boolean; -} diff --git a/src/version2/models/dashboardDetails.mts b/src/version2/models/dashboardDetails.mts new file mode 100644 index 000000000..a164ef979 --- /dev/null +++ b/src/version2/models/dashboardDetails.mts @@ -0,0 +1,13 @@ +import type { SharePermission } from './sharePermission.mjs'; + +/** Details of a dashboard. */ +export interface DashboardDetails { + /** The description of the dashboard. */ + description?: string; + /** The edit permissions for the dashboard. */ + editPermissions: SharePermission[]; + /** The name of the dashboard. */ + name: string; + /** The share permissions for the dashboard. */ + sharePermissions: SharePermission[]; +} diff --git a/src/version2/models/dashboardDetails.ts b/src/version2/models/dashboardDetails.ts deleted file mode 100644 index 9ea8f6def..000000000 --- a/src/version2/models/dashboardDetails.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { SharePermission } from './sharePermission.js'; - -/** Details of a dashboard. */ -export interface DashboardDetails { - /** The description of the dashboard. */ - description?: string; - /** The edit permissions for the dashboard. */ - editPermissions: SharePermission[]; - /** The name of the dashboard. */ - name: string; - /** The share permissions for the dashboard. */ - sharePermissions: SharePermission[]; -} diff --git a/src/version2/models/dashboardGadget.mts b/src/version2/models/dashboardGadget.mts new file mode 100644 index 000000000..0c3011b65 --- /dev/null +++ b/src/version2/models/dashboardGadget.mts @@ -0,0 +1,16 @@ +import { DashboardGadgetPosition } from './dashboardGadgetPosition.mjs'; + +/** Details of a gadget. */ +export interface DashboardGadget { + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color: string; + /** The ID of the gadget instance. */ + id: number; + /** The module key of the gadget type. */ + moduleKey?: string; + position?: DashboardGadgetPosition; + /** The title of the gadget. */ + title: string; + /** The URI of the gadget type. */ + uri?: string; +} diff --git a/src/version2/models/dashboardGadget.ts b/src/version2/models/dashboardGadget.ts deleted file mode 100644 index 9607386cd..000000000 --- a/src/version2/models/dashboardGadget.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { DashboardGadgetPosition } from './dashboardGadgetPosition.js'; - -/** Details of a gadget. */ -export interface DashboardGadget { - /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ - color: string; - /** The ID of the gadget instance. */ - id: number; - /** The module key of the gadget type. */ - moduleKey?: string; - position?: DashboardGadgetPosition; - /** The title of the gadget. */ - title: string; - /** The URI of the gadget type. */ - uri?: string; -} diff --git a/src/version2/models/dashboardGadgetPosition.ts b/src/version2/models/dashboardGadgetPosition.mts similarity index 100% rename from src/version2/models/dashboardGadgetPosition.ts rename to src/version2/models/dashboardGadgetPosition.mts diff --git a/src/version2/models/dashboardGadgetResponse.mts b/src/version2/models/dashboardGadgetResponse.mts new file mode 100644 index 000000000..8d8d2c3bb --- /dev/null +++ b/src/version2/models/dashboardGadgetResponse.mts @@ -0,0 +1,7 @@ +import { DashboardGadget } from './dashboardGadget.mjs'; + +/** The list of gadgets on the dashboard. */ +export interface DashboardGadgetResponse { + /** The list of gadgets. */ + gadgets: DashboardGadget[]; +} diff --git a/src/version2/models/dashboardGadgetResponse.ts b/src/version2/models/dashboardGadgetResponse.ts deleted file mode 100644 index 252a1f1fe..000000000 --- a/src/version2/models/dashboardGadgetResponse.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { DashboardGadget } from './dashboardGadget.js'; - -/** The list of gadgets on the dashboard. */ -export interface DashboardGadgetResponse { - /** The list of gadgets. */ - gadgets: DashboardGadget[]; -} diff --git a/src/version2/models/dashboardGadgetSettings.mts b/src/version2/models/dashboardGadgetSettings.mts new file mode 100644 index 000000000..150af2f40 --- /dev/null +++ b/src/version2/models/dashboardGadgetSettings.mts @@ -0,0 +1,19 @@ +import { DashboardGadgetPosition } from './dashboardGadgetPosition.mjs'; + +/** Details of the settings for a dashboard gadget. */ +export interface DashboardGadgetSettings { + /** The module key of the gadget type. Can't be provided with `uri`. */ + moduleKey?: string; + /** The URI of the gadget type. Can't be provided with `moduleKey`. */ + uri?: string; + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color?: 'blue' | 'red' | 'yellow' | 'green' | 'cyan' | 'purple' | 'gray' | 'white' | string; + position?: DashboardGadgetPosition; + /** The title of the gadget. */ + title?: string; + /** + * Whether to ignore the validation of module key and URI. For example, when a gadget is created that is a part of an + * application that isn't installed. + */ + ignoreUriAndModuleKeyValidation?: boolean; +} diff --git a/src/version2/models/dashboardGadgetSettings.ts b/src/version2/models/dashboardGadgetSettings.ts deleted file mode 100644 index d584c7e52..000000000 --- a/src/version2/models/dashboardGadgetSettings.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { DashboardGadgetPosition } from './dashboardGadgetPosition.js'; - -/** Details of the settings for a dashboard gadget. */ -export interface DashboardGadgetSettings { - /** The module key of the gadget type. Can't be provided with `uri`. */ - moduleKey?: string; - /** The URI of the gadget type. Can't be provided with `moduleKey`. */ - uri?: string; - /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ - color?: 'blue' | 'red' | 'yellow' | 'green' | 'cyan' | 'purple' | 'gray' | 'white' | string; - position?: DashboardGadgetPosition; - /** The title of the gadget. */ - title?: string; - /** - * Whether to ignore the validation of module key and URI. For example, when a gadget is created that is a part of an - * application that isn't installed. - */ - ignoreUriAndModuleKeyValidation?: boolean; -} diff --git a/src/version2/models/dashboardGadgetUpdateRequest.mts b/src/version2/models/dashboardGadgetUpdateRequest.mts new file mode 100644 index 000000000..039e7421c --- /dev/null +++ b/src/version2/models/dashboardGadgetUpdateRequest.mts @@ -0,0 +1,10 @@ +import { DashboardGadgetPosition } from './dashboardGadgetPosition.mjs'; + +/** The details of the gadget to update. */ +export interface DashboardGadgetUpdateRequest { + /** The title of the gadget. */ + title?: string; + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color?: 'blue' | 'red' | 'yellow' | 'green' | 'cyan' | 'purple' | 'gray' | 'white' | string; + position?: DashboardGadgetPosition; +} diff --git a/src/version2/models/dashboardGadgetUpdateRequest.ts b/src/version2/models/dashboardGadgetUpdateRequest.ts deleted file mode 100644 index 9c42d3da4..000000000 --- a/src/version2/models/dashboardGadgetUpdateRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { DashboardGadgetPosition } from './dashboardGadgetPosition.js'; - -/** The details of the gadget to update. */ -export interface DashboardGadgetUpdateRequest { - /** The title of the gadget. */ - title?: string; - /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ - color?: 'blue' | 'red' | 'yellow' | 'green' | 'cyan' | 'purple' | 'gray' | 'white' | string; - position?: DashboardGadgetPosition; -} diff --git a/src/version2/models/dashboardUser.mts b/src/version2/models/dashboardUser.mts new file mode 100644 index 000000000..723c864d5 --- /dev/null +++ b/src/version2/models/dashboardUser.mts @@ -0,0 +1,16 @@ +import { UserAvatarUrls } from './userAvatarUrls.mjs'; + +export interface DashboardUser { + /** The URL of the user. */ + self?: string; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** Whether the user is active. */ + active?: boolean; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + avatarUrls?: UserAvatarUrls; +} diff --git a/src/version2/models/dashboardUser.ts b/src/version2/models/dashboardUser.ts deleted file mode 100644 index f7b13a414..000000000 --- a/src/version2/models/dashboardUser.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { UserAvatarUrls } from './userAvatarUrls.js'; - -export interface DashboardUser { - /** The URL of the user. */ - self?: string; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active?: boolean; - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - avatarUrls?: UserAvatarUrls; -} diff --git a/src/version2/models/dateRangeFilter.ts b/src/version2/models/dateRangeFilter.mts similarity index 100% rename from src/version2/models/dateRangeFilter.ts rename to src/version2/models/dateRangeFilter.mts diff --git a/src/version2/models/defaultLevelValue.ts b/src/version2/models/defaultLevelValue.mts similarity index 100% rename from src/version2/models/defaultLevelValue.ts rename to src/version2/models/defaultLevelValue.mts diff --git a/src/version2/models/defaultShareScope.ts b/src/version2/models/defaultShareScope.mts similarity index 100% rename from src/version2/models/defaultShareScope.ts rename to src/version2/models/defaultShareScope.mts diff --git a/src/version2/models/defaultWorkflow.ts b/src/version2/models/defaultWorkflow.mts similarity index 100% rename from src/version2/models/defaultWorkflow.ts rename to src/version2/models/defaultWorkflow.mts diff --git a/src/version2/models/documentVersion.ts b/src/version2/models/documentVersion.mts similarity index 100% rename from src/version2/models/documentVersion.ts rename to src/version2/models/documentVersion.mts diff --git a/src/version2/models/entityProperty.ts b/src/version2/models/entityProperty.mts similarity index 100% rename from src/version2/models/entityProperty.ts rename to src/version2/models/entityProperty.mts diff --git a/src/version2/models/entityPropertyDetails.ts b/src/version2/models/entityPropertyDetails.mts similarity index 100% rename from src/version2/models/entityPropertyDetails.ts rename to src/version2/models/entityPropertyDetails.mts diff --git a/src/version2/models/error.ts b/src/version2/models/error.mts similarity index 100% rename from src/version2/models/error.ts rename to src/version2/models/error.mts diff --git a/src/version2/models/errorCollection.ts b/src/version2/models/errorCollection.mts similarity index 100% rename from src/version2/models/errorCollection.ts rename to src/version2/models/errorCollection.mts diff --git a/src/version2/models/errors.mts b/src/version2/models/errors.mts new file mode 100644 index 000000000..f18557824 --- /dev/null +++ b/src/version2/models/errors.mts @@ -0,0 +1,8 @@ +import { Error } from './error.mjs'; + +export interface Errors { + issueIsSubtask?: Error; + issuesInArchivedProjects?: Error; + issuesInUnlicensedProjects?: Error; + issuesNotFound?: Error; +} diff --git a/src/version2/models/errors.ts b/src/version2/models/errors.ts deleted file mode 100644 index 3cf939417..000000000 --- a/src/version2/models/errors.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Error } from './error.js'; - -export interface Errors { - issueIsSubtask?: Error; - issuesInArchivedProjects?: Error; - issuesInUnlicensedProjects?: Error; - issuesNotFound?: Error; -} diff --git a/src/version2/models/eventNotification.mts b/src/version2/models/eventNotification.mts new file mode 100644 index 000000000..86b1a018d --- /dev/null +++ b/src/version2/models/eventNotification.mts @@ -0,0 +1,39 @@ +import { FieldDetails } from './fieldDetails.mjs'; +import type { GroupName } from './groupName.mjs'; +import type { ProjectRole } from './projectRole.mjs'; +import { UserDetails } from './userDetails.mjs'; + +/** Details about a notification associated with an event. */ +export interface EventNotification { + /** The email address. */ + emailAddress?: string; + /** Expand options that include additional event notification details in the response. */ + expand?: string; + field?: FieldDetails; + group?: GroupName; + /** The ID of the notification. */ + id?: number; + /** Identifies the recipients of the notification. */ + notificationType?: string; + /** + * As a group's name can change, use of `recipient` is recommended. The identifier associated with the + * `notificationType` value that defines the receiver of the notification, where the receiver isn't implied by + * `notificationType` value. So, when `notificationType` is: + * + * `User` The `parameter` is the user account ID. `Group` The `parameter` is the group name. `ProjectRole` The + * `parameter` is the project role ID. `UserCustomField` The `parameter` is the ID of the custom field. + * `GroupCustomField` The `parameter` is the ID of the custom field. + */ + parameter?: string; + projectRole?: ProjectRole; + /** + * The identifier associated with the `notificationType` value that defines the receiver of the notification, where + * the receiver isn't implied by the `notificationType` value. So, when `notificationType` is: + * + * `User`, `recipient` is the user account ID. `Group`, `recipient` is the group ID. `ProjectRole`, `recipient` is the + * project role ID. `UserCustomField`, `recipient` is the ID of the custom field. `GroupCustomField`, `recipient` is + * the ID of the custom field. + */ + recipient?: string; + user?: UserDetails; +} diff --git a/src/version2/models/eventNotification.ts b/src/version2/models/eventNotification.ts deleted file mode 100644 index 5b2450ede..000000000 --- a/src/version2/models/eventNotification.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { FieldDetails } from './fieldDetails.js'; -import type { GroupName } from './groupName.js'; -import type { ProjectRole } from './projectRole.js'; -import type { UserDetails } from './userDetails.js'; - -/** Details about a notification associated with an event. */ -export interface EventNotification { - /** The email address. */ - emailAddress?: string; - /** Expand options that include additional event notification details in the response. */ - expand?: string; - field?: FieldDetails; - group?: GroupName; - /** The ID of the notification. */ - id?: number; - /** Identifies the recipients of the notification. */ - notificationType?: string; - /** - * As a group's name can change, use of `recipient` is recommended. The identifier associated with the - * `notificationType` value that defines the receiver of the notification, where the receiver isn't implied by - * `notificationType` value. So, when `notificationType` is: - * - * `User` The `parameter` is the user account ID. `Group` The `parameter` is the group name. `ProjectRole` The - * `parameter` is the project role ID. `UserCustomField` The `parameter` is the ID of the custom field. - * `GroupCustomField` The `parameter` is the ID of the custom field. - */ - parameter?: string; - projectRole?: ProjectRole; - /** - * The identifier associated with the `notificationType` value that defines the receiver of the notification, where - * the receiver isn't implied by the `notificationType` value. So, when `notificationType` is: - * - * `User`, `recipient` is the user account ID. `Group`, `recipient` is the group ID. `ProjectRole`, `recipient` is the - * project role ID. `UserCustomField`, `recipient` is the ID of the custom field. `GroupCustomField`, `recipient` is - * the ID of the custom field. - */ - recipient?: string; - user?: UserDetails; -} diff --git a/src/version2/models/exportArchivedIssuesTaskProgress.ts b/src/version2/models/exportArchivedIssuesTaskProgress.mts similarity index 100% rename from src/version2/models/exportArchivedIssuesTaskProgress.ts rename to src/version2/models/exportArchivedIssuesTaskProgress.mts diff --git a/src/version2/models/failedWebhook.ts b/src/version2/models/failedWebhook.mts similarity index 100% rename from src/version2/models/failedWebhook.ts rename to src/version2/models/failedWebhook.mts diff --git a/src/version2/models/failedWebhooks.mts b/src/version2/models/failedWebhooks.mts new file mode 100644 index 000000000..5e1534c80 --- /dev/null +++ b/src/version2/models/failedWebhooks.mts @@ -0,0 +1,18 @@ +import { FailedWebhook } from './failedWebhook.mjs'; + +/** A page of failed webhooks. */ +export interface FailedWebhooks { + /** + * The maximum number of items on the page. If the list of values is shorter than this number, then there are no more + * pages. + */ + maxResults: number; + /** + * The URL to the next page of results. Present only if the request returned at least one result.The next page may be + * empty at the time of receiving the response, but new failed webhooks may appear in time. You can save the URL to + * the next page and query for new results periodically (for example, every hour). + */ + next?: string; + /** The list of webhooks. */ + values: FailedWebhook[]; +} diff --git a/src/version2/models/failedWebhooks.ts b/src/version2/models/failedWebhooks.ts deleted file mode 100644 index cfe1b26c9..000000000 --- a/src/version2/models/failedWebhooks.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { FailedWebhook } from './failedWebhook.js'; - -/** A page of failed webhooks. */ -export interface FailedWebhooks { - /** - * The maximum number of items on the page. If the list of values is shorter than this number, then there are no more - * pages. - */ - maxResults: number; - /** - * The URL to the next page of results. Present only if the request returned at least one result.The next page may be - * empty at the time of receiving the response, but new failed webhooks may appear in time. You can save the URL to - * the next page and query for new results periodically (for example, every hour). - */ - next?: string; - /** The list of webhooks. */ - values: FailedWebhook[]; -} diff --git a/src/version2/models/field.mts b/src/version2/models/field.mts new file mode 100644 index 000000000..3d3b62cc5 --- /dev/null +++ b/src/version2/models/field.mts @@ -0,0 +1,28 @@ +import { FieldLastUsed } from './fieldLastUsed.mjs'; +import { JsonType } from './jsonType.mjs'; + +/** Details of a field. */ +export interface Field { + /** Number of contexts where the field is used. */ + contextsCount?: number; + /** The description of the field. */ + description?: string; + /** The ID of the field. */ + id: string; + /** Whether the field is locked. */ + isLocked?: boolean; + /** Whether the field is shown on screen or not. */ + isUnscreenable?: boolean; + /** The key of the field. */ + key?: string; + lastUsed?: FieldLastUsed; + /** The name of the field. */ + name: string; + /** Number of projects where the field is used. */ + projectsCount?: number; + schema: JsonType; + /** Number of screens where the field is used. */ + screensCount?: number; + /** The searcher key of the field. Returned for custom fields. */ + searcherKey?: string; +} diff --git a/src/version2/models/field.ts b/src/version2/models/field.ts deleted file mode 100644 index c99b9795b..000000000 --- a/src/version2/models/field.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { FieldLastUsed } from './fieldLastUsed.js'; -import type { JsonType } from './jsonType.js'; - -/** Details of a field. */ -export interface Field { - /** Number of contexts where the field is used. */ - contextsCount?: number; - /** The description of the field. */ - description?: string; - /** The ID of the field. */ - id: string; - /** Whether the field is locked. */ - isLocked?: boolean; - /** Whether the field is shown on screen or not. */ - isUnscreenable?: boolean; - /** The key of the field. */ - key?: string; - lastUsed?: FieldLastUsed; - /** The name of the field. */ - name: string; - /** Number of projects where the field is used. */ - projectsCount?: number; - schema: JsonType; - /** Number of screens where the field is used. */ - screensCount?: number; - /** The searcher key of the field. Returned for custom fields. */ - searcherKey?: string; -} diff --git a/src/version2/models/fieldConfiguration.ts b/src/version2/models/fieldConfiguration.mts similarity index 100% rename from src/version2/models/fieldConfiguration.ts rename to src/version2/models/fieldConfiguration.mts diff --git a/src/version2/models/fieldConfigurationDetails.ts b/src/version2/models/fieldConfigurationDetails.mts similarity index 100% rename from src/version2/models/fieldConfigurationDetails.ts rename to src/version2/models/fieldConfigurationDetails.mts diff --git a/src/version2/models/fieldConfigurationIssueTypeItem.ts b/src/version2/models/fieldConfigurationIssueTypeItem.mts similarity index 100% rename from src/version2/models/fieldConfigurationIssueTypeItem.ts rename to src/version2/models/fieldConfigurationIssueTypeItem.mts diff --git a/src/version2/models/fieldConfigurationItem.ts b/src/version2/models/fieldConfigurationItem.mts similarity index 100% rename from src/version2/models/fieldConfigurationItem.ts rename to src/version2/models/fieldConfigurationItem.mts diff --git a/src/version2/models/fieldConfigurationItemsDetails.mts b/src/version2/models/fieldConfigurationItemsDetails.mts new file mode 100644 index 000000000..05d214a2c --- /dev/null +++ b/src/version2/models/fieldConfigurationItemsDetails.mts @@ -0,0 +1,7 @@ +import { FieldConfigurationItem } from './fieldConfigurationItem.mjs'; + +/** Details of field configuration items. */ +export interface FieldConfigurationItemsDetails { + /** Details of fields in a field configuration. */ + fieldConfigurationItems: FieldConfigurationItem[]; +} diff --git a/src/version2/models/fieldConfigurationItemsDetails.ts b/src/version2/models/fieldConfigurationItemsDetails.ts deleted file mode 100644 index 65b1078fe..000000000 --- a/src/version2/models/fieldConfigurationItemsDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { FieldConfigurationItem } from './fieldConfigurationItem.js'; - -/** Details of field configuration items. */ -export interface FieldConfigurationItemsDetails { - /** Details of fields in a field configuration. */ - fieldConfigurationItems: FieldConfigurationItem[]; -} diff --git a/src/version2/models/fieldConfigurationScheme.ts b/src/version2/models/fieldConfigurationScheme.mts similarity index 100% rename from src/version2/models/fieldConfigurationScheme.ts rename to src/version2/models/fieldConfigurationScheme.mts diff --git a/src/version2/models/fieldConfigurationSchemeProjectAssociation.ts b/src/version2/models/fieldConfigurationSchemeProjectAssociation.mts similarity index 100% rename from src/version2/models/fieldConfigurationSchemeProjectAssociation.ts rename to src/version2/models/fieldConfigurationSchemeProjectAssociation.mts diff --git a/src/version2/models/fieldConfigurationSchemeProjects.mts b/src/version2/models/fieldConfigurationSchemeProjects.mts new file mode 100644 index 000000000..18d456c99 --- /dev/null +++ b/src/version2/models/fieldConfigurationSchemeProjects.mts @@ -0,0 +1,8 @@ +import { FieldConfigurationScheme } from './fieldConfigurationScheme.mjs'; + +/** Project list with assigned field configuration schema. */ +export interface FieldConfigurationSchemeProjects { + fieldConfigurationScheme?: FieldConfigurationScheme; + /** The IDs of projects using the field configuration scheme. */ + projectIds: string[]; +} diff --git a/src/version2/models/fieldConfigurationSchemeProjects.ts b/src/version2/models/fieldConfigurationSchemeProjects.ts deleted file mode 100644 index addca085b..000000000 --- a/src/version2/models/fieldConfigurationSchemeProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { FieldConfigurationScheme } from './fieldConfigurationScheme.js'; - -/** Project list with assigned field configuration schema. */ -export interface FieldConfigurationSchemeProjects { - fieldConfigurationScheme?: FieldConfigurationScheme; - /** The IDs of projects using the field configuration scheme. */ - projectIds: string[]; -} diff --git a/src/version2/models/fieldConfigurationToIssueTypeMapping.ts b/src/version2/models/fieldConfigurationToIssueTypeMapping.mts similarity index 100% rename from src/version2/models/fieldConfigurationToIssueTypeMapping.ts rename to src/version2/models/fieldConfigurationToIssueTypeMapping.mts diff --git a/src/version2/models/fieldDetails.mts b/src/version2/models/fieldDetails.mts new file mode 100644 index 000000000..7912ffb3b --- /dev/null +++ b/src/version2/models/fieldDetails.mts @@ -0,0 +1,27 @@ +import { JsonType } from './jsonType.mjs'; +import type { Scope } from './scope.mjs'; + +/** Details about a field. */ +export interface FieldDetails { + /** + * The names that can be used to reference the field in an advanced search. For more information, see [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ). + */ + clauseNames?: string[]; + /** Whether the field is a custom field. */ + custom?: boolean; + /** The ID of the field. */ + id?: string; + /** The key of the field. */ + key?: string; + /** The name of the field. */ + name?: string; + /** Whether the field can be used as a column on the issue navigator. */ + navigable?: boolean; + /** Whether the content of the field can be used to order lists. */ + orderable?: boolean; + schema?: JsonType; + scope?: Scope; + /** Whether the content of the field can be searched. */ + searchable?: boolean; +} diff --git a/src/version2/models/fieldDetails.ts b/src/version2/models/fieldDetails.ts deleted file mode 100644 index eff6edae9..000000000 --- a/src/version2/models/fieldDetails.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { JsonType } from './jsonType.js'; -import type { Scope } from './scope.js'; - -/** Details about a field. */ -export interface FieldDetails { - /** - * The names that can be used to reference the field in an advanced search. For more information, see [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ). - */ - clauseNames?: string[]; - /** Whether the field is a custom field. */ - custom?: boolean; - /** The ID of the field. */ - id?: string; - /** The key of the field. */ - key?: string; - /** The name of the field. */ - name?: string; - /** Whether the field can be used as a column on the issue navigator. */ - navigable?: boolean; - /** Whether the content of the field can be used to order lists. */ - orderable?: boolean; - schema?: JsonType; - scope?: Scope; - /** Whether the content of the field can be searched. */ - searchable?: boolean; -} diff --git a/src/version2/models/fieldLastUsed.ts b/src/version2/models/fieldLastUsed.mts similarity index 100% rename from src/version2/models/fieldLastUsed.ts rename to src/version2/models/fieldLastUsed.mts diff --git a/src/version2/models/fieldMetadata.mts b/src/version2/models/fieldMetadata.mts new file mode 100644 index 000000000..504c59864 --- /dev/null +++ b/src/version2/models/fieldMetadata.mts @@ -0,0 +1,24 @@ +import { JsonType } from './jsonType.mjs'; + +/** The metadata describing an issue field. */ +export interface FieldMetadata { + /** The list of values allowed in the field. */ + allowedValues?: any[]; + /** The URL that can be used to automatically complete the field. */ + autoCompleteUrl?: string; + /** The configuration properties. */ + configuration?: any; + /** The default value of the field. */ + defaultValue?: any; + /** Whether the field has a default value. */ + hasDefaultValue?: boolean; + /** The key of the field. */ + key: string; + /** The name of the field. */ + name: string; + /** The list of operations that can be performed on the field. */ + operations: string[]; + /** Whether the field is required. */ + required: boolean; + schema?: JsonType; +} diff --git a/src/version2/models/fieldMetadata.ts b/src/version2/models/fieldMetadata.ts deleted file mode 100644 index 053fb0e7c..000000000 --- a/src/version2/models/fieldMetadata.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { JsonType } from './jsonType.js'; - -/** The metadata describing an issue field. */ -export interface FieldMetadata { - /** The list of values allowed in the field. */ - allowedValues?: any[]; - /** The URL that can be used to automatically complete the field. */ - autoCompleteUrl?: string; - /** The configuration properties. */ - configuration?: any; - /** The default value of the field. */ - defaultValue?: any; - /** Whether the field has a default value. */ - hasDefaultValue?: boolean; - /** The key of the field. */ - key: string; - /** The name of the field. */ - name: string; - /** The list of operations that can be performed on the field. */ - operations: string[]; - /** Whether the field is required. */ - required: boolean; - schema?: JsonType; -} diff --git a/src/version2/models/fieldReferenceData.ts b/src/version2/models/fieldReferenceData.mts similarity index 100% rename from src/version2/models/fieldReferenceData.ts rename to src/version2/models/fieldReferenceData.mts diff --git a/src/version2/models/fields.mts b/src/version2/models/fields.mts new file mode 100644 index 000000000..d5610aa0a --- /dev/null +++ b/src/version2/models/fields.mts @@ -0,0 +1,98 @@ +import type { Attachment } from './attachment.mjs'; +import type { Comment } from './comment.mjs'; +import type { FixVersion } from './fixVersion.mjs'; +import type { Issue } from './issue.mjs'; +import type { IssueLink } from './issueLink.mjs'; +import type { IssueTypeDetails } from './issueTypeDetails.mjs'; +import type { Priority } from './priority.mjs'; +import type { ProjectComponent } from './projectComponent.mjs'; +import type { Resolution } from './resolution.mjs'; +import type { RichText } from './richText.mjs'; +import type { StatusDetails } from './statusDetails.mjs'; +import type { TimeTrackingDetails } from './timeTrackingDetails.mjs'; +import { User } from './user.mjs'; +import { UserDetails } from './userDetails.mjs'; +import type { Votes } from './votes.mjs'; +import type { Watchers } from './watchers.mjs'; +import type { Worklog } from './worklog.mjs'; + +/** Key fields from the linked issue. */ +export interface Fields { + /** The estimate of how much longer working on the issue will take, in seconds. */ + aggregatetimespent: number | null; + /** The assignee of the linked issue. */ + assignee: UserDetails; + /** The list of issue attachments. */ + attachment: Attachment[]; + /** The list of issue comment. */ + comment: { + /** The list of issue comment. */ + comments: Comment[]; + self: string; + maxResults: number; + total: number; + startAt: number; + }; + /** The list of project components the issue belongs to. */ + components: ProjectComponent[]; + /** The creation time of the issue. */ + created: string; + /** The user who created the issue */ + creator: User; + /** The issue description. */ + description?: string; + /** The time the issue is due. */ + duedate: string | null; + /** The value of the environment field. */ + environment: RichText | null; + /** The list of versions where the issue was fixed. */ + fixVersions: FixVersion[]; + /** The list of issue links. */ + issuelinks: IssueLink[]; + issuerestriction?: { + issuerestrictions: any; + shouldDisplay: boolean; + }; + /** The type of the linked issue. */ + issuetype: IssueTypeDetails; + /** The list of labels associated with the issue. */ + labels: string[]; + lastViewed: string | null; + /** The issue parent. */ + parent?: Issue; + /** The priority of the linked issue. */ + priority: Priority; + /** The reporter of the issue. */ + reporter: User; + /** The resolution of the issue. */ + resolution: Resolution | null; + /** The time the issue was resolved at. */ + resolutiondate: string | null; + /** The status of the linked issue. */ + status: StatusDetails; + statuscategorychangedate?: string; + /** The list of subtasks. */ + subtasks: Issue[]; + /** The summary description of the linked issue. */ + summary: string; + timeoriginalestimate?: any; + /** The time that was spent working on the issue, in seconds. */ + timespent: number | null; + /** The time tracking of the linked issue. */ + timetracking: TimeTrackingDetails; + /** The time when the issue was last updated at. */ + updated: string; + /** The number of voters of the issue. Returns an error if voting is disabled. */ + votes: Votes & { voters: never }; + /** The number of watchers of the issue. Returns an error if watching is disabled. */ + watches: Watchers; + worklog: { + startAt: number; + maxResults: number; + total: number; + worklogs: Worklog[]; + }; + workratio: number; + + [key: string]: any; +} diff --git a/src/version2/models/fields.ts b/src/version2/models/fields.ts deleted file mode 100644 index 4f9f9ab9f..000000000 --- a/src/version2/models/fields.ts +++ /dev/null @@ -1,98 +0,0 @@ -import type { Attachment } from './attachment.js'; -import type { Comment } from './comment.js'; -import type { FixVersion } from './fixVersion.js'; -import type { Issue } from './issue.js'; -import type { IssueLink } from './issueLink.js'; -import type { IssueTypeDetails } from './issueTypeDetails.js'; -import type { Priority } from './priority.js'; -import type { ProjectComponent } from './projectComponent.js'; -import type { Resolution } from './resolution.js'; -import type { RichText } from './richText.js'; -import type { StatusDetails } from './statusDetails.js'; -import type { TimeTrackingDetails } from './timeTrackingDetails.js'; -import type { User } from './user.js'; -import type { UserDetails } from './userDetails.js'; -import type { Votes } from './votes.js'; -import type { Watchers } from './watchers.js'; -import type { Worklog } from './worklog.js'; - -/** Key fields from the linked issue. */ -export interface Fields { - /** The estimate of how much longer working on the issue will take, in seconds. */ - aggregatetimespent: number | null; - /** The assignee of the linked issue. */ - assignee: UserDetails; - /** The list of issue attachments. */ - attachment: Attachment[]; - /** The list of issue comment. */ - comment: { - /** The list of issue comment. */ - comments: Comment[]; - self: string; - maxResults: number; - total: number; - startAt: number; - }; - /** The list of project components the issue belongs to. */ - components: ProjectComponent[]; - /** The creation time of the issue. */ - created: string; - /** The user who created the issue */ - creator: User; - /** The issue description. */ - description?: string; - /** The time the issue is due. */ - duedate: string | null; - /** The value of the environment field. */ - environment: RichText | null; - /** The list of versions where the issue was fixed. */ - fixVersions: FixVersion[]; - /** The list of issue links. */ - issuelinks: IssueLink[]; - issuerestriction?: { - issuerestrictions: any; - shouldDisplay: boolean; - }; - /** The type of the linked issue. */ - issuetype: IssueTypeDetails; - /** The list of labels associated with the issue. */ - labels: string[]; - lastViewed: string | null; - /** The issue parent. */ - parent?: Issue; - /** The priority of the linked issue. */ - priority: Priority; - /** The reporter of the issue. */ - reporter: User; - /** The resolution of the issue. */ - resolution: Resolution | null; - /** The time the issue was resolved at. */ - resolutiondate: string | null; - /** The status of the linked issue. */ - status: StatusDetails; - statuscategorychangedate?: string; - /** The list of subtasks. */ - subtasks: Issue[]; - /** The summary description of the linked issue. */ - summary: string; - timeoriginalestimate?: any; - /** The time that was spent working on the issue, in seconds. */ - timespent: number | null; - /** The time tracking of the linked issue. */ - timetracking: TimeTrackingDetails; - /** The time when the issue was last updated at. */ - updated: string; - /** The number of voters of the issue. Returns an error if voting is disabled. */ - votes: Votes & { voters: never }; - /** The number of watchers of the issue. Returns an error if watching is disabled. */ - watches: Watchers; - worklog: { - startAt: number; - maxResults: number; - total: number; - worklogs: Worklog[]; - }; - workratio: number; - - [key: string]: any; -} diff --git a/src/version2/models/filter.mts b/src/version2/models/filter.mts new file mode 100644 index 000000000..031350231 --- /dev/null +++ b/src/version2/models/filter.mts @@ -0,0 +1,40 @@ +import { FilterSubscriptionsList } from './filterSubscriptionsList.mjs'; +import type { SharePermission } from './sharePermission.mjs'; +import { User } from './user.mjs'; +import { UserList } from './userList.mjs'; + +/** Details about a filter. */ +export interface Filter { + /** A description of the filter. */ + description?: string; + /** The groups and projects that can edit the filter. */ + editPermissions?: SharePermission[]; + /** Whether the filter is selected as a favorite. */ + favourite?: boolean; + /** The count of how many users have selected this filter as a favorite, including the filter owner. */ + favouritedCount?: number; + /** The unique identifier for the filter. */ + id?: string; + /** The Jql query for the filter. For example, _project = SSP AND issuetype = Bug_. */ + jql?: string; + /** The name of the filter. Must be unique. */ + name: string; + owner?: User; + /** + * A URL to view the filter results in Jira, using the [Search for issues using + * Jql](#api-rest-api-2-filter-search-get) operation with the filter's Jql string to return the filter results. For + * example, _https://your-domain.atlassian.net/rest/api/2/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. + */ + searchUrl?: string; + /** The URL of the filter. */ + self?: string; + /** The groups and projects that the filter is shared with. */ + sharePermissions?: SharePermission[]; + sharedUsers?: UserList; + subscriptions?: FilterSubscriptionsList; + /** + * A URL to view the filter results in Jira, using the ID of the filter. For example, + * _https://your-domain.atlassian.net/issues/?filter=10100_. + */ + viewUrl?: string; +} diff --git a/src/version2/models/filter.ts b/src/version2/models/filter.ts deleted file mode 100644 index cc4499fc3..000000000 --- a/src/version2/models/filter.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { FilterSubscriptionsList } from './filterSubscriptionsList.js'; -import type { SharePermission } from './sharePermission.js'; -import type { User } from './user.js'; -import type { UserList } from './userList.js'; - -/** Details about a filter. */ -export interface Filter { - /** A description of the filter. */ - description?: string; - /** The groups and projects that can edit the filter. */ - editPermissions?: SharePermission[]; - /** Whether the filter is selected as a favorite. */ - favourite?: boolean; - /** The count of how many users have selected this filter as a favorite, including the filter owner. */ - favouritedCount?: number; - /** The unique identifier for the filter. */ - id?: string; - /** The JQL query for the filter. For example, _project = SSP AND issuetype = Bug_. */ - jql?: string; - /** The name of the filter. Must be unique. */ - name: string; - owner?: User; - /** - * A URL to view the filter results in Jira, using the [Search for issues using - * JQL](#api-rest-api-2-filter-search-get) operation with the filter's JQL string to return the filter results. For - * example, _https://your-domain.atlassian.net/rest/api/2/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. - */ - searchUrl?: string; - /** The URL of the filter. */ - self?: string; - /** The groups and projects that the filter is shared with. */ - sharePermissions?: SharePermission[]; - sharedUsers?: UserList; - subscriptions?: FilterSubscriptionsList; - /** - * A URL to view the filter results in Jira, using the ID of the filter. For example, - * _https://your-domain.atlassian.net/issues/?filter=10100_. - */ - viewUrl?: string; -} diff --git a/src/version2/models/filterDetails.mts b/src/version2/models/filterDetails.mts new file mode 100644 index 000000000..a95ec545e --- /dev/null +++ b/src/version2/models/filterDetails.mts @@ -0,0 +1,47 @@ +import { FilterSubscription } from './filterSubscription.mjs'; +import type { SharePermission } from './sharePermission.mjs'; +import { User } from './user.mjs'; + +/** Details of a filter. */ +export interface FilterDetails { + /** The description of the filter. */ + description?: string; + /** + * The groups and projects that can edit the filter. This can be specified when updating a filter, but not when + * creating a filter. + */ + editPermissions?: SharePermission[]; + /** Expand options that include additional filter details in the response. */ + expand?: string; + /** Whether the filter is selected as a favorite by any users, not including the filter owner. */ + favourite?: boolean; + /** The count of how many users have selected this filter as a favorite, including the filter owner. */ + favouritedCount?: number; + /** The unique identifier for the filter. */ + id?: string; + /** The Jql query for the filter. For example, _project = SSP AND issuetype = Bug_. */ + jql?: string; + /** The name of the filter. */ + name: string; + owner?: User; + /** + * A URL to view the filter results in Jira, using the [Search for issues using + * Jql](#api-rest-api-2-filter-search-get) operation with the filter's Jql string to return the filter results. For + * example, _https://your-domain.atlassian.net/rest/api/2/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. + */ + searchUrl?: string; + /** The URL of the filter. */ + self?: string; + /** + * The groups and projects that the filter is shared with. This can be specified when updating a filter, but not when + * creating a filter. + */ + sharePermissions?: SharePermission[]; + /** The users that are subscribed to the filter. */ + subscriptions?: FilterSubscription[]; + /** + * A URL to view the filter results in Jira, using the ID of the filter. For example, + * _https://your-domain.atlassian.net/issues/?filter=10100_. + */ + viewUrl?: string; +} diff --git a/src/version2/models/filterDetails.ts b/src/version2/models/filterDetails.ts deleted file mode 100644 index a3de35389..000000000 --- a/src/version2/models/filterDetails.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { FilterSubscription } from './filterSubscription.js'; -import type { SharePermission } from './sharePermission.js'; -import type { User } from './user.js'; - -/** Details of a filter. */ -export interface FilterDetails { - /** The description of the filter. */ - description?: string; - /** - * The groups and projects that can edit the filter. This can be specified when updating a filter, but not when - * creating a filter. - */ - editPermissions?: SharePermission[]; - /** Expand options that include additional filter details in the response. */ - expand?: string; - /** Whether the filter is selected as a favorite by any users, not including the filter owner. */ - favourite?: boolean; - /** The count of how many users have selected this filter as a favorite, including the filter owner. */ - favouritedCount?: number; - /** The unique identifier for the filter. */ - id?: string; - /** The JQL query for the filter. For example, _project = SSP AND issuetype = Bug_. */ - jql?: string; - /** The name of the filter. */ - name: string; - owner?: User; - /** - * A URL to view the filter results in Jira, using the [Search for issues using - * JQL](#api-rest-api-2-filter-search-get) operation with the filter's JQL string to return the filter results. For - * example, _https://your-domain.atlassian.net/rest/api/2/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. - */ - searchUrl?: string; - /** The URL of the filter. */ - self?: string; - /** - * The groups and projects that the filter is shared with. This can be specified when updating a filter, but not when - * creating a filter. - */ - sharePermissions?: SharePermission[]; - /** The users that are subscribed to the filter. */ - subscriptions?: FilterSubscription[]; - /** - * A URL to view the filter results in Jira, using the ID of the filter. For example, - * _https://your-domain.atlassian.net/issues/?filter=10100_. - */ - viewUrl?: string; -} diff --git a/src/version2/models/filterSubscription.mts b/src/version2/models/filterSubscription.mts new file mode 100644 index 000000000..70f66af1c --- /dev/null +++ b/src/version2/models/filterSubscription.mts @@ -0,0 +1,10 @@ +import type { GroupName } from './groupName.mjs'; +import { User } from './user.mjs'; + +/** Details of a user or group subscribing to a filter. */ +export interface FilterSubscription { + group?: GroupName; + /** The ID of the filter subscription. */ + id?: number; + user?: User; +} diff --git a/src/version2/models/filterSubscription.ts b/src/version2/models/filterSubscription.ts deleted file mode 100644 index 029f256c9..000000000 --- a/src/version2/models/filterSubscription.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { GroupName } from './groupName.js'; -import type { User } from './user.js'; - -/** Details of a user or group subscribing to a filter. */ -export interface FilterSubscription { - group?: GroupName; - /** The ID of the filter subscription. */ - id?: number; - user?: User; -} diff --git a/src/version2/models/filterSubscriptionsList.mts b/src/version2/models/filterSubscriptionsList.mts new file mode 100644 index 000000000..1fb028164 --- /dev/null +++ b/src/version2/models/filterSubscriptionsList.mts @@ -0,0 +1,15 @@ +import { FilterSubscription } from './filterSubscription.mjs'; + +/** A paginated list of subscriptions to a filter. */ +export interface FilterSubscriptionsList { + /** The index of the last item returned on the page. */ + 'end-index'?: number; + /** The list of items. */ + items?: FilterSubscription[]; + /** The maximum number of results that could be on the page. */ + 'max-results'?: number; + /** The number of items on the page. */ + size?: number; + /** The index of the first item returned on the page. */ + 'start-index'?: number; +} diff --git a/src/version2/models/filterSubscriptionsList.ts b/src/version2/models/filterSubscriptionsList.ts deleted file mode 100644 index 246bb4d17..000000000 --- a/src/version2/models/filterSubscriptionsList.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { FilterSubscription } from './filterSubscription.js'; - -/** A paginated list of subscriptions to a filter. */ -export interface FilterSubscriptionsList { - /** The index of the last item returned on the page. */ - 'end-index'?: number; - /** The list of items. */ - items?: FilterSubscription[]; - /** The maximum number of results that could be on the page. */ - 'max-results'?: number; - /** The number of items on the page. */ - size?: number; - /** The index of the first item returned on the page. */ - 'start-index'?: number; -} diff --git a/src/version2/models/fixVersion.ts b/src/version2/models/fixVersion.mts similarity index 100% rename from src/version2/models/fixVersion.ts rename to src/version2/models/fixVersion.mts diff --git a/src/version2/models/foundGroup.mts b/src/version2/models/foundGroup.mts new file mode 100644 index 000000000..43219af1c --- /dev/null +++ b/src/version2/models/foundGroup.mts @@ -0,0 +1,15 @@ +import { GroupLabel } from './groupLabel.mjs'; + +/** A group found in a search. */ +export interface FoundGroup { + /** + * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, + * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. + */ + groupId?: string; + /** The group name with the matched query string highlighted with the HTML bold tag. */ + html?: string; + labels?: GroupLabel[]; + /** The name of the group. The name of a group is mutable, to reliably identify a group use ``groupId`.` */ + name?: string; +} diff --git a/src/version2/models/foundGroup.ts b/src/version2/models/foundGroup.ts deleted file mode 100644 index f015d4ce7..000000000 --- a/src/version2/models/foundGroup.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { GroupLabel } from './groupLabel.js'; - -/** A group found in a search. */ -export interface FoundGroup { - /** - * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, - * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. - */ - groupId?: string; - /** The group name with the matched query string highlighted with the HTML bold tag. */ - html?: string; - labels?: GroupLabel[]; - /** The name of the group. The name of a group is mutable, to reliably identify a group use ``groupId`.` */ - name?: string; -} diff --git a/src/version2/models/foundGroups.mts b/src/version2/models/foundGroups.mts new file mode 100644 index 000000000..c06940ca6 --- /dev/null +++ b/src/version2/models/foundGroups.mts @@ -0,0 +1,13 @@ +import { FoundGroup } from './foundGroup.mjs'; + +/** + * The list of groups found in a search, including header text (Showing X of Y matching groups) and total of matched + * groups. + */ +export interface FoundGroups { + groups?: FoundGroup[]; + /** Header text indicating the number of groups in the response and the total number of groups found in the search. */ + header?: string; + /** The total number of groups found in the search. */ + total?: number; +} diff --git a/src/version2/models/foundGroups.ts b/src/version2/models/foundGroups.ts deleted file mode 100644 index a9d723ec7..000000000 --- a/src/version2/models/foundGroups.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { FoundGroup } from './foundGroup.js'; - -/** - * The list of groups found in a search, including header text (Showing X of Y matching groups) and total of matched - * groups. - */ -export interface FoundGroups { - groups?: FoundGroup[]; - /** Header text indicating the number of groups in the response and the total number of groups found in the search. */ - header?: string; - /** The total number of groups found in the search. */ - total?: number; -} diff --git a/src/version2/models/foundUsers.mts b/src/version2/models/foundUsers.mts new file mode 100644 index 000000000..1f480f241 --- /dev/null +++ b/src/version2/models/foundUsers.mts @@ -0,0 +1,13 @@ +import { UserPickerUser } from './userPickerUser.mjs'; + +/** + * The list of users found in a search, including header text (Showing X of Y matching users) and total of matched + * users. + */ +export interface FoundUsers { + /** Header text indicating the number of users in the response and the total number of users found in the search. */ + header?: string; + /** The total number of users found in the search. */ + total?: number; + users?: UserPickerUser[]; +} diff --git a/src/version2/models/foundUsers.ts b/src/version2/models/foundUsers.ts deleted file mode 100644 index c33d0a71d..000000000 --- a/src/version2/models/foundUsers.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { UserPickerUser } from './userPickerUser.js'; - -/** - * The list of users found in a search, including header text (Showing X of Y matching users) and total of matched - * users. - */ -export interface FoundUsers { - /** Header text indicating the number of users in the response and the total number of users found in the search. */ - header?: string; - /** The total number of users found in the search. */ - total?: number; - users?: UserPickerUser[]; -} diff --git a/src/version2/models/foundUsersAndGroups.mts b/src/version2/models/foundUsersAndGroups.mts new file mode 100644 index 000000000..5d70ffcfe --- /dev/null +++ b/src/version2/models/foundUsersAndGroups.mts @@ -0,0 +1,8 @@ +import { FoundGroups } from './foundGroups.mjs'; +import { FoundUsers } from './foundUsers.mjs'; + +/** List of users and groups found in a search. */ +export interface FoundUsersAndGroups { + groups?: FoundGroups; + users?: FoundUsers; +} diff --git a/src/version2/models/foundUsersAndGroups.ts b/src/version2/models/foundUsersAndGroups.ts deleted file mode 100644 index a984bb687..000000000 --- a/src/version2/models/foundUsersAndGroups.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { FoundGroups } from './foundGroups.js'; -import type { FoundUsers } from './foundUsers.js'; - -/** List of users and groups found in a search. */ -export interface FoundUsersAndGroups { - groups?: FoundGroups; - users?: FoundUsers; -} diff --git a/src/version2/models/functionReferenceData.ts b/src/version2/models/functionReferenceData.mts similarity index 100% rename from src/version2/models/functionReferenceData.ts rename to src/version2/models/functionReferenceData.mts diff --git a/src/version2/models/globalScope.ts b/src/version2/models/globalScope.mts similarity index 100% rename from src/version2/models/globalScope.ts rename to src/version2/models/globalScope.mts diff --git a/src/version2/models/group.mts b/src/version2/models/group.mts new file mode 100644 index 000000000..72e87a542 --- /dev/null +++ b/src/version2/models/group.mts @@ -0,0 +1,16 @@ +import { PagedListUserDetailsApplicationUser } from './pagedListUserDetailsApplicationUser.mjs'; + +export interface Group { + /** Expand options that include additional group details in the response. */ + expand?: string; + /** + * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, + * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. + */ + groupId?: string; + /** The name of group. */ + name?: string; + /** The URL for these group details. */ + self?: string; + users?: PagedListUserDetailsApplicationUser; +} diff --git a/src/version2/models/group.ts b/src/version2/models/group.ts deleted file mode 100644 index 5da577716..000000000 --- a/src/version2/models/group.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { PagedListUserDetailsApplicationUser } from './pagedListUserDetailsApplicationUser.js'; - -export interface Group { - /** Expand options that include additional group details in the response. */ - expand?: string; - /** - * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, - * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. - */ - groupId?: string; - /** The name of group. */ - name?: string; - /** The URL for these group details. */ - self?: string; - users?: PagedListUserDetailsApplicationUser; -} diff --git a/src/version2/models/groupDetails.ts b/src/version2/models/groupDetails.mts similarity index 100% rename from src/version2/models/groupDetails.ts rename to src/version2/models/groupDetails.mts diff --git a/src/version2/models/groupLabel.ts b/src/version2/models/groupLabel.mts similarity index 100% rename from src/version2/models/groupLabel.ts rename to src/version2/models/groupLabel.mts diff --git a/src/version2/models/groupName.ts b/src/version2/models/groupName.mts similarity index 100% rename from src/version2/models/groupName.ts rename to src/version2/models/groupName.mts diff --git a/src/version2/models/hierarchy.mts b/src/version2/models/hierarchy.mts new file mode 100644 index 000000000..e118049eb --- /dev/null +++ b/src/version2/models/hierarchy.mts @@ -0,0 +1,7 @@ +import { HierarchyLevel } from './hierarchyLevel.mjs'; + +/** The project issue type hierarchy. */ +export interface Hierarchy { + /** Details about the hierarchy level. */ + levels?: HierarchyLevel[]; +} diff --git a/src/version2/models/hierarchy.ts b/src/version2/models/hierarchy.ts deleted file mode 100644 index eaa4641cb..000000000 --- a/src/version2/models/hierarchy.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { HierarchyLevel } from './hierarchyLevel.js'; - -/** The project issue type hierarchy. */ -export interface Hierarchy { - /** Details about the hierarchy level. */ - levels?: HierarchyLevel[]; -} diff --git a/src/version2/models/hierarchyLevel.ts b/src/version2/models/hierarchyLevel.mts similarity index 100% rename from src/version2/models/hierarchyLevel.ts rename to src/version2/models/hierarchyLevel.mts diff --git a/src/version2/models/historyMetadata.mts b/src/version2/models/historyMetadata.mts new file mode 100644 index 000000000..06e4041d0 --- /dev/null +++ b/src/version2/models/historyMetadata.mts @@ -0,0 +1,24 @@ +import { HistoryMetadataParticipant } from './historyMetadataParticipant.mjs'; + +/** Details of issue history metadata. */ +export interface HistoryMetadata { + /** The activity described in the history record. */ + activityDescription?: string; + /** The key of the activity described in the history record. */ + activityDescriptionKey?: string; + actor?: HistoryMetadataParticipant; + cause?: HistoryMetadataParticipant; + /** The description of the history record. */ + description?: string; + /** The description key of the history record. */ + descriptionKey?: string; + /** The description of the email address associated the history record. */ + emailDescription?: string; + /** The description key of the email address associated the history record. */ + emailDescriptionKey?: string; + /** Additional arbitrary information about the history record. */ + extraData?: {}; + generator?: HistoryMetadataParticipant; + /** The type of the history record. */ + type?: string; +} diff --git a/src/version2/models/historyMetadata.ts b/src/version2/models/historyMetadata.ts deleted file mode 100644 index 7c4d04dca..000000000 --- a/src/version2/models/historyMetadata.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { HistoryMetadataParticipant } from './historyMetadataParticipant.js'; - -/** Details of issue history metadata. */ -export interface HistoryMetadata { - /** The activity described in the history record. */ - activityDescription?: string; - /** The key of the activity described in the history record. */ - activityDescriptionKey?: string; - actor?: HistoryMetadataParticipant; - cause?: HistoryMetadataParticipant; - /** The description of the history record. */ - description?: string; - /** The description key of the history record. */ - descriptionKey?: string; - /** The description of the email address associated the history record. */ - emailDescription?: string; - /** The description key of the email address associated the history record. */ - emailDescriptionKey?: string; - /** Additional arbitrary information about the history record. */ - extraData?: {}; - generator?: HistoryMetadataParticipant; - /** The type of the history record. */ - type?: string; -} diff --git a/src/version2/models/historyMetadataParticipant.ts b/src/version2/models/historyMetadataParticipant.mts similarity index 100% rename from src/version2/models/historyMetadataParticipant.ts rename to src/version2/models/historyMetadataParticipant.mts diff --git a/src/version2/models/icon.ts b/src/version2/models/icon.mts similarity index 100% rename from src/version2/models/icon.ts rename to src/version2/models/icon.mts diff --git a/src/version2/models/id.ts b/src/version2/models/id.mts similarity index 100% rename from src/version2/models/id.ts rename to src/version2/models/id.mts diff --git a/src/version2/models/idOrKey.ts b/src/version2/models/idOrKey.mts similarity index 100% rename from src/version2/models/idOrKey.ts rename to src/version2/models/idOrKey.mts diff --git a/src/version2/models/includedFields.ts b/src/version2/models/includedFields.mts similarity index 100% rename from src/version2/models/includedFields.ts rename to src/version2/models/includedFields.mts diff --git a/src/version2/models/index.mts b/src/version2/models/index.mts new file mode 100644 index 000000000..1004c0e26 --- /dev/null +++ b/src/version2/models/index.mts @@ -0,0 +1,543 @@ +export * from './actorInput.mjs'; +export * from './actorsMap.mjs'; +export * from './addField.mjs'; +export * from './addGroup.mjs'; +export * from './addSecuritySchemeLevelsRequest.mjs'; +export * from './announcementBannerConfiguration.mjs'; +export * from './announcementBannerConfigurationUpdate.mjs'; +export * from './application.mjs'; +export * from './applicationProperty.mjs'; +export * from './applicationRole.mjs'; +export * from './associatedItem.mjs'; +export * from './associateFieldConfigurationsWithIssueTypesRequest.mjs'; +export * from './attachment.mjs'; +export * from './attachmentArchiveEntry.mjs'; +export * from './attachmentArchiveImpl.mjs'; +export * from './attachmentArchiveItemReadable.mjs'; +export * from './attachmentArchiveMetadataReadable.mjs'; +export * from './attachmentMetadata.mjs'; +export * from './attachmentSettings.mjs'; +export * from './auditRecord.mjs'; +export * from './auditRecords.mjs'; +export * from './autoCompleteSuggestion.mjs'; +export * from './autoCompleteSuggestions.mjs'; +export * from './availableDashboardGadget.mjs'; +export * from './availableDashboardGadgetsResponse.mjs'; +export * from './availableWorkflowConnectRule.mjs'; +export * from './availableWorkflowForgeRule.mjs'; +export * from './availableWorkflowSystemRule.mjs'; +export * from './availableWorkflowTriggers.mjs'; +export * from './availableWorkflowTriggerTypes.mjs'; +export * from './avatar.mjs'; +export * from './avatars.mjs'; +export * from './avatarUrls.mjs'; +export * from './avatarWithDetails.mjs'; +export * from './bulkChangeOwnerDetails.mjs'; +export * from './bulkCustomFieldOptionCreateRequest.mjs'; +export * from './bulkCustomFieldOptionUpdateRequest.mjs'; +export * from './bulkEditShareableEntity.mjs'; +export * from './bulkIssueIsWatching.mjs'; +export * from './bulkIssuePropertyUpdateRequest.mjs'; +export * from './bulkOperationErrorResult.mjs'; +export * from './bulkPermissionGrants.mjs'; +export * from './bulkPermissionsRequest.mjs'; +export * from './bulkProjectPermissionGrants.mjs'; +export * from './bulkProjectPermissions.mjs'; +export * from './changeDetails.mjs'; +export * from './changedValue.mjs'; +export * from './changedWorklog.mjs'; +export * from './changedWorklogs.mjs'; +export * from './changelog.mjs'; +export * from './columnItem.mjs'; +export * from './comment.mjs'; +export * from './componentIssuesCount.mjs'; +export * from './componentWithIssueCount.mjs'; +export * from './conditionGroupConfiguration.mjs'; +export * from './conditionGroupUpdate.mjs'; +export * from './configuration.mjs'; +export * from './connectCustomFieldValue.mjs'; +export * from './connectCustomFieldValues.mjs'; +export * from './connectModule.mjs'; +export * from './connectModules.mjs'; +export * from './connectWorkflowTransitionRule.mjs'; +export * from './containerForProjectFeatures.mjs'; +export * from './containerForRegisteredWebhooks.mjs'; +export * from './containerForWebhookIDs.mjs'; +export * from './containerOfWorkflowSchemeAssociations.mjs'; +export * from './contextForProjectAndIssueType.mjs'; +export * from './contextualConfiguration.mjs'; +export * from './convertedJQLQueries.mjs'; +export * from './createCustomFieldContext.mjs'; +export * from './createdIssue.mjs'; +export * from './createdIssues.mjs'; +export * from './createIssueSecuritySchemeDetails.mjs'; +export * from './createNotificationSchemeDetails.mjs'; +export * from './createPriorityDetails.mjs'; +export * from './createProjectDetails.mjs'; +export * from './createResolutionDetails.mjs'; +export * from './createUiModificationDetails.mjs'; +export * from './createUpdateRoleRequest.mjs'; +export * from './createWorkflowCondition.mjs'; +export * from './createWorkflowDetails.mjs'; +export * from './createWorkflowStatusDetails.mjs'; +export * from './createWorkflowTransitionDetails.mjs'; +export * from './createWorkflowTransitionRule.mjs'; +export * from './createWorkflowTransitionRulesDetails.mjs'; +export * from './createWorkflowTransitionScreenDetails.mjs'; +export * from './customContextVariable.mjs'; +export * from './customFieldConfigurations.mjs'; +export * from './customFieldContext.mjs'; +export * from './customFieldContextDefaultValue.mjs'; +export * from './customFieldContextDefaultValueUpdate.mjs'; +export * from './customFieldContextOption.mjs'; +export * from './customFieldContextProjectMapping.mjs'; +export * from './customFieldContextUpdateDetails.mjs'; +export * from './customFieldCreatedContextOptionsList.mjs'; +export * from './customFieldDefinitionJson.mjs'; +export * from './customFieldOption.mjs'; +export * from './customFieldOptionCreate.mjs'; +export * from './customFieldOptionUpdate.mjs'; +export * from './customFieldReplacement.mjs'; +export * from './customFieldUpdatedContextOptionsList.mjs'; +export * from './customFieldValueUpdate.mjs'; +export * from './customFieldValueUpdateDetails.mjs'; +export * from './dashboard.mjs'; +export * from './dashboardDetails.mjs'; +export * from './dashboardGadget.mjs'; +export * from './dashboardGadgetPosition.mjs'; +export * from './dashboardGadgetResponse.mjs'; +export * from './dashboardGadgetSettings.mjs'; +export * from './dashboardGadgetUpdateRequest.mjs'; +export * from './dashboardUser.mjs'; +export * from './dateRangeFilter.mjs'; +export * from './defaultLevelValue.mjs'; +export * from './defaultShareScope.mjs'; +export * from './defaultWorkflow.mjs'; +export * from './documentVersion.mjs'; +export * from './entityProperty.mjs'; +export * from './entityPropertyDetails.mjs'; +export * from './error.mjs'; +export * from './errorCollection.mjs'; +export * from './errors.mjs'; +export * from './eventNotification.mjs'; +export * from './exportArchivedIssuesTaskProgress.mjs'; +export * from './failedWebhook.mjs'; +export * from './failedWebhooks.mjs'; +export * from './field.mjs'; +export * from './fieldConfiguration.mjs'; +export * from './fieldConfigurationDetails.mjs'; +export * from './fieldConfigurationIssueTypeItem.mjs'; +export * from './fieldConfigurationItem.mjs'; +export * from './fieldConfigurationItemsDetails.mjs'; +export * from './fieldConfigurationScheme.mjs'; +export * from './fieldConfigurationSchemeProjectAssociation.mjs'; +export * from './fieldConfigurationSchemeProjects.mjs'; +export * from './fieldConfigurationToIssueTypeMapping.mjs'; +export * from './fieldDetails.mjs'; +export * from './fieldLastUsed.mjs'; +export * from './fieldMetadata.mjs'; +export * from './fieldReferenceData.mjs'; +export * from './fields.mjs'; +export * from './filter.mjs'; +export * from './filterDetails.mjs'; +export * from './filterSubscription.mjs'; +export * from './filterSubscriptionsList.mjs'; +export * from './fixVersion.mjs'; +export * from './foundGroup.mjs'; +export * from './foundGroups.mjs'; +export * from './foundUsers.mjs'; +export * from './foundUsersAndGroups.mjs'; +export * from './functionReferenceData.mjs'; +export * from './globalScope.mjs'; +export * from './group.mjs'; +export * from './groupDetails.mjs'; +export * from './groupLabel.mjs'; +export * from './groupName.mjs'; +export * from './hierarchy.mjs'; +export * from './hierarchyLevel.mjs'; +export * from './historyMetadata.mjs'; +export * from './historyMetadataParticipant.mjs'; +export * from './icon.mjs'; +export * from './id.mjs'; +export * from './idOrKey.mjs'; +export * from './includedFields.mjs'; +export * from './issue.mjs'; +export * from './issueArchivalSync.mjs'; +export * from './issueChangelogIds.mjs'; +export * from './issueCommentListRequest.mjs'; +export * from './issueCreateMetadata.mjs'; +export * from './issueEntityProperties.mjs'; +export * from './issueEntityPropertiesForMultiUpdate.mjs'; +export * from './issueEvent.mjs'; +export * from './issueFieldOption.mjs'; +export * from './issueFieldOptionConfiguration.mjs'; +export * from './issueFieldOptionCreate.mjs'; +export * from './issueFieldOptionScope.mjs'; +export * from './issueFilterForBulkPropertyDelete.mjs'; +export * from './issueFilterForBulkPropertySet.mjs'; +export * from './issueLink.mjs'; +export * from './issueLinkType.mjs'; +export * from './issueLinkTypes.mjs'; +export * from './issueList.mjs'; +export * from './issueMatches.mjs'; +export * from './issueMatchesForJQL.mjs'; +export * from './issuePickerSuggestions.mjs'; +export * from './issuePickerSuggestionsIssueType.mjs'; +export * from './issuesAndJQLQueries.mjs'; +export * from './issueSecurityLevelMember.mjs'; +export * from './issueSecuritySchemeToProjectMapping.mjs'; +export * from './issuesJqlMetaData.mjs'; +export * from './issuesMeta.mjs'; +export * from './issuesUpdate.mjs'; +export * from './issueTransition.mjs'; +export * from './issueTypeCreate.mjs'; +export * from './issueTypeDetails.mjs'; +export * from './issueTypeIds.mjs'; +export * from './issueTypeIdsToRemove.mjs'; +export * from './issueTypeInfo.mjs'; +export * from './issueTypeIssueCreateMetadata.mjs'; +export * from './issueTypeScheme.mjs'; +export * from './issueTypeSchemeDetails.mjs'; +export * from './issueTypeSchemeID.mjs'; +export * from './issueTypeSchemeMapping.mjs'; +export * from './issueTypeSchemeProjectAssociation.mjs'; +export * from './issueTypeSchemeProjects.mjs'; +export * from './issueTypeSchemeUpdateDetails.mjs'; +export * from './issueTypeScreenScheme.mjs'; +export * from './issueTypeScreenSchemeDetails.mjs'; +export * from './issueTypeScreenSchemeId.mjs'; +export * from './issueTypeScreenSchemeItem.mjs'; +export * from './issueTypeScreenSchemeMapping.mjs'; +export * from './issueTypeScreenSchemeMappingDetails.mjs'; +export * from './issueTypeScreenSchemeProjectAssociation.mjs'; +export * from './issueTypeScreenSchemesProjects.mjs'; +export * from './issueTypeScreenSchemeUpdateDetails.mjs'; +export * from './issueTypesWorkflowMapping.mjs'; +export * from './issueTypeToContextMapping.mjs'; +export * from './issueTypeUpdate.mjs'; +export * from './issueTypeWithStatus.mjs'; +export * from './issueTypeWorkflowMapping.mjs'; +export * from './issueUpdateDetails.mjs'; +export * from './issueUpdateMetadata.mjs'; +export * from './jexpIssues.mjs'; +export * from './jexpJqlIssues.mjs'; +export * from './jiraExpressionAnalysis.mjs'; +export * from './jiraExpressionComplexity.mjs'; +export * from './jiraExpressionEvalContext.mjs'; +export * from './jiraExpressionEvalRequest.mjs'; +export * from './jiraExpressionEvaluationMetaData.mjs'; +export * from './jiraExpressionForAnalysis.mjs'; +export * from './jiraExpressionResult.mjs'; +export * from './jiraExpressionsAnalysis.mjs'; +export * from './jiraExpressionsComplexity.mjs'; +export * from './jiraExpressionsComplexityValue.mjs'; +export * from './jiraExpressionValidationError.mjs'; +export * from './jiraStatus.mjs'; +export * from './jiraWorkflow.mjs'; +export * from './jiraWorkflowStatus.mjs'; +export * from './jqlFunctionPrecomputation.mjs'; +export * from './jqlFunctionPrecomputationUpdate.mjs'; +export * from './jqlFunctionPrecomputationUpdateRequest.mjs'; +export * from './jQLPersonalDataMigrationRequest.mjs'; +export * from './jqlQueriesToParse.mjs'; +export * from './jqlQueriesToSanitize.mjs'; +export * from './jqlQuery.mjs'; +export * from './jqlQueryClause.mjs'; +export * from './jqlQueryField.mjs'; +export * from './jqlQueryFieldEntityProperty.mjs'; +export * from './jqlQueryOrderByClause.mjs'; +export * from './jqlQueryOrderByClauseElement.mjs'; +export * from './jqlQueryToSanitize.mjs'; +export * from './jQLQueryWithUnknownUsers.mjs'; +export * from './jQLReferenceData.mjs'; +export * from './jsonType.mjs'; +export * from './license.mjs'; +export * from './licensedApplication.mjs'; +export * from './licenseMetric.mjs'; +export * from './linkedIssue.mjs'; +export * from './linkGroup.mjs'; +export * from './linkIssueRequestJson.mjs'; +export * from './listWrapperCallbackApplicationRole.mjs'; +export * from './listWrapperCallbackGroupName.mjs'; +export * from './locale.mjs'; +export * from './moveField.mjs'; +export * from './multiIssueEntityProperties.mjs'; +export * from './multipleCustomFieldValuesUpdate.mjs'; +export * from './multipleCustomFieldValuesUpdateDetails.mjs'; +export * from './nestedResponse.mjs'; +export * from './newUserDetails.mjs'; +export * from './notification.mjs'; +export * from './notificationEvent.mjs'; +export * from './notificationRecipients.mjs'; +export * from './notificationRecipientsRestrictions.mjs'; +export * from './notificationScheme.mjs'; +export * from './notificationSchemeAndProjectMapping.mjs'; +export * from './notificationSchemeAndProjectMappingPage.mjs'; +export * from './notificationSchemeEvent.mjs'; +export * from './notificationSchemeEventDetails.mjs'; +export * from './notificationSchemeEventTypeId.mjs'; +export * from './notificationSchemeId.mjs'; +export * from './notificationSchemeNotificationDetails.mjs'; +export * from './oldToNewSecurityLevelMappings.mjs'; +export * from './operationMessage.mjs'; +export * from './operations.mjs'; +export * from './orderOfCustomFieldOptions.mjs'; +export * from './orderOfIssueTypes.mjs'; +export * from './pageChangelog.mjs'; +export * from './pageComment.mjs'; +export * from './pageComponentWithIssueCount.mjs'; +export * from './pageContextForProjectAndIssueType.mjs'; +export * from './pageContextualConfiguration.mjs'; +export * from './pageCustomFieldContext.mjs'; +export * from './pageCustomFieldContextDefaultValue.mjs'; +export * from './pageCustomFieldContextOption.mjs'; +export * from './pageCustomFieldContextProjectMapping.mjs'; +export * from './pageDashboard.mjs'; +export * from './pagedListUserDetailsApplicationUser.mjs'; +export * from './pageField.mjs'; +export * from './pageFieldConfiguration.mjs'; +export * from './pageFieldConfigurationIssueTypeItem.mjs'; +export * from './pageFieldConfigurationItem.mjs'; +export * from './pageFieldConfigurationScheme.mjs'; +export * from './pageFieldConfigurationSchemeProjects.mjs'; +export * from './pageFilterDetails.mjs'; +export * from './pageGroupDetails.mjs'; +export * from './pageIssueFieldOption.mjs'; +export * from './pageIssueSecurityLevelMember.mjs'; +export * from './pageIssueSecuritySchemeToProjectMapping.mjs'; +export * from './pageIssueTypeScheme.mjs'; +export * from './pageIssueTypeSchemeMapping.mjs'; +export * from './pageIssueTypeSchemeProjects.mjs'; +export * from './pageIssueTypeScreenScheme.mjs'; +export * from './pageIssueTypeScreenSchemeItem.mjs'; +export * from './pageIssueTypeScreenSchemesProjects.mjs'; +export * from './pageIssueTypeToContextMapping.mjs'; +export * from './pageJqlFunctionPrecomputation.mjs'; +export * from './pageNotificationScheme.mjs'; +export * from './pageOfChangelogs.mjs'; +export * from './pageOfComments.mjs'; +export * from './pageOfDashboards.mjs'; +export * from './pageOfStatuses.mjs'; +export * from './pageOfWorklogs.mjs'; +export * from './pagePriority.mjs'; +export * from './pageProject.mjs'; +export * from './pageProjectDetails.mjs'; +export * from './pageResolution.mjs'; +export * from './pageScreen.mjs'; +export * from './pageScreenScheme.mjs'; +export * from './pageScreenWithTab.mjs'; +export * from './pageSecurityLevel.mjs'; +export * from './pageSecurityLevelMember.mjs'; +export * from './pageSecuritySchemeWithProjects.mjs'; +export * from './pageString.mjs'; +export * from './pageUiModificationDetails.mjs'; +export * from './pageUser.mjs'; +export * from './pageUserDetails.mjs'; +export * from './pageUserKey.mjs'; +export * from './pageVersion.mjs'; +export * from './pageWebhook.mjs'; +export * from './pageWorkflow.mjs'; +export * from './pageWorkflowScheme.mjs'; +export * from './pageWorkflowTransitionRules.mjs'; +export * from './parsedJqlQueries.mjs'; +export * from './parsedJqlQuery.mjs'; +export * from './permissionDetails.mjs'; +export * from './permissionGrant.mjs'; +export * from './permissionGrants.mjs'; +export * from './permissionHolder.mjs'; +export * from './permissions.mjs'; +export * from './permissionScheme.mjs'; +export * from './permissionSchemes.mjs'; +export * from './permissionsKeys.mjs'; +export * from './permittedProjects.mjs'; +export * from './priority.mjs'; +export * from './priorityId.mjs'; +export * from './project.mjs'; +export * from './projectAndIssueTypePair.mjs'; +export * from './projectAvatars.mjs'; +export * from './projectCategory.mjs'; +export * from './projectComponent.mjs'; +export * from './projectDetails.mjs'; +export * from './projectEmailAddress.mjs'; +export * from './projectFeature.mjs'; +export * from './projectFeatureToggleRequest.mjs'; +export * from './projectId.mjs'; +export * from './projectIdentifier.mjs'; +export * from './projectIdentifiers.mjs'; +export * from './projectIds.mjs'; +export * from './projectInsight.mjs'; +export * from './projectIssueCreateMetadata.mjs'; +export * from './projectIssueSecurityLevels.mjs'; +export * from './projectIssueTypeHierarchy.mjs'; +export * from './projectIssueTypeMapping.mjs'; +export * from './projectIssueTypeMappings.mjs'; +export * from './projectIssueTypes.mjs'; +export * from './projectIssueTypesHierarchyLevel.mjs'; +export * from './projectLandingPageInfo.mjs'; +export * from './projectPermissions.mjs'; +export * from './projectRole.mjs'; +export * from './projectRoleActorsUpdate.mjs'; +export * from './projectRoleDetails.mjs'; +export * from './projectRoleGroup.mjs'; +export * from './projectRoleUser.mjs'; +export * from './projectScope.mjs'; +export * from './projectType.mjs'; +export * from './propertyKey.mjs'; +export * from './propertyKeys.mjs'; +export * from './publishedWorkflowId.mjs'; +export * from './registeredWebhook.mjs'; +export * from './remoteIssueLink.mjs'; +export * from './remoteIssueLinkIdentifies.mjs'; +export * from './remoteIssueLinkRequest.mjs'; +export * from './remoteObject.mjs'; +export * from './reorderIssuePriorities.mjs'; +export * from './reorderIssueResolutionsRequest.mjs'; +export * from './resolution.mjs'; +export * from './resolutionId.mjs'; +export * from './restrictedPermission.mjs'; +export * from './richText.mjs'; +export * from './roleActor.mjs'; +export * from './ruleConfiguration.mjs'; +export * from './sanitizedJqlQueries.mjs'; +export * from './sanitizedJqlQuery.mjs'; +export * from './scope.mjs'; +export * from './screen.mjs'; +export * from './screenableField.mjs'; +export * from './screenableTab.mjs'; +export * from './screenDetails.mjs'; +export * from './screenScheme.mjs'; +export * from './screenSchemeDetails.mjs'; +export * from './screenSchemeId.mjs'; +export * from './screenTypes.mjs'; +export * from './screenWithTab.mjs'; +export * from './searchAutoComplete.mjs'; +export * from './searchRequest.mjs'; +export * from './searchResults.mjs'; +export * from './securityLevel.mjs'; +export * from './securityLevelMember.mjs'; +export * from './securityScheme.mjs'; +export * from './securitySchemeId.mjs'; +export * from './securitySchemeLevel.mjs'; +export * from './securitySchemeLevelMember.mjs'; +export * from './securitySchemeMembersRequest.mjs'; +export * from './securitySchemes.mjs'; +export * from './securitySchemeWithProjects.mjs'; +export * from './serverInformation.mjs'; +export * from './setDefaultLevelsRequest.mjs'; +export * from './setDefaultPriorityRequest.mjs'; +export * from './setDefaultResolutionRequest.mjs'; +export * from './sharePermission.mjs'; +export * from './sharePermissionInput.mjs'; +export * from './simpleApplicationProperty.mjs'; +export * from './simpleLink.mjs'; +export * from './simpleListWrapperApplicationRole.mjs'; +export * from './simpleListWrapperGroupName.mjs'; +export * from './status.mjs'; +export * from './statusCategory.mjs'; +export * from './statusCreate.mjs'; +export * from './statusCreateRequest.mjs'; +export * from './statusDetails.mjs'; +export * from './statusLayoutUpdate.mjs'; +export * from './statusMapping.mjs'; +export * from './statusMappingDTO.mjs'; +export * from './statusMigration.mjs'; +export * from './statusReferenceAndPort.mjs'; +export * from './statusScope.mjs'; +export * from './statusUpdate.mjs'; +export * from './statusUpdateRequest.mjs'; +export * from './suggestedIssue.mjs'; +export * from './systemAvatars.mjs'; +export * from './tabMetadata.mjs'; +export * from './taskProgressObject.mjs'; +export * from './timeTrackingConfiguration.mjs'; +export * from './timeTrackingDetails.mjs'; +export * from './timeTrackingProvider.mjs'; +export * from './transition.mjs'; +export * from './transitions.mjs'; +export * from './transitionScreenDetails.mjs'; +export * from './transitionUpdateDTO.mjs'; +export * from './uiModificationContextDetails.mjs'; +export * from './uiModificationDetails.mjs'; +export * from './uiModificationIdentifiers.mjs'; +export * from './unrestrictedUserEmail.mjs'; +export * from './updateCustomFieldDetails.mjs'; +export * from './updatedProjectCategory.mjs'; +export * from './updateFieldConfigurationSchemeDetails.mjs'; +export * from './updateIssueSecurityLevelDetails.mjs'; +export * from './updateIssueSecuritySchemeRequest.mjs'; +export * from './updateNotificationSchemeDetails.mjs'; +export * from './updatePriorityDetails.mjs'; +export * from './updateProjectDetails.mjs'; +export * from './updateResolutionDetails.mjs'; +export * from './updateScreenDetails.mjs'; +export * from './updateScreenSchemeDetails.mjs'; +export * from './updateScreenTypes.mjs'; +export * from './updateUiModificationDetails.mjs'; +export * from './updateUserToGroup.mjs'; +export * from './user.mjs'; +export * from './userAvatarUrls.mjs'; +export * from './userDetails.mjs'; +export * from './userKey.mjs'; +export * from './userList.mjs'; +export * from './userMigration.mjs'; +export * from './userPickerUser.mjs'; +export * from './validationOptionsForCreate.mjs'; +export * from './validationOptionsForUpdate.mjs'; +export * from './version.mjs'; +export * from './versionIssueCounts.mjs'; +export * from './versionIssuesStatus.mjs'; +export * from './versionMove.mjs'; +export * from './versionUnresolvedIssuesCount.mjs'; +export * from './versionUsageInCustomField.mjs'; +export * from './visibility.mjs'; +export * from './votes.mjs'; +export * from './warningCollection.mjs'; +export * from './watchers.mjs'; +export * from './webhook.mjs'; +export * from './webhookDetails.mjs'; +export * from './webhookRegistrationDetails.mjs'; +export * from './webhooksExpirationDate.mjs'; +export * from './workflow.mjs'; +export * from './workflowCapabilities.mjs'; +export * from './workflowCondition.mjs'; +export * from './workflowCreate.mjs'; +export * from './workflowCreateRequest.mjs'; +export * from './workflowCreateResponse.mjs'; +export * from './workflowElementReference.mjs'; +export * from './workflowId.mjs'; +export * from './workflowLayout.mjs'; +export * from './workflowOperations.mjs'; +export * from './workflowRead.mjs'; +export * from './workflowReferenceStatus.mjs'; +export * from './workflowRuleConfiguration.mjs'; +export * from './workflowRules.mjs'; +export * from './workflowRulesSearch.mjs'; +export * from './workflowRulesSearchDetails.mjs'; +export * from './workflowScheme.mjs'; +export * from './workflowSchemeAssociations.mjs'; +export * from './workflowSchemeIdName.mjs'; +export * from './workflowSchemeProjectAssociation.mjs'; +export * from './workflowScope.mjs'; +export * from './workflowStatus.mjs'; +export * from './workflowStatusAndPort.mjs'; +export * from './workflowStatusLayout.mjs'; +export * from './workflowStatusProperties.mjs'; +export * from './workflowStatusUpdate.mjs'; +export * from './workflowsWithTransitionRulesDetails.mjs'; +export * from './workflowTransition.mjs'; +export * from './workflowTransitionProperty.mjs'; +export * from './workflowTransitionRule.mjs'; +export * from './workflowTransitionRules.mjs'; +export * from './workflowTransitionRulesDetails.mjs'; +export * from './workflowTransitionRulesUpdate.mjs'; +export * from './workflowTransitionRulesUpdateErrorDetails.mjs'; +export * from './workflowTransitionRulesUpdateErrors.mjs'; +export * from './workflowTransitions.mjs'; +export * from './workflowTrigger.mjs'; +export * from './workflowUpdate.mjs'; +export * from './workflowUpdateRequest.mjs'; +export * from './workflowUpdateResponse.mjs'; +export * from './workflowValidationError.mjs'; +export * from './workflowValidationErrorList.mjs'; +export * from './worklog.mjs'; +export * from './worklogIdsRequest.mjs'; diff --git a/src/version2/models/index.ts b/src/version2/models/index.ts deleted file mode 100644 index 2c4a400f1..000000000 --- a/src/version2/models/index.ts +++ /dev/null @@ -1,543 +0,0 @@ -export * from './actorInput.js'; -export * from './actorsMap.js'; -export * from './addField.js'; -export * from './addGroup.js'; -export * from './addSecuritySchemeLevelsRequest.js'; -export * from './announcementBannerConfiguration.js'; -export * from './announcementBannerConfigurationUpdate.js'; -export * from './application.js'; -export * from './applicationProperty.js'; -export * from './applicationRole.js'; -export * from './associatedItem.js'; -export * from './associateFieldConfigurationsWithIssueTypesRequest.js'; -export * from './attachment.js'; -export * from './attachmentArchiveEntry.js'; -export * from './attachmentArchiveImpl.js'; -export * from './attachmentArchiveItemReadable.js'; -export * from './attachmentArchiveMetadataReadable.js'; -export * from './attachmentMetadata.js'; -export * from './attachmentSettings.js'; -export * from './auditRecord.js'; -export * from './auditRecords.js'; -export * from './autoCompleteSuggestion.js'; -export * from './autoCompleteSuggestions.js'; -export * from './availableDashboardGadget.js'; -export * from './availableDashboardGadgetsResponse.js'; -export * from './availableWorkflowConnectRule.js'; -export * from './availableWorkflowForgeRule.js'; -export * from './availableWorkflowSystemRule.js'; -export * from './availableWorkflowTriggers.js'; -export * from './availableWorkflowTriggerTypes.js'; -export * from './avatar.js'; -export * from './avatars.js'; -export * from './avatarUrls.js'; -export * from './avatarWithDetails.js'; -export * from './bulkChangeOwnerDetails.js'; -export * from './bulkCustomFieldOptionCreateRequest.js'; -export * from './bulkCustomFieldOptionUpdateRequest.js'; -export * from './bulkEditShareableEntity.js'; -export * from './bulkIssueIsWatching.js'; -export * from './bulkIssuePropertyUpdateRequest.js'; -export * from './bulkOperationErrorResult.js'; -export * from './bulkPermissionGrants.js'; -export * from './bulkPermissionsRequest.js'; -export * from './bulkProjectPermissionGrants.js'; -export * from './bulkProjectPermissions.js'; -export * from './changeDetails.js'; -export * from './changedValue.js'; -export * from './changedWorklog.js'; -export * from './changedWorklogs.js'; -export * from './changelog.js'; -export * from './columnItem.js'; -export * from './comment.js'; -export * from './componentIssuesCount.js'; -export * from './componentWithIssueCount.js'; -export * from './conditionGroupConfiguration.js'; -export * from './conditionGroupUpdate.js'; -export * from './configuration.js'; -export * from './connectCustomFieldValue.js'; -export * from './connectCustomFieldValues.js'; -export * from './connectModule.js'; -export * from './connectModules.js'; -export * from './connectWorkflowTransitionRule.js'; -export * from './containerForProjectFeatures.js'; -export * from './containerForRegisteredWebhooks.js'; -export * from './containerForWebhookIDs.js'; -export * from './containerOfWorkflowSchemeAssociations.js'; -export * from './contextForProjectAndIssueType.js'; -export * from './contextualConfiguration.js'; -export * from './convertedJQLQueries.js'; -export * from './createCustomFieldContext.js'; -export * from './createdIssue.js'; -export * from './createdIssues.js'; -export * from './createIssueSecuritySchemeDetails.js'; -export * from './createNotificationSchemeDetails.js'; -export * from './createPriorityDetails.js'; -export * from './createProjectDetails.js'; -export * from './createResolutionDetails.js'; -export * from './createUiModificationDetails.js'; -export * from './createUpdateRoleRequest.js'; -export * from './createWorkflowCondition.js'; -export * from './createWorkflowDetails.js'; -export * from './createWorkflowStatusDetails.js'; -export * from './createWorkflowTransitionDetails.js'; -export * from './createWorkflowTransitionRule.js'; -export * from './createWorkflowTransitionRulesDetails.js'; -export * from './createWorkflowTransitionScreenDetails.js'; -export * from './customContextVariable.js'; -export * from './customFieldConfigurations.js'; -export * from './customFieldContext.js'; -export * from './customFieldContextDefaultValue.js'; -export * from './customFieldContextDefaultValueUpdate.js'; -export * from './customFieldContextOption.js'; -export * from './customFieldContextProjectMapping.js'; -export * from './customFieldContextUpdateDetails.js'; -export * from './customFieldCreatedContextOptionsList.js'; -export * from './customFieldDefinitionJson.js'; -export * from './customFieldOption.js'; -export * from './customFieldOptionCreate.js'; -export * from './customFieldOptionUpdate.js'; -export * from './customFieldReplacement.js'; -export * from './customFieldUpdatedContextOptionsList.js'; -export * from './customFieldValueUpdate.js'; -export * from './customFieldValueUpdateDetails.js'; -export * from './dashboard.js'; -export * from './dashboardDetails.js'; -export * from './dashboardGadget.js'; -export * from './dashboardGadgetPosition.js'; -export * from './dashboardGadgetResponse.js'; -export * from './dashboardGadgetSettings.js'; -export * from './dashboardGadgetUpdateRequest.js'; -export * from './dashboardUser.js'; -export * from './dateRangeFilter.js'; -export * from './defaultLevelValue.js'; -export * from './defaultShareScope.js'; -export * from './defaultWorkflow.js'; -export * from './documentVersion.js'; -export * from './entityProperty.js'; -export * from './entityPropertyDetails.js'; -export * from './error.js'; -export * from './errorCollection.js'; -export * from './errors.js'; -export * from './eventNotification.js'; -export * from './exportArchivedIssuesTaskProgress.js'; -export * from './failedWebhook.js'; -export * from './failedWebhooks.js'; -export * from './field.js'; -export * from './fieldConfiguration.js'; -export * from './fieldConfigurationDetails.js'; -export * from './fieldConfigurationIssueTypeItem.js'; -export * from './fieldConfigurationItem.js'; -export * from './fieldConfigurationItemsDetails.js'; -export * from './fieldConfigurationScheme.js'; -export * from './fieldConfigurationSchemeProjectAssociation.js'; -export * from './fieldConfigurationSchemeProjects.js'; -export * from './fieldConfigurationToIssueTypeMapping.js'; -export * from './fieldDetails.js'; -export * from './fieldLastUsed.js'; -export * from './fieldMetadata.js'; -export * from './fieldReferenceData.js'; -export * from './fields.js'; -export * from './filter.js'; -export * from './filterDetails.js'; -export * from './filterSubscription.js'; -export * from './filterSubscriptionsList.js'; -export * from './fixVersion.js'; -export * from './foundGroup.js'; -export * from './foundGroups.js'; -export * from './foundUsers.js'; -export * from './foundUsersAndGroups.js'; -export * from './functionReferenceData.js'; -export * from './globalScope.js'; -export * from './group.js'; -export * from './groupDetails.js'; -export * from './groupLabel.js'; -export * from './groupName.js'; -export * from './hierarchy.js'; -export * from './hierarchyLevel.js'; -export * from './historyMetadata.js'; -export * from './historyMetadataParticipant.js'; -export * from './icon.js'; -export * from './id.js'; -export * from './idOrKey.js'; -export * from './includedFields.js'; -export * from './issue.js'; -export * from './issueArchivalSync.js'; -export * from './issueChangelogIds.js'; -export * from './issueCommentListRequest.js'; -export * from './issueCreateMetadata.js'; -export * from './issueEntityProperties.js'; -export * from './issueEntityPropertiesForMultiUpdate.js'; -export * from './issueEvent.js'; -export * from './issueFieldOption.js'; -export * from './issueFieldOptionConfiguration.js'; -export * from './issueFieldOptionCreate.js'; -export * from './issueFieldOptionScope.js'; -export * from './issueFilterForBulkPropertyDelete.js'; -export * from './issueFilterForBulkPropertySet.js'; -export * from './issueLink.js'; -export * from './issueLinkType.js'; -export * from './issueLinkTypes.js'; -export * from './issueList.js'; -export * from './issueMatches.js'; -export * from './issueMatchesForJQL.js'; -export * from './issuePickerSuggestions.js'; -export * from './issuePickerSuggestionsIssueType.js'; -export * from './issuesAndJQLQueries.js'; -export * from './issueSecurityLevelMember.js'; -export * from './issueSecuritySchemeToProjectMapping.js'; -export * from './issuesJqlMetaData.js'; -export * from './issuesMeta.js'; -export * from './issuesUpdate.js'; -export * from './issueTransition.js'; -export * from './issueTypeCreate.js'; -export * from './issueTypeDetails.js'; -export * from './issueTypeIds.js'; -export * from './issueTypeIdsToRemove.js'; -export * from './issueTypeInfo.js'; -export * from './issueTypeIssueCreateMetadata.js'; -export * from './issueTypeScheme.js'; -export * from './issueTypeSchemeDetails.js'; -export * from './issueTypeSchemeID.js'; -export * from './issueTypeSchemeMapping.js'; -export * from './issueTypeSchemeProjectAssociation.js'; -export * from './issueTypeSchemeProjects.js'; -export * from './issueTypeSchemeUpdateDetails.js'; -export * from './issueTypeScreenScheme.js'; -export * from './issueTypeScreenSchemeDetails.js'; -export * from './issueTypeScreenSchemeId.js'; -export * from './issueTypeScreenSchemeItem.js'; -export * from './issueTypeScreenSchemeMapping.js'; -export * from './issueTypeScreenSchemeMappingDetails.js'; -export * from './issueTypeScreenSchemeProjectAssociation.js'; -export * from './issueTypeScreenSchemesProjects.js'; -export * from './issueTypeScreenSchemeUpdateDetails.js'; -export * from './issueTypesWorkflowMapping.js'; -export * from './issueTypeToContextMapping.js'; -export * from './issueTypeUpdate.js'; -export * from './issueTypeWithStatus.js'; -export * from './issueTypeWorkflowMapping.js'; -export * from './issueUpdateDetails.js'; -export * from './issueUpdateMetadata.js'; -export * from './jexpIssues.js'; -export * from './jexpJqlIssues.js'; -export * from './jiraExpressionAnalysis.js'; -export * from './jiraExpressionComplexity.js'; -export * from './jiraExpressionEvalContext.js'; -export * from './jiraExpressionEvalRequest.js'; -export * from './jiraExpressionEvaluationMetaData.js'; -export * from './jiraExpressionForAnalysis.js'; -export * from './jiraExpressionResult.js'; -export * from './jiraExpressionsAnalysis.js'; -export * from './jiraExpressionsComplexity.js'; -export * from './jiraExpressionsComplexityValue.js'; -export * from './jiraExpressionValidationError.js'; -export * from './jiraStatus.js'; -export * from './jiraWorkflow.js'; -export * from './jiraWorkflowStatus.js'; -export * from './jqlFunctionPrecomputation.js'; -export * from './jqlFunctionPrecomputationUpdate.js'; -export * from './jqlFunctionPrecomputationUpdateRequest.js'; -export * from './jQLPersonalDataMigrationRequest.js'; -export * from './jqlQueriesToParse.js'; -export * from './jqlQueriesToSanitize.js'; -export * from './jqlQuery.js'; -export * from './jqlQueryClause.js'; -export * from './jqlQueryField.js'; -export * from './jqlQueryFieldEntityProperty.js'; -export * from './jqlQueryOrderByClause.js'; -export * from './jqlQueryOrderByClauseElement.js'; -export * from './jqlQueryToSanitize.js'; -export * from './jQLQueryWithUnknownUsers.js'; -export * from './jQLReferenceData.js'; -export * from './jsonType.js'; -export * from './license.js'; -export * from './licensedApplication.js'; -export * from './licenseMetric.js'; -export * from './linkedIssue.js'; -export * from './linkGroup.js'; -export * from './linkIssueRequestJson.js'; -export * from './listWrapperCallbackApplicationRole.js'; -export * from './listWrapperCallbackGroupName.js'; -export * from './locale.js'; -export * from './moveField.js'; -export * from './multiIssueEntityProperties.js'; -export * from './multipleCustomFieldValuesUpdate.js'; -export * from './multipleCustomFieldValuesUpdateDetails.js'; -export * from './nestedResponse.js'; -export * from './newUserDetails.js'; -export * from './notification.js'; -export * from './notificationEvent.js'; -export * from './notificationRecipients.js'; -export * from './notificationRecipientsRestrictions.js'; -export * from './notificationScheme.js'; -export * from './notificationSchemeAndProjectMapping.js'; -export * from './notificationSchemeAndProjectMappingPage.js'; -export * from './notificationSchemeEvent.js'; -export * from './notificationSchemeEventDetails.js'; -export * from './notificationSchemeEventTypeId.js'; -export * from './notificationSchemeId.js'; -export * from './notificationSchemeNotificationDetails.js'; -export * from './oldToNewSecurityLevelMappings.js'; -export * from './operationMessage.js'; -export * from './operations.js'; -export * from './orderOfCustomFieldOptions.js'; -export * from './orderOfIssueTypes.js'; -export * from './pageChangelog.js'; -export * from './pageComment.js'; -export * from './pageComponentWithIssueCount.js'; -export * from './pageContextForProjectAndIssueType.js'; -export * from './pageContextualConfiguration.js'; -export * from './pageCustomFieldContext.js'; -export * from './pageCustomFieldContextDefaultValue.js'; -export * from './pageCustomFieldContextOption.js'; -export * from './pageCustomFieldContextProjectMapping.js'; -export * from './pageDashboard.js'; -export * from './pagedListUserDetailsApplicationUser.js'; -export * from './pageField.js'; -export * from './pageFieldConfiguration.js'; -export * from './pageFieldConfigurationIssueTypeItem.js'; -export * from './pageFieldConfigurationItem.js'; -export * from './pageFieldConfigurationScheme.js'; -export * from './pageFieldConfigurationSchemeProjects.js'; -export * from './pageFilterDetails.js'; -export * from './pageGroupDetails.js'; -export * from './pageIssueFieldOption.js'; -export * from './pageIssueSecurityLevelMember.js'; -export * from './pageIssueSecuritySchemeToProjectMapping.js'; -export * from './pageIssueTypeScheme.js'; -export * from './pageIssueTypeSchemeMapping.js'; -export * from './pageIssueTypeSchemeProjects.js'; -export * from './pageIssueTypeScreenScheme.js'; -export * from './pageIssueTypeScreenSchemeItem.js'; -export * from './pageIssueTypeScreenSchemesProjects.js'; -export * from './pageIssueTypeToContextMapping.js'; -export * from './pageJqlFunctionPrecomputation.js'; -export * from './pageNotificationScheme.js'; -export * from './pageOfChangelogs.js'; -export * from './pageOfComments.js'; -export * from './pageOfDashboards.js'; -export * from './pageOfStatuses.js'; -export * from './pageOfWorklogs.js'; -export * from './pagePriority.js'; -export * from './pageProject.js'; -export * from './pageProjectDetails.js'; -export * from './pageResolution.js'; -export * from './pageScreen.js'; -export * from './pageScreenScheme.js'; -export * from './pageScreenWithTab.js'; -export * from './pageSecurityLevel.js'; -export * from './pageSecurityLevelMember.js'; -export * from './pageSecuritySchemeWithProjects.js'; -export * from './pageString.js'; -export * from './pageUiModificationDetails.js'; -export * from './pageUser.js'; -export * from './pageUserDetails.js'; -export * from './pageUserKey.js'; -export * from './pageVersion.js'; -export * from './pageWebhook.js'; -export * from './pageWorkflow.js'; -export * from './pageWorkflowScheme.js'; -export * from './pageWorkflowTransitionRules.js'; -export * from './parsedJqlQueries.js'; -export * from './parsedJqlQuery.js'; -export * from './permissionDetails.js'; -export * from './permissionGrant.js'; -export * from './permissionGrants.js'; -export * from './permissionHolder.js'; -export * from './permissions.js'; -export * from './permissionScheme.js'; -export * from './permissionSchemes.js'; -export * from './permissionsKeys.js'; -export * from './permittedProjects.js'; -export * from './priority.js'; -export * from './priorityId.js'; -export * from './project.js'; -export * from './projectAndIssueTypePair.js'; -export * from './projectAvatars.js'; -export * from './projectCategory.js'; -export * from './projectComponent.js'; -export * from './projectDetails.js'; -export * from './projectEmailAddress.js'; -export * from './projectFeature.js'; -export * from './projectFeatureToggleRequest.js'; -export * from './projectId.js'; -export * from './projectIdentifier.js'; -export * from './projectIdentifiers.js'; -export * from './projectIds.js'; -export * from './projectInsight.js'; -export * from './projectIssueCreateMetadata.js'; -export * from './projectIssueSecurityLevels.js'; -export * from './projectIssueTypeHierarchy.js'; -export * from './projectIssueTypeMapping.js'; -export * from './projectIssueTypeMappings.js'; -export * from './projectIssueTypes.js'; -export * from './projectIssueTypesHierarchyLevel.js'; -export * from './projectLandingPageInfo.js'; -export * from './projectPermissions.js'; -export * from './projectRole.js'; -export * from './projectRoleActorsUpdate.js'; -export * from './projectRoleDetails.js'; -export * from './projectRoleGroup.js'; -export * from './projectRoleUser.js'; -export * from './projectScope.js'; -export * from './projectType.js'; -export * from './propertyKey.js'; -export * from './propertyKeys.js'; -export * from './publishedWorkflowId.js'; -export * from './registeredWebhook.js'; -export * from './remoteIssueLink.js'; -export * from './remoteIssueLinkIdentifies.js'; -export * from './remoteIssueLinkRequest.js'; -export * from './remoteObject.js'; -export * from './reorderIssuePriorities.js'; -export * from './reorderIssueResolutionsRequest.js'; -export * from './resolution.js'; -export * from './resolutionId.js'; -export * from './restrictedPermission.js'; -export * from './richText.js'; -export * from './roleActor.js'; -export * from './ruleConfiguration.js'; -export * from './sanitizedJqlQueries.js'; -export * from './sanitizedJqlQuery.js'; -export * from './scope.js'; -export * from './screen.js'; -export * from './screenableField.js'; -export * from './screenableTab.js'; -export * from './screenDetails.js'; -export * from './screenScheme.js'; -export * from './screenSchemeDetails.js'; -export * from './screenSchemeId.js'; -export * from './screenTypes.js'; -export * from './screenWithTab.js'; -export * from './searchAutoComplete.js'; -export * from './searchRequest.js'; -export * from './searchResults.js'; -export * from './securityLevel.js'; -export * from './securityLevelMember.js'; -export * from './securityScheme.js'; -export * from './securitySchemeId.js'; -export * from './securitySchemeLevel.js'; -export * from './securitySchemeLevelMember.js'; -export * from './securitySchemeMembersRequest.js'; -export * from './securitySchemes.js'; -export * from './securitySchemeWithProjects.js'; -export * from './serverInformation.js'; -export * from './setDefaultLevelsRequest.js'; -export * from './setDefaultPriorityRequest.js'; -export * from './setDefaultResolutionRequest.js'; -export * from './sharePermission.js'; -export * from './sharePermissionInput.js'; -export * from './simpleApplicationProperty.js'; -export * from './simpleLink.js'; -export * from './simpleListWrapperApplicationRole.js'; -export * from './simpleListWrapperGroupName.js'; -export * from './status.js'; -export * from './statusCategory.js'; -export * from './statusCreate.js'; -export * from './statusCreateRequest.js'; -export * from './statusDetails.js'; -export * from './statusLayoutUpdate.js'; -export * from './statusMapping.js'; -export * from './statusMappingDTO.js'; -export * from './statusMigration.js'; -export * from './statusReferenceAndPort.js'; -export * from './statusScope.js'; -export * from './statusUpdate.js'; -export * from './statusUpdateRequest.js'; -export * from './suggestedIssue.js'; -export * from './systemAvatars.js'; -export * from './tabMetadata.js'; -export * from './taskProgressObject.js'; -export * from './timeTrackingConfiguration.js'; -export * from './timeTrackingDetails.js'; -export * from './timeTrackingProvider.js'; -export * from './transition.js'; -export * from './transitions.js'; -export * from './transitionScreenDetails.js'; -export * from './transitionUpdateDTO.js'; -export * from './uiModificationContextDetails.js'; -export * from './uiModificationDetails.js'; -export * from './uiModificationIdentifiers.js'; -export * from './unrestrictedUserEmail.js'; -export * from './updateCustomFieldDetails.js'; -export * from './updatedProjectCategory.js'; -export * from './updateFieldConfigurationSchemeDetails.js'; -export * from './updateIssueSecurityLevelDetails.js'; -export * from './updateIssueSecuritySchemeRequest.js'; -export * from './updateNotificationSchemeDetails.js'; -export * from './updatePriorityDetails.js'; -export * from './updateProjectDetails.js'; -export * from './updateResolutionDetails.js'; -export * from './updateScreenDetails.js'; -export * from './updateScreenSchemeDetails.js'; -export * from './updateScreenTypes.js'; -export * from './updateUiModificationDetails.js'; -export * from './updateUserToGroup.js'; -export * from './user.js'; -export * from './userAvatarUrls.js'; -export * from './userDetails.js'; -export * from './userKey.js'; -export * from './userList.js'; -export * from './userMigration.js'; -export * from './userPickerUser.js'; -export * from './validationOptionsForCreate.js'; -export * from './validationOptionsForUpdate.js'; -export * from './version.js'; -export * from './versionIssueCounts.js'; -export * from './versionIssuesStatus.js'; -export * from './versionMove.js'; -export * from './versionUnresolvedIssuesCount.js'; -export * from './versionUsageInCustomField.js'; -export * from './visibility.js'; -export * from './votes.js'; -export * from './warningCollection.js'; -export * from './watchers.js'; -export * from './webhook.js'; -export * from './webhookDetails.js'; -export * from './webhookRegistrationDetails.js'; -export * from './webhooksExpirationDate.js'; -export * from './workflow.js'; -export * from './workflowCapabilities.js'; -export * from './workflowCondition.js'; -export * from './workflowCreate.js'; -export * from './workflowCreateRequest.js'; -export * from './workflowCreateResponse.js'; -export * from './workflowElementReference.js'; -export * from './workflowId.js'; -export * from './workflowLayout.js'; -export * from './workflowOperations.js'; -export * from './workflowRead.js'; -export * from './workflowReferenceStatus.js'; -export * from './workflowRuleConfiguration.js'; -export * from './workflowRules.js'; -export * from './workflowRulesSearch.js'; -export * from './workflowRulesSearchDetails.js'; -export * from './workflowScheme.js'; -export * from './workflowSchemeAssociations.js'; -export * from './workflowSchemeIdName.js'; -export * from './workflowSchemeProjectAssociation.js'; -export * from './workflowScope.js'; -export * from './workflowStatus.js'; -export * from './workflowStatusAndPort.js'; -export * from './workflowStatusLayout.js'; -export * from './workflowStatusProperties.js'; -export * from './workflowStatusUpdate.js'; -export * from './workflowsWithTransitionRulesDetails.js'; -export * from './workflowTransition.js'; -export * from './workflowTransitionProperty.js'; -export * from './workflowTransitionRule.js'; -export * from './workflowTransitionRules.js'; -export * from './workflowTransitionRulesDetails.js'; -export * from './workflowTransitionRulesUpdate.js'; -export * from './workflowTransitionRulesUpdateErrorDetails.js'; -export * from './workflowTransitionRulesUpdateErrors.js'; -export * from './workflowTransitions.js'; -export * from './workflowTrigger.js'; -export * from './workflowUpdate.js'; -export * from './workflowUpdateRequest.js'; -export * from './workflowUpdateResponse.js'; -export * from './workflowValidationError.js'; -export * from './workflowValidationErrorList.js'; -export * from './worklog.js'; -export * from './worklogIdsRequest.js'; diff --git a/src/version2/models/issue.mts b/src/version2/models/issue.mts new file mode 100644 index 000000000..1cf3fb1b1 --- /dev/null +++ b/src/version2/models/issue.mts @@ -0,0 +1,35 @@ +import { Fields } from './fields.mjs'; +import { IncludedFields } from './includedFields.mjs'; +import type { IssueTransition } from './issueTransition.mjs'; +import { IssueUpdateMetadata } from './issueUpdateMetadata.mjs'; +import { Operations } from './operations.mjs'; +import { PageOfChangelogs } from './pageOfChangelogs.mjs'; + +/** Details about an issue. */ +export interface Issue { + /** Expand options that include additional issue details in the response. */ + expand?: string; + /** The ID of the issue. */ + id: string; + /** The URL of the issue details. */ + self?: string; + /** The key of the issue. */ + key: string; + /** The rendered value of each field present on the issue. */ + renderedFields?: Fields; + /** Details of the issue properties identified in the request. */ + properties?: {}; + /** The ID and name of each field present on the issue. */ + names?: Record; + /** The schema describing each field present on the issue. */ + schema?: {}; + /** The transitions that can be performed on the issue. */ + transitions?: IssueTransition[]; + operations?: Operations; + editmeta?: IssueUpdateMetadata; + changelog?: PageOfChangelogs; + /** The versions of each field on the issue. */ + versionedRepresentations?: {}; + fieldsToInclude?: IncludedFields; + fields: Fields; +} diff --git a/src/version2/models/issue.ts b/src/version2/models/issue.ts deleted file mode 100644 index 2148a1042..000000000 --- a/src/version2/models/issue.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { Fields } from './fields.js'; -import type { IncludedFields } from './includedFields.js'; -import type { IssueTransition } from './issueTransition.js'; -import type { IssueUpdateMetadata } from './issueUpdateMetadata.js'; -import type { Operations } from './operations.js'; -import type { PageOfChangelogs } from './pageOfChangelogs.js'; - -/** Details about an issue. */ -export interface Issue { - /** Expand options that include additional issue details in the response. */ - expand?: string; - /** The ID of the issue. */ - id: string; - /** The URL of the issue details. */ - self?: string; - /** The key of the issue. */ - key: string; - /** The rendered value of each field present on the issue. */ - renderedFields?: Fields; - /** Details of the issue properties identified in the request. */ - properties?: {}; - /** The ID and name of each field present on the issue. */ - names?: Record; - /** The schema describing each field present on the issue. */ - schema?: {}; - /** The transitions that can be performed on the issue. */ - transitions?: IssueTransition[]; - operations?: Operations; - editmeta?: IssueUpdateMetadata; - changelog?: PageOfChangelogs; - /** The versions of each field on the issue. */ - versionedRepresentations?: {}; - fieldsToInclude?: IncludedFields; - fields: Fields; -} diff --git a/src/version2/models/issueArchivalSync.mts b/src/version2/models/issueArchivalSync.mts new file mode 100644 index 000000000..f9277fa1f --- /dev/null +++ b/src/version2/models/issueArchivalSync.mts @@ -0,0 +1,7 @@ +import { Errors } from './errors.mjs'; + +/** Number of archived/unarchived issues and list of errors that occurred during the action, if any. */ +export interface IssueArchivalSync { + errors?: Errors; + numberOfIssuesUpdated?: number; +} diff --git a/src/version2/models/issueArchivalSync.ts b/src/version2/models/issueArchivalSync.ts deleted file mode 100644 index 3151f6413..000000000 --- a/src/version2/models/issueArchivalSync.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Errors } from './errors.js'; - -/** Number of archived/unarchived issues and list of errors that occurred during the action, if any. */ -export interface IssueArchivalSync { - errors?: Errors; - numberOfIssuesUpdated?: number; -} diff --git a/src/version2/models/issueChangelogIds.ts b/src/version2/models/issueChangelogIds.mts similarity index 100% rename from src/version2/models/issueChangelogIds.ts rename to src/version2/models/issueChangelogIds.mts diff --git a/src/version2/models/issueCommentListRequest.ts b/src/version2/models/issueCommentListRequest.mts similarity index 100% rename from src/version2/models/issueCommentListRequest.ts rename to src/version2/models/issueCommentListRequest.mts diff --git a/src/version2/models/issueCreateMetadata.mts b/src/version2/models/issueCreateMetadata.mts new file mode 100644 index 000000000..38cebd5da --- /dev/null +++ b/src/version2/models/issueCreateMetadata.mts @@ -0,0 +1,9 @@ +import { ProjectIssueCreateMetadata } from './projectIssueCreateMetadata.mjs'; + +/** The wrapper for the issue creation metadata for a list of projects. */ +export interface IssueCreateMetadata { + /** Expand options that include additional project details in the response. */ + expand?: string; + /** List of projects and their issue creation metadata. */ + projects?: ProjectIssueCreateMetadata[]; +} diff --git a/src/version2/models/issueCreateMetadata.ts b/src/version2/models/issueCreateMetadata.ts deleted file mode 100644 index 3cebe89b2..000000000 --- a/src/version2/models/issueCreateMetadata.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ProjectIssueCreateMetadata } from './projectIssueCreateMetadata.js'; - -/** The wrapper for the issue creation metadata for a list of projects. */ -export interface IssueCreateMetadata { - /** Expand options that include additional project details in the response. */ - expand?: string; - /** List of projects and their issue creation metadata. */ - projects?: ProjectIssueCreateMetadata[]; -} diff --git a/src/version2/models/issueEntityProperties.ts b/src/version2/models/issueEntityProperties.mts similarity index 100% rename from src/version2/models/issueEntityProperties.ts rename to src/version2/models/issueEntityProperties.mts diff --git a/src/version2/models/issueEntityPropertiesForMultiUpdate.ts b/src/version2/models/issueEntityPropertiesForMultiUpdate.mts similarity index 100% rename from src/version2/models/issueEntityPropertiesForMultiUpdate.ts rename to src/version2/models/issueEntityPropertiesForMultiUpdate.mts diff --git a/src/version2/models/issueEvent.ts b/src/version2/models/issueEvent.mts similarity index 100% rename from src/version2/models/issueEvent.ts rename to src/version2/models/issueEvent.mts diff --git a/src/version2/models/issueFieldOption.mts b/src/version2/models/issueFieldOption.mts new file mode 100644 index 000000000..0a9d03e2c --- /dev/null +++ b/src/version2/models/issueFieldOption.mts @@ -0,0 +1,17 @@ +import { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration.mjs'; + +/** Details of the options for a select list issue field. */ +export interface IssueFieldOption { + config?: IssueFieldOptionConfiguration; + /** The unique identifier for the option. This is only unique within the select field's set of options. */ + id: number; + /** + * The properties of the object, as arbitrary key-value pairs. These properties can be searched using Jql, if the + * extractions (see [Issue Field Option Property + * Index](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/)) are defined + * in the descriptor for the issue field module. + */ + properties?: Record; + /** The option's name, which is displayed in Jira. */ + value: string; +} diff --git a/src/version2/models/issueFieldOption.ts b/src/version2/models/issueFieldOption.ts deleted file mode 100644 index f82fdbad8..000000000 --- a/src/version2/models/issueFieldOption.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration.js'; - -/** Details of the options for a select list issue field. */ -export interface IssueFieldOption { - config?: IssueFieldOptionConfiguration; - /** The unique identifier for the option. This is only unique within the select field's set of options. */ - id: number; - /** - * The properties of the object, as arbitrary key-value pairs. These properties can be searched using JQL, if the - * extractions (see [Issue Field Option Property - * Index](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/)) are defined - * in the descriptor for the issue field module. - */ - properties?: Record; - /** The option's name, which is displayed in Jira. */ - value: string; -} diff --git a/src/version2/models/issueFieldOptionConfiguration.mts b/src/version2/models/issueFieldOptionConfiguration.mts new file mode 100644 index 000000000..0b49ac3e4 --- /dev/null +++ b/src/version2/models/issueFieldOptionConfiguration.mts @@ -0,0 +1,6 @@ +import { IssueFieldOptionScope } from './issueFieldOptionScope.mjs'; + +/** Details of the projects the option is available in. */ +export interface IssueFieldOptionConfiguration { + scope?: IssueFieldOptionScope; +} diff --git a/src/version2/models/issueFieldOptionConfiguration.ts b/src/version2/models/issueFieldOptionConfiguration.ts deleted file mode 100644 index d1b44374f..000000000 --- a/src/version2/models/issueFieldOptionConfiguration.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueFieldOptionScope } from './issueFieldOptionScope.js'; - -/** Details of the projects the option is available in. */ -export interface IssueFieldOptionConfiguration { - scope?: IssueFieldOptionScope; -} diff --git a/src/version2/models/issueFieldOptionCreate.mts b/src/version2/models/issueFieldOptionCreate.mts new file mode 100644 index 000000000..4a98a900a --- /dev/null +++ b/src/version2/models/issueFieldOptionCreate.mts @@ -0,0 +1,13 @@ +import { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration.mjs'; + +export interface IssueFieldOptionCreate { + config?: IssueFieldOptionConfiguration; + /** + * The properties of the option as arbitrary key-value pairs. These properties can be searched using Jql, if the + * extractions (see https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/) + * are defined in the descriptor for the issue field module. + */ + properties?: {}; + /** The option's name, which is displayed in Jira. */ + value: string; +} diff --git a/src/version2/models/issueFieldOptionCreate.ts b/src/version2/models/issueFieldOptionCreate.ts deleted file mode 100644 index 364ff84b2..000000000 --- a/src/version2/models/issueFieldOptionCreate.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration.js'; - -export interface IssueFieldOptionCreate { - config?: IssueFieldOptionConfiguration; - /** - * The properties of the option as arbitrary key-value pairs. These properties can be searched using JQL, if the - * extractions (see https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/) - * are defined in the descriptor for the issue field module. - */ - properties?: {}; - /** The option's name, which is displayed in Jira. */ - value: string; -} diff --git a/src/version2/models/issueFieldOptionScope.mts b/src/version2/models/issueFieldOptionScope.mts new file mode 100644 index 000000000..2b332203c --- /dev/null +++ b/src/version2/models/issueFieldOptionScope.mts @@ -0,0 +1,12 @@ +import { GlobalScope } from './globalScope.mjs'; +import { ProjectScope } from './projectScope.mjs'; + +export interface IssueFieldOptionScope { + global?: GlobalScope; + /** + * Defines the projects in which the option is available and the behavior of the option within each project. Specify + * one object per project. The behavior of the option in a project context overrides the behavior in the global + * context. + */ + projects2?: ProjectScope[]; +} diff --git a/src/version2/models/issueFieldOptionScope.ts b/src/version2/models/issueFieldOptionScope.ts deleted file mode 100644 index aba3b3ee7..000000000 --- a/src/version2/models/issueFieldOptionScope.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { GlobalScope } from './globalScope.js'; -import type { ProjectScope } from './projectScope.js'; - -export interface IssueFieldOptionScope { - global?: GlobalScope; - /** - * Defines the projects in which the option is available and the behavior of the option within each project. Specify - * one object per project. The behavior of the option in a project context overrides the behavior in the global - * context. - */ - projects2?: ProjectScope[]; -} diff --git a/src/version2/models/issueFilterForBulkPropertyDelete.ts b/src/version2/models/issueFilterForBulkPropertyDelete.mts similarity index 100% rename from src/version2/models/issueFilterForBulkPropertyDelete.ts rename to src/version2/models/issueFilterForBulkPropertyDelete.mts diff --git a/src/version2/models/issueFilterForBulkPropertySet.ts b/src/version2/models/issueFilterForBulkPropertySet.mts similarity index 100% rename from src/version2/models/issueFilterForBulkPropertySet.ts rename to src/version2/models/issueFilterForBulkPropertySet.mts diff --git a/src/version2/models/issueLink.mts b/src/version2/models/issueLink.mts new file mode 100644 index 000000000..cf861979e --- /dev/null +++ b/src/version2/models/issueLink.mts @@ -0,0 +1,13 @@ +import { IssueLinkType } from './issueLinkType.mjs'; +import { LinkedIssue } from './linkedIssue.mjs'; + +/** Details of a link between issues. */ +export interface IssueLink { + /** The ID of the issue link. */ + id?: string; + inwardIssue?: LinkedIssue; + outwardIssue?: LinkedIssue; + /** The URL of the issue link. */ + self?: string; + type?: IssueLinkType; +} diff --git a/src/version2/models/issueLink.ts b/src/version2/models/issueLink.ts deleted file mode 100644 index ad044a302..000000000 --- a/src/version2/models/issueLink.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { IssueLinkType } from './issueLinkType.js'; -import type { LinkedIssue } from './linkedIssue.js'; - -/** Details of a link between issues. */ -export interface IssueLink { - /** The ID of the issue link. */ - id?: string; - inwardIssue?: LinkedIssue; - outwardIssue?: LinkedIssue; - /** The URL of the issue link. */ - self?: string; - type?: IssueLinkType; -} diff --git a/src/version2/models/issueLinkType.ts b/src/version2/models/issueLinkType.mts similarity index 100% rename from src/version2/models/issueLinkType.ts rename to src/version2/models/issueLinkType.mts diff --git a/src/version2/models/issueLinkTypes.mts b/src/version2/models/issueLinkTypes.mts new file mode 100644 index 000000000..696252c57 --- /dev/null +++ b/src/version2/models/issueLinkTypes.mts @@ -0,0 +1,7 @@ +import { IssueLinkType } from './issueLinkType.mjs'; + +/** A list of issue link type beans. */ +export interface IssueLinkTypes { + /** The issue link type bean. */ + issueLinkTypes?: IssueLinkType[]; +} diff --git a/src/version2/models/issueLinkTypes.ts b/src/version2/models/issueLinkTypes.ts deleted file mode 100644 index a9a9b4441..000000000 --- a/src/version2/models/issueLinkTypes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IssueLinkType } from './issueLinkType.js'; - -/** A list of issue link type beans. */ -export interface IssueLinkTypes { - /** The issue link type bean. */ - issueLinkTypes?: IssueLinkType[]; -} diff --git a/src/version2/models/issueList.ts b/src/version2/models/issueList.mts similarity index 100% rename from src/version2/models/issueList.ts rename to src/version2/models/issueList.mts diff --git a/src/version2/models/issueMatches.mts b/src/version2/models/issueMatches.mts new file mode 100644 index 000000000..2dea52f98 --- /dev/null +++ b/src/version2/models/issueMatches.mts @@ -0,0 +1,6 @@ +import { IssueMatchesForJQL } from './issueMatchesForJQL.mjs'; + +/** A list of matched issues or errors for each Jql query, in the order the Jql queries were passed. */ +export interface IssueMatches { + matches: IssueMatchesForJQL[]; +} diff --git a/src/version2/models/issueMatches.ts b/src/version2/models/issueMatches.ts deleted file mode 100644 index 5c4421961..000000000 --- a/src/version2/models/issueMatches.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueMatchesForJQL } from './issueMatchesForJQL.js'; - -/** A list of matched issues or errors for each JQL query, in the order the JQL queries were passed. */ -export interface IssueMatches { - matches: IssueMatchesForJQL[]; -} diff --git a/src/version2/models/issueMatchesForJQL.mts b/src/version2/models/issueMatchesForJQL.mts new file mode 100644 index 000000000..7c6202dd2 --- /dev/null +++ b/src/version2/models/issueMatchesForJQL.mts @@ -0,0 +1,7 @@ +/** A list of the issues matched to a Jql query or details of errors encountered during matching. */ +export interface IssueMatchesForJQL { + /** A list of errors. */ + errors: string[]; + /** A list of issue IDs. */ + matchedIssues: number[]; +} diff --git a/src/version2/models/issueMatchesForJQL.ts b/src/version2/models/issueMatchesForJQL.ts deleted file mode 100644 index 3e641200c..000000000 --- a/src/version2/models/issueMatchesForJQL.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** A list of the issues matched to a JQL query or details of errors encountered during matching. */ -export interface IssueMatchesForJQL { - /** A list of errors. */ - errors: string[]; - /** A list of issue IDs. */ - matchedIssues: number[]; -} diff --git a/src/version2/models/issuePickerSuggestions.mts b/src/version2/models/issuePickerSuggestions.mts new file mode 100644 index 000000000..3c49bbd5f --- /dev/null +++ b/src/version2/models/issuePickerSuggestions.mts @@ -0,0 +1,7 @@ +import { IssuePickerSuggestionsIssueType } from './issuePickerSuggestionsIssueType.mjs'; + +/** A list of issues suggested for use in auto-completion. */ +export interface IssuePickerSuggestions { + /** A list of issues for an issue type suggested for use in auto-completion. */ + sections?: IssuePickerSuggestionsIssueType[]; +} diff --git a/src/version2/models/issuePickerSuggestions.ts b/src/version2/models/issuePickerSuggestions.ts deleted file mode 100644 index a448a8494..000000000 --- a/src/version2/models/issuePickerSuggestions.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IssuePickerSuggestionsIssueType } from './issuePickerSuggestionsIssueType.js'; - -/** A list of issues suggested for use in auto-completion. */ -export interface IssuePickerSuggestions { - /** A list of issues for an issue type suggested for use in auto-completion. */ - sections?: IssuePickerSuggestionsIssueType[]; -} diff --git a/src/version2/models/issuePickerSuggestionsIssueType.mts b/src/version2/models/issuePickerSuggestionsIssueType.mts new file mode 100644 index 000000000..1b2af5090 --- /dev/null +++ b/src/version2/models/issuePickerSuggestionsIssueType.mts @@ -0,0 +1,15 @@ +import { SuggestedIssue } from './suggestedIssue.mjs'; + +/** A type of issue suggested for use in auto-completion. */ +export interface IssuePickerSuggestionsIssueType { + /** The ID of the type of issues suggested for use in auto-completion. */ + id?: string; + /** A list of issues suggested for use in auto-completion. */ + issues?: SuggestedIssue[]; + /** The label of the type of issues suggested for use in auto-completion. */ + label?: string; + /** If no issue suggestions are found, returns a message indicating no suggestions were found, */ + msg?: string; + /** If issue suggestions are found, returns a message indicating the number of issues suggestions found and returned. */ + sub?: string; +} diff --git a/src/version2/models/issuePickerSuggestionsIssueType.ts b/src/version2/models/issuePickerSuggestionsIssueType.ts deleted file mode 100644 index efe76ac4e..000000000 --- a/src/version2/models/issuePickerSuggestionsIssueType.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { SuggestedIssue } from './suggestedIssue.js'; - -/** A type of issue suggested for use in auto-completion. */ -export interface IssuePickerSuggestionsIssueType { - /** The ID of the type of issues suggested for use in auto-completion. */ - id?: string; - /** A list of issues suggested for use in auto-completion. */ - issues?: SuggestedIssue[]; - /** The label of the type of issues suggested for use in auto-completion. */ - label?: string; - /** If no issue suggestions are found, returns a message indicating no suggestions were found, */ - msg?: string; - /** If issue suggestions are found, returns a message indicating the number of issues suggestions found and returned. */ - sub?: string; -} diff --git a/src/version2/models/issueSecurityLevelMember.mts b/src/version2/models/issueSecurityLevelMember.mts new file mode 100644 index 000000000..55dd86d70 --- /dev/null +++ b/src/version2/models/issueSecurityLevelMember.mts @@ -0,0 +1,10 @@ +import type { PermissionHolder } from './permissionHolder.mjs'; + +/** Issue security level member. */ +export interface IssueSecurityLevelMember { + holder?: PermissionHolder; + /** The ID of the issue security level member. */ + id: number; + /** The ID of the issue security level. */ + issueSecurityLevelId: number; +} diff --git a/src/version2/models/issueSecurityLevelMember.ts b/src/version2/models/issueSecurityLevelMember.ts deleted file mode 100644 index 0d01fcf3c..000000000 --- a/src/version2/models/issueSecurityLevelMember.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { PermissionHolder } from './permissionHolder.js'; - -/** Issue security level member. */ -export interface IssueSecurityLevelMember { - holder?: PermissionHolder; - /** The ID of the issue security level member. */ - id: number; - /** The ID of the issue security level. */ - issueSecurityLevelId: number; -} diff --git a/src/version2/models/issueSecuritySchemeToProjectMapping.ts b/src/version2/models/issueSecuritySchemeToProjectMapping.mts similarity index 100% rename from src/version2/models/issueSecuritySchemeToProjectMapping.ts rename to src/version2/models/issueSecuritySchemeToProjectMapping.mts diff --git a/src/version2/models/issueTransition.mts b/src/version2/models/issueTransition.mts new file mode 100644 index 000000000..b9950dc2b --- /dev/null +++ b/src/version2/models/issueTransition.mts @@ -0,0 +1,31 @@ +import type { StatusDetails } from './statusDetails.mjs'; +import { TabMetadata } from './tabMetadata.mjs'; + +/** Details of an issue transition. */ +export interface IssueTransition { + /** The ID of the issue transition. Required when specifying a transition to undertake. */ + id?: string; + /** The name of the issue transition. */ + name?: string; + to?: StatusDetails; + /** Whether there is a screen associated with the issue transition. */ + hasScreen?: boolean; + /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ + isGlobal?: boolean; + /** Whether this is the initial issue transition for the workflow. */ + isInitial?: boolean; + /** Whether the transition is available to be performed. */ + isAvailable?: boolean; + /** Whether the issue has to meet criteria before the issue transition is applied. */ + isConditional?: boolean; + /** + * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and + * `update` in a transition request. + */ + fields?: {}; + /** Details of the tabs associated with the issue transition screen and the fields within these tabs. */ + tabs?: TabMetadata[]; + /** Expand options that include additional transition details in the response. */ + expand?: string; + looped?: boolean; +} diff --git a/src/version2/models/issueTransition.ts b/src/version2/models/issueTransition.ts deleted file mode 100644 index 2f37de70e..000000000 --- a/src/version2/models/issueTransition.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { StatusDetails } from './statusDetails.js'; -import type { TabMetadata } from './tabMetadata.js'; - -/** Details of an issue transition. */ -export interface IssueTransition { - /** The ID of the issue transition. Required when specifying a transition to undertake. */ - id?: string; - /** The name of the issue transition. */ - name?: string; - to?: StatusDetails; - /** Whether there is a screen associated with the issue transition. */ - hasScreen?: boolean; - /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ - isGlobal?: boolean; - /** Whether this is the initial issue transition for the workflow. */ - isInitial?: boolean; - /** Whether the transition is available to be performed. */ - isAvailable?: boolean; - /** Whether the issue has to meet criteria before the issue transition is applied. */ - isConditional?: boolean; - /** - * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and - * `update` in a transition request. - */ - fields?: {}; - /** Details of the tabs associated with the issue transition screen and the fields within these tabs. */ - tabs?: TabMetadata[]; - /** Expand options that include additional transition details in the response. */ - expand?: string; - looped?: boolean; -} diff --git a/src/version2/models/issueTypeCreate.ts b/src/version2/models/issueTypeCreate.mts similarity index 100% rename from src/version2/models/issueTypeCreate.ts rename to src/version2/models/issueTypeCreate.mts diff --git a/src/version2/models/issueTypeDetails.mts b/src/version2/models/issueTypeDetails.mts new file mode 100644 index 000000000..79531408f --- /dev/null +++ b/src/version2/models/issueTypeDetails.mts @@ -0,0 +1,24 @@ +import type { Scope } from './scope.mjs'; + +/** Details about an issue type. */ +export interface IssueTypeDetails { + /** The ID of the issue type's avatar. */ + avatarId?: number; + /** The description of the issue type. */ + description?: string; + /** Unique ID for next-gen projects. */ + entityId?: string; + /** Hierarchy level of the issue type. */ + hierarchyLevel?: number; + /** The URL of the issue type's avatar. */ + iconUrl?: string; + /** The ID of the issue type. */ + id?: string; + /** The name of the issue type. */ + name?: string; + scope?: Scope; + /** The URL of these issue type details. */ + self?: string; + /** Whether this issue type is used to create subtasks. */ + subtask?: boolean; +} diff --git a/src/version2/models/issueTypeDetails.ts b/src/version2/models/issueTypeDetails.ts deleted file mode 100644 index 8829c0c15..000000000 --- a/src/version2/models/issueTypeDetails.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { Scope } from './scope.js'; - -/** Details about an issue type. */ -export interface IssueTypeDetails { - /** The ID of the issue type's avatar. */ - avatarId?: number; - /** The description of the issue type. */ - description?: string; - /** Unique ID for next-gen projects. */ - entityId?: string; - /** Hierarchy level of the issue type. */ - hierarchyLevel?: number; - /** The URL of the issue type's avatar. */ - iconUrl?: string; - /** The ID of the issue type. */ - id?: string; - /** The name of the issue type. */ - name?: string; - scope?: Scope; - /** The URL of these issue type details. */ - self?: string; - /** Whether this issue type is used to create subtasks. */ - subtask?: boolean; -} diff --git a/src/version2/models/issueTypeIds.ts b/src/version2/models/issueTypeIds.mts similarity index 100% rename from src/version2/models/issueTypeIds.ts rename to src/version2/models/issueTypeIds.mts diff --git a/src/version2/models/issueTypeIdsToRemove.ts b/src/version2/models/issueTypeIdsToRemove.mts similarity index 100% rename from src/version2/models/issueTypeIdsToRemove.ts rename to src/version2/models/issueTypeIdsToRemove.mts diff --git a/src/version2/models/issueTypeInfo.ts b/src/version2/models/issueTypeInfo.mts similarity index 100% rename from src/version2/models/issueTypeInfo.ts rename to src/version2/models/issueTypeInfo.mts diff --git a/src/version2/models/issueTypeIssueCreateMetadata.mts b/src/version2/models/issueTypeIssueCreateMetadata.mts new file mode 100644 index 000000000..04ba5df63 --- /dev/null +++ b/src/version2/models/issueTypeIssueCreateMetadata.mts @@ -0,0 +1,28 @@ +import type { Scope } from './scope.mjs'; + +/** Details of the issue creation metadata for an issue type. */ +export interface IssueTypeIssueCreateMetadata { + /** The ID of the issue type's avatar. */ + avatarId?: number; + /** The description of the issue type. */ + description?: string; + /** Unique ID for next-gen projects. */ + entityId?: string; + /** Expand options that include additional issue type metadata details in the response. */ + expand?: string; + /** List of the fields available when creating an issue for the issue type. */ + fields?: {}; + /** Hierarchy level of the issue type. */ + hierarchyLevel?: number; + /** The URL of the issue type's avatar. */ + iconUrl?: string; + /** The ID of the issue type. */ + id?: string; + /** The name of the issue type. */ + name?: string; + scope?: Scope; + /** The URL of these issue type details. */ + self?: string; + /** Whether this issue type is used to create subtasks. */ + subtask?: boolean; +} diff --git a/src/version2/models/issueTypeIssueCreateMetadata.ts b/src/version2/models/issueTypeIssueCreateMetadata.ts deleted file mode 100644 index 3ef4cb470..000000000 --- a/src/version2/models/issueTypeIssueCreateMetadata.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Scope } from './scope.js'; - -/** Details of the issue creation metadata for an issue type. */ -export interface IssueTypeIssueCreateMetadata { - /** The ID of the issue type's avatar. */ - avatarId?: number; - /** The description of the issue type. */ - description?: string; - /** Unique ID for next-gen projects. */ - entityId?: string; - /** Expand options that include additional issue type metadata details in the response. */ - expand?: string; - /** List of the fields available when creating an issue for the issue type. */ - fields?: {}; - /** Hierarchy level of the issue type. */ - hierarchyLevel?: number; - /** The URL of the issue type's avatar. */ - iconUrl?: string; - /** The ID of the issue type. */ - id?: string; - /** The name of the issue type. */ - name?: string; - scope?: Scope; - /** The URL of these issue type details. */ - self?: string; - /** Whether this issue type is used to create subtasks. */ - subtask?: boolean; -} diff --git a/src/version2/models/issueTypeScheme.ts b/src/version2/models/issueTypeScheme.mts similarity index 100% rename from src/version2/models/issueTypeScheme.ts rename to src/version2/models/issueTypeScheme.mts diff --git a/src/version2/models/issueTypeSchemeDetails.ts b/src/version2/models/issueTypeSchemeDetails.mts similarity index 100% rename from src/version2/models/issueTypeSchemeDetails.ts rename to src/version2/models/issueTypeSchemeDetails.mts diff --git a/src/version2/models/issueTypeSchemeID.ts b/src/version2/models/issueTypeSchemeID.mts similarity index 100% rename from src/version2/models/issueTypeSchemeID.ts rename to src/version2/models/issueTypeSchemeID.mts diff --git a/src/version2/models/issueTypeSchemeMapping.ts b/src/version2/models/issueTypeSchemeMapping.mts similarity index 100% rename from src/version2/models/issueTypeSchemeMapping.ts rename to src/version2/models/issueTypeSchemeMapping.mts diff --git a/src/version2/models/issueTypeSchemeProjectAssociation.ts b/src/version2/models/issueTypeSchemeProjectAssociation.mts similarity index 100% rename from src/version2/models/issueTypeSchemeProjectAssociation.ts rename to src/version2/models/issueTypeSchemeProjectAssociation.mts diff --git a/src/version2/models/issueTypeSchemeProjects.mts b/src/version2/models/issueTypeSchemeProjects.mts new file mode 100644 index 000000000..b975f1026 --- /dev/null +++ b/src/version2/models/issueTypeSchemeProjects.mts @@ -0,0 +1,8 @@ +import { IssueTypeScheme } from './issueTypeScheme.mjs'; + +/** Issue type scheme with a list of the projects that use it. */ +export interface IssueTypeSchemeProjects { + issueTypeScheme?: IssueTypeScheme; + /** The IDs of the projects using the issue type scheme. */ + projectIds: string[]; +} diff --git a/src/version2/models/issueTypeSchemeProjects.ts b/src/version2/models/issueTypeSchemeProjects.ts deleted file mode 100644 index ac0f50b74..000000000 --- a/src/version2/models/issueTypeSchemeProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypeScheme } from './issueTypeScheme.js'; - -/** Issue type scheme with a list of the projects that use it. */ -export interface IssueTypeSchemeProjects { - issueTypeScheme?: IssueTypeScheme; - /** The IDs of the projects using the issue type scheme. */ - projectIds: string[]; -} diff --git a/src/version2/models/issueTypeSchemeUpdateDetails.ts b/src/version2/models/issueTypeSchemeUpdateDetails.mts similarity index 100% rename from src/version2/models/issueTypeSchemeUpdateDetails.ts rename to src/version2/models/issueTypeSchemeUpdateDetails.mts diff --git a/src/version2/models/issueTypeScreenScheme.ts b/src/version2/models/issueTypeScreenScheme.mts similarity index 100% rename from src/version2/models/issueTypeScreenScheme.ts rename to src/version2/models/issueTypeScreenScheme.mts diff --git a/src/version2/models/issueTypeScreenSchemeDetails.mts b/src/version2/models/issueTypeScreenSchemeDetails.mts new file mode 100644 index 000000000..5ac0de4fe --- /dev/null +++ b/src/version2/models/issueTypeScreenSchemeDetails.mts @@ -0,0 +1,14 @@ +import { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping.mjs'; + +/** The details of an issue type screen scheme. */ +export interface IssueTypeScreenSchemeDetails { + /** The description of the issue type screen scheme. The maximum length is 255 characters. */ + description?: string; + /** + * The IDs of the screen schemes for the issue type IDs and _default_. A _default_ entry is required to create an + * issue type screen scheme, it defines the mapping for all issue types without a screen scheme. + */ + issueTypeMappings: IssueTypeScreenSchemeMapping[]; + /** The name of the issue type screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: string; +} diff --git a/src/version2/models/issueTypeScreenSchemeDetails.ts b/src/version2/models/issueTypeScreenSchemeDetails.ts deleted file mode 100644 index 06f006a03..000000000 --- a/src/version2/models/issueTypeScreenSchemeDetails.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping.js'; - -/** The details of an issue type screen scheme. */ -export interface IssueTypeScreenSchemeDetails { - /** The description of the issue type screen scheme. The maximum length is 255 characters. */ - description?: string; - /** - * The IDs of the screen schemes for the issue type IDs and _default_. A _default_ entry is required to create an - * issue type screen scheme, it defines the mapping for all issue types without a screen scheme. - */ - issueTypeMappings: IssueTypeScreenSchemeMapping[]; - /** The name of the issue type screen scheme. The name must be unique. The maximum length is 255 characters. */ - name: string; -} diff --git a/src/version2/models/issueTypeScreenSchemeId.ts b/src/version2/models/issueTypeScreenSchemeId.mts similarity index 100% rename from src/version2/models/issueTypeScreenSchemeId.ts rename to src/version2/models/issueTypeScreenSchemeId.mts diff --git a/src/version2/models/issueTypeScreenSchemeItem.ts b/src/version2/models/issueTypeScreenSchemeItem.mts similarity index 100% rename from src/version2/models/issueTypeScreenSchemeItem.ts rename to src/version2/models/issueTypeScreenSchemeItem.mts diff --git a/src/version2/models/issueTypeScreenSchemeMapping.ts b/src/version2/models/issueTypeScreenSchemeMapping.mts similarity index 100% rename from src/version2/models/issueTypeScreenSchemeMapping.ts rename to src/version2/models/issueTypeScreenSchemeMapping.mts diff --git a/src/version2/models/issueTypeScreenSchemeMappingDetails.mts b/src/version2/models/issueTypeScreenSchemeMappingDetails.mts new file mode 100644 index 000000000..b8d7f4d5f --- /dev/null +++ b/src/version2/models/issueTypeScreenSchemeMappingDetails.mts @@ -0,0 +1,10 @@ +import { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping.mjs'; + +/** A list of issue type screen scheme mappings. */ +export interface IssueTypeScreenSchemeMappingDetails { + /** + * The list of issue type to screen scheme mappings. A _default_ entry cannot be specified because a default entry is + * added when an issue type screen scheme is created. + */ + issueTypeMappings: IssueTypeScreenSchemeMapping[]; +} diff --git a/src/version2/models/issueTypeScreenSchemeMappingDetails.ts b/src/version2/models/issueTypeScreenSchemeMappingDetails.ts deleted file mode 100644 index db73374ac..000000000 --- a/src/version2/models/issueTypeScreenSchemeMappingDetails.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping.js'; - -/** A list of issue type screen scheme mappings. */ -export interface IssueTypeScreenSchemeMappingDetails { - /** - * The list of issue type to screen scheme mappings. A _default_ entry cannot be specified because a default entry is - * added when an issue type screen scheme is created. - */ - issueTypeMappings: IssueTypeScreenSchemeMapping[]; -} diff --git a/src/version2/models/issueTypeScreenSchemeProjectAssociation.ts b/src/version2/models/issueTypeScreenSchemeProjectAssociation.mts similarity index 100% rename from src/version2/models/issueTypeScreenSchemeProjectAssociation.ts rename to src/version2/models/issueTypeScreenSchemeProjectAssociation.mts diff --git a/src/version2/models/issueTypeScreenSchemeUpdateDetails.ts b/src/version2/models/issueTypeScreenSchemeUpdateDetails.mts similarity index 100% rename from src/version2/models/issueTypeScreenSchemeUpdateDetails.ts rename to src/version2/models/issueTypeScreenSchemeUpdateDetails.mts diff --git a/src/version2/models/issueTypeScreenSchemesProjects.mts b/src/version2/models/issueTypeScreenSchemesProjects.mts new file mode 100644 index 000000000..896e054ad --- /dev/null +++ b/src/version2/models/issueTypeScreenSchemesProjects.mts @@ -0,0 +1,8 @@ +import { IssueTypeScreenScheme } from './issueTypeScreenScheme.mjs'; + +/** Issue type screen scheme with a list of the projects that use it. */ +export interface IssueTypeScreenSchemesProjects { + issueTypeScreenScheme?: IssueTypeScreenScheme; + /** The IDs of the projects using the issue type screen scheme. */ + projectIds: string[]; +} diff --git a/src/version2/models/issueTypeScreenSchemesProjects.ts b/src/version2/models/issueTypeScreenSchemesProjects.ts deleted file mode 100644 index 8fe7e994b..000000000 --- a/src/version2/models/issueTypeScreenSchemesProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypeScreenScheme } from './issueTypeScreenScheme.js'; - -/** Issue type screen scheme with a list of the projects that use it. */ -export interface IssueTypeScreenSchemesProjects { - issueTypeScreenScheme?: IssueTypeScreenScheme; - /** The IDs of the projects using the issue type screen scheme. */ - projectIds: string[]; -} diff --git a/src/version2/models/issueTypeToContextMapping.ts b/src/version2/models/issueTypeToContextMapping.mts similarity index 100% rename from src/version2/models/issueTypeToContextMapping.ts rename to src/version2/models/issueTypeToContextMapping.mts diff --git a/src/version2/models/issueTypeUpdate.ts b/src/version2/models/issueTypeUpdate.mts similarity index 100% rename from src/version2/models/issueTypeUpdate.ts rename to src/version2/models/issueTypeUpdate.mts diff --git a/src/version2/models/issueTypeWithStatus.mts b/src/version2/models/issueTypeWithStatus.mts new file mode 100644 index 000000000..178f6ac06 --- /dev/null +++ b/src/version2/models/issueTypeWithStatus.mts @@ -0,0 +1,15 @@ +import type { StatusDetails } from './statusDetails.mjs'; + +/** Status details for an issue type. */ +export interface IssueTypeWithStatus { + /** The ID of the issue type. */ + id: string; + /** The name of the issue type. */ + name: string; + /** The URL of the issue type's status details. */ + self: string; + /** List of status details for the issue type. */ + statuses: StatusDetails[]; + /** Whether this issue type represents subtasks. */ + subtask: boolean; +} diff --git a/src/version2/models/issueTypeWithStatus.ts b/src/version2/models/issueTypeWithStatus.ts deleted file mode 100644 index dfe7efb08..000000000 --- a/src/version2/models/issueTypeWithStatus.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { StatusDetails } from './statusDetails.js'; - -/** Status details for an issue type. */ -export interface IssueTypeWithStatus { - /** The ID of the issue type. */ - id: string; - /** The name of the issue type. */ - name: string; - /** The URL of the issue type's status details. */ - self: string; - /** List of status details for the issue type. */ - statuses: StatusDetails[]; - /** Whether this issue type represents subtasks. */ - subtask: boolean; -} diff --git a/src/version2/models/issueTypeWorkflowMapping.ts b/src/version2/models/issueTypeWorkflowMapping.mts similarity index 100% rename from src/version2/models/issueTypeWorkflowMapping.ts rename to src/version2/models/issueTypeWorkflowMapping.mts diff --git a/src/version2/models/issueTypesWorkflowMapping.ts b/src/version2/models/issueTypesWorkflowMapping.mts similarity index 100% rename from src/version2/models/issueTypesWorkflowMapping.ts rename to src/version2/models/issueTypesWorkflowMapping.mts diff --git a/src/version2/models/issueUpdateDetails.mts b/src/version2/models/issueUpdateDetails.mts new file mode 100644 index 000000000..6510f4f59 --- /dev/null +++ b/src/version2/models/issueUpdateDetails.mts @@ -0,0 +1,23 @@ +import { EntityProperty } from './entityProperty.mjs'; +import { Fields } from './fields.mjs'; +import { HistoryMetadata } from './historyMetadata.mjs'; +import type { IssueTransition } from './issueTransition.mjs'; + +/** Details of an issue update request. */ +export interface IssueUpdateDetails { + /** + * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field + * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are + * required, use `update`. Fields included in here cannot be included in `update`. + */ + fields?: Partial | any; + historyMetadata?: HistoryMetadata; + /** Details of issue properties to be added or update. */ + properties?: EntityProperty[]; + transition?: IssueTransition; + /** + * A Map containing the field name and a list of operations to perform on the issue screen field. Note that fields + * included in here cannot be included in `fields`. + */ + update?: {}; +} diff --git a/src/version2/models/issueUpdateDetails.ts b/src/version2/models/issueUpdateDetails.ts deleted file mode 100644 index 53ac169a6..000000000 --- a/src/version2/models/issueUpdateDetails.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { EntityProperty } from './entityProperty.js'; -import type { Fields } from './fields.js'; -import type { HistoryMetadata } from './historyMetadata.js'; -import type { IssueTransition } from './issueTransition.js'; - -/** Details of an issue update request. */ -export interface IssueUpdateDetails { - /** - * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field - * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are - * required, use `update`. Fields included in here cannot be included in `update`. - */ - fields?: Partial | any; - historyMetadata?: HistoryMetadata; - /** Details of issue properties to be added or update. */ - properties?: EntityProperty[]; - transition?: IssueTransition; - /** - * A Map containing the field name and a list of operations to perform on the issue screen field. Note that fields - * included in here cannot be included in `fields`. - */ - update?: {}; -} diff --git a/src/version2/models/issueUpdateMetadata.mts b/src/version2/models/issueUpdateMetadata.mts new file mode 100644 index 000000000..f58ace871 --- /dev/null +++ b/src/version2/models/issueUpdateMetadata.mts @@ -0,0 +1,7 @@ +import { Fields } from './fields.mjs'; + +/** A list of editable field details. */ +export interface IssueUpdateMetadata { + /** A list of editable field details. */ + fields?: Fields; +} diff --git a/src/version2/models/issueUpdateMetadata.ts b/src/version2/models/issueUpdateMetadata.ts deleted file mode 100644 index 5c7f96f5a..000000000 --- a/src/version2/models/issueUpdateMetadata.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Fields } from './fields.js'; - -/** A list of editable field details. */ -export interface IssueUpdateMetadata { - /** A list of editable field details. */ - fields?: Fields; -} diff --git a/src/version2/models/issuesAndJQLQueries.mts b/src/version2/models/issuesAndJQLQueries.mts new file mode 100644 index 000000000..d774f31e3 --- /dev/null +++ b/src/version2/models/issuesAndJQLQueries.mts @@ -0,0 +1,7 @@ +/** List of issues and Jql queries. */ +export interface IssuesAndJQLQueries { + /** A list of issue IDs. */ + issueIds: number[]; + /** A list of Jql queries. */ + jqls: string[]; +} diff --git a/src/version2/models/issuesAndJQLQueries.ts b/src/version2/models/issuesAndJQLQueries.ts deleted file mode 100644 index 4a036ad0e..000000000 --- a/src/version2/models/issuesAndJQLQueries.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** List of issues and JQL queries. */ -export interface IssuesAndJQLQueries { - /** A list of issue IDs. */ - issueIds: number[]; - /** A list of JQL queries. */ - jqls: string[]; -} diff --git a/src/version2/models/issuesJqlMetaData.mts b/src/version2/models/issuesJqlMetaData.mts new file mode 100644 index 000000000..44dc0191c --- /dev/null +++ b/src/version2/models/issuesJqlMetaData.mts @@ -0,0 +1,13 @@ +/** The description of the page of issues loaded by the provided Jql query. */ +export interface IssuesJqlMetaData { + /** The number of issues that were loaded in this evaluation. */ + count: number; + /** The maximum number of issues that could be loaded in this evaluation. */ + maxResults: number; + /** The index of the first issue. */ + startAt: number; + /** The total number of issues the Jql returned. */ + totalCount: number; + /** Any warnings related to the Jql query. Present only if the validation mode was set to `warn`. */ + validationWarnings?: string[]; +} diff --git a/src/version2/models/issuesJqlMetaData.ts b/src/version2/models/issuesJqlMetaData.ts deleted file mode 100644 index 35e4987b7..000000000 --- a/src/version2/models/issuesJqlMetaData.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** The description of the page of issues loaded by the provided JQL query. */ -export interface IssuesJqlMetaData { - /** The number of issues that were loaded in this evaluation. */ - count: number; - /** The maximum number of issues that could be loaded in this evaluation. */ - maxResults: number; - /** The index of the first issue. */ - startAt: number; - /** The total number of issues the JQL returned. */ - totalCount: number; - /** Any warnings related to the JQL query. Present only if the validation mode was set to `warn`. */ - validationWarnings?: string[]; -} diff --git a/src/version2/models/issuesMeta.mts b/src/version2/models/issuesMeta.mts new file mode 100644 index 000000000..569f4bf2a --- /dev/null +++ b/src/version2/models/issuesMeta.mts @@ -0,0 +1,6 @@ +import { IssuesJqlMetaData } from './issuesJqlMetaData.mjs'; + +/** Meta data describing the `issues` context variable. */ +export interface IssuesMeta { + jql?: IssuesJqlMetaData; +} diff --git a/src/version2/models/issuesMeta.ts b/src/version2/models/issuesMeta.ts deleted file mode 100644 index 786db99f5..000000000 --- a/src/version2/models/issuesMeta.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssuesJqlMetaData } from './issuesJqlMetaData.js'; - -/** Meta data describing the `issues` context variable. */ -export interface IssuesMeta { - jql?: IssuesJqlMetaData; -} diff --git a/src/version2/models/issuesUpdate.mts b/src/version2/models/issuesUpdate.mts new file mode 100644 index 000000000..3c850d1da --- /dev/null +++ b/src/version2/models/issuesUpdate.mts @@ -0,0 +1,5 @@ +import { IssueUpdateDetails } from './issueUpdateDetails.mjs'; + +export interface IssuesUpdate { + issueUpdates?: IssueUpdateDetails[]; +} diff --git a/src/version2/models/issuesUpdate.ts b/src/version2/models/issuesUpdate.ts deleted file mode 100644 index 005e0623e..000000000 --- a/src/version2/models/issuesUpdate.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { IssueUpdateDetails } from './issueUpdateDetails.js'; - -export interface IssuesUpdate { - issueUpdates?: IssueUpdateDetails[]; -} diff --git a/src/version2/models/jQLPersonalDataMigrationRequest.mts b/src/version2/models/jQLPersonalDataMigrationRequest.mts new file mode 100644 index 000000000..793136c7c --- /dev/null +++ b/src/version2/models/jQLPersonalDataMigrationRequest.mts @@ -0,0 +1,5 @@ +/** The Jql queries to be converted. */ +export interface JQLPersonalDataMigrationRequest { + /** A list of queries with user identifiers. Maximum of 100 queries. */ + queryStrings?: string[]; +} diff --git a/src/version2/models/jQLPersonalDataMigrationRequest.ts b/src/version2/models/jQLPersonalDataMigrationRequest.ts deleted file mode 100644 index 0a0730817..000000000 --- a/src/version2/models/jQLPersonalDataMigrationRequest.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The JQL queries to be converted. */ -export interface JQLPersonalDataMigrationRequest { - /** A list of queries with user identifiers. Maximum of 100 queries. */ - queryStrings?: string[]; -} diff --git a/src/version2/models/jQLQueryWithUnknownUsers.mts b/src/version2/models/jQLQueryWithUnknownUsers.mts new file mode 100644 index 000000000..ecdb0be81 --- /dev/null +++ b/src/version2/models/jQLQueryWithUnknownUsers.mts @@ -0,0 +1,7 @@ +/** Jql queries that contained users that could not be found */ +export interface JQLQueryWithUnknownUsers { + /** The converted query, with accountIDs instead of user identifiers, or 'unknown' for users that could not be found */ + convertedQuery?: string; + /** The original query, for reference */ + originalQuery?: string; +} diff --git a/src/version2/models/jQLQueryWithUnknownUsers.ts b/src/version2/models/jQLQueryWithUnknownUsers.ts deleted file mode 100644 index 81661d53e..000000000 --- a/src/version2/models/jQLQueryWithUnknownUsers.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** JQL queries that contained users that could not be found */ -export interface JQLQueryWithUnknownUsers { - /** The converted query, with accountIDs instead of user identifiers, or 'unknown' for users that could not be found */ - convertedQuery?: string; - /** The original query, for reference */ - originalQuery?: string; -} diff --git a/src/version2/models/jQLReferenceData.mts b/src/version2/models/jQLReferenceData.mts new file mode 100644 index 000000000..13e0e8fa4 --- /dev/null +++ b/src/version2/models/jQLReferenceData.mts @@ -0,0 +1,12 @@ +import { FieldReferenceData } from './fieldReferenceData.mjs'; +import { FunctionReferenceData } from './functionReferenceData.mjs'; + +/** Lists of Jql reference data. */ +export interface JQLReferenceData { + /** List of Jql query reserved words. */ + jqlReservedWords?: string[]; + /** List of fields usable in Jql queries. */ + visibleFieldNames?: FieldReferenceData[]; + /** List of functions usable in Jql queries. */ + visibleFunctionNames?: FunctionReferenceData[]; +} diff --git a/src/version2/models/jQLReferenceData.ts b/src/version2/models/jQLReferenceData.ts deleted file mode 100644 index 14b5f0552..000000000 --- a/src/version2/models/jQLReferenceData.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { FieldReferenceData } from './fieldReferenceData.js'; -import type { FunctionReferenceData } from './functionReferenceData.js'; - -/** Lists of JQL reference data. */ -export interface JQLReferenceData { - /** List of JQL query reserved words. */ - jqlReservedWords?: string[]; - /** List of fields usable in JQL queries. */ - visibleFieldNames?: FieldReferenceData[]; - /** List of functions usable in JQL queries. */ - visibleFunctionNames?: FunctionReferenceData[]; -} diff --git a/src/version2/models/jexpIssues.mts b/src/version2/models/jexpIssues.mts new file mode 100644 index 000000000..1b6e22b86 --- /dev/null +++ b/src/version2/models/jexpIssues.mts @@ -0,0 +1,6 @@ +import { JexpJqlIssues } from './jexpJqlIssues.mjs'; + +/** The Jql specifying the issues available in the evaluated Jira expression under the `issues` context variable. */ +export interface JexpIssues { + jql?: JexpJqlIssues; +} diff --git a/src/version2/models/jexpIssues.ts b/src/version2/models/jexpIssues.ts deleted file mode 100644 index ffb725892..000000000 --- a/src/version2/models/jexpIssues.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { JexpJqlIssues } from './jexpJqlIssues.js'; - -/** The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. */ -export interface JexpIssues { - jql?: JexpJqlIssues; -} diff --git a/src/version2/models/jexpJqlIssues.mts b/src/version2/models/jexpJqlIssues.mts new file mode 100644 index 000000000..c0de2c404 --- /dev/null +++ b/src/version2/models/jexpJqlIssues.mts @@ -0,0 +1,19 @@ +/** + * The Jql specifying the issues available in the evaluated Jira expression under the `issues` context variable. Not all + * issues returned by the Jql query are loaded, only those described by the `startAt` and `maxResults` properties. To + * determine whether it is necessary to iterate to ensure all the issues returned by the Jql query are evaluated, + * inspect `meta.issues.jql.count` in the response. + */ +export interface JexpJqlIssues { + /** + * The maximum number of issues to return from the Jql query. Inspect `meta.issues.jql.maxResults` in the response to + * ensure the maximum value has not been exceeded. + */ + maxResults?: number; + /** The Jql query. */ + query?: string; + /** The index of the first issue to return from the Jql query. */ + startAt?: number; + /** Determines how to validate the Jql query and treat the validation results. */ + validation?: string; +} diff --git a/src/version2/models/jexpJqlIssues.ts b/src/version2/models/jexpJqlIssues.ts deleted file mode 100644 index aeb69f78a..000000000 --- a/src/version2/models/jexpJqlIssues.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. Not all - * issues returned by the JQL query are loaded, only those described by the `startAt` and `maxResults` properties. To - * determine whether it is necessary to iterate to ensure all the issues returned by the JQL query are evaluated, - * inspect `meta.issues.jql.count` in the response. - */ -export interface JexpJqlIssues { - /** - * The maximum number of issues to return from the JQL query. Inspect `meta.issues.jql.maxResults` in the response to - * ensure the maximum value has not been exceeded. - */ - maxResults?: number; - /** The JQL query. */ - query?: string; - /** The index of the first issue to return from the JQL query. */ - startAt?: number; - /** Determines how to validate the JQL query and treat the validation results. */ - validation?: string; -} diff --git a/src/version2/models/jiraExpressionAnalysis.mts b/src/version2/models/jiraExpressionAnalysis.mts new file mode 100644 index 000000000..c0a323218 --- /dev/null +++ b/src/version2/models/jiraExpressionAnalysis.mts @@ -0,0 +1,18 @@ +import { JiraExpressionComplexity } from './jiraExpressionComplexity.mjs'; +import { JiraExpressionValidationError } from './jiraExpressionValidationError.mjs'; + +/** Details about the analysed Jira expression. */ +export interface JiraExpressionAnalysis { + complexity?: JiraExpressionComplexity; + /** A list of validation errors. Not included if the expression is valid. */ + errors?: JiraExpressionValidationError[]; + /** The analysed expression. */ + expression: string; + /** EXPERIMENTAL. The inferred type of the expression. */ + type?: string; + /** + * Whether the expression is valid and the interpreter will evaluate it. Note that the expression may fail at runtime + * (for example, if it executes too many expensive operations). + */ + valid: boolean; +} diff --git a/src/version2/models/jiraExpressionAnalysis.ts b/src/version2/models/jiraExpressionAnalysis.ts deleted file mode 100644 index 95520586c..000000000 --- a/src/version2/models/jiraExpressionAnalysis.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { JiraExpressionComplexity } from './jiraExpressionComplexity.js'; -import type { JiraExpressionValidationError } from './jiraExpressionValidationError.js'; - -/** Details about the analysed Jira expression. */ -export interface JiraExpressionAnalysis { - complexity?: JiraExpressionComplexity; - /** A list of validation errors. Not included if the expression is valid. */ - errors?: JiraExpressionValidationError[]; - /** The analysed expression. */ - expression: string; - /** EXPERIMENTAL. The inferred type of the expression. */ - type?: string; - /** - * Whether the expression is valid and the interpreter will evaluate it. Note that the expression may fail at runtime - * (for example, if it executes too many expensive operations). - */ - valid: boolean; -} diff --git a/src/version2/models/jiraExpressionComplexity.ts b/src/version2/models/jiraExpressionComplexity.mts similarity index 100% rename from src/version2/models/jiraExpressionComplexity.ts rename to src/version2/models/jiraExpressionComplexity.mts diff --git a/src/version2/models/jiraExpressionEvalContext.mts b/src/version2/models/jiraExpressionEvalContext.mts new file mode 100644 index 000000000..8210f1ea0 --- /dev/null +++ b/src/version2/models/jiraExpressionEvalContext.mts @@ -0,0 +1,32 @@ +import { CustomContextVariable } from './customContextVariable.mjs'; +import { IdOrKey } from './idOrKey.mjs'; +import { JexpIssues } from './jexpIssues.mjs'; + +export interface JiraExpressionEvalContext { + /** The ID of the board that is available under the `board` variable when evaluating the expression. */ + board?: number; + /** + * Custom context variables and their types. These variable types are available for use in a custom context: + * + * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) + * specified as an Atlassian account ID. + * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) + * specified by ID or key. All the fields of the issue object are available in the Jira expression. + * - `json`: A JSON object containing custom content. + * - `list`: A JSON list of `user`, `issue`, or `json` variable types. + */ + custom?: CustomContextVariable[]; + /** + * The ID of the customer request that is available under the `customerRequest` variable when evaluating the + * expression. This is the same as the ID of the underlying Jira issue, but the customer request context variable will + * have a different type. + */ + customerRequest?: number; + issue?: IdOrKey; + issues?: JexpIssues; + project?: IdOrKey; + /** The ID of the service desk that is available under the `serviceDesk` variable when evaluating the expression. */ + serviceDesk?: number; + /** The ID of the sprint that is available under the `sprint` variable when evaluating the expression. */ + sprint?: number; +} diff --git a/src/version2/models/jiraExpressionEvalContext.ts b/src/version2/models/jiraExpressionEvalContext.ts deleted file mode 100644 index e351bd8cf..000000000 --- a/src/version2/models/jiraExpressionEvalContext.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { CustomContextVariable } from './customContextVariable.js'; -import type { IdOrKey } from './idOrKey.js'; -import type { JexpIssues } from './jexpIssues.js'; - -export interface JiraExpressionEvalContext { - /** The ID of the board that is available under the `board` variable when evaluating the expression. */ - board?: number; - /** - * Custom context variables and their types. These variable types are available for use in a custom context: - * - * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) - * specified as an Atlassian account ID. - * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) - * specified by ID or key. All the fields of the issue object are available in the Jira expression. - * - `json`: A JSON object containing custom content. - * - `list`: A JSON list of `user`, `issue`, or `json` variable types. - */ - custom?: CustomContextVariable[]; - /** - * The ID of the customer request that is available under the `customerRequest` variable when evaluating the - * expression. This is the same as the ID of the underlying Jira issue, but the customer request context variable will - * have a different type. - */ - customerRequest?: number; - issue?: IdOrKey; - issues?: JexpIssues; - project?: IdOrKey; - /** The ID of the service desk that is available under the `serviceDesk` variable when evaluating the expression. */ - serviceDesk?: number; - /** The ID of the sprint that is available under the `sprint` variable when evaluating the expression. */ - sprint?: number; -} diff --git a/src/version2/models/jiraExpressionEvalRequest.mts b/src/version2/models/jiraExpressionEvalRequest.mts new file mode 100644 index 000000000..2b047d50f --- /dev/null +++ b/src/version2/models/jiraExpressionEvalRequest.mts @@ -0,0 +1,7 @@ +import { JiraExpressionEvalContext } from './jiraExpressionEvalContext.mjs'; + +export interface JiraExpressionEvalRequest { + context?: JiraExpressionEvalContext; + /** The Jira expression to evaluate. */ + expression: string; +} diff --git a/src/version2/models/jiraExpressionEvalRequest.ts b/src/version2/models/jiraExpressionEvalRequest.ts deleted file mode 100644 index 052ba0a04..000000000 --- a/src/version2/models/jiraExpressionEvalRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { JiraExpressionEvalContext } from './jiraExpressionEvalContext.js'; - -export interface JiraExpressionEvalRequest { - context?: JiraExpressionEvalContext; - /** The Jira expression to evaluate. */ - expression: string; -} diff --git a/src/version2/models/jiraExpressionEvaluationMetaData.mts b/src/version2/models/jiraExpressionEvaluationMetaData.mts new file mode 100644 index 000000000..4cb3c424d --- /dev/null +++ b/src/version2/models/jiraExpressionEvaluationMetaData.mts @@ -0,0 +1,7 @@ +import { IssuesMeta } from './issuesMeta.mjs'; +import { JiraExpressionsComplexity } from './jiraExpressionsComplexity.mjs'; + +export interface JiraExpressionEvaluationMetaData { + complexity?: JiraExpressionsComplexity; + issues?: IssuesMeta; +} diff --git a/src/version2/models/jiraExpressionEvaluationMetaData.ts b/src/version2/models/jiraExpressionEvaluationMetaData.ts deleted file mode 100644 index 1a406e308..000000000 --- a/src/version2/models/jiraExpressionEvaluationMetaData.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IssuesMeta } from './issuesMeta.js'; -import type { JiraExpressionsComplexity } from './jiraExpressionsComplexity.js'; - -export interface JiraExpressionEvaluationMetaData { - complexity?: JiraExpressionsComplexity; - issues?: IssuesMeta; -} diff --git a/src/version2/models/jiraExpressionForAnalysis.ts b/src/version2/models/jiraExpressionForAnalysis.mts similarity index 100% rename from src/version2/models/jiraExpressionForAnalysis.ts rename to src/version2/models/jiraExpressionForAnalysis.mts diff --git a/src/version2/models/jiraExpressionResult.mts b/src/version2/models/jiraExpressionResult.mts new file mode 100644 index 000000000..1f26c5869 --- /dev/null +++ b/src/version2/models/jiraExpressionResult.mts @@ -0,0 +1,13 @@ +import { JiraExpressionEvaluationMetaData } from './jiraExpressionEvaluationMetaData.mjs'; + +/** The result of evaluating a Jira expression. */ +export interface JiraExpressionResult { + meta?: JiraExpressionEvaluationMetaData; + /** + * The value of the evaluated expression. It may be a primitive JSON value or a Jira REST API object. (Some + * expressions do not produce any meaningful results—for example, an expression that returns a lambda function—if + * that's the case a simple string representation is returned. These string representations should not be relied upon + * and may change without notice.) + */ + value: any; +} diff --git a/src/version2/models/jiraExpressionResult.ts b/src/version2/models/jiraExpressionResult.ts deleted file mode 100644 index 8aaeae00b..000000000 --- a/src/version2/models/jiraExpressionResult.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { JiraExpressionEvaluationMetaData } from './jiraExpressionEvaluationMetaData.js'; - -/** The result of evaluating a Jira expression. */ -export interface JiraExpressionResult { - meta?: JiraExpressionEvaluationMetaData; - /** - * The value of the evaluated expression. It may be a primitive JSON value or a Jira REST API object. (Some - * expressions do not produce any meaningful results—for example, an expression that returns a lambda function—if - * that's the case a simple string representation is returned. These string representations should not be relied upon - * and may change without notice.) - */ - value: any; -} diff --git a/src/version2/models/jiraExpressionValidationError.ts b/src/version2/models/jiraExpressionValidationError.mts similarity index 100% rename from src/version2/models/jiraExpressionValidationError.ts rename to src/version2/models/jiraExpressionValidationError.mts diff --git a/src/version2/models/jiraExpressionsAnalysis.mts b/src/version2/models/jiraExpressionsAnalysis.mts new file mode 100644 index 000000000..2cd80ae44 --- /dev/null +++ b/src/version2/models/jiraExpressionsAnalysis.mts @@ -0,0 +1,7 @@ +import { JiraExpressionAnalysis } from './jiraExpressionAnalysis.mjs'; + +/** Details about the analysed Jira expression. */ +export interface JiraExpressionsAnalysis { + /** The results of Jira expressions analysis. */ + results: JiraExpressionAnalysis[]; +} diff --git a/src/version2/models/jiraExpressionsAnalysis.ts b/src/version2/models/jiraExpressionsAnalysis.ts deleted file mode 100644 index 9e1486df9..000000000 --- a/src/version2/models/jiraExpressionsAnalysis.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { JiraExpressionAnalysis } from './jiraExpressionAnalysis.js'; - -/** Details about the analysed Jira expression. */ -export interface JiraExpressionsAnalysis { - /** The results of Jira expressions analysis. */ - results: JiraExpressionAnalysis[]; -} diff --git a/src/version2/models/jiraExpressionsComplexity.mts b/src/version2/models/jiraExpressionsComplexity.mts new file mode 100644 index 000000000..cf53e8b69 --- /dev/null +++ b/src/version2/models/jiraExpressionsComplexity.mts @@ -0,0 +1,8 @@ +import { JiraExpressionsComplexityValue } from './jiraExpressionsComplexityValue.mjs'; + +export interface JiraExpressionsComplexity { + steps?: JiraExpressionsComplexityValue; + expensiveOperations?: JiraExpressionsComplexityValue; + beans?: JiraExpressionsComplexityValue; + primitiveValues?: JiraExpressionsComplexityValue; +} diff --git a/src/version2/models/jiraExpressionsComplexity.ts b/src/version2/models/jiraExpressionsComplexity.ts deleted file mode 100644 index 2e9aad253..000000000 --- a/src/version2/models/jiraExpressionsComplexity.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { JiraExpressionsComplexityValue } from './jiraExpressionsComplexityValue.js'; - -export interface JiraExpressionsComplexity { - steps?: JiraExpressionsComplexityValue; - expensiveOperations?: JiraExpressionsComplexityValue; - beans?: JiraExpressionsComplexityValue; - primitiveValues?: JiraExpressionsComplexityValue; -} diff --git a/src/version2/models/jiraExpressionsComplexityValue.ts b/src/version2/models/jiraExpressionsComplexityValue.mts similarity index 100% rename from src/version2/models/jiraExpressionsComplexityValue.ts rename to src/version2/models/jiraExpressionsComplexityValue.mts diff --git a/src/version2/models/jiraStatus.mts b/src/version2/models/jiraStatus.mts new file mode 100644 index 000000000..51f5e6e92 --- /dev/null +++ b/src/version2/models/jiraStatus.mts @@ -0,0 +1,17 @@ +import { ProjectIssueTypes } from './projectIssueTypes.mjs'; +import type { StatusScope } from './statusScope.mjs'; + +/** Details of a status. */ +export interface JiraStatus { + /** The description of the status. */ + description?: string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; + scope?: StatusScope; + /** The category of the status. */ + statusCategory?: string; + /** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ + usages?: ProjectIssueTypes[]; +} diff --git a/src/version2/models/jiraStatus.ts b/src/version2/models/jiraStatus.ts deleted file mode 100644 index 13b2cb692..000000000 --- a/src/version2/models/jiraStatus.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { ProjectIssueTypes } from './projectIssueTypes.js'; -import type { StatusScope } from './statusScope.js'; - -/** Details of a status. */ -export interface JiraStatus { - /** The description of the status. */ - description?: string; - /** The ID of the status. */ - id?: string; - /** The name of the status. */ - name?: string; - scope?: StatusScope; - /** The category of the status. */ - statusCategory?: string; - /** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ - usages?: ProjectIssueTypes[]; -} diff --git a/src/version2/models/jiraWorkflow.mts b/src/version2/models/jiraWorkflow.mts new file mode 100644 index 000000000..70cbc025e --- /dev/null +++ b/src/version2/models/jiraWorkflow.mts @@ -0,0 +1,32 @@ +import { DocumentVersion } from './documentVersion.mjs'; +import { ProjectIssueTypes } from './projectIssueTypes.mjs'; +import { WorkflowLayout } from './workflowLayout.mjs'; +import { WorkflowReferenceStatus } from './workflowReferenceStatus.mjs'; +import { WorkflowScope } from './workflowScope.mjs'; +import { WorkflowTransitions } from './workflowTransitions.mjs'; + +/** Details of a workflow. */ +export interface JiraWorkflow { + /** The description of the workflow. */ + description?: string; + /** The ID of the workflow. */ + id?: string; + /** Indicates if the workflow can be edited. */ + isEditable?: boolean; + /** The name of the workflow. */ + name?: string; + scope?: WorkflowScope; + startPointLayout?: WorkflowLayout; + /** The statuses referenced in this workflow. */ + statuses?: WorkflowReferenceStatus[]; + /** If there is a current [asynchronous task](#async-operations) operation for this workflow. */ + taskId?: string; + /** The transitions of the workflow. */ + transitions?: WorkflowTransitions[]; + /** + * Use the optional `workflows.usages` expand to get additional information about the projects and issue types + * associated with the requested workflows. + */ + usages?: ProjectIssueTypes[]; + version?: DocumentVersion; +} diff --git a/src/version2/models/jiraWorkflow.ts b/src/version2/models/jiraWorkflow.ts deleted file mode 100644 index e3c38c496..000000000 --- a/src/version2/models/jiraWorkflow.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { DocumentVersion } from './documentVersion.js'; -import type { ProjectIssueTypes } from './projectIssueTypes.js'; -import type { WorkflowLayout } from './workflowLayout.js'; -import type { WorkflowReferenceStatus } from './workflowReferenceStatus.js'; -import type { WorkflowScope } from './workflowScope.js'; -import type { WorkflowTransitions } from './workflowTransitions.js'; - -/** Details of a workflow. */ -export interface JiraWorkflow { - /** The description of the workflow. */ - description?: string; - /** The ID of the workflow. */ - id?: string; - /** Indicates if the workflow can be edited. */ - isEditable?: boolean; - /** The name of the workflow. */ - name?: string; - scope?: WorkflowScope; - startPointLayout?: WorkflowLayout; - /** The statuses referenced in this workflow. */ - statuses?: WorkflowReferenceStatus[]; - /** If there is a current [asynchronous task](#async-operations) operation for this workflow. */ - taskId?: string; - /** The transitions of the workflow. */ - transitions?: WorkflowTransitions[]; - /** - * Use the optional `workflows.usages` expand to get additional information about the projects and issue types - * associated with the requested workflows. - */ - usages?: ProjectIssueTypes[]; - version?: DocumentVersion; -} diff --git a/src/version2/models/jiraWorkflowStatus.mts b/src/version2/models/jiraWorkflowStatus.mts new file mode 100644 index 000000000..779cb3410 --- /dev/null +++ b/src/version2/models/jiraWorkflowStatus.mts @@ -0,0 +1,22 @@ +import { ProjectIssueTypes } from './projectIssueTypes.mjs'; +import { WorkflowScope } from './workflowScope.mjs'; + +/** Details of a status. */ +export interface JiraWorkflowStatus { + /** The description of the status. */ + description?: string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; + scope?: WorkflowScope; + /** The category of the status. */ + statusCategory?: string; + /** The reference of the status. */ + statusReference?: string; + /** + * The `statuses.usages` expand is an optional parameter that can be used when reading and updating statuses in Jira. + * It provides additional information about the projects and issue types associated with the requested statuses. + */ + usages?: ProjectIssueTypes[]; +} diff --git a/src/version2/models/jiraWorkflowStatus.ts b/src/version2/models/jiraWorkflowStatus.ts deleted file mode 100644 index 24fdf901e..000000000 --- a/src/version2/models/jiraWorkflowStatus.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { ProjectIssueTypes } from './projectIssueTypes.js'; -import type { WorkflowScope } from './workflowScope.js'; - -/** Details of a status. */ -export interface JiraWorkflowStatus { - /** The description of the status. */ - description?: string; - /** The ID of the status. */ - id?: string; - /** The name of the status. */ - name?: string; - scope?: WorkflowScope; - /** The category of the status. */ - statusCategory?: string; - /** The reference of the status. */ - statusReference?: string; - /** - * The `statuses.usages` expand is an optional parameter that can be used when reading and updating statuses in Jira. - * It provides additional information about the projects and issue types associated with the requested statuses. - */ - usages?: ProjectIssueTypes[]; -} diff --git a/src/version2/models/jqlFunctionPrecomputation.ts b/src/version2/models/jqlFunctionPrecomputation.mts similarity index 100% rename from src/version2/models/jqlFunctionPrecomputation.ts rename to src/version2/models/jqlFunctionPrecomputation.mts diff --git a/src/version2/models/jqlFunctionPrecomputationUpdate.ts b/src/version2/models/jqlFunctionPrecomputationUpdate.mts similarity index 100% rename from src/version2/models/jqlFunctionPrecomputationUpdate.ts rename to src/version2/models/jqlFunctionPrecomputationUpdate.mts diff --git a/src/version2/models/jqlFunctionPrecomputationUpdateRequest.mts b/src/version2/models/jqlFunctionPrecomputationUpdateRequest.mts new file mode 100644 index 000000000..90b449b60 --- /dev/null +++ b/src/version2/models/jqlFunctionPrecomputationUpdateRequest.mts @@ -0,0 +1,6 @@ +import { JqlFunctionPrecomputationUpdate } from './jqlFunctionPrecomputationUpdate.mjs'; + +/** List of pairs (id and value) for precomputation updates. */ +export interface JqlFunctionPrecomputationUpdateRequest { + values: JqlFunctionPrecomputationUpdate[]; +} diff --git a/src/version2/models/jqlFunctionPrecomputationUpdateRequest.ts b/src/version2/models/jqlFunctionPrecomputationUpdateRequest.ts deleted file mode 100644 index 93dfd4850..000000000 --- a/src/version2/models/jqlFunctionPrecomputationUpdateRequest.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { JqlFunctionPrecomputationUpdate } from './jqlFunctionPrecomputationUpdate.js'; - -/** List of pairs (id and value) for precomputation updates. */ -export interface JqlFunctionPrecomputationUpdateRequest { - values: JqlFunctionPrecomputationUpdate[]; -} diff --git a/src/version2/models/jqlQueriesToParse.mts b/src/version2/models/jqlQueriesToParse.mts new file mode 100644 index 000000000..9bb4f6ad1 --- /dev/null +++ b/src/version2/models/jqlQueriesToParse.mts @@ -0,0 +1,5 @@ +/** A list of Jql queries to parse. */ +export interface JqlQueriesToParse { + /** A list of queries to parse. */ + queries: string[]; +} diff --git a/src/version2/models/jqlQueriesToParse.ts b/src/version2/models/jqlQueriesToParse.ts deleted file mode 100644 index 69990243f..000000000 --- a/src/version2/models/jqlQueriesToParse.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** A list of JQL queries to parse. */ -export interface JqlQueriesToParse { - /** A list of queries to parse. */ - queries: string[]; -} diff --git a/src/version2/models/jqlQueriesToSanitize.mts b/src/version2/models/jqlQueriesToSanitize.mts new file mode 100644 index 000000000..9200763ff --- /dev/null +++ b/src/version2/models/jqlQueriesToSanitize.mts @@ -0,0 +1,7 @@ +import { JqlQueryToSanitize } from './jqlQueryToSanitize.mjs'; + +/** The list of Jql queries to sanitize for the given account IDs. */ +export interface JqlQueriesToSanitize { + /** The list of Jql queries to sanitize. Must contain unique values. Maximum of 20 queries. */ + queries: JqlQueryToSanitize[]; +} diff --git a/src/version2/models/jqlQueriesToSanitize.ts b/src/version2/models/jqlQueriesToSanitize.ts deleted file mode 100644 index bb86b4d9f..000000000 --- a/src/version2/models/jqlQueriesToSanitize.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { JqlQueryToSanitize } from './jqlQueryToSanitize.js'; - -/** The list of JQL queries to sanitize for the given account IDs. */ -export interface JqlQueriesToSanitize { - /** The list of JQL queries to sanitize. Must contain unique values. Maximum of 20 queries. */ - queries: JqlQueryToSanitize[]; -} diff --git a/src/version2/models/jqlQuery.mts b/src/version2/models/jqlQuery.mts new file mode 100644 index 000000000..3eabec5b5 --- /dev/null +++ b/src/version2/models/jqlQuery.mts @@ -0,0 +1,8 @@ +import { JqlQueryClause } from './jqlQueryClause.mjs'; +import { JqlQueryOrderByClause } from './jqlQueryOrderByClause.mjs'; + +/** A parsed Jql query. */ +export interface JqlQuery { + orderBy?: JqlQueryOrderByClause; + where?: JqlQueryClause; +} diff --git a/src/version2/models/jqlQuery.ts b/src/version2/models/jqlQuery.ts deleted file mode 100644 index 124a24fed..000000000 --- a/src/version2/models/jqlQuery.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { JqlQueryClause } from './jqlQueryClause.js'; -import type { JqlQueryOrderByClause } from './jqlQueryOrderByClause.js'; - -/** A parsed JQL query. */ -export interface JqlQuery { - orderBy?: JqlQueryOrderByClause; - where?: JqlQueryClause; -} diff --git a/src/version2/models/jqlQueryClause.mts b/src/version2/models/jqlQueryClause.mts new file mode 100644 index 000000000..359f6a2af --- /dev/null +++ b/src/version2/models/jqlQueryClause.mts @@ -0,0 +1,2 @@ +/** A Jql query clause. */ +export interface JqlQueryClause {} diff --git a/src/version2/models/jqlQueryClause.ts b/src/version2/models/jqlQueryClause.ts deleted file mode 100644 index 15c1a05c5..000000000 --- a/src/version2/models/jqlQueryClause.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** A JQL query clause. */ -export interface JqlQueryClause {} diff --git a/src/version2/models/jqlQueryField.mts b/src/version2/models/jqlQueryField.mts new file mode 100644 index 000000000..1c4506382 --- /dev/null +++ b/src/version2/models/jqlQueryField.mts @@ -0,0 +1,14 @@ +import { JqlQueryFieldEntityProperty } from './jqlQueryFieldEntityProperty.mjs'; + +/** + * A field used in a Jql query. See [Advanced searching - fields reference](https://confluence.atlassian.com/x/dAiiLQ) + * for more information about fields in Jql queries. + */ +export interface JqlQueryField { + /** The encoded name of the field, which can be used directly in a Jql query. */ + encodedName?: string; + /** The name of the field. */ + name: string; + /** When the field refers to a value in an entity property, details of the entity property value. */ + property?: JqlQueryFieldEntityProperty[]; +} diff --git a/src/version2/models/jqlQueryField.ts b/src/version2/models/jqlQueryField.ts deleted file mode 100644 index a5e64d072..000000000 --- a/src/version2/models/jqlQueryField.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { JqlQueryFieldEntityProperty } from './jqlQueryFieldEntityProperty.js'; - -/** - * A field used in a JQL query. See [Advanced searching - fields reference](https://confluence.atlassian.com/x/dAiiLQ) - * for more information about fields in JQL queries. - */ -export interface JqlQueryField { - /** The encoded name of the field, which can be used directly in a JQL query. */ - encodedName?: string; - /** The name of the field. */ - name: string; - /** When the field refers to a value in an entity property, details of the entity property value. */ - property?: JqlQueryFieldEntityProperty[]; -} diff --git a/src/version2/models/jqlQueryFieldEntityProperty.ts b/src/version2/models/jqlQueryFieldEntityProperty.mts similarity index 100% rename from src/version2/models/jqlQueryFieldEntityProperty.ts rename to src/version2/models/jqlQueryFieldEntityProperty.mts diff --git a/src/version2/models/jqlQueryOrderByClause.mts b/src/version2/models/jqlQueryOrderByClause.mts new file mode 100644 index 000000000..dbf27a467 --- /dev/null +++ b/src/version2/models/jqlQueryOrderByClause.mts @@ -0,0 +1,7 @@ +import { JqlQueryOrderByClauseElement } from './jqlQueryOrderByClauseElement.mjs'; + +/** Details of the order-by Jql clause. */ +export interface JqlQueryOrderByClause { + /** The list of order-by clause fields and their ordering directives. */ + fields: JqlQueryOrderByClauseElement[]; +} diff --git a/src/version2/models/jqlQueryOrderByClause.ts b/src/version2/models/jqlQueryOrderByClause.ts deleted file mode 100644 index 878b10024..000000000 --- a/src/version2/models/jqlQueryOrderByClause.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { JqlQueryOrderByClauseElement } from './jqlQueryOrderByClauseElement.js'; - -/** Details of the order-by JQL clause. */ -export interface JqlQueryOrderByClause { - /** The list of order-by clause fields and their ordering directives. */ - fields: JqlQueryOrderByClauseElement[]; -} diff --git a/src/version2/models/jqlQueryOrderByClauseElement.mts b/src/version2/models/jqlQueryOrderByClauseElement.mts new file mode 100644 index 000000000..0c25af851 --- /dev/null +++ b/src/version2/models/jqlQueryOrderByClauseElement.mts @@ -0,0 +1,8 @@ +import { JqlQueryField } from './jqlQueryField.mjs'; + +/** An element of the order-by Jql clause. */ +export interface JqlQueryOrderByClauseElement { + /** The direction in which to order the results. */ + direction?: string; + field: JqlQueryField; +} diff --git a/src/version2/models/jqlQueryOrderByClauseElement.ts b/src/version2/models/jqlQueryOrderByClauseElement.ts deleted file mode 100644 index 85d8e66fd..000000000 --- a/src/version2/models/jqlQueryOrderByClauseElement.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { JqlQueryField } from './jqlQueryField.js'; - -/** An element of the order-by JQL clause. */ -export interface JqlQueryOrderByClauseElement { - /** The direction in which to order the results. */ - direction?: string; - field: JqlQueryField; -} diff --git a/src/version2/models/jqlQueryToSanitize.mts b/src/version2/models/jqlQueryToSanitize.mts new file mode 100644 index 000000000..93ae518e5 --- /dev/null +++ b/src/version2/models/jqlQueryToSanitize.mts @@ -0,0 +1,13 @@ +/** + * The Jql query to sanitize for the account ID. If the account ID is null, sanitizing is performed for an anonymous + * user. + */ +export interface JqlQueryToSanitize { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** The query to sanitize. */ + query: string; +} diff --git a/src/version2/models/jqlQueryToSanitize.ts b/src/version2/models/jqlQueryToSanitize.ts deleted file mode 100644 index e774eaf2a..000000000 --- a/src/version2/models/jqlQueryToSanitize.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The JQL query to sanitize for the account ID. If the account ID is null, sanitizing is performed for an anonymous - * user. - */ -export interface JqlQueryToSanitize { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** The query to sanitize. */ - query: string; -} diff --git a/src/version2/models/jsonType.ts b/src/version2/models/jsonType.mts similarity index 100% rename from src/version2/models/jsonType.ts rename to src/version2/models/jsonType.mts diff --git a/src/version2/models/license.mts b/src/version2/models/license.mts new file mode 100644 index 000000000..70db44801 --- /dev/null +++ b/src/version2/models/license.mts @@ -0,0 +1,7 @@ +import { LicensedApplication } from './licensedApplication.mjs'; + +/** Details about a license for the Jira instance. */ +export interface License { + /** The applications under this license. */ + applications: LicensedApplication[]; +} diff --git a/src/version2/models/license.ts b/src/version2/models/license.ts deleted file mode 100644 index 717ba9b9e..000000000 --- a/src/version2/models/license.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { LicensedApplication } from './licensedApplication.js'; - -/** Details about a license for the Jira instance. */ -export interface License { - /** The applications under this license. */ - applications: LicensedApplication[]; -} diff --git a/src/version2/models/licenseMetric.ts b/src/version2/models/licenseMetric.mts similarity index 100% rename from src/version2/models/licenseMetric.ts rename to src/version2/models/licenseMetric.mts diff --git a/src/version2/models/licensedApplication.ts b/src/version2/models/licensedApplication.mts similarity index 100% rename from src/version2/models/licensedApplication.ts rename to src/version2/models/licensedApplication.mts diff --git a/src/version2/models/linkGroup.mts b/src/version2/models/linkGroup.mts new file mode 100644 index 000000000..159c851d5 --- /dev/null +++ b/src/version2/models/linkGroup.mts @@ -0,0 +1,11 @@ +import type { SimpleLink } from './simpleLink.mjs'; + +/** Details a link group, which defines issue operations. */ +export interface LinkGroup { + groups?: LinkGroup[]; + header?: SimpleLink; + id?: string; + links?: SimpleLink[]; + styleClass?: string; + weight?: number; +} diff --git a/src/version2/models/linkGroup.ts b/src/version2/models/linkGroup.ts deleted file mode 100644 index 8f53f82df..000000000 --- a/src/version2/models/linkGroup.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { SimpleLink } from './simpleLink.js'; - -/** Details a link group, which defines issue operations. */ -export interface LinkGroup { - groups?: LinkGroup[]; - header?: SimpleLink; - id?: string; - links?: SimpleLink[]; - styleClass?: string; - weight?: number; -} diff --git a/src/version2/models/linkIssueRequestJson.mts b/src/version2/models/linkIssueRequestJson.mts new file mode 100644 index 000000000..d4de9bb36 --- /dev/null +++ b/src/version2/models/linkIssueRequestJson.mts @@ -0,0 +1,10 @@ +import type { Comment } from './comment.mjs'; +import { IssueLinkType } from './issueLinkType.mjs'; +import { LinkedIssue } from './linkedIssue.mjs'; + +export interface LinkIssueRequestJson { + comment?: Comment; + inwardIssue: LinkedIssue; + outwardIssue: LinkedIssue; + type: IssueLinkType; +} diff --git a/src/version2/models/linkIssueRequestJson.ts b/src/version2/models/linkIssueRequestJson.ts deleted file mode 100644 index 139218e9b..000000000 --- a/src/version2/models/linkIssueRequestJson.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Comment } from './comment.js'; -import type { IssueLinkType } from './issueLinkType.js'; -import type { LinkedIssue } from './linkedIssue.js'; - -export interface LinkIssueRequestJson { - comment?: Comment; - inwardIssue: LinkedIssue; - outwardIssue: LinkedIssue; - type: IssueLinkType; -} diff --git a/src/version2/models/linkedIssue.mts b/src/version2/models/linkedIssue.mts new file mode 100644 index 000000000..796a50728 --- /dev/null +++ b/src/version2/models/linkedIssue.mts @@ -0,0 +1,12 @@ +import { Fields } from './fields.mjs'; + +/** The ID or key of a linked issue. */ +export interface LinkedIssue { + fields?: Fields; + /** The ID of an issue. Required if `key` isn't provided. */ + id?: string; + /** The key of an issue. Required if `id` isn't provided. */ + key?: string; + /** The URL of the issue. */ + self?: string; +} diff --git a/src/version2/models/linkedIssue.ts b/src/version2/models/linkedIssue.ts deleted file mode 100644 index 58ba5f31a..000000000 --- a/src/version2/models/linkedIssue.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Fields } from './fields.js'; - -/** The ID or key of a linked issue. */ -export interface LinkedIssue { - fields?: Fields; - /** The ID of an issue. Required if `key` isn't provided. */ - id?: string; - /** The key of an issue. Required if `id` isn't provided. */ - key?: string; - /** The URL of the issue. */ - self?: string; -} diff --git a/src/version2/models/listWrapperCallbackApplicationRole.ts b/src/version2/models/listWrapperCallbackApplicationRole.mts similarity index 100% rename from src/version2/models/listWrapperCallbackApplicationRole.ts rename to src/version2/models/listWrapperCallbackApplicationRole.mts diff --git a/src/version2/models/listWrapperCallbackGroupName.ts b/src/version2/models/listWrapperCallbackGroupName.mts similarity index 100% rename from src/version2/models/listWrapperCallbackGroupName.ts rename to src/version2/models/listWrapperCallbackGroupName.mts diff --git a/src/version2/models/locale.ts b/src/version2/models/locale.mts similarity index 100% rename from src/version2/models/locale.ts rename to src/version2/models/locale.mts diff --git a/src/version2/models/moveField.ts b/src/version2/models/moveField.mts similarity index 100% rename from src/version2/models/moveField.ts rename to src/version2/models/moveField.mts diff --git a/src/version2/models/multiIssueEntityProperties.mts b/src/version2/models/multiIssueEntityProperties.mts new file mode 100644 index 000000000..6b7c919a8 --- /dev/null +++ b/src/version2/models/multiIssueEntityProperties.mts @@ -0,0 +1,10 @@ +import { IssueEntityPropertiesForMultiUpdate } from './issueEntityPropertiesForMultiUpdate.mjs'; + +/** + * A list of issues and their respective properties to set or update. See [Entity + * properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. + */ +export interface MultiIssueEntityProperties { + /** A list of issue IDs and their respective properties. */ + issues?: IssueEntityPropertiesForMultiUpdate[]; +} diff --git a/src/version2/models/multiIssueEntityProperties.ts b/src/version2/models/multiIssueEntityProperties.ts deleted file mode 100644 index f343f8735..000000000 --- a/src/version2/models/multiIssueEntityProperties.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { IssueEntityPropertiesForMultiUpdate } from './issueEntityPropertiesForMultiUpdate.js'; - -/** - * A list of issues and their respective properties to set or update. See [Entity - * properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. - */ -export interface MultiIssueEntityProperties { - /** A list of issue IDs and their respective properties. */ - issues?: IssueEntityPropertiesForMultiUpdate[]; -} diff --git a/src/version2/models/multipleCustomFieldValuesUpdate.ts b/src/version2/models/multipleCustomFieldValuesUpdate.mts similarity index 100% rename from src/version2/models/multipleCustomFieldValuesUpdate.ts rename to src/version2/models/multipleCustomFieldValuesUpdate.mts diff --git a/src/version2/models/multipleCustomFieldValuesUpdateDetails.mts b/src/version2/models/multipleCustomFieldValuesUpdateDetails.mts new file mode 100644 index 000000000..c15e9e08d --- /dev/null +++ b/src/version2/models/multipleCustomFieldValuesUpdateDetails.mts @@ -0,0 +1,6 @@ +import { MultipleCustomFieldValuesUpdate } from './multipleCustomFieldValuesUpdate.mjs'; + +/** List of updates for a custom fields. */ +export interface MultipleCustomFieldValuesUpdateDetails { + updates?: MultipleCustomFieldValuesUpdate[]; +} diff --git a/src/version2/models/multipleCustomFieldValuesUpdateDetails.ts b/src/version2/models/multipleCustomFieldValuesUpdateDetails.ts deleted file mode 100644 index 29ed2e5e1..000000000 --- a/src/version2/models/multipleCustomFieldValuesUpdateDetails.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { MultipleCustomFieldValuesUpdate } from './multipleCustomFieldValuesUpdate.js'; - -/** List of updates for a custom fields. */ -export interface MultipleCustomFieldValuesUpdateDetails { - updates?: MultipleCustomFieldValuesUpdate[]; -} diff --git a/src/version2/models/nestedResponse.mts b/src/version2/models/nestedResponse.mts new file mode 100644 index 000000000..8c6c1dcf9 --- /dev/null +++ b/src/version2/models/nestedResponse.mts @@ -0,0 +1,8 @@ +import type { ErrorCollection } from './errorCollection.mjs'; +import { WarningCollection } from './warningCollection.mjs'; + +export interface NestedResponse { + errorCollection?: ErrorCollection; + status?: number; + warningCollection?: WarningCollection; +} diff --git a/src/version2/models/nestedResponse.ts b/src/version2/models/nestedResponse.ts deleted file mode 100644 index 488db3a60..000000000 --- a/src/version2/models/nestedResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ErrorCollection } from './errorCollection.js'; -import type { WarningCollection } from './warningCollection.js'; - -export interface NestedResponse { - errorCollection?: ErrorCollection; - status?: number; - warningCollection?: WarningCollection; -} diff --git a/src/version2/models/newUserDetails.ts b/src/version2/models/newUserDetails.mts similarity index 100% rename from src/version2/models/newUserDetails.ts rename to src/version2/models/newUserDetails.mts diff --git a/src/version2/models/notification.mts b/src/version2/models/notification.mts new file mode 100644 index 000000000..07e3e3616 --- /dev/null +++ b/src/version2/models/notification.mts @@ -0,0 +1,17 @@ +import { NotificationRecipients } from './notificationRecipients.mjs'; +import { NotificationRecipientsRestrictions } from './notificationRecipientsRestrictions.mjs'; + +/** Details about a notification. */ +export interface Notification { + /** The HTML body of the email notification for the issue. */ + htmlBody?: string; + restrict?: NotificationRecipientsRestrictions; + /** + * The subject of the email notification for the issue. If this is not specified, then the subject is set to the issue + * key and summary. + */ + subject?: string; + /** The plain text body of the email notification for the issue. */ + textBody?: string; + to?: NotificationRecipients; +} diff --git a/src/version2/models/notification.ts b/src/version2/models/notification.ts deleted file mode 100644 index ca061a5e7..000000000 --- a/src/version2/models/notification.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { NotificationRecipients } from './notificationRecipients.js'; -import type { NotificationRecipientsRestrictions } from './notificationRecipientsRestrictions.js'; - -/** Details about a notification. */ -export interface Notification { - /** The HTML body of the email notification for the issue. */ - htmlBody?: string; - restrict?: NotificationRecipientsRestrictions; - /** - * The subject of the email notification for the issue. If this is not specified, then the subject is set to the issue - * key and summary. - */ - subject?: string; - /** The plain text body of the email notification for the issue. */ - textBody?: string; - to?: NotificationRecipients; -} diff --git a/src/version2/models/notificationEvent.ts b/src/version2/models/notificationEvent.mts similarity index 100% rename from src/version2/models/notificationEvent.ts rename to src/version2/models/notificationEvent.mts diff --git a/src/version2/models/notificationRecipients.mts b/src/version2/models/notificationRecipients.mts new file mode 100644 index 000000000..b37f7f834 --- /dev/null +++ b/src/version2/models/notificationRecipients.mts @@ -0,0 +1,20 @@ +import type { GroupName } from './groupName.mjs'; +import { UserDetails } from './userDetails.mjs'; + +/** Details of the users and groups to receive the notification. */ +export interface NotificationRecipients { + /** Whether the notification should be sent to the issue's assignees. */ + assignee?: boolean; + /** List of groupIds to receive the notification. */ + groupIds?: string[]; + /** List of groups to receive the notification. */ + groups?: GroupName[]; + /** Whether the notification should be sent to the issue's reporter. */ + reporter?: boolean; + /** List of users to receive the notification. */ + users?: UserDetails[]; + /** Whether the notification should be sent to the issue's voters. */ + voters?: boolean; + /** Whether the notification should be sent to the issue's watchers. */ + watchers?: boolean; +} diff --git a/src/version2/models/notificationRecipients.ts b/src/version2/models/notificationRecipients.ts deleted file mode 100644 index facd20019..000000000 --- a/src/version2/models/notificationRecipients.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { GroupName } from './groupName.js'; -import type { UserDetails } from './userDetails.js'; - -/** Details of the users and groups to receive the notification. */ -export interface NotificationRecipients { - /** Whether the notification should be sent to the issue's assignees. */ - assignee?: boolean; - /** List of groupIds to receive the notification. */ - groupIds?: string[]; - /** List of groups to receive the notification. */ - groups?: GroupName[]; - /** Whether the notification should be sent to the issue's reporter. */ - reporter?: boolean; - /** List of users to receive the notification. */ - users?: UserDetails[]; - /** Whether the notification should be sent to the issue's voters. */ - voters?: boolean; - /** Whether the notification should be sent to the issue's watchers. */ - watchers?: boolean; -} diff --git a/src/version2/models/notificationRecipientsRestrictions.mts b/src/version2/models/notificationRecipientsRestrictions.mts new file mode 100644 index 000000000..45ea8df39 --- /dev/null +++ b/src/version2/models/notificationRecipientsRestrictions.mts @@ -0,0 +1,12 @@ +import type { GroupName } from './groupName.mjs'; +import { RestrictedPermission } from './restrictedPermission.mjs'; + +/** Details of the group membership or permissions needed to receive the notification. */ +export interface NotificationRecipientsRestrictions { + /** List of groupId memberships required to receive the notification. */ + groupIds?: string[]; + /** List of group memberships required to receive the notification. */ + groups?: GroupName[]; + /** List of permissions required to receive the notification. */ + permissions?: RestrictedPermission[]; +} diff --git a/src/version2/models/notificationRecipientsRestrictions.ts b/src/version2/models/notificationRecipientsRestrictions.ts deleted file mode 100644 index a33f4dc16..000000000 --- a/src/version2/models/notificationRecipientsRestrictions.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { GroupName } from './groupName.js'; -import type { RestrictedPermission } from './restrictedPermission.js'; - -/** Details of the group membership or permissions needed to receive the notification. */ -export interface NotificationRecipientsRestrictions { - /** List of groupId memberships required to receive the notification. */ - groupIds?: string[]; - /** List of group memberships required to receive the notification. */ - groups?: GroupName[]; - /** List of permissions required to receive the notification. */ - permissions?: RestrictedPermission[]; -} diff --git a/src/version2/models/notificationScheme.mts b/src/version2/models/notificationScheme.mts new file mode 100644 index 000000000..5667cf5be --- /dev/null +++ b/src/version2/models/notificationScheme.mts @@ -0,0 +1,20 @@ +import { NotificationSchemeEvent } from './notificationSchemeEvent.mjs'; +import type { Scope } from './scope.mjs'; + +/** Details about a notification scheme. */ +export interface NotificationScheme { + /** The description of the notification scheme. */ + description?: string; + /** Expand options that include additional notification scheme details in the response. */ + expand?: string; + /** The ID of the notification scheme. */ + id?: number; + /** The name of the notification scheme. */ + name?: string; + /** The notification events and associated recipients. */ + notificationSchemeEvents?: NotificationSchemeEvent[]; + /** The list of project IDs associated with the notification scheme. */ + projects?: number[]; + scope?: Scope; + self?: string; +} diff --git a/src/version2/models/notificationScheme.ts b/src/version2/models/notificationScheme.ts deleted file mode 100644 index 07d9a2692..000000000 --- a/src/version2/models/notificationScheme.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { NotificationSchemeEvent } from './notificationSchemeEvent.js'; -import type { Scope } from './scope.js'; - -/** Details about a notification scheme. */ -export interface NotificationScheme { - /** The description of the notification scheme. */ - description?: string; - /** Expand options that include additional notification scheme details in the response. */ - expand?: string; - /** The ID of the notification scheme. */ - id?: number; - /** The name of the notification scheme. */ - name?: string; - /** The notification events and associated recipients. */ - notificationSchemeEvents?: NotificationSchemeEvent[]; - /** The list of project IDs associated with the notification scheme. */ - projects?: number[]; - scope?: Scope; - self?: string; -} diff --git a/src/version2/models/notificationSchemeAndProjectMapping.ts b/src/version2/models/notificationSchemeAndProjectMapping.mts similarity index 100% rename from src/version2/models/notificationSchemeAndProjectMapping.ts rename to src/version2/models/notificationSchemeAndProjectMapping.mts diff --git a/src/version2/models/notificationSchemeAndProjectMappingPage.mts b/src/version2/models/notificationSchemeAndProjectMappingPage.mts new file mode 100644 index 000000000..c8278b5b3 --- /dev/null +++ b/src/version2/models/notificationSchemeAndProjectMappingPage.mts @@ -0,0 +1,19 @@ +import { NotificationSchemeAndProjectMapping } from './notificationSchemeAndProjectMapping.mjs'; + +/** A page of items. */ +export interface NotificationSchemeAndProjectMappingPage { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: NotificationSchemeAndProjectMapping[]; +} diff --git a/src/version2/models/notificationSchemeAndProjectMappingPage.ts b/src/version2/models/notificationSchemeAndProjectMappingPage.ts deleted file mode 100644 index 272131b30..000000000 --- a/src/version2/models/notificationSchemeAndProjectMappingPage.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { NotificationSchemeAndProjectMapping } from './notificationSchemeAndProjectMapping.js'; - -/** A page of items. */ -export interface NotificationSchemeAndProjectMappingPage { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: NotificationSchemeAndProjectMapping[]; -} diff --git a/src/version2/models/notificationSchemeEvent.mts b/src/version2/models/notificationSchemeEvent.mts new file mode 100644 index 000000000..f135060a6 --- /dev/null +++ b/src/version2/models/notificationSchemeEvent.mts @@ -0,0 +1,8 @@ +import { EventNotification } from './eventNotification.mjs'; +import { NotificationEvent } from './notificationEvent.mjs'; + +/** Details about a notification scheme event. */ +export interface NotificationSchemeEvent { + event?: NotificationEvent; + notifications?: EventNotification[]; +} diff --git a/src/version2/models/notificationSchemeEvent.ts b/src/version2/models/notificationSchemeEvent.ts deleted file mode 100644 index edf809239..000000000 --- a/src/version2/models/notificationSchemeEvent.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { EventNotification } from './eventNotification.js'; -import type { NotificationEvent } from './notificationEvent.js'; - -/** Details about a notification scheme event. */ -export interface NotificationSchemeEvent { - event?: NotificationEvent; - notifications?: EventNotification[]; -} diff --git a/src/version2/models/notificationSchemeEventDetails.mts b/src/version2/models/notificationSchemeEventDetails.mts new file mode 100644 index 000000000..1bc5e86fb --- /dev/null +++ b/src/version2/models/notificationSchemeEventDetails.mts @@ -0,0 +1,9 @@ +import { NotificationSchemeEventTypeId } from './notificationSchemeEventTypeId.mjs'; +import { NotificationSchemeNotificationDetails } from './notificationSchemeNotificationDetails.mjs'; + +/** Details of a notification scheme event. */ +export interface NotificationSchemeEventDetails { + event?: NotificationSchemeEventTypeId; + /** The list of notifications mapped to a specified event. */ + notifications: NotificationSchemeNotificationDetails[]; +} diff --git a/src/version2/models/notificationSchemeEventDetails.ts b/src/version2/models/notificationSchemeEventDetails.ts deleted file mode 100644 index 5ba1caa9f..000000000 --- a/src/version2/models/notificationSchemeEventDetails.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { NotificationSchemeEventTypeId } from './notificationSchemeEventTypeId.js'; -import type { NotificationSchemeNotificationDetails } from './notificationSchemeNotificationDetails.js'; - -/** Details of a notification scheme event. */ -export interface NotificationSchemeEventDetails { - event?: NotificationSchemeEventTypeId; - /** The list of notifications mapped to a specified event. */ - notifications: NotificationSchemeNotificationDetails[]; -} diff --git a/src/version2/models/notificationSchemeEventTypeId.ts b/src/version2/models/notificationSchemeEventTypeId.mts similarity index 100% rename from src/version2/models/notificationSchemeEventTypeId.ts rename to src/version2/models/notificationSchemeEventTypeId.mts diff --git a/src/version2/models/notificationSchemeId.ts b/src/version2/models/notificationSchemeId.mts similarity index 100% rename from src/version2/models/notificationSchemeId.ts rename to src/version2/models/notificationSchemeId.mts diff --git a/src/version2/models/notificationSchemeNotificationDetails.ts b/src/version2/models/notificationSchemeNotificationDetails.mts similarity index 100% rename from src/version2/models/notificationSchemeNotificationDetails.ts rename to src/version2/models/notificationSchemeNotificationDetails.mts diff --git a/src/version2/models/oldToNewSecurityLevelMappings.ts b/src/version2/models/oldToNewSecurityLevelMappings.mts similarity index 100% rename from src/version2/models/oldToNewSecurityLevelMappings.ts rename to src/version2/models/oldToNewSecurityLevelMappings.mts diff --git a/src/version2/models/operationMessage.ts b/src/version2/models/operationMessage.mts similarity index 100% rename from src/version2/models/operationMessage.ts rename to src/version2/models/operationMessage.mts diff --git a/src/version2/models/operations.mts b/src/version2/models/operations.mts new file mode 100644 index 000000000..abc4e9bf0 --- /dev/null +++ b/src/version2/models/operations.mts @@ -0,0 +1,7 @@ +import { LinkGroup } from './linkGroup.mjs'; + +/** Details of the operations that can be performed on the issue. */ +export interface Operations { + /** Details of the link groups defining issue operations. */ + linkGroups?: LinkGroup[]; +} diff --git a/src/version2/models/operations.ts b/src/version2/models/operations.ts deleted file mode 100644 index 8102a00ec..000000000 --- a/src/version2/models/operations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { LinkGroup } from './linkGroup.js'; - -/** Details of the operations that can be performed on the issue. */ -export interface Operations { - /** Details of the link groups defining issue operations. */ - linkGroups?: LinkGroup[]; -} diff --git a/src/version2/models/orderOfCustomFieldOptions.ts b/src/version2/models/orderOfCustomFieldOptions.mts similarity index 100% rename from src/version2/models/orderOfCustomFieldOptions.ts rename to src/version2/models/orderOfCustomFieldOptions.mts diff --git a/src/version2/models/orderOfIssueTypes.ts b/src/version2/models/orderOfIssueTypes.mts similarity index 100% rename from src/version2/models/orderOfIssueTypes.ts rename to src/version2/models/orderOfIssueTypes.mts diff --git a/src/version2/models/pageChangelog.mts b/src/version2/models/pageChangelog.mts new file mode 100644 index 000000000..7f8aab805 --- /dev/null +++ b/src/version2/models/pageChangelog.mts @@ -0,0 +1,19 @@ +import type { Changelog } from './changelog.mjs'; + +/** A page of items. */ +export interface PageChangelog { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: Changelog[]; +} diff --git a/src/version2/models/pageChangelog.ts b/src/version2/models/pageChangelog.ts deleted file mode 100644 index 664cb59f3..000000000 --- a/src/version2/models/pageChangelog.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Changelog } from './changelog.js'; - -/** A page of items. */ -export interface PageChangelog { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: Changelog[]; -} diff --git a/src/version2/models/pageComment.mts b/src/version2/models/pageComment.mts new file mode 100644 index 000000000..7306adc31 --- /dev/null +++ b/src/version2/models/pageComment.mts @@ -0,0 +1,19 @@ +import type { Comment } from './comment.mjs'; + +/** A page of items. */ +export interface PageComment { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: Comment[]; +} diff --git a/src/version2/models/pageComment.ts b/src/version2/models/pageComment.ts deleted file mode 100644 index dbd24b14e..000000000 --- a/src/version2/models/pageComment.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Comment } from './comment.js'; - -/** A page of items. */ -export interface PageComment { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: Comment[]; -} diff --git a/src/version2/models/pageComponentWithIssueCount.mts b/src/version2/models/pageComponentWithIssueCount.mts new file mode 100644 index 000000000..b8ca11611 --- /dev/null +++ b/src/version2/models/pageComponentWithIssueCount.mts @@ -0,0 +1,19 @@ +import { ComponentWithIssueCount } from './componentWithIssueCount.mjs'; + +/** A page of items. */ +export interface PageComponentWithIssueCount { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: ComponentWithIssueCount[]; +} diff --git a/src/version2/models/pageComponentWithIssueCount.ts b/src/version2/models/pageComponentWithIssueCount.ts deleted file mode 100644 index e6974a057..000000000 --- a/src/version2/models/pageComponentWithIssueCount.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ComponentWithIssueCount } from './componentWithIssueCount.js'; - -/** A page of items. */ -export interface PageComponentWithIssueCount { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: ComponentWithIssueCount[]; -} diff --git a/src/version2/models/pageContextForProjectAndIssueType.mts b/src/version2/models/pageContextForProjectAndIssueType.mts new file mode 100644 index 000000000..04b0f02fe --- /dev/null +++ b/src/version2/models/pageContextForProjectAndIssueType.mts @@ -0,0 +1,19 @@ +import { ContextForProjectAndIssueType } from './contextForProjectAndIssueType.mjs'; + +/** A page of items. */ +export interface PageContextForProjectAndIssueType { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: ContextForProjectAndIssueType[]; +} diff --git a/src/version2/models/pageContextForProjectAndIssueType.ts b/src/version2/models/pageContextForProjectAndIssueType.ts deleted file mode 100644 index 355ab2fdd..000000000 --- a/src/version2/models/pageContextForProjectAndIssueType.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ContextForProjectAndIssueType } from './contextForProjectAndIssueType.js'; - -/** A page of items. */ -export interface PageContextForProjectAndIssueType { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: ContextForProjectAndIssueType[]; -} diff --git a/src/version2/models/pageContextualConfiguration.mts b/src/version2/models/pageContextualConfiguration.mts new file mode 100644 index 000000000..40edfda5f --- /dev/null +++ b/src/version2/models/pageContextualConfiguration.mts @@ -0,0 +1,19 @@ +import { ContextualConfiguration } from './contextualConfiguration.mjs'; + +/** A page of items. */ +export interface PageContextualConfiguration { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: ContextualConfiguration[]; +} diff --git a/src/version2/models/pageContextualConfiguration.ts b/src/version2/models/pageContextualConfiguration.ts deleted file mode 100644 index 0416f74ab..000000000 --- a/src/version2/models/pageContextualConfiguration.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ContextualConfiguration } from './contextualConfiguration.js'; - -/** A page of items. */ -export interface PageContextualConfiguration { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: ContextualConfiguration[]; -} diff --git a/src/version2/models/pageCustomFieldContext.mts b/src/version2/models/pageCustomFieldContext.mts new file mode 100644 index 000000000..2edeafca1 --- /dev/null +++ b/src/version2/models/pageCustomFieldContext.mts @@ -0,0 +1,19 @@ +import { CustomFieldContext } from './customFieldContext.mjs'; + +/** A page of items. */ +export interface PageCustomFieldContext { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: CustomFieldContext[]; +} diff --git a/src/version2/models/pageCustomFieldContext.ts b/src/version2/models/pageCustomFieldContext.ts deleted file mode 100644 index 14e597cec..000000000 --- a/src/version2/models/pageCustomFieldContext.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { CustomFieldContext } from './customFieldContext.js'; - -/** A page of items. */ -export interface PageCustomFieldContext { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: CustomFieldContext[]; -} diff --git a/src/version2/models/pageCustomFieldContextDefaultValue.mts b/src/version2/models/pageCustomFieldContextDefaultValue.mts new file mode 100644 index 000000000..8042fb628 --- /dev/null +++ b/src/version2/models/pageCustomFieldContextDefaultValue.mts @@ -0,0 +1,19 @@ +import { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue.mjs'; + +/** A page of items. */ +export interface PageCustomFieldContextDefaultValue { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: CustomFieldContextDefaultValue[]; +} diff --git a/src/version2/models/pageCustomFieldContextDefaultValue.ts b/src/version2/models/pageCustomFieldContextDefaultValue.ts deleted file mode 100644 index 75127467a..000000000 --- a/src/version2/models/pageCustomFieldContextDefaultValue.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue.js'; - -/** A page of items. */ -export interface PageCustomFieldContextDefaultValue { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: CustomFieldContextDefaultValue[]; -} diff --git a/src/version2/models/pageCustomFieldContextOption.mts b/src/version2/models/pageCustomFieldContextOption.mts new file mode 100644 index 000000000..a8d74a1f9 --- /dev/null +++ b/src/version2/models/pageCustomFieldContextOption.mts @@ -0,0 +1,19 @@ +import { CustomFieldContextOption } from './customFieldContextOption.mjs'; + +/** A page of items. */ +export interface PageCustomFieldContextOption { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: CustomFieldContextOption[]; +} diff --git a/src/version2/models/pageCustomFieldContextOption.ts b/src/version2/models/pageCustomFieldContextOption.ts deleted file mode 100644 index e74598564..000000000 --- a/src/version2/models/pageCustomFieldContextOption.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { CustomFieldContextOption } from './customFieldContextOption.js'; - -/** A page of items. */ -export interface PageCustomFieldContextOption { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: CustomFieldContextOption[]; -} diff --git a/src/version2/models/pageCustomFieldContextProjectMapping.mts b/src/version2/models/pageCustomFieldContextProjectMapping.mts new file mode 100644 index 000000000..7cc159b92 --- /dev/null +++ b/src/version2/models/pageCustomFieldContextProjectMapping.mts @@ -0,0 +1,19 @@ +import { CustomFieldContextProjectMapping } from './customFieldContextProjectMapping.mjs'; + +/** A page of items. */ +export interface PageCustomFieldContextProjectMapping { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: CustomFieldContextProjectMapping[]; +} diff --git a/src/version2/models/pageCustomFieldContextProjectMapping.ts b/src/version2/models/pageCustomFieldContextProjectMapping.ts deleted file mode 100644 index 3f86933c7..000000000 --- a/src/version2/models/pageCustomFieldContextProjectMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { CustomFieldContextProjectMapping } from './customFieldContextProjectMapping.js'; - -/** A page of items. */ -export interface PageCustomFieldContextProjectMapping { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: CustomFieldContextProjectMapping[]; -} diff --git a/src/version2/models/pageDashboard.mts b/src/version2/models/pageDashboard.mts new file mode 100644 index 000000000..2c68e4e7c --- /dev/null +++ b/src/version2/models/pageDashboard.mts @@ -0,0 +1,19 @@ +import type { Dashboard } from './dashboard.mjs'; + +/** A page of items. */ +export interface PageDashboard { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: Dashboard[]; +} diff --git a/src/version2/models/pageDashboard.ts b/src/version2/models/pageDashboard.ts deleted file mode 100644 index 6f86a3080..000000000 --- a/src/version2/models/pageDashboard.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Dashboard } from './dashboard.js'; - -/** A page of items. */ -export interface PageDashboard { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: Dashboard[]; -} diff --git a/src/version2/models/pageField.mts b/src/version2/models/pageField.mts new file mode 100644 index 000000000..85e2c2891 --- /dev/null +++ b/src/version2/models/pageField.mts @@ -0,0 +1,19 @@ +import { Field } from './field.mjs'; + +/** A page of items. */ +export interface PageField { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: Field[]; +} diff --git a/src/version2/models/pageField.ts b/src/version2/models/pageField.ts deleted file mode 100644 index 42a949fa0..000000000 --- a/src/version2/models/pageField.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Field } from './field.js'; - -/** A page of items. */ -export interface PageField { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: Field[]; -} diff --git a/src/version2/models/pageFieldConfiguration.mts b/src/version2/models/pageFieldConfiguration.mts new file mode 100644 index 000000000..70bc30481 --- /dev/null +++ b/src/version2/models/pageFieldConfiguration.mts @@ -0,0 +1,19 @@ +import { FieldConfiguration } from './fieldConfiguration.mjs'; + +/** A page of items. */ +export interface PageFieldConfiguration { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: FieldConfiguration[]; +} diff --git a/src/version2/models/pageFieldConfiguration.ts b/src/version2/models/pageFieldConfiguration.ts deleted file mode 100644 index 354e511c3..000000000 --- a/src/version2/models/pageFieldConfiguration.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FieldConfiguration } from './fieldConfiguration.js'; - -/** A page of items. */ -export interface PageFieldConfiguration { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: FieldConfiguration[]; -} diff --git a/src/version2/models/pageFieldConfigurationIssueTypeItem.mts b/src/version2/models/pageFieldConfigurationIssueTypeItem.mts new file mode 100644 index 000000000..9be72fbeb --- /dev/null +++ b/src/version2/models/pageFieldConfigurationIssueTypeItem.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationIssueTypeItem } from './fieldConfigurationIssueTypeItem.mjs'; + +/** A page of items. */ +export interface PageFieldConfigurationIssueTypeItem { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: FieldConfigurationIssueTypeItem[]; +} diff --git a/src/version2/models/pageFieldConfigurationIssueTypeItem.ts b/src/version2/models/pageFieldConfigurationIssueTypeItem.ts deleted file mode 100644 index 3ba381cf1..000000000 --- a/src/version2/models/pageFieldConfigurationIssueTypeItem.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FieldConfigurationIssueTypeItem } from './fieldConfigurationIssueTypeItem.js'; - -/** A page of items. */ -export interface PageFieldConfigurationIssueTypeItem { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: FieldConfigurationIssueTypeItem[]; -} diff --git a/src/version2/models/pageFieldConfigurationItem.mts b/src/version2/models/pageFieldConfigurationItem.mts new file mode 100644 index 000000000..73b3ba2dd --- /dev/null +++ b/src/version2/models/pageFieldConfigurationItem.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationItem } from './fieldConfigurationItem.mjs'; + +/** A page of items. */ +export interface PageFieldConfigurationItem { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: FieldConfigurationItem[]; +} diff --git a/src/version2/models/pageFieldConfigurationItem.ts b/src/version2/models/pageFieldConfigurationItem.ts deleted file mode 100644 index 65231ef49..000000000 --- a/src/version2/models/pageFieldConfigurationItem.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FieldConfigurationItem } from './fieldConfigurationItem.js'; - -/** A page of items. */ -export interface PageFieldConfigurationItem { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: FieldConfigurationItem[]; -} diff --git a/src/version2/models/pageFieldConfigurationScheme.mts b/src/version2/models/pageFieldConfigurationScheme.mts new file mode 100644 index 000000000..55a235d77 --- /dev/null +++ b/src/version2/models/pageFieldConfigurationScheme.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationScheme } from './fieldConfigurationScheme.mjs'; + +/** A page of items. */ +export interface PageFieldConfigurationScheme { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: FieldConfigurationScheme[]; +} diff --git a/src/version2/models/pageFieldConfigurationScheme.ts b/src/version2/models/pageFieldConfigurationScheme.ts deleted file mode 100644 index d65371caa..000000000 --- a/src/version2/models/pageFieldConfigurationScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FieldConfigurationScheme } from './fieldConfigurationScheme.js'; - -/** A page of items. */ -export interface PageFieldConfigurationScheme { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: FieldConfigurationScheme[]; -} diff --git a/src/version2/models/pageFieldConfigurationSchemeProjects.mts b/src/version2/models/pageFieldConfigurationSchemeProjects.mts new file mode 100644 index 000000000..3289e4a24 --- /dev/null +++ b/src/version2/models/pageFieldConfigurationSchemeProjects.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationSchemeProjects } from './fieldConfigurationSchemeProjects.mjs'; + +/** A page of items. */ +export interface PageFieldConfigurationSchemeProjects { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: FieldConfigurationSchemeProjects[]; +} diff --git a/src/version2/models/pageFieldConfigurationSchemeProjects.ts b/src/version2/models/pageFieldConfigurationSchemeProjects.ts deleted file mode 100644 index fb6ec2194..000000000 --- a/src/version2/models/pageFieldConfigurationSchemeProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FieldConfigurationSchemeProjects } from './fieldConfigurationSchemeProjects.js'; - -/** A page of items. */ -export interface PageFieldConfigurationSchemeProjects { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: FieldConfigurationSchemeProjects[]; -} diff --git a/src/version2/models/pageFilterDetails.mts b/src/version2/models/pageFilterDetails.mts new file mode 100644 index 000000000..1a20cddad --- /dev/null +++ b/src/version2/models/pageFilterDetails.mts @@ -0,0 +1,19 @@ +import { FilterDetails } from './filterDetails.mjs'; + +/** A page of items. */ +export interface PageFilterDetails { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: FilterDetails[]; +} diff --git a/src/version2/models/pageFilterDetails.ts b/src/version2/models/pageFilterDetails.ts deleted file mode 100644 index dfe0ce3e0..000000000 --- a/src/version2/models/pageFilterDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FilterDetails } from './filterDetails.js'; - -/** A page of items. */ -export interface PageFilterDetails { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: FilterDetails[]; -} diff --git a/src/version2/models/pageGroupDetails.mts b/src/version2/models/pageGroupDetails.mts new file mode 100644 index 000000000..4570bb7e3 --- /dev/null +++ b/src/version2/models/pageGroupDetails.mts @@ -0,0 +1,19 @@ +import { GroupDetails } from './groupDetails.mjs'; + +/** A page of items. */ +export interface PageGroupDetails { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: GroupDetails[]; +} diff --git a/src/version2/models/pageGroupDetails.ts b/src/version2/models/pageGroupDetails.ts deleted file mode 100644 index a5c3f35c4..000000000 --- a/src/version2/models/pageGroupDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { GroupDetails } from './groupDetails.js'; - -/** A page of items. */ -export interface PageGroupDetails { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: GroupDetails[]; -} diff --git a/src/version2/models/pageIssueFieldOption.mts b/src/version2/models/pageIssueFieldOption.mts new file mode 100644 index 000000000..9a41ac1e7 --- /dev/null +++ b/src/version2/models/pageIssueFieldOption.mts @@ -0,0 +1,19 @@ +import { IssueFieldOption } from './issueFieldOption.mjs'; + +/** A page of items. */ +export interface PageIssueFieldOption { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: IssueFieldOption[]; +} diff --git a/src/version2/models/pageIssueFieldOption.ts b/src/version2/models/pageIssueFieldOption.ts deleted file mode 100644 index 8ab2dc015..000000000 --- a/src/version2/models/pageIssueFieldOption.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueFieldOption } from './issueFieldOption.js'; - -/** A page of items. */ -export interface PageIssueFieldOption { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueFieldOption[]; -} diff --git a/src/version2/models/pageIssueSecurityLevelMember.mts b/src/version2/models/pageIssueSecurityLevelMember.mts new file mode 100644 index 000000000..327846656 --- /dev/null +++ b/src/version2/models/pageIssueSecurityLevelMember.mts @@ -0,0 +1,19 @@ +import { IssueSecurityLevelMember } from './issueSecurityLevelMember.mjs'; + +/** A page of items. */ +export interface PageIssueSecurityLevelMember { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: IssueSecurityLevelMember[]; +} diff --git a/src/version2/models/pageIssueSecurityLevelMember.ts b/src/version2/models/pageIssueSecurityLevelMember.ts deleted file mode 100644 index f5bd892bd..000000000 --- a/src/version2/models/pageIssueSecurityLevelMember.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueSecurityLevelMember } from './issueSecurityLevelMember.js'; - -/** A page of items. */ -export interface PageIssueSecurityLevelMember { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueSecurityLevelMember[]; -} diff --git a/src/version2/models/pageIssueSecuritySchemeToProjectMapping.mts b/src/version2/models/pageIssueSecuritySchemeToProjectMapping.mts new file mode 100644 index 000000000..70819c8f5 --- /dev/null +++ b/src/version2/models/pageIssueSecuritySchemeToProjectMapping.mts @@ -0,0 +1,19 @@ +import { IssueSecuritySchemeToProjectMapping } from './issueSecuritySchemeToProjectMapping.mjs'; + +/** A page of items. */ +export interface PageIssueSecuritySchemeToProjectMapping { + /** Whether this is the last page. */ + isLast: boolean; + /** The maximum number of items that could be returned. */ + maxResults: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self: string; + /** The index of the first item returned. */ + startAt: number; + /** The number of items returned. */ + total: number; + /** The list of items. */ + values: IssueSecuritySchemeToProjectMapping[]; +} diff --git a/src/version2/models/pageIssueSecuritySchemeToProjectMapping.ts b/src/version2/models/pageIssueSecuritySchemeToProjectMapping.ts deleted file mode 100644 index d3d1a878c..000000000 --- a/src/version2/models/pageIssueSecuritySchemeToProjectMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueSecuritySchemeToProjectMapping } from './issueSecuritySchemeToProjectMapping.js'; - -/** A page of items. */ -export interface PageIssueSecuritySchemeToProjectMapping { - /** Whether this is the last page. */ - isLast: boolean; - /** The maximum number of items that could be returned. */ - maxResults: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self: string; - /** The index of the first item returned. */ - startAt: number; - /** The number of items returned. */ - total: number; - /** The list of items. */ - values: IssueSecuritySchemeToProjectMapping[]; -} diff --git a/src/version2/models/pageIssueTypeScheme.mts b/src/version2/models/pageIssueTypeScheme.mts new file mode 100644 index 000000000..b4b2954f3 --- /dev/null +++ b/src/version2/models/pageIssueTypeScheme.mts @@ -0,0 +1,19 @@ +import { IssueTypeScheme } from './issueTypeScheme.mjs'; + +/** A page of items. */ +export interface PageIssueTypeScheme { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: IssueTypeScheme[]; +} diff --git a/src/version2/models/pageIssueTypeScheme.ts b/src/version2/models/pageIssueTypeScheme.ts deleted file mode 100644 index d05d4feb7..000000000 --- a/src/version2/models/pageIssueTypeScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeScheme } from './issueTypeScheme.js'; - -/** A page of items. */ -export interface PageIssueTypeScheme { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueTypeScheme[]; -} diff --git a/src/version2/models/pageIssueTypeSchemeMapping.mts b/src/version2/models/pageIssueTypeSchemeMapping.mts new file mode 100644 index 000000000..7efa7541d --- /dev/null +++ b/src/version2/models/pageIssueTypeSchemeMapping.mts @@ -0,0 +1,19 @@ +import { IssueTypeSchemeMapping } from './issueTypeSchemeMapping.mjs'; + +/** A page of items. */ +export interface PageIssueTypeSchemeMapping { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: IssueTypeSchemeMapping[]; +} diff --git a/src/version2/models/pageIssueTypeSchemeMapping.ts b/src/version2/models/pageIssueTypeSchemeMapping.ts deleted file mode 100644 index 94490a566..000000000 --- a/src/version2/models/pageIssueTypeSchemeMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeSchemeMapping } from './issueTypeSchemeMapping.js'; - -/** A page of items. */ -export interface PageIssueTypeSchemeMapping { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueTypeSchemeMapping[]; -} diff --git a/src/version2/models/pageIssueTypeSchemeProjects.mts b/src/version2/models/pageIssueTypeSchemeProjects.mts new file mode 100644 index 000000000..11be816b1 --- /dev/null +++ b/src/version2/models/pageIssueTypeSchemeProjects.mts @@ -0,0 +1,19 @@ +import { IssueTypeSchemeProjects } from './issueTypeSchemeProjects.mjs'; + +/** A page of items. */ +export interface PageIssueTypeSchemeProjects { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: IssueTypeSchemeProjects[]; +} diff --git a/src/version2/models/pageIssueTypeSchemeProjects.ts b/src/version2/models/pageIssueTypeSchemeProjects.ts deleted file mode 100644 index 91b92b2ad..000000000 --- a/src/version2/models/pageIssueTypeSchemeProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeSchemeProjects } from './issueTypeSchemeProjects.js'; - -/** A page of items. */ -export interface PageIssueTypeSchemeProjects { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueTypeSchemeProjects[]; -} diff --git a/src/version2/models/pageIssueTypeScreenScheme.mts b/src/version2/models/pageIssueTypeScreenScheme.mts new file mode 100644 index 000000000..1a13ac3f3 --- /dev/null +++ b/src/version2/models/pageIssueTypeScreenScheme.mts @@ -0,0 +1,19 @@ +import { IssueTypeScreenScheme } from './issueTypeScreenScheme.mjs'; + +/** A page of items. */ +export interface PageIssueTypeScreenScheme { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: IssueTypeScreenScheme[]; +} diff --git a/src/version2/models/pageIssueTypeScreenScheme.ts b/src/version2/models/pageIssueTypeScreenScheme.ts deleted file mode 100644 index 5de7dc369..000000000 --- a/src/version2/models/pageIssueTypeScreenScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeScreenScheme } from './issueTypeScreenScheme.js'; - -/** A page of items. */ -export interface PageIssueTypeScreenScheme { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueTypeScreenScheme[]; -} diff --git a/src/version2/models/pageIssueTypeScreenSchemeItem.mts b/src/version2/models/pageIssueTypeScreenSchemeItem.mts new file mode 100644 index 000000000..7eac1170f --- /dev/null +++ b/src/version2/models/pageIssueTypeScreenSchemeItem.mts @@ -0,0 +1,19 @@ +import { IssueTypeScreenSchemeItem } from './issueTypeScreenSchemeItem.mjs'; + +/** A page of items. */ +export interface PageIssueTypeScreenSchemeItem { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: IssueTypeScreenSchemeItem[]; +} diff --git a/src/version2/models/pageIssueTypeScreenSchemeItem.ts b/src/version2/models/pageIssueTypeScreenSchemeItem.ts deleted file mode 100644 index 2dce57d83..000000000 --- a/src/version2/models/pageIssueTypeScreenSchemeItem.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeScreenSchemeItem } from './issueTypeScreenSchemeItem.js'; - -/** A page of items. */ -export interface PageIssueTypeScreenSchemeItem { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueTypeScreenSchemeItem[]; -} diff --git a/src/version2/models/pageIssueTypeScreenSchemesProjects.mts b/src/version2/models/pageIssueTypeScreenSchemesProjects.mts new file mode 100644 index 000000000..6efd94486 --- /dev/null +++ b/src/version2/models/pageIssueTypeScreenSchemesProjects.mts @@ -0,0 +1,19 @@ +import { IssueTypeScreenSchemesProjects } from './issueTypeScreenSchemesProjects.mjs'; + +/** A page of items. */ +export interface PageIssueTypeScreenSchemesProjects { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: IssueTypeScreenSchemesProjects[]; +} diff --git a/src/version2/models/pageIssueTypeScreenSchemesProjects.ts b/src/version2/models/pageIssueTypeScreenSchemesProjects.ts deleted file mode 100644 index 531c42f0d..000000000 --- a/src/version2/models/pageIssueTypeScreenSchemesProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeScreenSchemesProjects } from './issueTypeScreenSchemesProjects.js'; - -/** A page of items. */ -export interface PageIssueTypeScreenSchemesProjects { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueTypeScreenSchemesProjects[]; -} diff --git a/src/version2/models/pageIssueTypeToContextMapping.mts b/src/version2/models/pageIssueTypeToContextMapping.mts new file mode 100644 index 000000000..d0127eca8 --- /dev/null +++ b/src/version2/models/pageIssueTypeToContextMapping.mts @@ -0,0 +1,19 @@ +import { IssueTypeToContextMapping } from './issueTypeToContextMapping.mjs'; + +/** A page of items. */ +export interface PageIssueTypeToContextMapping { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: IssueTypeToContextMapping[]; +} diff --git a/src/version2/models/pageIssueTypeToContextMapping.ts b/src/version2/models/pageIssueTypeToContextMapping.ts deleted file mode 100644 index 92a30f017..000000000 --- a/src/version2/models/pageIssueTypeToContextMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeToContextMapping } from './issueTypeToContextMapping.js'; - -/** A page of items. */ -export interface PageIssueTypeToContextMapping { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueTypeToContextMapping[]; -} diff --git a/src/version2/models/pageJqlFunctionPrecomputation.mts b/src/version2/models/pageJqlFunctionPrecomputation.mts new file mode 100644 index 000000000..3e2c315a4 --- /dev/null +++ b/src/version2/models/pageJqlFunctionPrecomputation.mts @@ -0,0 +1,19 @@ +import { JqlFunctionPrecomputation } from './jqlFunctionPrecomputation.mjs'; + +/** A page of items. */ +export interface PageJqlFunctionPrecomputation { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: JqlFunctionPrecomputation[]; +} diff --git a/src/version2/models/pageJqlFunctionPrecomputation.ts b/src/version2/models/pageJqlFunctionPrecomputation.ts deleted file mode 100644 index 0aeaad066..000000000 --- a/src/version2/models/pageJqlFunctionPrecomputation.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { JqlFunctionPrecomputation } from './jqlFunctionPrecomputation.js'; - -/** A page of items. */ -export interface PageJqlFunctionPrecomputation { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: JqlFunctionPrecomputation[]; -} diff --git a/src/version2/models/pageNotificationScheme.mts b/src/version2/models/pageNotificationScheme.mts new file mode 100644 index 000000000..266c80082 --- /dev/null +++ b/src/version2/models/pageNotificationScheme.mts @@ -0,0 +1,19 @@ +import { NotificationScheme } from './notificationScheme.mjs'; + +/** A page of items. */ +export interface PageNotificationScheme { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: NotificationScheme[]; +} diff --git a/src/version2/models/pageNotificationScheme.ts b/src/version2/models/pageNotificationScheme.ts deleted file mode 100644 index 8857daa40..000000000 --- a/src/version2/models/pageNotificationScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { NotificationScheme } from './notificationScheme.js'; - -/** A page of items. */ -export interface PageNotificationScheme { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: NotificationScheme[]; -} diff --git a/src/version2/models/pageOfChangelogs.mts b/src/version2/models/pageOfChangelogs.mts new file mode 100644 index 000000000..8e78bc40e --- /dev/null +++ b/src/version2/models/pageOfChangelogs.mts @@ -0,0 +1,13 @@ +import type { Changelog } from './changelog.mjs'; + +/** A page of changelogs. */ +export interface PageOfChangelogs { + /** The list of changelogs. */ + histories?: Changelog[]; + /** The maximum number of results that could be on the page. */ + maxResults?: number; + /** The index of the first item returned on the page. */ + startAt?: number; + /** The number of results on the page. */ + total?: number; +} diff --git a/src/version2/models/pageOfChangelogs.ts b/src/version2/models/pageOfChangelogs.ts deleted file mode 100644 index 5be65cc74..000000000 --- a/src/version2/models/pageOfChangelogs.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Changelog } from './changelog.js'; - -/** A page of changelogs. */ -export interface PageOfChangelogs { - /** The list of changelogs. */ - histories?: Changelog[]; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The index of the first item returned on the page. */ - startAt?: number; - /** The number of results on the page. */ - total?: number; -} diff --git a/src/version2/models/pageOfComments.mts b/src/version2/models/pageOfComments.mts new file mode 100644 index 000000000..3db4529e7 --- /dev/null +++ b/src/version2/models/pageOfComments.mts @@ -0,0 +1,13 @@ +import type { Comment } from './comment.mjs'; + +/** A page of comments. */ +export interface PageOfComments { + /** The list of comments. */ + comments?: Comment[]; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; +} diff --git a/src/version2/models/pageOfComments.ts b/src/version2/models/pageOfComments.ts deleted file mode 100644 index 0b1d4f879..000000000 --- a/src/version2/models/pageOfComments.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Comment } from './comment.js'; - -/** A page of comments. */ -export interface PageOfComments { - /** The list of comments. */ - comments?: Comment[]; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; -} diff --git a/src/version2/models/pageOfDashboards.mts b/src/version2/models/pageOfDashboards.mts new file mode 100644 index 000000000..fb117b195 --- /dev/null +++ b/src/version2/models/pageOfDashboards.mts @@ -0,0 +1,17 @@ +import type { Dashboard } from './dashboard.mjs'; + +/** A page containing dashboard details. */ +export interface PageOfDashboards { + /** List of dashboards. */ + dashboards?: Dashboard[]; + /** The maximum number of results that could be on the page. */ + maxResults?: number; + /** The URL of the next page of results, if any. */ + next?: string; + /** The URL of the previous page of results, if any. */ + prev?: string; + /** The index of the first item returned on the page. */ + startAt?: number; + /** The number of results on the page. */ + total?: number; +} diff --git a/src/version2/models/pageOfDashboards.ts b/src/version2/models/pageOfDashboards.ts deleted file mode 100644 index 71b2057df..000000000 --- a/src/version2/models/pageOfDashboards.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { Dashboard } from './dashboard.js'; - -/** A page containing dashboard details. */ -export interface PageOfDashboards { - /** List of dashboards. */ - dashboards?: Dashboard[]; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The URL of the next page of results, if any. */ - next?: string; - /** The URL of the previous page of results, if any. */ - prev?: string; - /** The index of the first item returned on the page. */ - startAt?: number; - /** The number of results on the page. */ - total?: number; -} diff --git a/src/version2/models/pageOfStatuses.mts b/src/version2/models/pageOfStatuses.mts new file mode 100644 index 000000000..fd73d1105 --- /dev/null +++ b/src/version2/models/pageOfStatuses.mts @@ -0,0 +1,18 @@ +import type { JiraStatus } from './jiraStatus.mjs'; + +export interface PageOfStatuses { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The URL of the next page of results, if any. */ + nextPage?: string; + /** The URL of this page. */ + self?: string; + /** The index of the first item returned on the page. */ + startAt?: number; + /** Number of items that satisfy the search. */ + total?: number; + /** The list of items. */ + values?: JiraStatus[]; +} diff --git a/src/version2/models/pageOfStatuses.ts b/src/version2/models/pageOfStatuses.ts deleted file mode 100644 index 8d275ea0a..000000000 --- a/src/version2/models/pageOfStatuses.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { JiraStatus } from './jiraStatus.js'; - -export interface PageOfStatuses { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The URL of the next page of results, if any. */ - nextPage?: string; - /** The URL of this page. */ - self?: string; - /** The index of the first item returned on the page. */ - startAt?: number; - /** Number of items that satisfy the search. */ - total?: number; - /** The list of items. */ - values?: JiraStatus[]; -} diff --git a/src/version2/models/pageOfWorklogs.mts b/src/version2/models/pageOfWorklogs.mts new file mode 100644 index 000000000..26de9ffa7 --- /dev/null +++ b/src/version2/models/pageOfWorklogs.mts @@ -0,0 +1,13 @@ +import type { Worklog } from './worklog.mjs'; + +/** Paginated list of worklog details */ +export interface PageOfWorklogs { + /** The maximum number of results that could be on the page. */ + maxResults: number; + /** The index of the first item returned on the page. */ + startAt: number; + /** The number of results on the page. */ + total: number; + /** List of worklogs. */ + worklogs: Worklog[]; +} diff --git a/src/version2/models/pageOfWorklogs.ts b/src/version2/models/pageOfWorklogs.ts deleted file mode 100644 index 7e722acfd..000000000 --- a/src/version2/models/pageOfWorklogs.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Worklog } from './worklog.js'; - -/** Paginated list of worklog details */ -export interface PageOfWorklogs { - /** The maximum number of results that could be on the page. */ - maxResults: number; - /** The index of the first item returned on the page. */ - startAt: number; - /** The number of results on the page. */ - total: number; - /** List of worklogs. */ - worklogs: Worklog[]; -} diff --git a/src/version2/models/pagePriority.mts b/src/version2/models/pagePriority.mts new file mode 100644 index 000000000..bac0150bc --- /dev/null +++ b/src/version2/models/pagePriority.mts @@ -0,0 +1,19 @@ +import type { Priority } from './priority.mjs'; + +/** A page of items. */ +export interface PagePriority { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: Priority[]; +} diff --git a/src/version2/models/pagePriority.ts b/src/version2/models/pagePriority.ts deleted file mode 100644 index a142583e0..000000000 --- a/src/version2/models/pagePriority.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Priority } from './priority.js'; - -/** A page of items. */ -export interface PagePriority { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: Priority[]; -} diff --git a/src/version2/models/pageProject.mts b/src/version2/models/pageProject.mts new file mode 100644 index 000000000..3f8670f7c --- /dev/null +++ b/src/version2/models/pageProject.mts @@ -0,0 +1,19 @@ +import type { Project } from './project.mjs'; + +/** A page of items. */ +export interface PageProject { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values: Project[]; +} diff --git a/src/version2/models/pageProject.ts b/src/version2/models/pageProject.ts deleted file mode 100644 index 38981e3a5..000000000 --- a/src/version2/models/pageProject.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Project } from './project.js'; - -/** A page of items. */ -export interface PageProject { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values: Project[]; -} diff --git a/src/version2/models/pageProjectDetails.mts b/src/version2/models/pageProjectDetails.mts new file mode 100644 index 000000000..bb6f771d7 --- /dev/null +++ b/src/version2/models/pageProjectDetails.mts @@ -0,0 +1,19 @@ +import type { ProjectDetails } from './projectDetails.mjs'; + +/** A page of items. */ +export interface PageProjectDetails { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: ProjectDetails[]; +} diff --git a/src/version2/models/pageProjectDetails.ts b/src/version2/models/pageProjectDetails.ts deleted file mode 100644 index e1830fe52..000000000 --- a/src/version2/models/pageProjectDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ProjectDetails } from './projectDetails.js'; - -/** A page of items. */ -export interface PageProjectDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: ProjectDetails[]; -} diff --git a/src/version2/models/pageResolution.mts b/src/version2/models/pageResolution.mts new file mode 100644 index 000000000..59c7355b3 --- /dev/null +++ b/src/version2/models/pageResolution.mts @@ -0,0 +1,19 @@ +import type { Resolution } from './resolution.mjs'; + +/** A page of items. */ +export interface PageResolution { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: Resolution[]; +} diff --git a/src/version2/models/pageResolution.ts b/src/version2/models/pageResolution.ts deleted file mode 100644 index 2d72eb028..000000000 --- a/src/version2/models/pageResolution.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Resolution } from './resolution.js'; - -/** A page of items. */ -export interface PageResolution { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: Resolution[]; -} diff --git a/src/version2/models/pageScreen.mts b/src/version2/models/pageScreen.mts new file mode 100644 index 000000000..9f1a8e914 --- /dev/null +++ b/src/version2/models/pageScreen.mts @@ -0,0 +1,19 @@ +import type { Screen } from './screen.mjs'; + +/** A page of items. */ +export interface PageScreen { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: Screen[]; +} diff --git a/src/version2/models/pageScreen.ts b/src/version2/models/pageScreen.ts deleted file mode 100644 index 03c57d7a0..000000000 --- a/src/version2/models/pageScreen.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Screen } from './screen.js'; - -/** A page of items. */ -export interface PageScreen { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: Screen[]; -} diff --git a/src/version2/models/pageScreenScheme.mts b/src/version2/models/pageScreenScheme.mts new file mode 100644 index 000000000..f8a7c693b --- /dev/null +++ b/src/version2/models/pageScreenScheme.mts @@ -0,0 +1,19 @@ +import type { ScreenScheme } from './screenScheme.mjs'; + +/** A page of items. */ +export interface PageScreenScheme { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: ScreenScheme[]; +} diff --git a/src/version2/models/pageScreenScheme.ts b/src/version2/models/pageScreenScheme.ts deleted file mode 100644 index 2f393195f..000000000 --- a/src/version2/models/pageScreenScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ScreenScheme } from './screenScheme.js'; - -/** A page of items. */ -export interface PageScreenScheme { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: ScreenScheme[]; -} diff --git a/src/version2/models/pageScreenWithTab.mts b/src/version2/models/pageScreenWithTab.mts new file mode 100644 index 000000000..6400ffe48 --- /dev/null +++ b/src/version2/models/pageScreenWithTab.mts @@ -0,0 +1,19 @@ +import type { ScreenWithTab } from './screenWithTab.mjs'; + +/** A page of items. */ +export interface PageScreenWithTab { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: ScreenWithTab[]; +} diff --git a/src/version2/models/pageScreenWithTab.ts b/src/version2/models/pageScreenWithTab.ts deleted file mode 100644 index 820c6746f..000000000 --- a/src/version2/models/pageScreenWithTab.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ScreenWithTab } from './screenWithTab.js'; - -/** A page of items. */ -export interface PageScreenWithTab { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: ScreenWithTab[]; -} diff --git a/src/version2/models/pageSecurityLevel.mts b/src/version2/models/pageSecurityLevel.mts new file mode 100644 index 000000000..131ab86e8 --- /dev/null +++ b/src/version2/models/pageSecurityLevel.mts @@ -0,0 +1,19 @@ +import type { SecurityLevel } from './securityLevel.mjs'; + +/** A page of items. */ +export interface PageSecurityLevel { + /** Whether this is the last page. */ + isLast: boolean; + /** The maximum number of items that could be returned. */ + maxResults: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self: string; + /** The index of the first item returned. */ + startAt: number; + /** The number of items returned. */ + total: number; + /** The list of items. */ + values: SecurityLevel[]; +} diff --git a/src/version2/models/pageSecurityLevel.ts b/src/version2/models/pageSecurityLevel.ts deleted file mode 100644 index 617a298fa..000000000 --- a/src/version2/models/pageSecurityLevel.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { SecurityLevel } from './securityLevel.js'; - -/** A page of items. */ -export interface PageSecurityLevel { - /** Whether this is the last page. */ - isLast: boolean; - /** The maximum number of items that could be returned. */ - maxResults: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self: string; - /** The index of the first item returned. */ - startAt: number; - /** The number of items returned. */ - total: number; - /** The list of items. */ - values: SecurityLevel[]; -} diff --git a/src/version2/models/pageSecurityLevelMember.mts b/src/version2/models/pageSecurityLevelMember.mts new file mode 100644 index 000000000..d455f37d0 --- /dev/null +++ b/src/version2/models/pageSecurityLevelMember.mts @@ -0,0 +1,19 @@ +import type { SecurityLevelMember } from './securityLevelMember.mjs'; + +/** A page of items. */ +export interface PageSecurityLevelMember { + /** Whether this is the last page. */ + isLast: boolean; + /** The maximum number of items that could be returned. */ + maxResults: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self: string; + /** The index of the first item returned. */ + startAt: number; + /** The number of items returned. */ + total: number; + /** The list of items. */ + values: SecurityLevelMember[]; +} diff --git a/src/version2/models/pageSecurityLevelMember.ts b/src/version2/models/pageSecurityLevelMember.ts deleted file mode 100644 index bebc061d6..000000000 --- a/src/version2/models/pageSecurityLevelMember.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { SecurityLevelMember } from './securityLevelMember.js'; - -/** A page of items. */ -export interface PageSecurityLevelMember { - /** Whether this is the last page. */ - isLast: boolean; - /** The maximum number of items that could be returned. */ - maxResults: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self: string; - /** The index of the first item returned. */ - startAt: number; - /** The number of items returned. */ - total: number; - /** The list of items. */ - values: SecurityLevelMember[]; -} diff --git a/src/version2/models/pageSecuritySchemeWithProjects.mts b/src/version2/models/pageSecuritySchemeWithProjects.mts new file mode 100644 index 000000000..54d63a3c5 --- /dev/null +++ b/src/version2/models/pageSecuritySchemeWithProjects.mts @@ -0,0 +1,19 @@ +import type { SecuritySchemeWithProjects } from './securitySchemeWithProjects.mjs'; + +/** A page of items. */ +export interface PageSecuritySchemeWithProjects { + /** Whether this is the last page. */ + isLast: boolean; + /** The maximum number of items that could be returned. */ + maxResults: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self: string; + /** The index of the first item returned. */ + startAt: number; + /** The number of items returned. */ + total: number; + /** The list of items. */ + values: SecuritySchemeWithProjects[]; +} diff --git a/src/version2/models/pageSecuritySchemeWithProjects.ts b/src/version2/models/pageSecuritySchemeWithProjects.ts deleted file mode 100644 index 0f37fd7ba..000000000 --- a/src/version2/models/pageSecuritySchemeWithProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { SecuritySchemeWithProjects } from './securitySchemeWithProjects.js'; - -/** A page of items. */ -export interface PageSecuritySchemeWithProjects { - /** Whether this is the last page. */ - isLast: boolean; - /** The maximum number of items that could be returned. */ - maxResults: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self: string; - /** The index of the first item returned. */ - startAt: number; - /** The number of items returned. */ - total: number; - /** The list of items. */ - values: SecuritySchemeWithProjects[]; -} diff --git a/src/version2/models/pageString.ts b/src/version2/models/pageString.mts similarity index 100% rename from src/version2/models/pageString.ts rename to src/version2/models/pageString.mts diff --git a/src/version2/models/pageUiModificationDetails.mts b/src/version2/models/pageUiModificationDetails.mts new file mode 100644 index 000000000..3c85bb4b3 --- /dev/null +++ b/src/version2/models/pageUiModificationDetails.mts @@ -0,0 +1,19 @@ +import type { UiModificationDetails } from './uiModificationDetails.mjs'; + +/** A page of items. */ +export interface PageUiModificationDetails { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: UiModificationDetails[]; +} diff --git a/src/version2/models/pageUiModificationDetails.ts b/src/version2/models/pageUiModificationDetails.ts deleted file mode 100644 index c1e79d25c..000000000 --- a/src/version2/models/pageUiModificationDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { UiModificationDetails } from './uiModificationDetails.js'; - -/** A page of items. */ -export interface PageUiModificationDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: UiModificationDetails[]; -} diff --git a/src/version2/models/pageUser.mts b/src/version2/models/pageUser.mts new file mode 100644 index 000000000..c57577c91 --- /dev/null +++ b/src/version2/models/pageUser.mts @@ -0,0 +1,19 @@ +import { User } from './user.mjs'; + +/** A page of items. */ +export interface PageUser { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: User[]; +} diff --git a/src/version2/models/pageUser.ts b/src/version2/models/pageUser.ts deleted file mode 100644 index 6e898b7ea..000000000 --- a/src/version2/models/pageUser.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { User } from './user.js'; - -/** A page of items. */ -export interface PageUser { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: User[]; -} diff --git a/src/version2/models/pageUserDetails.mts b/src/version2/models/pageUserDetails.mts new file mode 100644 index 000000000..8c77b5dea --- /dev/null +++ b/src/version2/models/pageUserDetails.mts @@ -0,0 +1,19 @@ +import { UserDetails } from './userDetails.mjs'; + +/** A page of items. */ +export interface PageUserDetails { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: UserDetails[]; +} diff --git a/src/version2/models/pageUserDetails.ts b/src/version2/models/pageUserDetails.ts deleted file mode 100644 index 65a73261a..000000000 --- a/src/version2/models/pageUserDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { UserDetails } from './userDetails.js'; - -/** A page of items. */ -export interface PageUserDetails { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: UserDetails[]; -} diff --git a/src/version2/models/pageUserKey.mts b/src/version2/models/pageUserKey.mts new file mode 100644 index 000000000..be04dc234 --- /dev/null +++ b/src/version2/models/pageUserKey.mts @@ -0,0 +1,19 @@ +import type { UserKey } from './userKey.mjs'; + +/** A page of items. */ +export interface PageUserKey { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: UserKey[]; +} diff --git a/src/version2/models/pageUserKey.ts b/src/version2/models/pageUserKey.ts deleted file mode 100644 index 949473b8c..000000000 --- a/src/version2/models/pageUserKey.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { UserKey } from './userKey.js'; - -/** A page of items. */ -export interface PageUserKey { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: UserKey[]; -} diff --git a/src/version2/models/pageVersion.mts b/src/version2/models/pageVersion.mts new file mode 100644 index 000000000..b09289ea5 --- /dev/null +++ b/src/version2/models/pageVersion.mts @@ -0,0 +1,19 @@ +import type { Version } from './version.mjs'; + +/** A page of items. */ +export interface PageVersion { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: Version[]; +} diff --git a/src/version2/models/pageVersion.ts b/src/version2/models/pageVersion.ts deleted file mode 100644 index 93d8f3968..000000000 --- a/src/version2/models/pageVersion.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Version } from './version.js'; - -/** A page of items. */ -export interface PageVersion { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: Version[]; -} diff --git a/src/version2/models/pageWebhook.mts b/src/version2/models/pageWebhook.mts new file mode 100644 index 000000000..e18662b78 --- /dev/null +++ b/src/version2/models/pageWebhook.mts @@ -0,0 +1,19 @@ +import type { Webhook } from './webhook.mjs'; + +/** A page of items. */ +export interface PageWebhook { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: Webhook[]; +} diff --git a/src/version2/models/pageWebhook.ts b/src/version2/models/pageWebhook.ts deleted file mode 100644 index 3766692bf..000000000 --- a/src/version2/models/pageWebhook.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Webhook } from './webhook.js'; - -/** A page of items. */ -export interface PageWebhook { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: Webhook[]; -} diff --git a/src/version2/models/pageWorkflow.mts b/src/version2/models/pageWorkflow.mts new file mode 100644 index 000000000..e9fef4cf6 --- /dev/null +++ b/src/version2/models/pageWorkflow.mts @@ -0,0 +1,19 @@ +import type { Workflow } from './workflow.mjs'; + +/** A page of items. */ +export interface PageWorkflow { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: Workflow[]; +} diff --git a/src/version2/models/pageWorkflow.ts b/src/version2/models/pageWorkflow.ts deleted file mode 100644 index ba2e8e6f0..000000000 --- a/src/version2/models/pageWorkflow.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Workflow } from './workflow.js'; - -/** A page of items. */ -export interface PageWorkflow { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: Workflow[]; -} diff --git a/src/version2/models/pageWorkflowScheme.mts b/src/version2/models/pageWorkflowScheme.mts new file mode 100644 index 000000000..bce450282 --- /dev/null +++ b/src/version2/models/pageWorkflowScheme.mts @@ -0,0 +1,19 @@ +import type { WorkflowScheme } from './workflowScheme.mjs'; + +/** A page of items. */ +export interface PageWorkflowScheme { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: WorkflowScheme[]; +} diff --git a/src/version2/models/pageWorkflowScheme.ts b/src/version2/models/pageWorkflowScheme.ts deleted file mode 100644 index 9c837d3c8..000000000 --- a/src/version2/models/pageWorkflowScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { WorkflowScheme } from './workflowScheme.js'; - -/** A page of items. */ -export interface PageWorkflowScheme { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: WorkflowScheme[]; -} diff --git a/src/version2/models/pageWorkflowTransitionRules.mts b/src/version2/models/pageWorkflowTransitionRules.mts new file mode 100644 index 000000000..586010061 --- /dev/null +++ b/src/version2/models/pageWorkflowTransitionRules.mts @@ -0,0 +1,19 @@ +import type { WorkflowTransitionRules } from './workflowTransitionRules.mjs'; + +/** A page of items. */ +export interface PageWorkflowTransitionRules { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: WorkflowTransitionRules[]; +} diff --git a/src/version2/models/pageWorkflowTransitionRules.ts b/src/version2/models/pageWorkflowTransitionRules.ts deleted file mode 100644 index c667f599e..000000000 --- a/src/version2/models/pageWorkflowTransitionRules.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { WorkflowTransitionRules } from './workflowTransitionRules.js'; - -/** A page of items. */ -export interface PageWorkflowTransitionRules { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: WorkflowTransitionRules[]; -} diff --git a/src/version2/models/pagedListUserDetailsApplicationUser.mts b/src/version2/models/pagedListUserDetailsApplicationUser.mts new file mode 100644 index 000000000..8f22b739a --- /dev/null +++ b/src/version2/models/pagedListUserDetailsApplicationUser.mts @@ -0,0 +1,18 @@ +import { UserDetails } from './userDetails.mjs'; + +/** + * A paged list. To access additional details append `[start-index:end-index]` to the expand request. For example, + * `?expand=sharedUsers[10:40]` returns a list starting at item 10 and finishing at item 40. + */ +export interface PagedListUserDetailsApplicationUser { + /** The index of the last item returned on the page. */ + 'end-index'?: number; + /** The list of items. */ + items?: UserDetails[]; + /** The maximum number of results that could be on the page. */ + 'max-results'?: number; + /** The number of items on the page. */ + size?: number; + /** The index of the first item returned on the page. */ + 'start-index'?: number; +} diff --git a/src/version2/models/pagedListUserDetailsApplicationUser.ts b/src/version2/models/pagedListUserDetailsApplicationUser.ts deleted file mode 100644 index 93ae7d581..000000000 --- a/src/version2/models/pagedListUserDetailsApplicationUser.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { UserDetails } from './userDetails.js'; - -/** - * A paged list. To access additional details append `[start-index:end-index]` to the expand request. For example, - * `?expand=sharedUsers[10:40]` returns a list starting at item 10 and finishing at item 40. - */ -export interface PagedListUserDetailsApplicationUser { - /** The index of the last item returned on the page. */ - 'end-index'?: number; - /** The list of items. */ - items?: UserDetails[]; - /** The maximum number of results that could be on the page. */ - 'max-results'?: number; - /** The number of items on the page. */ - size?: number; - /** The index of the first item returned on the page. */ - 'start-index'?: number; -} diff --git a/src/version2/models/parsedJqlQueries.mts b/src/version2/models/parsedJqlQueries.mts new file mode 100644 index 000000000..e4ae784f6 --- /dev/null +++ b/src/version2/models/parsedJqlQueries.mts @@ -0,0 +1,7 @@ +import type { ParsedJqlQuery } from './parsedJqlQuery.mjs'; + +/** A list of parsed Jql queries. */ +export interface ParsedJqlQueries { + /** A list of parsed Jql queries. */ + queries: ParsedJqlQuery[]; +} diff --git a/src/version2/models/parsedJqlQueries.ts b/src/version2/models/parsedJqlQueries.ts deleted file mode 100644 index c4b94647b..000000000 --- a/src/version2/models/parsedJqlQueries.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ParsedJqlQuery } from './parsedJqlQuery.js'; - -/** A list of parsed JQL queries. */ -export interface ParsedJqlQueries { - /** A list of parsed JQL queries. */ - queries: ParsedJqlQuery[]; -} diff --git a/src/version2/models/parsedJqlQuery.mts b/src/version2/models/parsedJqlQuery.mts new file mode 100644 index 000000000..33299e83a --- /dev/null +++ b/src/version2/models/parsedJqlQuery.mts @@ -0,0 +1,10 @@ +import type { JqlQuery } from './jqlQuery.mjs'; + +/** Details of a parsed Jql query. */ +export interface ParsedJqlQuery { + /** The list of syntax or validation errors. */ + errors?: string[]; + /** The Jql query that was parsed and validated. */ + query: string; + structure?: JqlQuery; +} diff --git a/src/version2/models/parsedJqlQuery.ts b/src/version2/models/parsedJqlQuery.ts deleted file mode 100644 index 42dd8f6eb..000000000 --- a/src/version2/models/parsedJqlQuery.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { JqlQuery } from './jqlQuery.js'; - -/** Details of a parsed JQL query. */ -export interface ParsedJqlQuery { - /** The list of syntax or validation errors. */ - errors?: string[]; - /** The JQL query that was parsed and validated. */ - query: string; - structure?: JqlQuery; -} diff --git a/src/version2/models/permissionDetails.mts b/src/version2/models/permissionDetails.mts new file mode 100644 index 000000000..14aaa79dd --- /dev/null +++ b/src/version2/models/permissionDetails.mts @@ -0,0 +1,9 @@ +import type { SharePermission } from './sharePermission.mjs'; + +/** Details for permissions of shareable entities */ +export interface PermissionDetails { + /** The edit permissions for the shareable entities. */ + editPermissions: SharePermission[]; + /** The share permissions for the shareable entities. */ + sharePermissions: SharePermission[]; +} diff --git a/src/version2/models/permissionDetails.ts b/src/version2/models/permissionDetails.ts deleted file mode 100644 index 906895dc0..000000000 --- a/src/version2/models/permissionDetails.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { SharePermission } from './sharePermission.js'; - -/** Details for permissions of shareable entities */ -export interface PermissionDetails { - /** The edit permissions for the shareable entities. */ - editPermissions: SharePermission[]; - /** The share permissions for the shareable entities. */ - sharePermissions: SharePermission[]; -} diff --git a/src/version2/models/permissionGrant.mts b/src/version2/models/permissionGrant.mts new file mode 100644 index 000000000..cbb933bbc --- /dev/null +++ b/src/version2/models/permissionGrant.mts @@ -0,0 +1,19 @@ +import type { PermissionHolder } from './permissionHolder.mjs'; + +/** Details about a permission granted to a user or group. */ +export interface PermissionGrant { + holder?: PermissionHolder; + /** The ID of the permission granted details. */ + id?: number; + /** + * The permission to grant. This permission can be one of the built-in permissions or a custom permission added by an + * app. See [Built-in permissions](../api-group-permission-schemes/#built-in-permissions) in _Get all permission + * schemes_ for more information about the built-in permissions. See the [project + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation + * for more information about custom permissions. + */ + permission?: string; + /** The URL of the permission granted details. */ + self?: string; +} diff --git a/src/version2/models/permissionGrant.ts b/src/version2/models/permissionGrant.ts deleted file mode 100644 index 6b60b2126..000000000 --- a/src/version2/models/permissionGrant.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { PermissionHolder } from './permissionHolder.js'; - -/** Details about a permission granted to a user or group. */ -export interface PermissionGrant { - holder?: PermissionHolder; - /** The ID of the permission granted details. */ - id?: number; - /** - * The permission to grant. This permission can be one of the built-in permissions or a custom permission added by an - * app. See [Built-in permissions](../api-group-permission-schemes/#built-in-permissions) in _Get all permission - * schemes_ for more information about the built-in permissions. See the [project - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation - * for more information about custom permissions. - */ - permission?: string; - /** The URL of the permission granted details. */ - self?: string; -} diff --git a/src/version2/models/permissionGrants.mts b/src/version2/models/permissionGrants.mts new file mode 100644 index 000000000..53188d497 --- /dev/null +++ b/src/version2/models/permissionGrants.mts @@ -0,0 +1,9 @@ +import type { PermissionGrant } from './permissionGrant.mjs'; + +/** List of permission grants. */ +export interface PermissionGrants { + /** Expand options that include additional permission grant details in the response. */ + expand?: string; + /** Permission grants list. */ + permissions?: PermissionGrant[]; +} diff --git a/src/version2/models/permissionGrants.ts b/src/version2/models/permissionGrants.ts deleted file mode 100644 index b2819c5b2..000000000 --- a/src/version2/models/permissionGrants.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { PermissionGrant } from './permissionGrant.js'; - -/** List of permission grants. */ -export interface PermissionGrants { - /** Expand options that include additional permission grant details in the response. */ - expand?: string; - /** Permission grants list. */ - permissions?: PermissionGrant[]; -} diff --git a/src/version2/models/permissionHolder.ts b/src/version2/models/permissionHolder.mts similarity index 100% rename from src/version2/models/permissionHolder.ts rename to src/version2/models/permissionHolder.mts diff --git a/src/version2/models/permissionScheme.mts b/src/version2/models/permissionScheme.mts new file mode 100644 index 000000000..f6c36117e --- /dev/null +++ b/src/version2/models/permissionScheme.mts @@ -0,0 +1,22 @@ +import type { PermissionGrant } from './permissionGrant.mjs'; +import type { Scope } from './scope.mjs'; + +/** Details of a permission scheme. */ +export interface PermissionScheme { + /** A description for the permission scheme. */ + description?: string; + /** The expand options available for the permission scheme. */ + expand?: string; + /** The ID of the permission scheme. */ + id?: number; + /** The name of the permission scheme. Must be unique. */ + name: string; + /** + * The permission scheme to create or update. See [About permission schemes and + * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more information. + */ + permissions?: PermissionGrant[]; + scope?: Scope; + /** The URL of the permission scheme. */ + self?: string; +} diff --git a/src/version2/models/permissionScheme.ts b/src/version2/models/permissionScheme.ts deleted file mode 100644 index 6c82886de..000000000 --- a/src/version2/models/permissionScheme.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { PermissionGrant } from './permissionGrant.js'; -import type { Scope } from './scope.js'; - -/** Details of a permission scheme. */ -export interface PermissionScheme { - /** A description for the permission scheme. */ - description?: string; - /** The expand options available for the permission scheme. */ - expand?: string; - /** The ID of the permission scheme. */ - id?: number; - /** The name of the permission scheme. Must be unique. */ - name: string; - /** - * The permission scheme to create or update. See [About permission schemes and - * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more information. - */ - permissions?: PermissionGrant[]; - scope?: Scope; - /** The URL of the permission scheme. */ - self?: string; -} diff --git a/src/version2/models/permissionSchemes.mts b/src/version2/models/permissionSchemes.mts new file mode 100644 index 000000000..2ac1a132e --- /dev/null +++ b/src/version2/models/permissionSchemes.mts @@ -0,0 +1,7 @@ +import type { PermissionScheme } from './permissionScheme.mjs'; + +/** List of all permission schemes. */ +export interface PermissionSchemes { + /** Permission schemes list. */ + permissionSchemes?: PermissionScheme[]; +} diff --git a/src/version2/models/permissionSchemes.ts b/src/version2/models/permissionSchemes.ts deleted file mode 100644 index 6590857de..000000000 --- a/src/version2/models/permissionSchemes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PermissionScheme } from './permissionScheme.js'; - -/** List of all permission schemes. */ -export interface PermissionSchemes { - /** Permission schemes list. */ - permissionSchemes?: PermissionScheme[]; -} diff --git a/src/version2/models/permissions.ts b/src/version2/models/permissions.mts similarity index 100% rename from src/version2/models/permissions.ts rename to src/version2/models/permissions.mts diff --git a/src/version2/models/permissionsKeys.ts b/src/version2/models/permissionsKeys.mts similarity index 100% rename from src/version2/models/permissionsKeys.ts rename to src/version2/models/permissionsKeys.mts diff --git a/src/version2/models/permittedProjects.mts b/src/version2/models/permittedProjects.mts new file mode 100644 index 000000000..3b1dad5f7 --- /dev/null +++ b/src/version2/models/permittedProjects.mts @@ -0,0 +1,7 @@ +import type { ProjectIdentifier } from './projectIdentifier.mjs'; + +/** A list of projects in which a user is granted permissions. */ +export interface PermittedProjects { + /** A list of projects. */ + projects?: ProjectIdentifier[]; +} diff --git a/src/version2/models/permittedProjects.ts b/src/version2/models/permittedProjects.ts deleted file mode 100644 index c59be1713..000000000 --- a/src/version2/models/permittedProjects.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ProjectIdentifier } from './projectIdentifier.js'; - -/** A list of projects in which a user is granted permissions. */ -export interface PermittedProjects { - /** A list of projects. */ - projects?: ProjectIdentifier[]; -} diff --git a/src/version2/models/priority.ts b/src/version2/models/priority.mts similarity index 100% rename from src/version2/models/priority.ts rename to src/version2/models/priority.mts diff --git a/src/version2/models/priorityId.ts b/src/version2/models/priorityId.mts similarity index 100% rename from src/version2/models/priorityId.ts rename to src/version2/models/priorityId.mts diff --git a/src/version2/models/project.mts b/src/version2/models/project.mts new file mode 100644 index 000000000..e06d3dfe2 --- /dev/null +++ b/src/version2/models/project.mts @@ -0,0 +1,80 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; +import type { Hierarchy } from './hierarchy.mjs'; +import type { IssueTypeDetails } from './issueTypeDetails.mjs'; +import type { ProjectCategory } from './projectCategory.mjs'; +import type { ProjectComponent } from './projectComponent.mjs'; +import type { ProjectInsight } from './projectInsight.mjs'; +import type { ProjectLandingPageInfo } from './projectLandingPageInfo.mjs'; +import type { ProjectPermissions } from './projectPermissions.mjs'; +import { User } from './user.mjs'; +import type { Version } from './version.mjs'; + +/** Details about a project. */ +export interface Project { + /** Whether the project is archived. */ + archived?: boolean; + archivedBy?: User; + /** The date when the project was archived. */ + archivedDate?: string; + /** The default assignee when creating issues for this project. */ + assigneeType?: string; + avatarUrls?: AvatarUrls; + /** List of the components contained in the project. */ + components?: ProjectComponent[]; + /** Whether the project is marked as deleted. */ + deleted?: boolean; + deletedBy?: User; + /** The date when the project was marked as deleted. */ + deletedDate?: string; + /** A brief description of the project. */ + description?: string; + /** An email address associated with the project. */ + email?: string; + /** Expand options that include additional project details in the response. */ + expand?: string; + /** Whether the project is selected as a favorite. */ + favourite?: boolean; + /** The ID of the project. */ + id?: string; + insight?: ProjectInsight; + /** Whether the project is private. */ + isPrivate?: boolean; + issueTypeHierarchy?: Hierarchy; + /** List of the issue types available in the project. */ + issueTypes?: IssueTypeDetails[]; + /** The key of the project. */ + key?: string; + landingPageInfo?: ProjectLandingPageInfo; + lead?: User; + /** The name of the project. */ + name?: string; + permissions?: ProjectPermissions; + projectCategory?: ProjectCategory; + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the + * project. + */ + projectTypeKey?: string; + /** Map of project properties */ + properties?: {}; + /** The date when the project is deleted permanently. */ + retentionTillDate?: string; + /** + * The name and self URL for each role defined in the project. For more information, see [Create project + * role](#api-rest-api-2-role-post). + */ + roles?: {}; + /** The URL of the project details. */ + self?: string; + /** Whether the project is simplified. */ + simplified?: boolean; + /** The type of the project. */ + style?: string; + /** A link to information about this project, such as project documentation. */ + url?: string; + /** Unique ID for next-gen projects. */ + uuid?: string; + /** The versions defined in the project. For more information, see [Create version](#api-rest-api-2-version-post). */ + versions?: Version[]; +} diff --git a/src/version2/models/project.ts b/src/version2/models/project.ts deleted file mode 100644 index a409177bb..000000000 --- a/src/version2/models/project.ts +++ /dev/null @@ -1,80 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; -import type { Hierarchy } from './hierarchy.js'; -import type { IssueTypeDetails } from './issueTypeDetails.js'; -import type { ProjectCategory } from './projectCategory.js'; -import type { ProjectComponent } from './projectComponent.js'; -import type { ProjectInsight } from './projectInsight.js'; -import type { ProjectLandingPageInfo } from './projectLandingPageInfo.js'; -import type { ProjectPermissions } from './projectPermissions.js'; -import type { User } from './user.js'; -import type { Version } from './version.js'; - -/** Details about a project. */ -export interface Project { - /** Whether the project is archived. */ - archived?: boolean; - archivedBy?: User; - /** The date when the project was archived. */ - archivedDate?: string; - /** The default assignee when creating issues for this project. */ - assigneeType?: string; - avatarUrls?: AvatarUrls; - /** List of the components contained in the project. */ - components?: ProjectComponent[]; - /** Whether the project is marked as deleted. */ - deleted?: boolean; - deletedBy?: User; - /** The date when the project was marked as deleted. */ - deletedDate?: string; - /** A brief description of the project. */ - description?: string; - /** An email address associated with the project. */ - email?: string; - /** Expand options that include additional project details in the response. */ - expand?: string; - /** Whether the project is selected as a favorite. */ - favourite?: boolean; - /** The ID of the project. */ - id?: string; - insight?: ProjectInsight; - /** Whether the project is private. */ - isPrivate?: boolean; - issueTypeHierarchy?: Hierarchy; - /** List of the issue types available in the project. */ - issueTypes?: IssueTypeDetails[]; - /** The key of the project. */ - key?: string; - landingPageInfo?: ProjectLandingPageInfo; - lead?: User; - /** The name of the project. */ - name?: string; - permissions?: ProjectPermissions; - projectCategory?: ProjectCategory; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the - * project. - */ - projectTypeKey?: string; - /** Map of project properties */ - properties?: {}; - /** The date when the project is deleted permanently. */ - retentionTillDate?: string; - /** - * The name and self URL for each role defined in the project. For more information, see [Create project - * role](#api-rest-api-2-role-post). - */ - roles?: {}; - /** The URL of the project details. */ - self?: string; - /** Whether the project is simplified. */ - simplified?: boolean; - /** The type of the project. */ - style?: string; - /** A link to information about this project, such as project documentation. */ - url?: string; - /** Unique ID for next-gen projects. */ - uuid?: string; - /** The versions defined in the project. For more information, see [Create version](#api-rest-api-2-version-post). */ - versions?: Version[]; -} diff --git a/src/version2/models/projectAndIssueTypePair.ts b/src/version2/models/projectAndIssueTypePair.mts similarity index 100% rename from src/version2/models/projectAndIssueTypePair.ts rename to src/version2/models/projectAndIssueTypePair.mts diff --git a/src/version2/models/projectAvatars.mts b/src/version2/models/projectAvatars.mts new file mode 100644 index 000000000..763dab302 --- /dev/null +++ b/src/version2/models/projectAvatars.mts @@ -0,0 +1,9 @@ +import type { Avatar } from './avatar.mjs'; + +/** List of project avatars. */ +export interface ProjectAvatars { + /** List of avatars added to Jira. These avatars may be deleted. */ + custom?: Avatar[]; + /** List of avatars included with Jira. These avatars cannot be deleted. */ + system?: Avatar[]; +} diff --git a/src/version2/models/projectAvatars.ts b/src/version2/models/projectAvatars.ts deleted file mode 100644 index 108a17a95..000000000 --- a/src/version2/models/projectAvatars.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Avatar } from './avatar.js'; - -/** List of project avatars. */ -export interface ProjectAvatars { - /** List of avatars added to Jira. These avatars may be deleted. */ - custom?: Avatar[]; - /** List of avatars included with Jira. These avatars cannot be deleted. */ - system?: Avatar[]; -} diff --git a/src/version2/models/projectCategory.ts b/src/version2/models/projectCategory.mts similarity index 100% rename from src/version2/models/projectCategory.ts rename to src/version2/models/projectCategory.mts diff --git a/src/version2/models/projectComponent.mts b/src/version2/models/projectComponent.mts new file mode 100644 index 000000000..543822642 --- /dev/null +++ b/src/version2/models/projectComponent.mts @@ -0,0 +1,66 @@ +import { User } from './user.mjs'; + +/** Details about a project component. */ +export interface ProjectComponent { + assignee?: User; + /** + * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` + * for details on how the type of the user, and hence the user, assigned to issues is determined. Can take the + * following values: + * + * `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the + * component is in. `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for + * the component. `UNASSIGNED` an assignee is not set for issues created with this component. `PROJECT_DEFAULT` the + * assignee to any issues created with this component is nominally the default assignee for the project that the + * component is in. + * + * Default value: `PROJECT_DEFAULT`. + * Optional when creating or updating a component. + */ + assigneeType?: string; + /** The description for the component. Optional when creating or updating a component. */ + description?: string; + /** The unique identifier for the component. */ + id?: string; + /** + * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but + * the component lead is not set, then `false` is returned. + */ + isAssigneeTypeValid?: boolean; + lead?: User; + /** + * The accountId of the component's lead user. The accountId uniquely identifies the user across all Atlassian + * products. For example, _5b10ac8d82e05b22cc7d4ef5_. + */ + leadAccountId?: string; + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + leadUserName?: string; + /** + * The unique name for the component in the project. Required when creating a component. Optional when updating a + * component. The maximum length is 255 characters. + */ + name?: string; + /** The key of the project the component is assigned to. Required when creating a component. Can't be updated. */ + project?: string; + /** The ID of the project the component is assigned to. */ + projectId?: number; + realAssignee?: User; + /** + * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set + * from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This + * property is set to one of the following values: + * + * `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in + * the project that the component is in. `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component + * lead has permission to be assigned issues in the project that the component is in. `UNASSIGNED` when `assigneeType` + * is `UNASSIGNED` and Jira is configured to allow unassigned issues. `PROJECT_DEFAULT` when none of the preceding + * cases are true. + */ + realAssigneeType?: string; + /** The URL of the component. */ + self?: string; +} diff --git a/src/version2/models/projectComponent.ts b/src/version2/models/projectComponent.ts deleted file mode 100644 index cd4726e83..000000000 --- a/src/version2/models/projectComponent.ts +++ /dev/null @@ -1,66 +0,0 @@ -import type { User } from './user.js'; - -/** Details about a project component. */ -export interface ProjectComponent { - assignee?: User; - /** - * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` - * for details on how the type of the user, and hence the user, assigned to issues is determined. Can take the - * following values: - * - * `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the - * component is in. `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for - * the component. `UNASSIGNED` an assignee is not set for issues created with this component. `PROJECT_DEFAULT` the - * assignee to any issues created with this component is nominally the default assignee for the project that the - * component is in. - * - * Default value: `PROJECT_DEFAULT`. - * Optional when creating or updating a component. - */ - assigneeType?: string; - /** The description for the component. Optional when creating or updating a component. */ - description?: string; - /** The unique identifier for the component. */ - id?: string; - /** - * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but - * the component lead is not set, then `false` is returned. - */ - isAssigneeTypeValid?: boolean; - lead?: User; - /** - * The accountId of the component's lead user. The accountId uniquely identifies the user across all Atlassian - * products. For example, _5b10ac8d82e05b22cc7d4ef5_. - */ - leadAccountId?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - leadUserName?: string; - /** - * The unique name for the component in the project. Required when creating a component. Optional when updating a - * component. The maximum length is 255 characters. - */ - name?: string; - /** The key of the project the component is assigned to. Required when creating a component. Can't be updated. */ - project?: string; - /** The ID of the project the component is assigned to. */ - projectId?: number; - realAssignee?: User; - /** - * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set - * from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This - * property is set to one of the following values: - * - * `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in - * the project that the component is in. `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component - * lead has permission to be assigned issues in the project that the component is in. `UNASSIGNED` when `assigneeType` - * is `UNASSIGNED` and Jira is configured to allow unassigned issues. `PROJECT_DEFAULT` when none of the preceding - * cases are true. - */ - realAssigneeType?: string; - /** The URL of the component. */ - self?: string; -} diff --git a/src/version2/models/projectDetails.mts b/src/version2/models/projectDetails.mts new file mode 100644 index 000000000..28e56f763 --- /dev/null +++ b/src/version2/models/projectDetails.mts @@ -0,0 +1,24 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; +import type { UpdatedProjectCategory } from './updatedProjectCategory.mjs'; + +/** Details about a project. */ +export interface ProjectDetails { + avatarUrls?: AvatarUrls; + /** The ID of the project. */ + id?: string; + /** The key of the project. */ + key?: string; + /** The name of the project. */ + name?: string; + projectCategory?: UpdatedProjectCategory; + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the + * project. + */ + projectTypeKey?: string; + /** The URL of the project details. */ + self?: string; + /** Whether or not the project is simplified. */ + simplified?: boolean; +} diff --git a/src/version2/models/projectDetails.ts b/src/version2/models/projectDetails.ts deleted file mode 100644 index a6f9639e0..000000000 --- a/src/version2/models/projectDetails.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; -import type { UpdatedProjectCategory } from './updatedProjectCategory.js'; - -/** Details about a project. */ -export interface ProjectDetails { - avatarUrls?: AvatarUrls; - /** The ID of the project. */ - id?: string; - /** The key of the project. */ - key?: string; - /** The name of the project. */ - name?: string; - projectCategory?: UpdatedProjectCategory; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the - * project. - */ - projectTypeKey?: string; - /** The URL of the project details. */ - self?: string; - /** Whether or not the project is simplified. */ - simplified?: boolean; -} diff --git a/src/version2/models/projectEmailAddress.ts b/src/version2/models/projectEmailAddress.mts similarity index 100% rename from src/version2/models/projectEmailAddress.ts rename to src/version2/models/projectEmailAddress.mts diff --git a/src/version2/models/projectFeature.ts b/src/version2/models/projectFeature.mts similarity index 100% rename from src/version2/models/projectFeature.ts rename to src/version2/models/projectFeature.mts diff --git a/src/version2/models/projectFeatureToggleRequest.ts b/src/version2/models/projectFeatureToggleRequest.mts similarity index 100% rename from src/version2/models/projectFeatureToggleRequest.ts rename to src/version2/models/projectFeatureToggleRequest.mts diff --git a/src/version2/models/projectId.ts b/src/version2/models/projectId.mts similarity index 100% rename from src/version2/models/projectId.ts rename to src/version2/models/projectId.mts diff --git a/src/version2/models/projectIdentifier.ts b/src/version2/models/projectIdentifier.mts similarity index 100% rename from src/version2/models/projectIdentifier.ts rename to src/version2/models/projectIdentifier.mts diff --git a/src/version2/models/projectIdentifiers.ts b/src/version2/models/projectIdentifiers.mts similarity index 100% rename from src/version2/models/projectIdentifiers.ts rename to src/version2/models/projectIdentifiers.mts diff --git a/src/version2/models/projectIds.ts b/src/version2/models/projectIds.mts similarity index 100% rename from src/version2/models/projectIds.ts rename to src/version2/models/projectIds.mts diff --git a/src/version2/models/projectInsight.ts b/src/version2/models/projectInsight.mts similarity index 100% rename from src/version2/models/projectInsight.ts rename to src/version2/models/projectInsight.mts diff --git a/src/version2/models/projectIssueCreateMetadata.mts b/src/version2/models/projectIssueCreateMetadata.mts new file mode 100644 index 000000000..04b757156 --- /dev/null +++ b/src/version2/models/projectIssueCreateMetadata.mts @@ -0,0 +1,19 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; +import type { IssueTypeIssueCreateMetadata } from './issueTypeIssueCreateMetadata.mjs'; + +/** Details of the issue creation metadata for a project. */ +export interface ProjectIssueCreateMetadata { + avatarUrls?: AvatarUrls; + /** Expand options that include additional project issue create metadata details in the response. */ + expand?: string; + /** The ID of the project. */ + id?: string; + /** List of the issue types supported by the project. */ + issuetypes?: IssueTypeIssueCreateMetadata[]; + /** The key of the project. */ + key?: string; + /** The name of the project. */ + name?: string; + /** The URL of the project. */ + self?: string; +} diff --git a/src/version2/models/projectIssueCreateMetadata.ts b/src/version2/models/projectIssueCreateMetadata.ts deleted file mode 100644 index 42fca1773..000000000 --- a/src/version2/models/projectIssueCreateMetadata.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; -import type { IssueTypeIssueCreateMetadata } from './issueTypeIssueCreateMetadata.js'; - -/** Details of the issue creation metadata for a project. */ -export interface ProjectIssueCreateMetadata { - avatarUrls?: AvatarUrls; - /** Expand options that include additional project issue create metadata details in the response. */ - expand?: string; - /** The ID of the project. */ - id?: string; - /** List of the issue types supported by the project. */ - issuetypes?: IssueTypeIssueCreateMetadata[]; - /** The key of the project. */ - key?: string; - /** The name of the project. */ - name?: string; - /** The URL of the project. */ - self?: string; -} diff --git a/src/version2/models/projectIssueSecurityLevels.mts b/src/version2/models/projectIssueSecurityLevels.mts new file mode 100644 index 000000000..f8a3d01fb --- /dev/null +++ b/src/version2/models/projectIssueSecurityLevels.mts @@ -0,0 +1,7 @@ +import type { SecurityLevel } from './securityLevel.mjs'; + +/** List of issue level security items in a project. */ +export interface ProjectIssueSecurityLevels { + /** Issue level security items list. */ + levels: SecurityLevel[]; +} diff --git a/src/version2/models/projectIssueSecurityLevels.ts b/src/version2/models/projectIssueSecurityLevels.ts deleted file mode 100644 index eff8bfc31..000000000 --- a/src/version2/models/projectIssueSecurityLevels.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SecurityLevel } from './securityLevel.js'; - -/** List of issue level security items in a project. */ -export interface ProjectIssueSecurityLevels { - /** Issue level security items list. */ - levels: SecurityLevel[]; -} diff --git a/src/version2/models/projectIssueTypeHierarchy.mts b/src/version2/models/projectIssueTypeHierarchy.mts new file mode 100644 index 000000000..6e6eba225 --- /dev/null +++ b/src/version2/models/projectIssueTypeHierarchy.mts @@ -0,0 +1,9 @@ +import type { ProjectIssueTypesHierarchyLevel } from './projectIssueTypesHierarchyLevel.mjs'; + +/** The hierarchy of issue types within a project. */ +export interface ProjectIssueTypeHierarchy { + /** Details of an issue type hierarchy level. */ + hierarchy?: ProjectIssueTypesHierarchyLevel[]; + /** The ID of the project. */ + projectId?: number; +} diff --git a/src/version2/models/projectIssueTypeHierarchy.ts b/src/version2/models/projectIssueTypeHierarchy.ts deleted file mode 100644 index 48a6b9a42..000000000 --- a/src/version2/models/projectIssueTypeHierarchy.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ProjectIssueTypesHierarchyLevel } from './projectIssueTypesHierarchyLevel.js'; - -/** The hierarchy of issue types within a project. */ -export interface ProjectIssueTypeHierarchy { - /** Details of an issue type hierarchy level. */ - hierarchy?: ProjectIssueTypesHierarchyLevel[]; - /** The ID of the project. */ - projectId?: number; -} diff --git a/src/version2/models/projectIssueTypeMapping.ts b/src/version2/models/projectIssueTypeMapping.mts similarity index 100% rename from src/version2/models/projectIssueTypeMapping.ts rename to src/version2/models/projectIssueTypeMapping.mts diff --git a/src/version2/models/projectIssueTypeMappings.mts b/src/version2/models/projectIssueTypeMappings.mts new file mode 100644 index 000000000..81055b4eb --- /dev/null +++ b/src/version2/models/projectIssueTypeMappings.mts @@ -0,0 +1,7 @@ +import type { ProjectIssueTypeMapping } from './projectIssueTypeMapping.mjs'; + +/** The project and issue type mappings. */ +export interface ProjectIssueTypeMappings { + /** The project and issue type mappings. */ + mappings: ProjectIssueTypeMapping[]; +} diff --git a/src/version2/models/projectIssueTypeMappings.ts b/src/version2/models/projectIssueTypeMappings.ts deleted file mode 100644 index 6fe583521..000000000 --- a/src/version2/models/projectIssueTypeMappings.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ProjectIssueTypeMapping } from './projectIssueTypeMapping.js'; - -/** The project and issue type mappings. */ -export interface ProjectIssueTypeMappings { - /** The project and issue type mappings. */ - mappings: ProjectIssueTypeMapping[]; -} diff --git a/src/version2/models/projectIssueTypes.mts b/src/version2/models/projectIssueTypes.mts new file mode 100644 index 000000000..4dcad8c6e --- /dev/null +++ b/src/version2/models/projectIssueTypes.mts @@ -0,0 +1,8 @@ +import type { ProjectId } from './projectId.mjs'; + +/** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ +export interface ProjectIssueTypes { + /** IDs of the issue types */ + issueTypes?: string[]; + project?: ProjectId; +} diff --git a/src/version2/models/projectIssueTypes.ts b/src/version2/models/projectIssueTypes.ts deleted file mode 100644 index 7ef04fe89..000000000 --- a/src/version2/models/projectIssueTypes.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectId } from './projectId.js'; - -/** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ -export interface ProjectIssueTypes { - /** IDs of the issue types */ - issueTypes?: string[]; - project?: ProjectId; -} diff --git a/src/version2/models/projectIssueTypesHierarchyLevel.mts b/src/version2/models/projectIssueTypesHierarchyLevel.mts new file mode 100644 index 000000000..6953904cd --- /dev/null +++ b/src/version2/models/projectIssueTypesHierarchyLevel.mts @@ -0,0 +1,11 @@ +import type { IssueTypeInfo } from './issueTypeInfo.mjs'; + +/** Details of an issue type hierarchy level. */ +export interface ProjectIssueTypesHierarchyLevel { + /** The list of issue types in the hierarchy level. */ + issueTypes?: IssueTypeInfo[]; + /** The level of the issue type hierarchy level. */ + level?: number; + /** The name of the issue type hierarchy level. */ + name?: string; +} diff --git a/src/version2/models/projectIssueTypesHierarchyLevel.ts b/src/version2/models/projectIssueTypesHierarchyLevel.ts deleted file mode 100644 index e77a92f33..000000000 --- a/src/version2/models/projectIssueTypesHierarchyLevel.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { IssueTypeInfo } from './issueTypeInfo.js'; - -/** Details of an issue type hierarchy level. */ -export interface ProjectIssueTypesHierarchyLevel { - /** The list of issue types in the hierarchy level. */ - issueTypes?: IssueTypeInfo[]; - /** The level of the issue type hierarchy level. */ - level?: number; - /** The name of the issue type hierarchy level. */ - name?: string; -} diff --git a/src/version2/models/projectLandingPageInfo.ts b/src/version2/models/projectLandingPageInfo.mts similarity index 100% rename from src/version2/models/projectLandingPageInfo.ts rename to src/version2/models/projectLandingPageInfo.mts diff --git a/src/version2/models/projectPermissions.ts b/src/version2/models/projectPermissions.mts similarity index 100% rename from src/version2/models/projectPermissions.ts rename to src/version2/models/projectPermissions.mts diff --git a/src/version2/models/projectRole.mts b/src/version2/models/projectRole.mts new file mode 100644 index 000000000..f624b8deb --- /dev/null +++ b/src/version2/models/projectRole.mts @@ -0,0 +1,27 @@ +import type { RoleActor } from './roleActor.mjs'; +import type { Scope } from './scope.mjs'; + +/** Details about the roles in a project. */ +export interface ProjectRole { + /** The list of users who act in this role. */ + actors?: RoleActor[]; + /** Whether this role is the admin role for the project. */ + admin?: boolean; + /** Whether the calling user is part of this role. */ + currentUserRole?: boolean; + /** Whether this role is the default role for the project */ + default?: boolean; + /** The description of the project role. */ + description?: string; + /** The ID of the project role. */ + id?: number; + /** The name of the project role. */ + name?: string; + /** Whether the roles are configurable for this project. */ + roleConfigurable?: boolean; + scope?: Scope; + /** The URL the project role details. */ + self?: string; + /** The translated name of the project role. */ + translatedName?: string; +} diff --git a/src/version2/models/projectRole.ts b/src/version2/models/projectRole.ts deleted file mode 100644 index e204fc527..000000000 --- a/src/version2/models/projectRole.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { RoleActor } from './roleActor.js'; -import type { Scope } from './scope.js'; - -/** Details about the roles in a project. */ -export interface ProjectRole { - /** The list of users who act in this role. */ - actors?: RoleActor[]; - /** Whether this role is the admin role for the project. */ - admin?: boolean; - /** Whether the calling user is part of this role. */ - currentUserRole?: boolean; - /** Whether this role is the default role for the project */ - default?: boolean; - /** The description of the project role. */ - description?: string; - /** The ID of the project role. */ - id?: number; - /** The name of the project role. */ - name?: string; - /** Whether the roles are configurable for this project. */ - roleConfigurable?: boolean; - scope?: Scope; - /** The URL the project role details. */ - self?: string; - /** The translated name of the project role. */ - translatedName?: string; -} diff --git a/src/version2/models/projectRoleActorsUpdate.ts b/src/version2/models/projectRoleActorsUpdate.mts similarity index 100% rename from src/version2/models/projectRoleActorsUpdate.ts rename to src/version2/models/projectRoleActorsUpdate.mts diff --git a/src/version2/models/projectRoleDetails.mts b/src/version2/models/projectRoleDetails.mts new file mode 100644 index 000000000..55f0669f6 --- /dev/null +++ b/src/version2/models/projectRoleDetails.mts @@ -0,0 +1,22 @@ +import type { Scope } from './scope.mjs'; + +/** Details about a project role. */ +export interface ProjectRoleDetails { + /** Whether this role is the admin role for the project. */ + admin?: boolean; + /** Whether this role is the default role for the project. */ + default?: boolean; + /** The description of the project role. */ + description?: string; + /** The ID of the project role. */ + id?: number; + /** The name of the project role. */ + name?: string; + /** Whether the roles are configurable for this project. */ + roleConfigurable?: boolean; + scope?: Scope; + /** The URL the project role details. */ + self?: string; + /** The translated name of the project role. */ + translatedName?: string; +} diff --git a/src/version2/models/projectRoleDetails.ts b/src/version2/models/projectRoleDetails.ts deleted file mode 100644 index ab5eac775..000000000 --- a/src/version2/models/projectRoleDetails.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { Scope } from './scope.js'; - -/** Details about a project role. */ -export interface ProjectRoleDetails { - /** Whether this role is the admin role for the project. */ - admin?: boolean; - /** Whether this role is the default role for the project. */ - default?: boolean; - /** The description of the project role. */ - description?: string; - /** The ID of the project role. */ - id?: number; - /** The name of the project role. */ - name?: string; - /** Whether the roles are configurable for this project. */ - roleConfigurable?: boolean; - scope?: Scope; - /** The URL the project role details. */ - self?: string; - /** The translated name of the project role. */ - translatedName?: string; -} diff --git a/src/version2/models/projectRoleGroup.ts b/src/version2/models/projectRoleGroup.mts similarity index 100% rename from src/version2/models/projectRoleGroup.ts rename to src/version2/models/projectRoleGroup.mts diff --git a/src/version2/models/projectRoleUser.ts b/src/version2/models/projectRoleUser.mts similarity index 100% rename from src/version2/models/projectRoleUser.ts rename to src/version2/models/projectRoleUser.mts diff --git a/src/version2/models/projectScope.ts b/src/version2/models/projectScope.mts similarity index 100% rename from src/version2/models/projectScope.ts rename to src/version2/models/projectScope.mts diff --git a/src/version2/models/projectType.ts b/src/version2/models/projectType.mts similarity index 100% rename from src/version2/models/projectType.ts rename to src/version2/models/projectType.mts diff --git a/src/version2/models/propertyKey.ts b/src/version2/models/propertyKey.mts similarity index 100% rename from src/version2/models/propertyKey.ts rename to src/version2/models/propertyKey.mts diff --git a/src/version2/models/propertyKeys.mts b/src/version2/models/propertyKeys.mts new file mode 100644 index 000000000..3db8a9493 --- /dev/null +++ b/src/version2/models/propertyKeys.mts @@ -0,0 +1,7 @@ +import type { PropertyKey } from './propertyKey.mjs'; + +/** List of property keys. */ +export interface PropertyKeys { + /** Property key details. */ + keys?: PropertyKey[]; +} diff --git a/src/version2/models/propertyKeys.ts b/src/version2/models/propertyKeys.ts deleted file mode 100644 index 79e6474d8..000000000 --- a/src/version2/models/propertyKeys.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PropertyKey } from './propertyKey.js'; - -/** List of property keys. */ -export interface PropertyKeys { - /** Property key details. */ - keys?: PropertyKey[]; -} diff --git a/src/version2/models/publishedWorkflowId.ts b/src/version2/models/publishedWorkflowId.mts similarity index 100% rename from src/version2/models/publishedWorkflowId.ts rename to src/version2/models/publishedWorkflowId.mts diff --git a/src/version2/models/registeredWebhook.ts b/src/version2/models/registeredWebhook.mts similarity index 100% rename from src/version2/models/registeredWebhook.ts rename to src/version2/models/registeredWebhook.mts diff --git a/src/version2/models/remoteIssueLink.mts b/src/version2/models/remoteIssueLink.mts new file mode 100644 index 000000000..b78b237b1 --- /dev/null +++ b/src/version2/models/remoteIssueLink.mts @@ -0,0 +1,16 @@ +import type { Application } from './application.mjs'; +import type { RemoteObject } from './remoteObject.mjs'; + +/** Details of an issue remote link. */ +export interface RemoteIssueLink { + application?: Application; + /** The global ID of the link, such as the ID of the item on the remote system. */ + globalId?: string; + /** The ID of the link. */ + id?: number; + object?: RemoteObject; + /** Description of the relationship between the issue and the linked item. */ + relationship?: string; + /** The URL of the link. */ + self?: string; +} diff --git a/src/version2/models/remoteIssueLink.ts b/src/version2/models/remoteIssueLink.ts deleted file mode 100644 index afcaea05a..000000000 --- a/src/version2/models/remoteIssueLink.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Application } from './application.js'; -import type { RemoteObject } from './remoteObject.js'; - -/** Details of an issue remote link. */ -export interface RemoteIssueLink { - application?: Application; - /** The global ID of the link, such as the ID of the item on the remote system. */ - globalId?: string; - /** The ID of the link. */ - id?: number; - object?: RemoteObject; - /** Description of the relationship between the issue and the linked item. */ - relationship?: string; - /** The URL of the link. */ - self?: string; -} diff --git a/src/version2/models/remoteIssueLinkIdentifies.ts b/src/version2/models/remoteIssueLinkIdentifies.mts similarity index 100% rename from src/version2/models/remoteIssueLinkIdentifies.ts rename to src/version2/models/remoteIssueLinkIdentifies.mts diff --git a/src/version2/models/remoteIssueLinkRequest.mts b/src/version2/models/remoteIssueLinkRequest.mts new file mode 100644 index 000000000..c12f620dd --- /dev/null +++ b/src/version2/models/remoteIssueLinkRequest.mts @@ -0,0 +1,23 @@ +import type { Application } from './application.mjs'; +import type { RemoteObject } from './remoteObject.mjs'; + +/** Details of a remote issue link. */ +export interface RemoteIssueLinkRequest { + /** + * An identifier for the remote item in the remote system. For example, the global ID for a remote item in Confluence + * would consist of the app ID and page ID, like this: `appId=456&pageId=123`. + * + * Setting this field enables the remote issue link details to be updated or deleted using remote system and item + * details as the record identifier, rather than using the record's Jira ID. + * + * The maximum length is 255 characters. + */ + globalId?: string; + application?: Application; + /** + * Description of the relationship between the issue and the linked item. If not set, the relationship description + * "links to" is used in Jira. + */ + relationship?: string; + object?: RemoteObject; +} diff --git a/src/version2/models/remoteIssueLinkRequest.ts b/src/version2/models/remoteIssueLinkRequest.ts deleted file mode 100644 index 4957c40da..000000000 --- a/src/version2/models/remoteIssueLinkRequest.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { Application } from './application.js'; -import type { RemoteObject } from './remoteObject.js'; - -/** Details of a remote issue link. */ -export interface RemoteIssueLinkRequest { - /** - * An identifier for the remote item in the remote system. For example, the global ID for a remote item in Confluence - * would consist of the app ID and page ID, like this: `appId=456&pageId=123`. - * - * Setting this field enables the remote issue link details to be updated or deleted using remote system and item - * details as the record identifier, rather than using the record's Jira ID. - * - * The maximum length is 255 characters. - */ - globalId?: string; - application?: Application; - /** - * Description of the relationship between the issue and the linked item. If not set, the relationship description - * "links to" is used in Jira. - */ - relationship?: string; - object?: RemoteObject; -} diff --git a/src/version2/models/remoteObject.mts b/src/version2/models/remoteObject.mts new file mode 100644 index 000000000..e8d3f312f --- /dev/null +++ b/src/version2/models/remoteObject.mts @@ -0,0 +1,14 @@ +import type { Icon } from './icon.mjs'; +import type { Status } from './status.mjs'; + +/** The linked item. */ +export interface RemoteObject { + icon?: Icon; + status?: Status; + /** The summary details of the item. */ + summary?: string; + /** The title of the item. */ + title: string; + /** The URL of the item. */ + url: string; +} diff --git a/src/version2/models/remoteObject.ts b/src/version2/models/remoteObject.ts deleted file mode 100644 index 052e80f14..000000000 --- a/src/version2/models/remoteObject.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Icon } from './icon.js'; -import type { Status } from './status.js'; - -/** The linked item. */ -export interface RemoteObject { - icon?: Icon; - status?: Status; - /** The summary details of the item. */ - summary?: string; - /** The title of the item. */ - title: string; - /** The URL of the item. */ - url: string; -} diff --git a/src/version2/models/reorderIssuePriorities.ts b/src/version2/models/reorderIssuePriorities.mts similarity index 100% rename from src/version2/models/reorderIssuePriorities.ts rename to src/version2/models/reorderIssuePriorities.mts diff --git a/src/version2/models/reorderIssueResolutionsRequest.ts b/src/version2/models/reorderIssueResolutionsRequest.mts similarity index 100% rename from src/version2/models/reorderIssueResolutionsRequest.ts rename to src/version2/models/reorderIssueResolutionsRequest.mts diff --git a/src/version2/models/resolution.ts b/src/version2/models/resolution.mts similarity index 100% rename from src/version2/models/resolution.ts rename to src/version2/models/resolution.mts diff --git a/src/version2/models/resolutionId.ts b/src/version2/models/resolutionId.mts similarity index 100% rename from src/version2/models/resolutionId.ts rename to src/version2/models/resolutionId.mts diff --git a/src/version2/models/restrictedPermission.ts b/src/version2/models/restrictedPermission.mts similarity index 100% rename from src/version2/models/restrictedPermission.ts rename to src/version2/models/restrictedPermission.mts diff --git a/src/version2/models/richText.ts b/src/version2/models/richText.mts similarity index 100% rename from src/version2/models/richText.ts rename to src/version2/models/richText.mts diff --git a/src/version2/models/roleActor.mts b/src/version2/models/roleActor.mts new file mode 100644 index 000000000..9e16006ea --- /dev/null +++ b/src/version2/models/roleActor.mts @@ -0,0 +1,25 @@ +import type { ProjectRoleGroup } from './projectRoleGroup.mjs'; +import type { ProjectRoleUser } from './projectRoleUser.mjs'; + +/** Details about a user assigned to a project role. */ +export interface RoleActor { + actorGroup?: ProjectRoleGroup; + actorUser?: ProjectRoleUser; + /** The avatar of the role actor. */ + avatarUrl?: string; + /** + * The display name of the role actor. For users, depending on the user’s privacy setting, this may return an + * alternative value for the user's name. + */ + displayName?: string; + /** The ID of the role actor. */ + id?: number; + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + name?: string; + /** The type of role actor. */ + type?: string; +} diff --git a/src/version2/models/roleActor.ts b/src/version2/models/roleActor.ts deleted file mode 100644 index b2e717252..000000000 --- a/src/version2/models/roleActor.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { ProjectRoleGroup } from './projectRoleGroup.js'; -import type { ProjectRoleUser } from './projectRoleUser.js'; - -/** Details about a user assigned to a project role. */ -export interface RoleActor { - actorGroup?: ProjectRoleGroup; - actorUser?: ProjectRoleUser; - /** The avatar of the role actor. */ - avatarUrl?: string; - /** - * The display name of the role actor. For users, depending on the user’s privacy setting, this may return an - * alternative value for the user's name. - */ - displayName?: string; - /** The ID of the role actor. */ - id?: number; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - name?: string; - /** The type of role actor. */ - type?: string; -} diff --git a/src/version2/models/ruleConfiguration.ts b/src/version2/models/ruleConfiguration.mts similarity index 100% rename from src/version2/models/ruleConfiguration.ts rename to src/version2/models/ruleConfiguration.mts diff --git a/src/version2/models/sanitizedJqlQueries.mts b/src/version2/models/sanitizedJqlQueries.mts new file mode 100644 index 000000000..462913b18 --- /dev/null +++ b/src/version2/models/sanitizedJqlQueries.mts @@ -0,0 +1,7 @@ +import type { SanitizedJqlQuery } from './sanitizedJqlQuery.mjs'; + +/** The sanitized Jql queries for the given account IDs. */ +export interface SanitizedJqlQueries { + /** The list of sanitized Jql queries. */ + queries?: SanitizedJqlQuery[]; +} diff --git a/src/version2/models/sanitizedJqlQueries.ts b/src/version2/models/sanitizedJqlQueries.ts deleted file mode 100644 index d6ab7f52b..000000000 --- a/src/version2/models/sanitizedJqlQueries.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SanitizedJqlQuery } from './sanitizedJqlQuery.js'; - -/** The sanitized JQL queries for the given account IDs. */ -export interface SanitizedJqlQueries { - /** The list of sanitized JQL queries. */ - queries?: SanitizedJqlQuery[]; -} diff --git a/src/version2/models/sanitizedJqlQuery.mts b/src/version2/models/sanitizedJqlQuery.mts new file mode 100644 index 000000000..2d2bef283 --- /dev/null +++ b/src/version2/models/sanitizedJqlQuery.mts @@ -0,0 +1,12 @@ +import type { ErrorCollection } from './errorCollection.mjs'; + +/** Details of the sanitized Jql query. */ +export interface SanitizedJqlQuery { + /** The account ID of the user for whom sanitization was performed. */ + accountId?: string; + errors?: ErrorCollection; + /** The initial query. */ + initialQuery?: string; + /** The sanitized query, if there were no errors. */ + sanitizedQuery?: string; +} diff --git a/src/version2/models/sanitizedJqlQuery.ts b/src/version2/models/sanitizedJqlQuery.ts deleted file mode 100644 index 3dcfa387a..000000000 --- a/src/version2/models/sanitizedJqlQuery.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { ErrorCollection } from './errorCollection.js'; - -/** Details of the sanitized JQL query. */ -export interface SanitizedJqlQuery { - /** The account ID of the user for whom sanitization was performed. */ - accountId?: string; - errors?: ErrorCollection; - /** The initial query. */ - initialQuery?: string; - /** The sanitized query, if there were no errors. */ - sanitizedQuery?: string; -} diff --git a/src/version2/models/scope.mts b/src/version2/models/scope.mts new file mode 100644 index 000000000..2e7e65701 --- /dev/null +++ b/src/version2/models/scope.mts @@ -0,0 +1,11 @@ +import type { ProjectDetails } from './projectDetails.mjs'; + +/** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ +export interface Scope { + project?: ProjectDetails; + /** The type of scope. */ + type?: string; +} diff --git a/src/version2/models/scope.ts b/src/version2/models/scope.ts deleted file mode 100644 index 41df357a3..000000000 --- a/src/version2/models/scope.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ProjectDetails } from './projectDetails.js'; - -/** - * The projects the item is associated with. Indicated for items associated with [next-gen - * projects](https://confluence.atlassian.com/x/loMyO). - */ -export interface Scope { - project?: ProjectDetails; - /** The type of scope. */ - type?: string; -} diff --git a/src/version2/models/screen.mts b/src/version2/models/screen.mts new file mode 100644 index 000000000..58c3abdbc --- /dev/null +++ b/src/version2/models/screen.mts @@ -0,0 +1,12 @@ +import type { Scope } from './scope.mjs'; + +/** A screen. */ +export interface Screen { + /** The description of the screen. */ + description?: string; + /** The ID of the screen. */ + id?: number; + /** The name of the screen. */ + name?: string; + scope?: Scope; +} diff --git a/src/version2/models/screen.ts b/src/version2/models/screen.ts deleted file mode 100644 index d81545f55..000000000 --- a/src/version2/models/screen.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Scope } from './scope.js'; - -/** A screen. */ -export interface Screen { - /** The description of the screen. */ - description?: string; - /** The ID of the screen. */ - id?: number; - /** The name of the screen. */ - name?: string; - scope?: Scope; -} diff --git a/src/version2/models/screenDetails.ts b/src/version2/models/screenDetails.mts similarity index 100% rename from src/version2/models/screenDetails.ts rename to src/version2/models/screenDetails.mts diff --git a/src/version2/models/screenScheme.mts b/src/version2/models/screenScheme.mts new file mode 100644 index 000000000..c774dc4a8 --- /dev/null +++ b/src/version2/models/screenScheme.mts @@ -0,0 +1,14 @@ +import type { PageIssueTypeScreenScheme } from './pageIssueTypeScreenScheme.mjs'; +import type { ScreenTypes } from './screenTypes.mjs'; + +/** A screen scheme. */ +export interface ScreenScheme { + /** The description of the screen scheme. */ + description?: string; + /** The ID of the screen scheme. */ + id?: number; + issueTypeScreenSchemes?: PageIssueTypeScreenScheme; + /** The name of the screen scheme. */ + name?: string; + screens?: ScreenTypes; +} diff --git a/src/version2/models/screenScheme.ts b/src/version2/models/screenScheme.ts deleted file mode 100644 index 8539e3a54..000000000 --- a/src/version2/models/screenScheme.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { PageIssueTypeScreenScheme } from './pageIssueTypeScreenScheme.js'; -import type { ScreenTypes } from './screenTypes.js'; - -/** A screen scheme. */ -export interface ScreenScheme { - /** The description of the screen scheme. */ - description?: string; - /** The ID of the screen scheme. */ - id?: number; - issueTypeScreenSchemes?: PageIssueTypeScreenScheme; - /** The name of the screen scheme. */ - name?: string; - screens?: ScreenTypes; -} diff --git a/src/version2/models/screenSchemeDetails.mts b/src/version2/models/screenSchemeDetails.mts new file mode 100644 index 000000000..7a7e650cb --- /dev/null +++ b/src/version2/models/screenSchemeDetails.mts @@ -0,0 +1,10 @@ +import type { ScreenTypes } from './screenTypes.mjs'; + +/** Details of a screen scheme. */ +export interface ScreenSchemeDetails { + /** The description of the screen scheme. The maximum length is 255 characters. */ + description?: string; + /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: string; + screens?: ScreenTypes; +} diff --git a/src/version2/models/screenSchemeDetails.ts b/src/version2/models/screenSchemeDetails.ts deleted file mode 100644 index e6d01df52..000000000 --- a/src/version2/models/screenSchemeDetails.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ScreenTypes } from './screenTypes.js'; - -/** Details of a screen scheme. */ -export interface ScreenSchemeDetails { - /** The description of the screen scheme. The maximum length is 255 characters. */ - description?: string; - /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ - name: string; - screens?: ScreenTypes; -} diff --git a/src/version2/models/screenSchemeId.ts b/src/version2/models/screenSchemeId.mts similarity index 100% rename from src/version2/models/screenSchemeId.ts rename to src/version2/models/screenSchemeId.mts diff --git a/src/version2/models/screenTypes.ts b/src/version2/models/screenTypes.mts similarity index 100% rename from src/version2/models/screenTypes.ts rename to src/version2/models/screenTypes.mts diff --git a/src/version2/models/screenWithTab.mts b/src/version2/models/screenWithTab.mts new file mode 100644 index 000000000..a40ffb30a --- /dev/null +++ b/src/version2/models/screenWithTab.mts @@ -0,0 +1,14 @@ +import type { Scope } from './scope.mjs'; +import type { ScreenableTab } from './screenableTab.mjs'; + +/** A screen with tab details. */ +export interface ScreenWithTab { + /** The description of the screen. */ + description?: string; + /** The ID of the screen. */ + id?: number; + /** The name of the screen. */ + name?: string; + scope?: Scope; + tab?: ScreenableTab; +} diff --git a/src/version2/models/screenWithTab.ts b/src/version2/models/screenWithTab.ts deleted file mode 100644 index 817b31205..000000000 --- a/src/version2/models/screenWithTab.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Scope } from './scope.js'; -import type { ScreenableTab } from './screenableTab.js'; - -/** A screen with tab details. */ -export interface ScreenWithTab { - /** The description of the screen. */ - description?: string; - /** The ID of the screen. */ - id?: number; - /** The name of the screen. */ - name?: string; - scope?: Scope; - tab?: ScreenableTab; -} diff --git a/src/version2/models/screenableField.ts b/src/version2/models/screenableField.mts similarity index 100% rename from src/version2/models/screenableField.ts rename to src/version2/models/screenableField.mts diff --git a/src/version2/models/screenableTab.ts b/src/version2/models/screenableTab.mts similarity index 100% rename from src/version2/models/screenableTab.ts rename to src/version2/models/screenableTab.mts diff --git a/src/version2/models/searchAutoComplete.ts b/src/version2/models/searchAutoComplete.mts similarity index 100% rename from src/version2/models/searchAutoComplete.ts rename to src/version2/models/searchAutoComplete.mts diff --git a/src/version2/models/searchRequest.mts b/src/version2/models/searchRequest.mts new file mode 100644 index 000000000..019483de7 --- /dev/null +++ b/src/version2/models/searchRequest.mts @@ -0,0 +1,80 @@ +export interface SearchRequest { + /** A [Jql](https://confluence.atlassian.com/x/egORLQ) expression. */ + jql?: string; + /** The index of the first item to return in the page of results (page offset). The base index is `0`. */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** + * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a + * comma-separated list. Expand options include: + * + * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to + * exclude. + * + * The default is `*navigable`. + * + * Examples: + * + * `summary,comment` Returns the summary and comments fields only. `-description` Returns all navigable (default) + * fields except description. `*all,-comment` Returns all fields except comments. + * + * Multiple `fields` parameters can be included in a request. + * + * Note: All navigable fields are returned by default. This differs from [GET + * issue](#api-rest-api-2-issue-issueIdOrKey-get) where the default is all fields. + */ + fields?: string[]; + /** + * Determines how to validate the Jql query and treat the validation results. Supported values: + * + * `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). + * `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for + * `strict`. `false` _Deprecated_ A legacy synonym for `warn`. + * + * The default is `strict`. + * + * Note: If the Jql is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. + */ + validateQuery?: string; + /** + * Use [expand](em>#expansion) to include additional information about issues in the response. Note that, unlike the + * majority of instances where `expand` is specified, `expand` is defined as a list of values. The expand options + * are: + * + * - `renderedFields` Returns field values rendered in HTML format. + * - `names` Returns the display name of each field. + * - `schema` Returns the schema describing a field type. + * - `transitions` Returns all possible transitions for the issue. + * - `operations` Returns all possible operations for the issue. + * - `editmeta` Returns information about how each field can be edited. + * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each + * version of a field's value, with the highest numbered item representing the most recent version. + */ + expand?: + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | ( + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + )[] + | string + | string[]; + /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ + properties?: string[]; + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys?: boolean; +} diff --git a/src/version2/models/searchRequest.ts b/src/version2/models/searchRequest.ts deleted file mode 100644 index 59057b364..000000000 --- a/src/version2/models/searchRequest.ts +++ /dev/null @@ -1,80 +0,0 @@ -export interface SearchRequest { - /** A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. */ - jql?: string; - /** The index of the first item to return in the page of results (page offset). The base index is `0`. */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a - * comma-separated list. Expand options include: - * - * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to - * exclude. - * - * The default is `*navigable`. - * - * Examples: - * - * `summary,comment` Returns the summary and comments fields only. `-description` Returns all navigable (default) - * fields except description. `*all,-comment` Returns all fields except comments. - * - * Multiple `fields` parameters can be included in a request. - * - * Note: All navigable fields are returned by default. This differs from [GET - * issue](#api-rest-api-2-issue-issueIdOrKey-get) where the default is all fields. - */ - fields?: string[]; - /** - * Determines how to validate the JQL query and treat the validation results. Supported values: - * - * `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). - * `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for - * `strict`. `false` _Deprecated_ A legacy synonym for `warn`. - * - * The default is `strict`. - * - * Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. - */ - validateQuery?: string; - /** - * Use [expand](em>#expansion) to include additional information about issues in the response. Note that, unlike the - * majority of instances where `expand` is specified, `expand` is defined as a list of values. The expand options - * are: - * - * - `renderedFields` Returns field values rendered in HTML format. - * - `names` Returns the display name of each field. - * - `schema` Returns the schema describing a field type. - * - `transitions` Returns all possible transitions for the issue. - * - `operations` Returns all possible operations for the issue. - * - `editmeta` Returns information about how each field can be edited. - * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. - * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each - * version of a field's value, with the highest numbered item representing the most recent version. - */ - expand?: - | 'renderedFields' - | 'names' - | 'schema' - | 'transitions' - | 'operations' - | 'editmeta' - | 'changelog' - | 'versionedRepresentations' - | ( - | 'renderedFields' - | 'names' - | 'schema' - | 'transitions' - | 'operations' - | 'editmeta' - | 'changelog' - | 'versionedRepresentations' - )[] - | string - | string[]; - /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ - properties?: string[]; - /** Reference fields by their key (rather than ID). The default is `false`. */ - fieldsByKeys?: boolean; -} diff --git a/src/version2/models/searchResults.mts b/src/version2/models/searchResults.mts new file mode 100644 index 000000000..bc282b13b --- /dev/null +++ b/src/version2/models/searchResults.mts @@ -0,0 +1,21 @@ +import type { Issue } from './issue.mjs'; + +/** The result of a Jql search. */ +export interface SearchResults { + /** Expand options that include additional search result details in the response. */ + expand?: string; + /** The list of issues found by the search. */ + issues?: Issue[]; + /** The maximum number of results that could be on the page. */ + maxResults?: number; + /** The ID and name of each field in the search results. */ + names?: {}; + /** The schema describing the field types in the search results. */ + schema?: {}; + /** The index of the first item returned on the page. */ + startAt?: number; + /** The number of results on the page. */ + total?: number; + /** Any warnings related to the Jql query. */ + warningMessages?: string[]; +} diff --git a/src/version2/models/searchResults.ts b/src/version2/models/searchResults.ts deleted file mode 100644 index 5e7ac0db0..000000000 --- a/src/version2/models/searchResults.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Issue } from './issue.js'; - -/** The result of a JQL search. */ -export interface SearchResults { - /** Expand options that include additional search result details in the response. */ - expand?: string; - /** The list of issues found by the search. */ - issues?: Issue[]; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The ID and name of each field in the search results. */ - names?: {}; - /** The schema describing the field types in the search results. */ - schema?: {}; - /** The index of the first item returned on the page. */ - startAt?: number; - /** The number of results on the page. */ - total?: number; - /** Any warnings related to the JQL query. */ - warningMessages?: string[]; -} diff --git a/src/version2/models/securityLevel.ts b/src/version2/models/securityLevel.mts similarity index 100% rename from src/version2/models/securityLevel.ts rename to src/version2/models/securityLevel.mts diff --git a/src/version2/models/securityLevelMember.mts b/src/version2/models/securityLevelMember.mts new file mode 100644 index 000000000..f9723fbfb --- /dev/null +++ b/src/version2/models/securityLevelMember.mts @@ -0,0 +1,12 @@ +import type { PermissionHolder } from './permissionHolder.mjs'; + +/** Issue security level member. */ +export interface SecurityLevelMember { + holder?: PermissionHolder; + /** The ID of the issue security level member. */ + id: string; + /** The ID of the issue security level. */ + issueSecurityLevelId: string; + /** The ID of the issue security scheme. */ + issueSecuritySchemeId: string; +} diff --git a/src/version2/models/securityLevelMember.ts b/src/version2/models/securityLevelMember.ts deleted file mode 100644 index 311d8f5d6..000000000 --- a/src/version2/models/securityLevelMember.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { PermissionHolder } from './permissionHolder.js'; - -/** Issue security level member. */ -export interface SecurityLevelMember { - holder?: PermissionHolder; - /** The ID of the issue security level member. */ - id: string; - /** The ID of the issue security level. */ - issueSecurityLevelId: string; - /** The ID of the issue security scheme. */ - issueSecuritySchemeId: string; -} diff --git a/src/version2/models/securityScheme.mts b/src/version2/models/securityScheme.mts new file mode 100644 index 000000000..d9529b9cf --- /dev/null +++ b/src/version2/models/securityScheme.mts @@ -0,0 +1,16 @@ +import type { SecurityLevel } from './securityLevel.mjs'; + +/** Details about a security scheme. */ +export interface SecurityScheme { + /** The ID of the default security level. */ + defaultSecurityLevelId?: number; + /** The description of the issue security scheme. */ + description?: string; + /** The ID of the issue security scheme. */ + id?: number; + levels?: SecurityLevel[]; + /** The name of the issue security scheme. */ + name?: string; + /** The URL of the issue security scheme. */ + self?: string; +} diff --git a/src/version2/models/securityScheme.ts b/src/version2/models/securityScheme.ts deleted file mode 100644 index e28e22caf..000000000 --- a/src/version2/models/securityScheme.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { SecurityLevel } from './securityLevel.js'; - -/** Details about a security scheme. */ -export interface SecurityScheme { - /** The ID of the default security level. */ - defaultSecurityLevelId?: number; - /** The description of the issue security scheme. */ - description?: string; - /** The ID of the issue security scheme. */ - id?: number; - levels?: SecurityLevel[]; - /** The name of the issue security scheme. */ - name?: string; - /** The URL of the issue security scheme. */ - self?: string; -} diff --git a/src/version2/models/securitySchemeId.ts b/src/version2/models/securitySchemeId.mts similarity index 100% rename from src/version2/models/securitySchemeId.ts rename to src/version2/models/securitySchemeId.mts diff --git a/src/version2/models/securitySchemeLevel.mts b/src/version2/models/securitySchemeLevel.mts new file mode 100644 index 000000000..55f650528 --- /dev/null +++ b/src/version2/models/securitySchemeLevel.mts @@ -0,0 +1,12 @@ +import type { SecuritySchemeLevelMember } from './securitySchemeLevelMember.mjs'; + +export interface SecuritySchemeLevel { + /** The description of the issue security scheme level. */ + description?: string; + /** Specifies whether the level is the default level. False by default. */ + isDefault?: boolean; + /** The list of level members which should be added to the issue security scheme level. */ + members?: SecuritySchemeLevelMember[]; + /** The name of the issue security scheme level. Must be unique. */ + name: string; +} diff --git a/src/version2/models/securitySchemeLevel.ts b/src/version2/models/securitySchemeLevel.ts deleted file mode 100644 index 9fa72eced..000000000 --- a/src/version2/models/securitySchemeLevel.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { SecuritySchemeLevelMember } from './securitySchemeLevelMember.js'; - -export interface SecuritySchemeLevel { - /** The description of the issue security scheme level. */ - description?: string; - /** Specifies whether the level is the default level. False by default. */ - isDefault?: boolean; - /** The list of level members which should be added to the issue security scheme level. */ - members?: SecuritySchemeLevelMember[]; - /** The name of the issue security scheme level. Must be unique. */ - name: string; -} diff --git a/src/version2/models/securitySchemeLevelMember.ts b/src/version2/models/securitySchemeLevelMember.mts similarity index 100% rename from src/version2/models/securitySchemeLevelMember.ts rename to src/version2/models/securitySchemeLevelMember.mts diff --git a/src/version2/models/securitySchemeMembersRequest.mts b/src/version2/models/securitySchemeMembersRequest.mts new file mode 100644 index 000000000..346c88f32 --- /dev/null +++ b/src/version2/models/securitySchemeMembersRequest.mts @@ -0,0 +1,7 @@ +import type { SecuritySchemeLevelMember } from './securitySchemeLevelMember.mjs'; + +/** Details of issue security scheme level new members. */ +export interface SecuritySchemeMembersRequest { + /** The list of level members which should be added to the issue security scheme level. */ + members: SecuritySchemeLevelMember[]; +} diff --git a/src/version2/models/securitySchemeMembersRequest.ts b/src/version2/models/securitySchemeMembersRequest.ts deleted file mode 100644 index 9e8498ff1..000000000 --- a/src/version2/models/securitySchemeMembersRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SecuritySchemeLevelMember } from './securitySchemeLevelMember.js'; - -/** Details of issue security scheme level new members. */ -export interface SecuritySchemeMembersRequest { - /** The list of level members which should be added to the issue security scheme level. */ - members: SecuritySchemeLevelMember[]; -} diff --git a/src/version2/models/securitySchemeWithProjects.ts b/src/version2/models/securitySchemeWithProjects.mts similarity index 100% rename from src/version2/models/securitySchemeWithProjects.ts rename to src/version2/models/securitySchemeWithProjects.mts diff --git a/src/version2/models/securitySchemes.mts b/src/version2/models/securitySchemes.mts new file mode 100644 index 000000000..cc5c5d77a --- /dev/null +++ b/src/version2/models/securitySchemes.mts @@ -0,0 +1,7 @@ +import type { SecurityScheme } from './securityScheme.mjs'; + +/** List of security schemes. */ +export interface SecuritySchemes { + /** List of security schemes. */ + issueSecuritySchemes?: SecurityScheme[]; +} diff --git a/src/version2/models/securitySchemes.ts b/src/version2/models/securitySchemes.ts deleted file mode 100644 index 78f585d65..000000000 --- a/src/version2/models/securitySchemes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SecurityScheme } from './securityScheme.js'; - -/** List of security schemes. */ -export interface SecuritySchemes { - /** List of security schemes. */ - issueSecuritySchemes?: SecurityScheme[]; -} diff --git a/src/version2/models/serverInformation.ts b/src/version2/models/serverInformation.mts similarity index 100% rename from src/version2/models/serverInformation.ts rename to src/version2/models/serverInformation.mts diff --git a/src/version2/models/setDefaultLevelsRequest.mts b/src/version2/models/setDefaultLevelsRequest.mts new file mode 100644 index 000000000..9aeece50e --- /dev/null +++ b/src/version2/models/setDefaultLevelsRequest.mts @@ -0,0 +1,7 @@ +import type { DefaultLevelValue } from './defaultLevelValue.mjs'; + +/** Details of new default levels. */ +export interface SetDefaultLevelsRequest { + /** List of objects with issue security scheme ID and new default level ID. */ + defaultValues: DefaultLevelValue[]; +} diff --git a/src/version2/models/setDefaultLevelsRequest.ts b/src/version2/models/setDefaultLevelsRequest.ts deleted file mode 100644 index ce205a786..000000000 --- a/src/version2/models/setDefaultLevelsRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { DefaultLevelValue } from './defaultLevelValue.js'; - -/** Details of new default levels. */ -export interface SetDefaultLevelsRequest { - /** List of objects with issue security scheme ID and new default level ID. */ - defaultValues: DefaultLevelValue[]; -} diff --git a/src/version2/models/setDefaultPriorityRequest.ts b/src/version2/models/setDefaultPriorityRequest.mts similarity index 100% rename from src/version2/models/setDefaultPriorityRequest.ts rename to src/version2/models/setDefaultPriorityRequest.mts diff --git a/src/version2/models/setDefaultResolutionRequest.ts b/src/version2/models/setDefaultResolutionRequest.mts similarity index 100% rename from src/version2/models/setDefaultResolutionRequest.ts rename to src/version2/models/setDefaultResolutionRequest.mts diff --git a/src/version2/models/sharePermission.mts b/src/version2/models/sharePermission.mts new file mode 100644 index 000000000..93fb3bf88 --- /dev/null +++ b/src/version2/models/sharePermission.mts @@ -0,0 +1,28 @@ +import type { GroupName } from './groupName.mjs'; +import type { Project } from './project.mjs'; +import type { ProjectRole } from './projectRole.mjs'; +import { User } from './user.mjs'; + +/** Details of a share permission for the filter. */ +export interface SharePermission { + /** The unique identifier of the share permission. */ + id?: number; + /** + * The type of share permission: + * + * - `user` Shared with a user. + * - `group` Shared with a group. If set in a request, then specify `sharePermission.group` as well. + * - `project` Shared with a project. If set in a request, then specify `sharePermission.project` as well. + * - `projectRole` Share with a project role in a project. This value is not returned in responses. It is used in + * requests, where it needs to be specify with `projectId` and `projectRoleId`. + * - `global` Shared globally. If set in a request, no other `sharePermission` properties need to be specified. + * - `loggedin` Shared with all logged-in users. Note: This value is set in a request by specifying `authenticated` as + * the `type`. + * - `project-unknown` Shared with a project that the user does not have access to. Cannot be set in a request. + */ + type: 'user' | 'group' | 'project' | 'projectRole' | 'global' | 'loggedin' | 'project-unknown' | string; + project?: Project; + role?: ProjectRole; + group?: GroupName; + user?: User; +} diff --git a/src/version2/models/sharePermission.ts b/src/version2/models/sharePermission.ts deleted file mode 100644 index 445872920..000000000 --- a/src/version2/models/sharePermission.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { GroupName } from './groupName.js'; -import type { Project } from './project.js'; -import type { ProjectRole } from './projectRole.js'; -import type { User } from './user.js'; - -/** Details of a share permission for the filter. */ -export interface SharePermission { - /** The unique identifier of the share permission. */ - id?: number; - /** - * The type of share permission: - * - * - `user` Shared with a user. - * - `group` Shared with a group. If set in a request, then specify `sharePermission.group` as well. - * - `project` Shared with a project. If set in a request, then specify `sharePermission.project` as well. - * - `projectRole` Share with a project role in a project. This value is not returned in responses. It is used in - * requests, where it needs to be specify with `projectId` and `projectRoleId`. - * - `global` Shared globally. If set in a request, no other `sharePermission` properties need to be specified. - * - `loggedin` Shared with all logged-in users. Note: This value is set in a request by specifying `authenticated` as - * the `type`. - * - `project-unknown` Shared with a project that the user does not have access to. Cannot be set in a request. - */ - type: 'user' | 'group' | 'project' | 'projectRole' | 'global' | 'loggedin' | 'project-unknown' | string; - project?: Project; - role?: ProjectRole; - group?: GroupName; - user?: User; -} diff --git a/src/version2/models/sharePermissionInput.ts b/src/version2/models/sharePermissionInput.mts similarity index 100% rename from src/version2/models/sharePermissionInput.ts rename to src/version2/models/sharePermissionInput.mts diff --git a/src/version2/models/simpleApplicationProperty.ts b/src/version2/models/simpleApplicationProperty.mts similarity index 100% rename from src/version2/models/simpleApplicationProperty.ts rename to src/version2/models/simpleApplicationProperty.mts diff --git a/src/version2/models/simpleLink.ts b/src/version2/models/simpleLink.mts similarity index 100% rename from src/version2/models/simpleLink.ts rename to src/version2/models/simpleLink.mts diff --git a/src/version2/models/simpleListWrapperApplicationRole.mts b/src/version2/models/simpleListWrapperApplicationRole.mts new file mode 100644 index 000000000..0bd81e6c0 --- /dev/null +++ b/src/version2/models/simpleListWrapperApplicationRole.mts @@ -0,0 +1,10 @@ +import type { ApplicationRole } from './applicationRole.mjs'; +import type { ListWrapperCallbackApplicationRole } from './listWrapperCallbackApplicationRole.mjs'; + +export interface SimpleListWrapperApplicationRole { + callback?: ListWrapperCallbackApplicationRole; + items?: ApplicationRole[]; + 'max-results'?: number; + pagingCallback?: ListWrapperCallbackApplicationRole; + size?: number; +} diff --git a/src/version2/models/simpleListWrapperApplicationRole.ts b/src/version2/models/simpleListWrapperApplicationRole.ts deleted file mode 100644 index 451d0ad63..000000000 --- a/src/version2/models/simpleListWrapperApplicationRole.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ApplicationRole } from './applicationRole.js'; -import type { ListWrapperCallbackApplicationRole } from './listWrapperCallbackApplicationRole.js'; - -export interface SimpleListWrapperApplicationRole { - callback?: ListWrapperCallbackApplicationRole; - items?: ApplicationRole[]; - 'max-results'?: number; - pagingCallback?: ListWrapperCallbackApplicationRole; - size?: number; -} diff --git a/src/version2/models/simpleListWrapperGroupName.mts b/src/version2/models/simpleListWrapperGroupName.mts new file mode 100644 index 000000000..bc74037cf --- /dev/null +++ b/src/version2/models/simpleListWrapperGroupName.mts @@ -0,0 +1,10 @@ +import type { GroupName } from './groupName.mjs'; +import type { ListWrapperCallbackGroupName } from './listWrapperCallbackGroupName.mjs'; + +export interface SimpleListWrapperGroupName { + callback?: ListWrapperCallbackGroupName; + items?: GroupName[]; + 'max-results'?: number; + pagingCallback?: ListWrapperCallbackGroupName; + size?: number; +} diff --git a/src/version2/models/simpleListWrapperGroupName.ts b/src/version2/models/simpleListWrapperGroupName.ts deleted file mode 100644 index f366882cb..000000000 --- a/src/version2/models/simpleListWrapperGroupName.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { GroupName } from './groupName.js'; -import type { ListWrapperCallbackGroupName } from './listWrapperCallbackGroupName.js'; - -export interface SimpleListWrapperGroupName { - callback?: ListWrapperCallbackGroupName; - items?: GroupName[]; - 'max-results'?: number; - pagingCallback?: ListWrapperCallbackGroupName; - size?: number; -} diff --git a/src/version2/models/status.mts b/src/version2/models/status.mts new file mode 100644 index 000000000..e073b370d --- /dev/null +++ b/src/version2/models/status.mts @@ -0,0 +1,11 @@ +import type { Icon } from './icon.mjs'; + +/** The status of the item. */ +export interface Status { + icon?: Icon; + /** + * Whether the item is resolved. If set to "true", the link to the issue is displayed in a strikethrough font, + * otherwise the link displays in normal font. + */ + resolved?: boolean; +} diff --git a/src/version2/models/status.ts b/src/version2/models/status.ts deleted file mode 100644 index 010027fd1..000000000 --- a/src/version2/models/status.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Icon } from './icon.js'; - -/** The status of the item. */ -export interface Status { - icon?: Icon; - /** - * Whether the item is resolved. If set to "true", the link to the issue is displayed in a strikethrough font, - * otherwise the link displays in normal font. - */ - resolved?: boolean; -} diff --git a/src/version2/models/statusCategory.ts b/src/version2/models/statusCategory.mts similarity index 100% rename from src/version2/models/statusCategory.ts rename to src/version2/models/statusCategory.mts diff --git a/src/version2/models/statusCreate.ts b/src/version2/models/statusCreate.mts similarity index 100% rename from src/version2/models/statusCreate.ts rename to src/version2/models/statusCreate.mts diff --git a/src/version2/models/statusCreateRequest.mts b/src/version2/models/statusCreateRequest.mts new file mode 100644 index 000000000..12963af2f --- /dev/null +++ b/src/version2/models/statusCreateRequest.mts @@ -0,0 +1,9 @@ +import type { StatusCreate } from './statusCreate.mjs'; +import type { StatusScope } from './statusScope.mjs'; + +/** Details of the statuses being created and their scope. */ +export interface StatusCreateRequest { + scope: StatusScope; + /** Details of the statuses being created. */ + statuses: StatusCreate[]; +} diff --git a/src/version2/models/statusCreateRequest.ts b/src/version2/models/statusCreateRequest.ts deleted file mode 100644 index 53a0e9989..000000000 --- a/src/version2/models/statusCreateRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { StatusCreate } from './statusCreate.js'; -import type { StatusScope } from './statusScope.js'; - -/** Details of the statuses being created and their scope. */ -export interface StatusCreateRequest { - scope: StatusScope; - /** Details of the statuses being created. */ - statuses: StatusCreate[]; -} diff --git a/src/version2/models/statusDetails.mts b/src/version2/models/statusDetails.mts new file mode 100644 index 000000000..d29381c3a --- /dev/null +++ b/src/version2/models/statusDetails.mts @@ -0,0 +1,16 @@ +import type { StatusCategory } from './statusCategory.mjs'; + +/** A status. */ +export interface StatusDetails { + /** The description of the status. */ + description?: string; + /** The URL of the icon used to represent the status. */ + iconUrl?: string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; + /** The URL of the status. */ + self?: string; + statusCategory?: StatusCategory; +} diff --git a/src/version2/models/statusDetails.ts b/src/version2/models/statusDetails.ts deleted file mode 100644 index a86294f76..000000000 --- a/src/version2/models/statusDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { StatusCategory } from './statusCategory.js'; - -/** A status. */ -export interface StatusDetails { - /** The description of the status. */ - description?: string; - /** The URL of the icon used to represent the status. */ - iconUrl?: string; - /** The ID of the status. */ - id?: string; - /** The name of the status. */ - name?: string; - /** The URL of the status. */ - self?: string; - statusCategory?: StatusCategory; -} diff --git a/src/version2/models/statusLayoutUpdate.mts b/src/version2/models/statusLayoutUpdate.mts new file mode 100644 index 000000000..b1bd2f1c1 --- /dev/null +++ b/src/version2/models/statusLayoutUpdate.mts @@ -0,0 +1,10 @@ +import { WorkflowLayout } from './workflowLayout.mjs'; + +/** The statuses associated with this workflow. */ +export interface StatusLayoutUpdate { + layout?: WorkflowLayout; + /** The properties for this status layout. */ + properties: {}; + /** A unique ID which the status will use to refer to this layout configuration. */ + statusReference: string; +} diff --git a/src/version2/models/statusLayoutUpdate.ts b/src/version2/models/statusLayoutUpdate.ts deleted file mode 100644 index 4af618a4a..000000000 --- a/src/version2/models/statusLayoutUpdate.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { WorkflowLayout } from './workflowLayout.js'; - -/** The statuses associated with this workflow. */ -export interface StatusLayoutUpdate { - layout?: WorkflowLayout; - /** The properties for this status layout. */ - properties: {}; - /** A unique ID which the status will use to refer to this layout configuration. */ - statusReference: string; -} diff --git a/src/version2/models/statusMapping.ts b/src/version2/models/statusMapping.mts similarity index 100% rename from src/version2/models/statusMapping.ts rename to src/version2/models/statusMapping.mts diff --git a/src/version2/models/statusMappingDTO.mts b/src/version2/models/statusMappingDTO.mts new file mode 100644 index 000000000..0f4a9450c --- /dev/null +++ b/src/version2/models/statusMappingDTO.mts @@ -0,0 +1,11 @@ +import { StatusMigration } from './statusMigration.mjs'; + +/** The mapping of old to new status ID for a specific project and issue type. */ +export interface StatusMappingDTO { + /** The issue type for the status mapping. */ + issueTypeId: string; + /** The project for the status mapping. */ + projectId: string; + /** The list of old and new status ID mappings for the specified project and issue type. */ + statusMigrations: StatusMigration[]; +} diff --git a/src/version2/models/statusMappingDTO.ts b/src/version2/models/statusMappingDTO.ts deleted file mode 100644 index 957b74ea4..000000000 --- a/src/version2/models/statusMappingDTO.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { StatusMigration } from './statusMigration.js'; - -/** The mapping of old to new status ID for a specific project and issue type. */ -export interface StatusMappingDTO { - /** The issue type for the status mapping. */ - issueTypeId: string; - /** The project for the status mapping. */ - projectId: string; - /** The list of old and new status ID mappings for the specified project and issue type. */ - statusMigrations: StatusMigration[]; -} diff --git a/src/version2/models/statusMigration.ts b/src/version2/models/statusMigration.mts similarity index 100% rename from src/version2/models/statusMigration.ts rename to src/version2/models/statusMigration.mts diff --git a/src/version2/models/statusReferenceAndPort.ts b/src/version2/models/statusReferenceAndPort.mts similarity index 100% rename from src/version2/models/statusReferenceAndPort.ts rename to src/version2/models/statusReferenceAndPort.mts diff --git a/src/version2/models/statusScope.mts b/src/version2/models/statusScope.mts new file mode 100644 index 000000000..568833928 --- /dev/null +++ b/src/version2/models/statusScope.mts @@ -0,0 +1,8 @@ +import type { ProjectId } from './projectId.mjs'; + +/** The scope of the status. */ +export interface StatusScope { + project?: ProjectId; + /** The scope of the status. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects. */ + type: string; +} diff --git a/src/version2/models/statusScope.ts b/src/version2/models/statusScope.ts deleted file mode 100644 index 0a8e2cc50..000000000 --- a/src/version2/models/statusScope.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectId } from './projectId.js'; - -/** The scope of the status. */ -export interface StatusScope { - project?: ProjectId; - /** The scope of the status. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects. */ - type: string; -} diff --git a/src/version2/models/statusUpdate.ts b/src/version2/models/statusUpdate.mts similarity index 100% rename from src/version2/models/statusUpdate.ts rename to src/version2/models/statusUpdate.mts diff --git a/src/version2/models/statusUpdateRequest.mts b/src/version2/models/statusUpdateRequest.mts new file mode 100644 index 000000000..2ae0c2697 --- /dev/null +++ b/src/version2/models/statusUpdateRequest.mts @@ -0,0 +1,7 @@ +import type { StatusUpdate } from './statusUpdate.mjs'; + +/** The list of statuses that will be updated. */ +export interface StatusUpdateRequest { + /** The list of statuses that will be updated. */ + statuses?: StatusUpdate[]; +} diff --git a/src/version2/models/statusUpdateRequest.ts b/src/version2/models/statusUpdateRequest.ts deleted file mode 100644 index be4da347d..000000000 --- a/src/version2/models/statusUpdateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { StatusUpdate } from './statusUpdate.js'; - -/** The list of statuses that will be updated. */ -export interface StatusUpdateRequest { - /** The list of statuses that will be updated. */ - statuses?: StatusUpdate[]; -} diff --git a/src/version2/models/suggestedIssue.ts b/src/version2/models/suggestedIssue.mts similarity index 100% rename from src/version2/models/suggestedIssue.ts rename to src/version2/models/suggestedIssue.mts diff --git a/src/version2/models/systemAvatars.mts b/src/version2/models/systemAvatars.mts new file mode 100644 index 000000000..7984cb58a --- /dev/null +++ b/src/version2/models/systemAvatars.mts @@ -0,0 +1,7 @@ +import type { Avatar } from './avatar.mjs'; + +/** List of system avatars. */ +export interface SystemAvatars { + /** A list of avatar details. */ + system?: Avatar[]; +} diff --git a/src/version2/models/systemAvatars.ts b/src/version2/models/systemAvatars.ts deleted file mode 100644 index e698d2613..000000000 --- a/src/version2/models/systemAvatars.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Avatar } from './avatar.js'; - -/** List of system avatars. */ -export interface SystemAvatars { - /** A list of avatar details. */ - system?: Avatar[]; -} diff --git a/src/version2/models/tabMetadata.mts b/src/version2/models/tabMetadata.mts new file mode 100644 index 000000000..3e774e651 --- /dev/null +++ b/src/version2/models/tabMetadata.mts @@ -0,0 +1,9 @@ +import { FieldMetadata } from './fieldMetadata.mjs'; + +/** The metadata describing a tab in an issue screen. */ +export interface TabMetadata { + /** The name of the tab. */ + name: string; + /** The fields within the tab */ + fields: FieldMetadata[]; +} diff --git a/src/version2/models/tabMetadata.ts b/src/version2/models/tabMetadata.ts deleted file mode 100644 index d344b47b0..000000000 --- a/src/version2/models/tabMetadata.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { FieldMetadata } from './fieldMetadata.js'; - -/** The metadata describing a tab in an issue screen. */ -export interface TabMetadata { - /** The name of the tab. */ - name: string; - /** The fields within the tab */ - fields: FieldMetadata[]; -} diff --git a/src/version2/models/taskProgressObject.ts b/src/version2/models/taskProgressObject.mts similarity index 100% rename from src/version2/models/taskProgressObject.ts rename to src/version2/models/taskProgressObject.mts diff --git a/src/version2/models/timeTrackingConfiguration.ts b/src/version2/models/timeTrackingConfiguration.mts similarity index 100% rename from src/version2/models/timeTrackingConfiguration.ts rename to src/version2/models/timeTrackingConfiguration.mts diff --git a/src/version2/models/timeTrackingDetails.ts b/src/version2/models/timeTrackingDetails.mts similarity index 100% rename from src/version2/models/timeTrackingDetails.ts rename to src/version2/models/timeTrackingDetails.mts diff --git a/src/version2/models/timeTrackingProvider.ts b/src/version2/models/timeTrackingProvider.mts similarity index 100% rename from src/version2/models/timeTrackingProvider.ts rename to src/version2/models/timeTrackingProvider.mts diff --git a/src/version2/models/transition.mts b/src/version2/models/transition.mts new file mode 100644 index 000000000..f98fc1fc2 --- /dev/null +++ b/src/version2/models/transition.mts @@ -0,0 +1,22 @@ +import { TransitionScreenDetails } from './transitionScreenDetails.mjs'; +import type { WorkflowRules } from './workflowRules.mjs'; + +/** Details of a workflow transition. */ +export interface Transition { + /** The description of the transition. */ + description: string; + /** The statuses the transition can start from. */ + from: string[]; + /** The ID of the transition. */ + id: string; + /** The name of the transition. */ + name: string; + /** The properties of the transition. */ + properties?: {}; + rules?: WorkflowRules; + screen?: TransitionScreenDetails; + /** The status the transition goes to. */ + to: string; + /** The type of the transition. */ + type: string; +} diff --git a/src/version2/models/transition.ts b/src/version2/models/transition.ts deleted file mode 100644 index 666367b5b..000000000 --- a/src/version2/models/transition.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { TransitionScreenDetails } from './transitionScreenDetails.js'; -import type { WorkflowRules } from './workflowRules.js'; - -/** Details of a workflow transition. */ -export interface Transition { - /** The description of the transition. */ - description: string; - /** The statuses the transition can start from. */ - from: string[]; - /** The ID of the transition. */ - id: string; - /** The name of the transition. */ - name: string; - /** The properties of the transition. */ - properties?: {}; - rules?: WorkflowRules; - screen?: TransitionScreenDetails; - /** The status the transition goes to. */ - to: string; - /** The type of the transition. */ - type: string; -} diff --git a/src/version2/models/transitionScreenDetails.ts b/src/version2/models/transitionScreenDetails.mts similarity index 100% rename from src/version2/models/transitionScreenDetails.ts rename to src/version2/models/transitionScreenDetails.mts diff --git a/src/version2/models/transitionUpdateDTO.mts b/src/version2/models/transitionUpdateDTO.mts new file mode 100644 index 000000000..a5a5b2135 --- /dev/null +++ b/src/version2/models/transitionUpdateDTO.mts @@ -0,0 +1,31 @@ +import { ConditionGroupUpdate } from './conditionGroupUpdate.mjs'; +import { StatusReferenceAndPort } from './statusReferenceAndPort.mjs'; +import { WorkflowRuleConfiguration } from './workflowRuleConfiguration.mjs'; +import { WorkflowTrigger } from './workflowTrigger.mjs'; + +/** The transitions of this workflow. */ +export interface TransitionUpdateDTO { + /** The post-functions of the transition. */ + actions?: WorkflowRuleConfiguration[]; + conditions?: ConditionGroupUpdate; + /** The custom event ID of the transition. */ + customIssueEventId?: string; + /** The description of the transition. */ + description?: string; + /** The statuses the transition can start from. */ + from?: StatusReferenceAndPort[]; + /** The ID of the transition. */ + id: string; + /** The name of the transition. */ + name: string; + /** The properties of the transition. */ + properties?: {}; + to?: StatusReferenceAndPort; + transitionScreen?: WorkflowRuleConfiguration; + /** The triggers of the transition. */ + triggers?: WorkflowTrigger[]; + /** The transition type. */ + type: string; + /** The validators of the transition. */ + validators?: WorkflowRuleConfiguration[]; +} diff --git a/src/version2/models/transitionUpdateDTO.ts b/src/version2/models/transitionUpdateDTO.ts deleted file mode 100644 index 00206efa8..000000000 --- a/src/version2/models/transitionUpdateDTO.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { ConditionGroupUpdate } from './conditionGroupUpdate.js'; -import type { StatusReferenceAndPort } from './statusReferenceAndPort.js'; -import type { WorkflowRuleConfiguration } from './workflowRuleConfiguration.js'; -import type { WorkflowTrigger } from './workflowTrigger.js'; - -/** The transitions of this workflow. */ -export interface TransitionUpdateDTO { - /** The post-functions of the transition. */ - actions?: WorkflowRuleConfiguration[]; - conditions?: ConditionGroupUpdate; - /** The custom event ID of the transition. */ - customIssueEventId?: string; - /** The description of the transition. */ - description?: string; - /** The statuses the transition can start from. */ - from?: StatusReferenceAndPort[]; - /** The ID of the transition. */ - id: string; - /** The name of the transition. */ - name: string; - /** The properties of the transition. */ - properties?: {}; - to?: StatusReferenceAndPort; - transitionScreen?: WorkflowRuleConfiguration; - /** The triggers of the transition. */ - triggers?: WorkflowTrigger[]; - /** The transition type. */ - type: string; - /** The validators of the transition. */ - validators?: WorkflowRuleConfiguration[]; -} diff --git a/src/version2/models/transitions.mts b/src/version2/models/transitions.mts new file mode 100644 index 000000000..58362e776 --- /dev/null +++ b/src/version2/models/transitions.mts @@ -0,0 +1,9 @@ +import type { IssueTransition } from './issueTransition.mjs'; + +/** List of issue transitions. */ +export interface Transitions { + /** Expand options that include additional transitions details in the response. */ + expand?: string; + /** List of issue transitions. */ + transitions?: IssueTransition[]; +} diff --git a/src/version2/models/transitions.ts b/src/version2/models/transitions.ts deleted file mode 100644 index bc6d52a1b..000000000 --- a/src/version2/models/transitions.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { IssueTransition } from './issueTransition.js'; - -/** List of issue transitions. */ -export interface Transitions { - /** Expand options that include additional transitions details in the response. */ - expand?: string; - /** List of issue transitions. */ - transitions?: IssueTransition[]; -} diff --git a/src/version2/models/uiModificationContextDetails.ts b/src/version2/models/uiModificationContextDetails.mts similarity index 100% rename from src/version2/models/uiModificationContextDetails.ts rename to src/version2/models/uiModificationContextDetails.mts diff --git a/src/version2/models/uiModificationDetails.mts b/src/version2/models/uiModificationDetails.mts new file mode 100644 index 000000000..d65963bb6 --- /dev/null +++ b/src/version2/models/uiModificationDetails.mts @@ -0,0 +1,17 @@ +import type { UiModificationContextDetails } from './uiModificationContextDetails.mjs'; + +/** The details of a UI modification. */ +export interface UiModificationDetails { + /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ + contexts?: UiModificationContextDetails[]; + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data?: string; + /** The description of the UI modification. The maximum length is 255 characters. */ + description?: string; + /** The ID of the UI modification. */ + id: string; + /** The name of the UI modification. The maximum length is 255 characters. */ + name: string; + /** The URL of the UI modification. */ + self: string; +} diff --git a/src/version2/models/uiModificationDetails.ts b/src/version2/models/uiModificationDetails.ts deleted file mode 100644 index b867d2701..000000000 --- a/src/version2/models/uiModificationDetails.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { UiModificationContextDetails } from './uiModificationContextDetails.js'; - -/** The details of a UI modification. */ -export interface UiModificationDetails { - /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ - contexts?: UiModificationContextDetails[]; - /** The data of the UI modification. The maximum size of the data is 50000 characters. */ - data?: string; - /** The description of the UI modification. The maximum length is 255 characters. */ - description?: string; - /** The ID of the UI modification. */ - id: string; - /** The name of the UI modification. The maximum length is 255 characters. */ - name: string; - /** The URL of the UI modification. */ - self: string; -} diff --git a/src/version2/models/uiModificationIdentifiers.ts b/src/version2/models/uiModificationIdentifiers.mts similarity index 100% rename from src/version2/models/uiModificationIdentifiers.ts rename to src/version2/models/uiModificationIdentifiers.mts diff --git a/src/version2/models/unrestrictedUserEmail.ts b/src/version2/models/unrestrictedUserEmail.mts similarity index 100% rename from src/version2/models/unrestrictedUserEmail.ts rename to src/version2/models/unrestrictedUserEmail.mts diff --git a/src/version2/models/updateCustomFieldDetails.ts b/src/version2/models/updateCustomFieldDetails.mts similarity index 100% rename from src/version2/models/updateCustomFieldDetails.ts rename to src/version2/models/updateCustomFieldDetails.mts diff --git a/src/version2/models/updateFieldConfigurationSchemeDetails.ts b/src/version2/models/updateFieldConfigurationSchemeDetails.mts similarity index 100% rename from src/version2/models/updateFieldConfigurationSchemeDetails.ts rename to src/version2/models/updateFieldConfigurationSchemeDetails.mts diff --git a/src/version2/models/updateIssueSecurityLevelDetails.ts b/src/version2/models/updateIssueSecurityLevelDetails.mts similarity index 100% rename from src/version2/models/updateIssueSecurityLevelDetails.ts rename to src/version2/models/updateIssueSecurityLevelDetails.mts diff --git a/src/version2/models/updateIssueSecuritySchemeRequest.ts b/src/version2/models/updateIssueSecuritySchemeRequest.mts similarity index 100% rename from src/version2/models/updateIssueSecuritySchemeRequest.ts rename to src/version2/models/updateIssueSecuritySchemeRequest.mts diff --git a/src/version2/models/updateNotificationSchemeDetails.ts b/src/version2/models/updateNotificationSchemeDetails.mts similarity index 100% rename from src/version2/models/updateNotificationSchemeDetails.ts rename to src/version2/models/updateNotificationSchemeDetails.mts diff --git a/src/version2/models/updatePriorityDetails.ts b/src/version2/models/updatePriorityDetails.mts similarity index 100% rename from src/version2/models/updatePriorityDetails.ts rename to src/version2/models/updatePriorityDetails.mts diff --git a/src/version2/models/updateProjectDetails.ts b/src/version2/models/updateProjectDetails.mts similarity index 100% rename from src/version2/models/updateProjectDetails.ts rename to src/version2/models/updateProjectDetails.mts diff --git a/src/version2/models/updateResolutionDetails.ts b/src/version2/models/updateResolutionDetails.mts similarity index 100% rename from src/version2/models/updateResolutionDetails.ts rename to src/version2/models/updateResolutionDetails.mts diff --git a/src/version2/models/updateScreenDetails.ts b/src/version2/models/updateScreenDetails.mts similarity index 100% rename from src/version2/models/updateScreenDetails.ts rename to src/version2/models/updateScreenDetails.mts diff --git a/src/version2/models/updateScreenSchemeDetails.mts b/src/version2/models/updateScreenSchemeDetails.mts new file mode 100644 index 000000000..920f13550 --- /dev/null +++ b/src/version2/models/updateScreenSchemeDetails.mts @@ -0,0 +1,10 @@ +import type { UpdateScreenTypes } from './updateScreenTypes.mjs'; + +/** Details of a screen scheme. */ +export interface UpdateScreenSchemeDetails { + /** The description of the screen scheme. The maximum length is 255 characters. */ + description?: string; + /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ + name?: string; + screens?: UpdateScreenTypes; +} diff --git a/src/version2/models/updateScreenSchemeDetails.ts b/src/version2/models/updateScreenSchemeDetails.ts deleted file mode 100644 index 23726c845..000000000 --- a/src/version2/models/updateScreenSchemeDetails.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { UpdateScreenTypes } from './updateScreenTypes.js'; - -/** Details of a screen scheme. */ -export interface UpdateScreenSchemeDetails { - /** The description of the screen scheme. The maximum length is 255 characters. */ - description?: string; - /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ - name?: string; - screens?: UpdateScreenTypes; -} diff --git a/src/version2/models/updateScreenTypes.ts b/src/version2/models/updateScreenTypes.mts similarity index 100% rename from src/version2/models/updateScreenTypes.ts rename to src/version2/models/updateScreenTypes.mts diff --git a/src/version2/models/updateUiModificationDetails.mts b/src/version2/models/updateUiModificationDetails.mts new file mode 100644 index 000000000..8f40932f3 --- /dev/null +++ b/src/version2/models/updateUiModificationDetails.mts @@ -0,0 +1,16 @@ +import type { UiModificationContextDetails } from './uiModificationContextDetails.mjs'; + +/** The details of a UI modification. */ +export interface UpdateUiModificationDetails { + /** + * List of contexts of the UI modification. The maximum number of contexts is 1000. If provided, replaces all existing + * contexts. + */ + contexts?: UiModificationContextDetails[]; + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data?: string; + /** The description of the UI modification. The maximum length is 255 characters. */ + description?: string; + /** The name of the UI modification. The maximum length is 255 characters. */ + name?: string; +} diff --git a/src/version2/models/updateUiModificationDetails.ts b/src/version2/models/updateUiModificationDetails.ts deleted file mode 100644 index 0162ae707..000000000 --- a/src/version2/models/updateUiModificationDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { UiModificationContextDetails } from './uiModificationContextDetails.js'; - -/** The details of a UI modification. */ -export interface UpdateUiModificationDetails { - /** - * List of contexts of the UI modification. The maximum number of contexts is 1000. If provided, replaces all existing - * contexts. - */ - contexts?: UiModificationContextDetails[]; - /** The data of the UI modification. The maximum size of the data is 50000 characters. */ - data?: string; - /** The description of the UI modification. The maximum length is 255 characters. */ - description?: string; - /** The name of the UI modification. The maximum length is 255 characters. */ - name?: string; -} diff --git a/src/version2/models/updateUserToGroup.ts b/src/version2/models/updateUserToGroup.mts similarity index 100% rename from src/version2/models/updateUserToGroup.ts rename to src/version2/models/updateUserToGroup.mts diff --git a/src/version2/models/updatedProjectCategory.ts b/src/version2/models/updatedProjectCategory.mts similarity index 100% rename from src/version2/models/updatedProjectCategory.ts rename to src/version2/models/updatedProjectCategory.mts diff --git a/src/version2/models/user.mts b/src/version2/models/user.mts new file mode 100644 index 000000000..a7306a8a6 --- /dev/null +++ b/src/version2/models/user.mts @@ -0,0 +1,62 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; +import type { SimpleListWrapperApplicationRole } from './simpleListWrapperApplicationRole.mjs'; +import type { SimpleListWrapperGroupName } from './simpleListWrapperGroupName.mjs'; + +/** + * A user with details as permitted by the user's Atlassian Account privacy settings. However, be aware of these + * exceptions:* + * + * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, + * `displayName` provides an indication and other parameters have default values or are blank (for example, email is + * blank). + * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted + * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. + * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have + * fallback values. + */ +export interface User { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. Required in requests. + */ + accountId?: string; + /** + * The user account type. Can take the following values: + * + * `atlassian` regular Atlassian user account `app` system account used for Connect applications and OAuth to + * represent external systems `customer` Jira Service Desk account representing an external service desk + */ + accountType?: string; + /** Whether the user is active. */ + active?: boolean; + applicationRoles?: SimpleListWrapperApplicationRole; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** The email address of the user. Depending on the user’s privacy setting, this may be returned as null. */ + emailAddress?: string; + /** Expand options that include additional user details in the response. */ + expand?: string; + groups?: SimpleListWrapperGroupName; + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + key?: string; + /** The locale of the user. Depending on the user’s privacy setting, this may be returned as null. */ + locale?: string; + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + name?: string; + /** The URL of the user. */ + self?: string; + /** + * The time zone specified in the user's profile. Depending on the user’s privacy setting, this may be returned as + * null. + */ + timeZone?: string; +} diff --git a/src/version2/models/user.ts b/src/version2/models/user.ts deleted file mode 100644 index 15aa2c52a..000000000 --- a/src/version2/models/user.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; -import type { SimpleListWrapperApplicationRole } from './simpleListWrapperApplicationRole.js'; -import type { SimpleListWrapperGroupName } from './simpleListWrapperGroupName.js'; - -/** - * A user with details as permitted by the user's Atlassian Account privacy settings. However, be aware of these - * exceptions:* - * - * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, - * `displayName` provides an indication and other parameters have default values or are blank (for example, email is - * blank). - * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted - * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. - * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have - * fallback values. - */ -export interface User { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. Required in requests. - */ - accountId?: string; - /** - * The user account type. Can take the following values: - * - * `atlassian` regular Atlassian user account `app` system account used for Connect applications and OAuth to - * represent external systems `customer` Jira Service Desk account representing an external service desk - */ - accountType?: string; - /** Whether the user is active. */ - active?: boolean; - applicationRoles?: SimpleListWrapperApplicationRole; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** The email address of the user. Depending on the user’s privacy setting, this may be returned as null. */ - emailAddress?: string; - /** Expand options that include additional user details in the response. */ - expand?: string; - groups?: SimpleListWrapperGroupName; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - key?: string; - /** The locale of the user. Depending on the user’s privacy setting, this may be returned as null. */ - locale?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - name?: string; - /** The URL of the user. */ - self?: string; - /** - * The time zone specified in the user's profile. Depending on the user’s privacy setting, this may be returned as - * null. - */ - timeZone?: string; -} diff --git a/src/version2/models/userAvatarUrls.ts b/src/version2/models/userAvatarUrls.mts similarity index 100% rename from src/version2/models/userAvatarUrls.ts rename to src/version2/models/userAvatarUrls.mts diff --git a/src/version2/models/userDetails.mts b/src/version2/models/userDetails.mts new file mode 100644 index 000000000..212442ecc --- /dev/null +++ b/src/version2/models/userDetails.mts @@ -0,0 +1,51 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; + +/** + * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* + * + * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, + * `displayName` provides an indication and other parameters have default values or are blank (for example, email is + * blank). + * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted + * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. + * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have + * fallback values. + */ +export interface UserDetails { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** + * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application + * user) or 'customer' (Jira Service Desk customer user) + */ + accountType?: string; + /** Whether the user is active. */ + active?: boolean; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ + displayName?: string; + /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ + emailAddress?: string; + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + key?: string; + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + name?: string; + /** The URL of the user. */ + self?: string; + /** + * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as + * null. + */ + timeZone?: string; +} diff --git a/src/version2/models/userDetails.ts b/src/version2/models/userDetails.ts deleted file mode 100644 index e0ed48b46..000000000 --- a/src/version2/models/userDetails.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; - -/** - * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* - * - * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, - * `displayName` provides an indication and other parameters have default values or are blank (for example, email is - * blank). - * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted - * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. - * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have - * fallback values. - */ -export interface UserDetails { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** - * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application - * user) or 'customer' (Jira Service Desk customer user) - */ - accountType?: string; - /** Whether the user is active. */ - active?: boolean; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ - displayName?: string; - /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ - emailAddress?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - key?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - name?: string; - /** The URL of the user. */ - self?: string; - /** - * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as - * null. - */ - timeZone?: string; -} diff --git a/src/version2/models/userKey.ts b/src/version2/models/userKey.mts similarity index 100% rename from src/version2/models/userKey.ts rename to src/version2/models/userKey.mts diff --git a/src/version2/models/userList.mts b/src/version2/models/userList.mts new file mode 100644 index 000000000..1f3b9ef6d --- /dev/null +++ b/src/version2/models/userList.mts @@ -0,0 +1,18 @@ +import { User } from './user.mjs'; + +/** + * A paginated list of users sharing the filter. This includes users that are members of the groups or can browse the + * projects that the filter is shared with. + */ +export interface UserList { + /** The index of the last item returned on the page. */ + 'end-index'?: number; + /** The list of items. */ + items?: User[]; + /** The maximum number of results that could be on the page. */ + 'max-results'?: number; + /** The number of items on the page. */ + size?: number; + /** The index of the first item returned on the page. */ + 'start-index'?: number; +} diff --git a/src/version2/models/userList.ts b/src/version2/models/userList.ts deleted file mode 100644 index 63129dbd4..000000000 --- a/src/version2/models/userList.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { User } from './user.js'; - -/** - * A paginated list of users sharing the filter. This includes users that are members of the groups or can browse the - * projects that the filter is shared with. - */ -export interface UserList { - /** The index of the last item returned on the page. */ - 'end-index'?: number; - /** The list of items. */ - items?: User[]; - /** The maximum number of results that could be on the page. */ - 'max-results'?: number; - /** The number of items on the page. */ - size?: number; - /** The index of the first item returned on the page. */ - 'start-index'?: number; -} diff --git a/src/version2/models/userMigration.ts b/src/version2/models/userMigration.mts similarity index 100% rename from src/version2/models/userMigration.ts rename to src/version2/models/userMigration.mts diff --git a/src/version2/models/userPickerUser.ts b/src/version2/models/userPickerUser.mts similarity index 100% rename from src/version2/models/userPickerUser.ts rename to src/version2/models/userPickerUser.mts diff --git a/src/version2/models/validationOptionsForCreate.ts b/src/version2/models/validationOptionsForCreate.mts similarity index 100% rename from src/version2/models/validationOptionsForCreate.ts rename to src/version2/models/validationOptionsForCreate.mts diff --git a/src/version2/models/validationOptionsForUpdate.ts b/src/version2/models/validationOptionsForUpdate.mts similarity index 100% rename from src/version2/models/validationOptionsForUpdate.ts rename to src/version2/models/validationOptionsForUpdate.mts diff --git a/src/version2/models/version.mts b/src/version2/models/version.mts new file mode 100644 index 000000000..c33537eec --- /dev/null +++ b/src/version2/models/version.mts @@ -0,0 +1,71 @@ +import type { SimpleLink } from './simpleLink.mjs'; +import type { VersionIssuesStatus } from './versionIssuesStatus.mjs'; + +/** Details about a project version. */ +export interface Version { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about version in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `operations` Returns the list of operations available for this version. + * - `issuesstatus` Returns the count of issues in this version for each of the status categories _to do_, _in + * progress_, _done_, and _unmapped_. The _unmapped_ property contains a count of issues with a status other than + * _to do_, _in progress_, and _done_. + * + * Optional for create and update. + */ + expand?: 'operations' | 'issuesstatus' | ('operations' | 'issuesstatus')[] | string | string[]; + /** The URL of the version. */ + self?: string; + /** The ID of the version. */ + id?: string; + /** The description of the version. Optional when creating or updating a version. */ + description?: string; + /** + * The unique name of the version. Required when creating a version. Optional when updating a version. The maximum + * length is 255 characters. + */ + name?: string; + /** Indicates that the version is archived. Optional when creating or updating a version. */ + archived?: boolean; + /** + * Indicates that the version is released. If the version is released a request to release again is ignored. Not + * applicable when creating a version. Optional when updating a version. + */ + released?: boolean; + /** + * The start date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a + * version. + */ + startDate?: string; + /** + * The release date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a + * version. + */ + releaseDate?: string; + /** Indicates that the version is overdue. */ + overdue?: boolean; + /** + * The date on which work on this version is expected to start, expressed in the instance's _Day/Month/Year Format_ + * date format. + */ + userStartDate?: string; + /** + * The date on which work on this version is expected to finish, expressed in the instance's _Day/Month/Year Format_ + * date format. + */ + userReleaseDate?: string; + /** + * The ID of the project to which this version is attached. Required when creating a version. Not applicable when + * updating a version. + */ + projectId: number; + /** + * The URL of the self link to the version to which all unfixed issues are moved when a version is released. Not + * applicable when creating a version. Optional when updating a version. + */ + moveUnfixedIssuesTo?: string; + /** If the expand option `operations` is used, returns the list of operations available for this version. */ + operations?: SimpleLink[]; + issuesStatusForFixVersion?: VersionIssuesStatus; +} diff --git a/src/version2/models/version.ts b/src/version2/models/version.ts deleted file mode 100644 index 138628711..000000000 --- a/src/version2/models/version.ts +++ /dev/null @@ -1,71 +0,0 @@ -import type { SimpleLink } from './simpleLink.js'; -import type { VersionIssuesStatus } from './versionIssuesStatus.js'; - -/** Details about a project version. */ -export interface Version { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about version in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `operations` Returns the list of operations available for this version. - * - `issuesstatus` Returns the count of issues in this version for each of the status categories _to do_, _in - * progress_, _done_, and _unmapped_. The _unmapped_ property contains a count of issues with a status other than - * _to do_, _in progress_, and _done_. - * - * Optional for create and update. - */ - expand?: 'operations' | 'issuesstatus' | ('operations' | 'issuesstatus')[] | string | string[]; - /** The URL of the version. */ - self?: string; - /** The ID of the version. */ - id?: string; - /** The description of the version. Optional when creating or updating a version. */ - description?: string; - /** - * The unique name of the version. Required when creating a version. Optional when updating a version. The maximum - * length is 255 characters. - */ - name?: string; - /** Indicates that the version is archived. Optional when creating or updating a version. */ - archived?: boolean; - /** - * Indicates that the version is released. If the version is released a request to release again is ignored. Not - * applicable when creating a version. Optional when updating a version. - */ - released?: boolean; - /** - * The start date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a - * version. - */ - startDate?: string; - /** - * The release date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a - * version. - */ - releaseDate?: string; - /** Indicates that the version is overdue. */ - overdue?: boolean; - /** - * The date on which work on this version is expected to start, expressed in the instance's _Day/Month/Year Format_ - * date format. - */ - userStartDate?: string; - /** - * The date on which work on this version is expected to finish, expressed in the instance's _Day/Month/Year Format_ - * date format. - */ - userReleaseDate?: string; - /** - * The ID of the project to which this version is attached. Required when creating a version. Not applicable when - * updating a version. - */ - projectId: number; - /** - * The URL of the self link to the version to which all unfixed issues are moved when a version is released. Not - * applicable when creating a version. Optional when updating a version. - */ - moveUnfixedIssuesTo?: string; - /** If the expand option `operations` is used, returns the list of operations available for this version. */ - operations?: SimpleLink[]; - issuesStatusForFixVersion?: VersionIssuesStatus; -} diff --git a/src/version2/models/versionIssueCounts.mts b/src/version2/models/versionIssueCounts.mts new file mode 100644 index 000000000..48fa9adc9 --- /dev/null +++ b/src/version2/models/versionIssueCounts.mts @@ -0,0 +1,15 @@ +import { VersionUsageInCustomField } from './versionUsageInCustomField.mjs'; + +/** Various counts of issues within a version. */ +export interface VersionIssueCounts { + /** List of custom fields using the version. */ + customFieldUsage?: VersionUsageInCustomField[]; + /** Count of issues where a version custom field is set to the version. */ + issueCountWithCustomFieldsShowingVersion?: number; + /** Count of issues where the `affectedVersion` is set to the version. */ + issuesAffectedCount?: number; + /** Count of issues where the `fixVersion` is set to the version. */ + issuesFixedCount?: number; + /** The URL of these count details. */ + self?: string; +} diff --git a/src/version2/models/versionIssueCounts.ts b/src/version2/models/versionIssueCounts.ts deleted file mode 100644 index b0680db9f..000000000 --- a/src/version2/models/versionIssueCounts.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { VersionUsageInCustomField } from './versionUsageInCustomField.js'; - -/** Various counts of issues within a version. */ -export interface VersionIssueCounts { - /** List of custom fields using the version. */ - customFieldUsage?: VersionUsageInCustomField[]; - /** Count of issues where a version custom field is set to the version. */ - issueCountWithCustomFieldsShowingVersion?: number; - /** Count of issues where the `affectedVersion` is set to the version. */ - issuesAffectedCount?: number; - /** Count of issues where the `fixVersion` is set to the version. */ - issuesFixedCount?: number; - /** The URL of these count details. */ - self?: string; -} diff --git a/src/version2/models/versionIssuesStatus.ts b/src/version2/models/versionIssuesStatus.mts similarity index 100% rename from src/version2/models/versionIssuesStatus.ts rename to src/version2/models/versionIssuesStatus.mts diff --git a/src/version2/models/versionMove.ts b/src/version2/models/versionMove.mts similarity index 100% rename from src/version2/models/versionMove.ts rename to src/version2/models/versionMove.mts diff --git a/src/version2/models/versionUnresolvedIssuesCount.ts b/src/version2/models/versionUnresolvedIssuesCount.mts similarity index 100% rename from src/version2/models/versionUnresolvedIssuesCount.ts rename to src/version2/models/versionUnresolvedIssuesCount.mts diff --git a/src/version2/models/versionUsageInCustomField.ts b/src/version2/models/versionUsageInCustomField.mts similarity index 100% rename from src/version2/models/versionUsageInCustomField.ts rename to src/version2/models/versionUsageInCustomField.mts diff --git a/src/version2/models/visibility.ts b/src/version2/models/visibility.mts similarity index 100% rename from src/version2/models/visibility.ts rename to src/version2/models/visibility.mts diff --git a/src/version2/models/votes.mts b/src/version2/models/votes.mts new file mode 100644 index 000000000..2796869cc --- /dev/null +++ b/src/version2/models/votes.mts @@ -0,0 +1,16 @@ +import { User } from './user.mjs'; + +/** The details of votes on an issue. */ +export interface Votes { + /** Whether the user making this request has voted on the issue. */ + hasVoted?: boolean; + /** The URL of these issue vote details. */ + self?: string; + /** + * List of the users who have voted on this issue. An empty list is returned when the calling user doesn't have the + * _View voters and watchers_ project permission. + */ + voters?: User[]; + /** The number of votes on the issue. */ + votes?: number; +} diff --git a/src/version2/models/votes.ts b/src/version2/models/votes.ts deleted file mode 100644 index a538a66b4..000000000 --- a/src/version2/models/votes.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { User } from './user.js'; - -/** The details of votes on an issue. */ -export interface Votes { - /** Whether the user making this request has voted on the issue. */ - hasVoted?: boolean; - /** The URL of these issue vote details. */ - self?: string; - /** - * List of the users who have voted on this issue. An empty list is returned when the calling user doesn't have the - * _View voters and watchers_ project permission. - */ - voters?: User[]; - /** The number of votes on the issue. */ - votes?: number; -} diff --git a/src/version2/models/warningCollection.ts b/src/version2/models/warningCollection.mts similarity index 100% rename from src/version2/models/warningCollection.ts rename to src/version2/models/warningCollection.mts diff --git a/src/version2/models/watchers.mts b/src/version2/models/watchers.mts new file mode 100644 index 000000000..fa8268e10 --- /dev/null +++ b/src/version2/models/watchers.mts @@ -0,0 +1,13 @@ +import { UserDetails } from './userDetails.mjs'; + +/** The details of watchers on an issue. */ +export interface Watchers { + /** Whether the calling user is watching this issue. */ + isWatching?: boolean; + /** The URL of these issue watcher details. */ + self?: string; + /** The number of users watching this issue. */ + watchCount?: number; + /** Details of the users watching this issue. */ + watchers?: UserDetails[]; +} diff --git a/src/version2/models/watchers.ts b/src/version2/models/watchers.ts deleted file mode 100644 index e66ad85d3..000000000 --- a/src/version2/models/watchers.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { UserDetails } from './userDetails.js'; - -/** The details of watchers on an issue. */ -export interface Watchers { - /** Whether the calling user is watching this issue. */ - isWatching?: boolean; - /** The URL of these issue watcher details. */ - self?: string; - /** The number of users watching this issue. */ - watchCount?: number; - /** Details of the users watching this issue. */ - watchers?: UserDetails[]; -} diff --git a/src/version2/models/webhook.mts b/src/version2/models/webhook.mts new file mode 100644 index 000000000..0b1c83ef7 --- /dev/null +++ b/src/version2/models/webhook.mts @@ -0,0 +1,26 @@ +/** A webhook. */ +export interface Webhook { + /** The Jira events that trigger the webhook. */ + events: string[]; + /** + * The date after which the webhook is no longer sent. Use [Extend webhook + * life](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-webhooks/#api-rest-api-3-webhook-refresh-put) + * to extend the date. + */ + expirationDate?: number; + /** + * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. + * If this parameter is not present, the app is notified about all field updates. + */ + fieldIdsFilter?: string[]; + /** The ID of the webhook. */ + id: number; + /** + * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or + * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property + * updates. + */ + issuePropertyKeysFilter?: string[]; + /** The Jql filter that specifies which issues the webhook is sent for. */ + jqlFilter: string; +} diff --git a/src/version2/models/webhook.ts b/src/version2/models/webhook.ts deleted file mode 100644 index 7886ad727..000000000 --- a/src/version2/models/webhook.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** A webhook. */ -export interface Webhook { - /** The Jira events that trigger the webhook. */ - events: string[]; - /** - * The date after which the webhook is no longer sent. Use [Extend webhook - * life](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-webhooks/#api-rest-api-3-webhook-refresh-put) - * to extend the date. - */ - expirationDate?: number; - /** - * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. - * If this parameter is not present, the app is notified about all field updates. - */ - fieldIdsFilter?: string[]; - /** The ID of the webhook. */ - id: number; - /** - * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or - * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property - * updates. - */ - issuePropertyKeysFilter?: string[]; - /** The JQL filter that specifies which issues the webhook is sent for. */ - jqlFilter: string; -} diff --git a/src/version2/models/webhookDetails.mts b/src/version2/models/webhookDetails.mts new file mode 100644 index 000000000..aefca5d3d --- /dev/null +++ b/src/version2/models/webhookDetails.mts @@ -0,0 +1,25 @@ +/** A list of webhooks. */ +export interface WebhookDetails { + /** The Jira events that trigger the webhook. */ + events: string[]; + /** + * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. + * If this parameter is not present, the app is notified about all field updates. + */ + fieldIdsFilter?: string[]; + /** + * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or + * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property + * updates. + */ + issuePropertyKeysFilter?: string[]; + /** + * The Jql filter that specifies which issues the webhook is sent for. Only a subset of Jql can be used. The supported + * elements are: + * + * Fields: `issueKey`, `project`, `issuetype`, `status`, `assignee`, `reporter`, `issue.property`, and `cf[id]`. For + * custom fields (`cf[id]`), only the epic label custom field is supported.". Operators: `=`, `!=`, `IN`, and `NOT + * IN`. + */ + jqlFilter: string; +} diff --git a/src/version2/models/webhookDetails.ts b/src/version2/models/webhookDetails.ts deleted file mode 100644 index 2fb3e0f98..000000000 --- a/src/version2/models/webhookDetails.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** A list of webhooks. */ -export interface WebhookDetails { - /** The Jira events that trigger the webhook. */ - events: string[]; - /** - * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. - * If this parameter is not present, the app is notified about all field updates. - */ - fieldIdsFilter?: string[]; - /** - * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or - * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property - * updates. - */ - issuePropertyKeysFilter?: string[]; - /** - * The JQL filter that specifies which issues the webhook is sent for. Only a subset of JQL can be used. The supported - * elements are: - * - * Fields: `issueKey`, `project`, `issuetype`, `status`, `assignee`, `reporter`, `issue.property`, and `cf[id]`. For - * custom fields (`cf[id]`), only the epic label custom field is supported.". Operators: `=`, `!=`, `IN`, and `NOT - * IN`. - */ - jqlFilter: string; -} diff --git a/src/version2/models/webhookRegistrationDetails.mts b/src/version2/models/webhookRegistrationDetails.mts new file mode 100644 index 000000000..13c31de8f --- /dev/null +++ b/src/version2/models/webhookRegistrationDetails.mts @@ -0,0 +1,12 @@ +import { WebhookDetails } from './webhookDetails.mjs'; + +/** Details of webhooks to register. */ +export interface WebhookRegistrationDetails { + /** + * The URL that specifies where to send the webhooks. This URL must use the same base URL as the Connect app. Only a + * single URL per app is allowed to be registered. + */ + url: string; + /** A list of webhooks. */ + webhooks: WebhookDetails[]; +} diff --git a/src/version2/models/webhookRegistrationDetails.ts b/src/version2/models/webhookRegistrationDetails.ts deleted file mode 100644 index 08d8c5482..000000000 --- a/src/version2/models/webhookRegistrationDetails.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { WebhookDetails } from './webhookDetails.js'; - -/** Details of webhooks to register. */ -export interface WebhookRegistrationDetails { - /** - * The URL that specifies where to send the webhooks. This URL must use the same base URL as the Connect app. Only a - * single URL per app is allowed to be registered. - */ - url: string; - /** A list of webhooks. */ - webhooks: WebhookDetails[]; -} diff --git a/src/version2/models/webhooksExpirationDate.ts b/src/version2/models/webhooksExpirationDate.mts similarity index 100% rename from src/version2/models/webhooksExpirationDate.ts rename to src/version2/models/webhooksExpirationDate.mts diff --git a/src/version2/models/workflow.mts b/src/version2/models/workflow.mts new file mode 100644 index 000000000..bf7157572 --- /dev/null +++ b/src/version2/models/workflow.mts @@ -0,0 +1,30 @@ +import type { ProjectDetails } from './projectDetails.mjs'; +import { PublishedWorkflowId } from './publishedWorkflowId.mjs'; +import { Transition } from './transition.mjs'; +import { WorkflowOperations } from './workflowOperations.mjs'; +import { WorkflowSchemeIdName } from './workflowSchemeIdName.mjs'; +import { WorkflowStatus } from './workflowStatus.mjs'; + +/** Details about a workflow. */ +export interface Workflow { + /** The creation date of the workflow. */ + created?: string; + /** The description of the workflow. */ + description: string; + /** Whether the workflow has a draft version. */ + hasDraftWorkflow?: boolean; + id: PublishedWorkflowId; + /** Whether this is the default workflow. */ + isDefault?: boolean; + operations?: WorkflowOperations; + /** The projects the workflow is assigned to, through workflow schemes. */ + projects?: ProjectDetails[]; + /** The workflow schemes the workflow is assigned to. */ + schemes?: WorkflowSchemeIdName[]; + /** The statuses of the workflow. */ + statuses?: WorkflowStatus[]; + /** The transitions of the workflow. */ + transitions?: Transition[]; + /** The last edited date of the workflow. */ + updated?: string; +} diff --git a/src/version2/models/workflow.ts b/src/version2/models/workflow.ts deleted file mode 100644 index 119beef26..000000000 --- a/src/version2/models/workflow.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { ProjectDetails } from './projectDetails.js'; -import type { PublishedWorkflowId } from './publishedWorkflowId.js'; -import type { Transition } from './transition.js'; -import type { WorkflowOperations } from './workflowOperations.js'; -import type { WorkflowSchemeIdName } from './workflowSchemeIdName.js'; -import type { WorkflowStatus } from './workflowStatus.js'; - -/** Details about a workflow. */ -export interface Workflow { - /** The creation date of the workflow. */ - created?: string; - /** The description of the workflow. */ - description: string; - /** Whether the workflow has a draft version. */ - hasDraftWorkflow?: boolean; - id: PublishedWorkflowId; - /** Whether this is the default workflow. */ - isDefault?: boolean; - operations?: WorkflowOperations; - /** The projects the workflow is assigned to, through workflow schemes. */ - projects?: ProjectDetails[]; - /** The workflow schemes the workflow is assigned to. */ - schemes?: WorkflowSchemeIdName[]; - /** The statuses of the workflow. */ - statuses?: WorkflowStatus[]; - /** The transitions of the workflow. */ - transitions?: Transition[]; - /** The last edited date of the workflow. */ - updated?: string; -} diff --git a/src/version2/models/workflowCapabilities.mts b/src/version2/models/workflowCapabilities.mts new file mode 100644 index 000000000..c40bdb92c --- /dev/null +++ b/src/version2/models/workflowCapabilities.mts @@ -0,0 +1,22 @@ +import { AvailableWorkflowConnectRule } from './availableWorkflowConnectRule.mjs'; +import { AvailableWorkflowForgeRule } from './availableWorkflowForgeRule.mjs'; +import { AvailableWorkflowSystemRule } from './availableWorkflowSystemRule.mjs'; +import { AvailableWorkflowTriggers } from './availableWorkflowTriggers.mjs'; + +export interface WorkflowCapabilities { + /** The Connect provided ecosystem rules available. */ + connectRules?: AvailableWorkflowConnectRule[]; + /** + * The scope of the workflow capabilities. `GLOBAL` for company-managed projects and `PROJECT` for team-managed + * projects. + */ + editorScope?: string; + /** The Forge provided ecosystem rules available. */ + forgeRules?: AvailableWorkflowForgeRule[]; + /** The types of projects that this capability set is available for. */ + projectTypes?: string[]; + /** The Atlassian provided system rules available. */ + systemRules?: AvailableWorkflowSystemRule[]; + /** The trigger rules available. */ + triggerRules?: AvailableWorkflowTriggers[]; +} diff --git a/src/version2/models/workflowCapabilities.ts b/src/version2/models/workflowCapabilities.ts deleted file mode 100644 index 6dbbdda64..000000000 --- a/src/version2/models/workflowCapabilities.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { AvailableWorkflowConnectRule } from './availableWorkflowConnectRule.js'; -import type { AvailableWorkflowForgeRule } from './availableWorkflowForgeRule.js'; -import type { AvailableWorkflowSystemRule } from './availableWorkflowSystemRule.js'; -import type { AvailableWorkflowTriggers } from './availableWorkflowTriggers.js'; - -export interface WorkflowCapabilities { - /** The Connect provided ecosystem rules available. */ - connectRules?: AvailableWorkflowConnectRule[]; - /** - * The scope of the workflow capabilities. `GLOBAL` for company-managed projects and `PROJECT` for team-managed - * projects. - */ - editorScope?: string; - /** The Forge provided ecosystem rules available. */ - forgeRules?: AvailableWorkflowForgeRule[]; - /** The types of projects that this capability set is available for. */ - projectTypes?: string[]; - /** The Atlassian provided system rules available. */ - systemRules?: AvailableWorkflowSystemRule[]; - /** The trigger rules available. */ - triggerRules?: AvailableWorkflowTriggers[]; -} diff --git a/src/version2/models/workflowCondition.ts b/src/version2/models/workflowCondition.mts similarity index 100% rename from src/version2/models/workflowCondition.ts rename to src/version2/models/workflowCondition.mts diff --git a/src/version2/models/workflowCreate.mts b/src/version2/models/workflowCreate.mts new file mode 100644 index 000000000..b93e50922 --- /dev/null +++ b/src/version2/models/workflowCreate.mts @@ -0,0 +1,16 @@ +import { StatusLayoutUpdate } from './statusLayoutUpdate.mjs'; +import { TransitionUpdateDTO } from './transitionUpdateDTO.mjs'; +import { WorkflowLayout } from './workflowLayout.mjs'; + +/** The details of the workflows to create. */ +export interface WorkflowCreate { + /** The description of the workflow to create. */ + description?: string; + /** The name of the workflow to create. */ + name: string; + startPointLayout?: WorkflowLayout; + /** The statuses associated with this workflow. */ + statuses: StatusLayoutUpdate[]; + /** The transitions of this workflow. */ + transitions: TransitionUpdateDTO[]; +} diff --git a/src/version2/models/workflowCreate.ts b/src/version2/models/workflowCreate.ts deleted file mode 100644 index 94e98b2a3..000000000 --- a/src/version2/models/workflowCreate.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { StatusLayoutUpdate } from './statusLayoutUpdate.js'; -import type { TransitionUpdateDTO } from './transitionUpdateDTO.js'; -import type { WorkflowLayout } from './workflowLayout.js'; - -/** The details of the workflows to create. */ -export interface WorkflowCreate { - /** The description of the workflow to create. */ - description?: string; - /** The name of the workflow to create. */ - name: string; - startPointLayout?: WorkflowLayout; - /** The statuses associated with this workflow. */ - statuses: StatusLayoutUpdate[]; - /** The transitions of this workflow. */ - transitions: TransitionUpdateDTO[]; -} diff --git a/src/version2/models/workflowCreateRequest.mts b/src/version2/models/workflowCreateRequest.mts new file mode 100644 index 000000000..af6ab2c3f --- /dev/null +++ b/src/version2/models/workflowCreateRequest.mts @@ -0,0 +1,12 @@ +import { WorkflowCreate } from './workflowCreate.mjs'; +import { WorkflowScope } from './workflowScope.mjs'; +import { WorkflowStatusUpdate } from './workflowStatusUpdate.mjs'; + +/** The create workflows payload. */ +export interface WorkflowCreateRequest { + scope: WorkflowScope; + /** The statuses to associate with the workflows. */ + statuses: WorkflowStatusUpdate[]; + /** The details of the workflows to create. */ + workflows: WorkflowCreate[]; +} diff --git a/src/version2/models/workflowCreateRequest.ts b/src/version2/models/workflowCreateRequest.ts deleted file mode 100644 index 73aa27cd8..000000000 --- a/src/version2/models/workflowCreateRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { WorkflowCreate } from './workflowCreate.js'; -import type { WorkflowScope } from './workflowScope.js'; -import type { WorkflowStatusUpdate } from './workflowStatusUpdate.js'; - -/** The create workflows payload. */ -export interface WorkflowCreateRequest { - scope: WorkflowScope; - /** The statuses to associate with the workflows. */ - statuses: WorkflowStatusUpdate[]; - /** The details of the workflows to create. */ - workflows: WorkflowCreate[]; -} diff --git a/src/version2/models/workflowCreateResponse.mts b/src/version2/models/workflowCreateResponse.mts new file mode 100644 index 000000000..16f5c2bcc --- /dev/null +++ b/src/version2/models/workflowCreateResponse.mts @@ -0,0 +1,10 @@ +import { JiraWorkflow } from './jiraWorkflow.mjs'; +import { JiraWorkflowStatus } from './jiraWorkflowStatus.mjs'; + +/** Details of the created workflows and statuses. */ +export interface WorkflowCreateResponse { + /** List of created statuses. */ + statuses?: JiraWorkflowStatus[]; + /** List of created workflows. */ + workflows?: JiraWorkflow[]; +} diff --git a/src/version2/models/workflowCreateResponse.ts b/src/version2/models/workflowCreateResponse.ts deleted file mode 100644 index 63a1dce4b..000000000 --- a/src/version2/models/workflowCreateResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { JiraWorkflow } from './jiraWorkflow.js'; -import type { JiraWorkflowStatus } from './jiraWorkflowStatus.js'; - -/** Details of the created workflows and statuses. */ -export interface WorkflowCreateResponse { - /** List of created statuses. */ - statuses?: JiraWorkflowStatus[]; - /** List of created workflows. */ - workflows?: JiraWorkflow[]; -} diff --git a/src/version2/models/workflowElementReference.mts b/src/version2/models/workflowElementReference.mts new file mode 100644 index 000000000..ee4dfea33 --- /dev/null +++ b/src/version2/models/workflowElementReference.mts @@ -0,0 +1,14 @@ +import { ProjectAndIssueTypePair } from './projectAndIssueTypePair.mjs'; + +/** A reference to the location of the error. This will be null if the error does not refer to a specific element. */ +export interface WorkflowElementReference { + /** A property key. */ + propertyKey?: string; + /** A rule ID. */ + ruleId?: string; + statusMappingReference?: ProjectAndIssueTypePair; + /** A status reference. */ + statusReference?: string; + /** A transition ID. */ + transitionId?: string; +} diff --git a/src/version2/models/workflowElementReference.ts b/src/version2/models/workflowElementReference.ts deleted file mode 100644 index b52f864d0..000000000 --- a/src/version2/models/workflowElementReference.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { ProjectAndIssueTypePair } from './projectAndIssueTypePair.js'; - -/** A reference to the location of the error. This will be null if the error does not refer to a specific element. */ -export interface WorkflowElementReference { - /** A property key. */ - propertyKey?: string; - /** A rule ID. */ - ruleId?: string; - statusMappingReference?: ProjectAndIssueTypePair; - /** A status reference. */ - statusReference?: string; - /** A transition ID. */ - transitionId?: string; -} diff --git a/src/version2/models/workflowId.ts b/src/version2/models/workflowId.mts similarity index 100% rename from src/version2/models/workflowId.ts rename to src/version2/models/workflowId.mts diff --git a/src/version2/models/workflowLayout.ts b/src/version2/models/workflowLayout.mts similarity index 100% rename from src/version2/models/workflowLayout.ts rename to src/version2/models/workflowLayout.mts diff --git a/src/version2/models/workflowOperations.ts b/src/version2/models/workflowOperations.mts similarity index 100% rename from src/version2/models/workflowOperations.ts rename to src/version2/models/workflowOperations.mts diff --git a/src/version2/models/workflowRead.mts b/src/version2/models/workflowRead.mts new file mode 100644 index 000000000..3fbe7b2fd --- /dev/null +++ b/src/version2/models/workflowRead.mts @@ -0,0 +1,10 @@ +import { JiraWorkflow } from './jiraWorkflow.mjs'; +import { JiraWorkflowStatus } from './jiraWorkflowStatus.mjs'; + +/** Details of workflows and related statuses. */ +export interface WorkflowRead { + /** List of statuses. */ + statuses?: JiraWorkflowStatus[]; + /** List of workflows. */ + workflows?: JiraWorkflow[]; +} diff --git a/src/version2/models/workflowRead.ts b/src/version2/models/workflowRead.ts deleted file mode 100644 index 59b708c10..000000000 --- a/src/version2/models/workflowRead.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { JiraWorkflow } from './jiraWorkflow.js'; -import type { JiraWorkflowStatus } from './jiraWorkflowStatus.js'; - -/** Details of workflows and related statuses. */ -export interface WorkflowRead { - /** List of statuses. */ - statuses?: JiraWorkflowStatus[]; - /** List of workflows. */ - workflows?: JiraWorkflow[]; -} diff --git a/src/version2/models/workflowReferenceStatus.mts b/src/version2/models/workflowReferenceStatus.mts new file mode 100644 index 000000000..f3e1aed6a --- /dev/null +++ b/src/version2/models/workflowReferenceStatus.mts @@ -0,0 +1,12 @@ +import { WorkflowStatusLayout } from './workflowStatusLayout.mjs'; + +/** The statuses referenced in the workflow. */ +export interface WorkflowReferenceStatus { + /** Indicates if the status is deprecated. */ + deprecated?: boolean; + layout?: WorkflowStatusLayout; + /** The properties associated with the status. */ + properties?: {}; + /** The reference of the status. */ + statusReference?: string; +} diff --git a/src/version2/models/workflowReferenceStatus.ts b/src/version2/models/workflowReferenceStatus.ts deleted file mode 100644 index b6931c5a2..000000000 --- a/src/version2/models/workflowReferenceStatus.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { WorkflowStatusLayout } from './workflowStatusLayout.js'; - -/** The statuses referenced in the workflow. */ -export interface WorkflowReferenceStatus { - /** Indicates if the status is deprecated. */ - deprecated?: boolean; - layout?: WorkflowStatusLayout; - /** The properties associated with the status. */ - properties?: {}; - /** The reference of the status. */ - statusReference?: string; -} diff --git a/src/version2/models/workflowRuleConfiguration.ts b/src/version2/models/workflowRuleConfiguration.mts similarity index 100% rename from src/version2/models/workflowRuleConfiguration.ts rename to src/version2/models/workflowRuleConfiguration.mts diff --git a/src/version2/models/workflowRules.mts b/src/version2/models/workflowRules.mts new file mode 100644 index 000000000..ef9ed10db --- /dev/null +++ b/src/version2/models/workflowRules.mts @@ -0,0 +1,11 @@ +import { WorkflowCondition } from './workflowCondition.mjs'; +import { WorkflowTransitionRule } from './workflowTransitionRule.mjs'; + +/** A collection of transition rules. */ +export interface WorkflowRules { + conditionsTree?: WorkflowCondition; + /** The workflow post functions. */ + postFunctions?: WorkflowTransitionRule[]; + /** The workflow validators. */ + validators?: WorkflowTransitionRule[]; +} diff --git a/src/version2/models/workflowRules.ts b/src/version2/models/workflowRules.ts deleted file mode 100644 index e7cb21a1d..000000000 --- a/src/version2/models/workflowRules.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { WorkflowCondition } from './workflowCondition.js'; -import type { WorkflowTransitionRule } from './workflowTransitionRule.js'; - -/** A collection of transition rules. */ -export interface WorkflowRules { - conditionsTree?: WorkflowCondition; - /** The workflow post functions. */ - postFunctions?: WorkflowTransitionRule[]; - /** The workflow validators. */ - validators?: WorkflowTransitionRule[]; -} diff --git a/src/version2/models/workflowRulesSearch.ts b/src/version2/models/workflowRulesSearch.mts similarity index 100% rename from src/version2/models/workflowRulesSearch.ts rename to src/version2/models/workflowRulesSearch.mts diff --git a/src/version2/models/workflowRulesSearchDetails.mts b/src/version2/models/workflowRulesSearchDetails.mts new file mode 100644 index 000000000..89d3ff9b1 --- /dev/null +++ b/src/version2/models/workflowRulesSearchDetails.mts @@ -0,0 +1,11 @@ +import type { WorkflowTransitionRules } from './workflowTransitionRules.mjs'; + +/** Details of workflow transition rules. */ +export interface WorkflowRulesSearchDetails { + /** List of workflow rule IDs that do not belong to the workflow or can not be found. */ + invalidRules?: string[]; + /** List of valid workflow transition rules. */ + validRules?: WorkflowTransitionRules[]; + /** The workflow ID. */ + workflowEntityId?: string; +} diff --git a/src/version2/models/workflowRulesSearchDetails.ts b/src/version2/models/workflowRulesSearchDetails.ts deleted file mode 100644 index 9c7da0492..000000000 --- a/src/version2/models/workflowRulesSearchDetails.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { WorkflowTransitionRules } from './workflowTransitionRules.js'; - -/** Details of workflow transition rules. */ -export interface WorkflowRulesSearchDetails { - /** List of workflow rule IDs that do not belong to the workflow or can not be found. */ - invalidRules?: string[]; - /** List of valid workflow transition rules. */ - validRules?: WorkflowTransitionRules[]; - /** The workflow ID. */ - workflowEntityId?: string; -} diff --git a/src/version2/models/workflowScheme.mts b/src/version2/models/workflowScheme.mts new file mode 100644 index 000000000..8d82b8e17 --- /dev/null +++ b/src/version2/models/workflowScheme.mts @@ -0,0 +1,61 @@ +import { User } from './user.mjs'; + +/** Details about a workflow scheme. */ +export interface WorkflowScheme { + /** + * The name of the default workflow for the workflow scheme. The default workflow has _All Unassigned Issue Types_ + * assigned to it in Jira. If `defaultWorkflow` is not specified when creating a workflow scheme, it is set to _Jira + * Workflow (jira)_. + */ + defaultWorkflow?: string; + /** The description of the workflow scheme. */ + description?: string; + /** Whether the workflow scheme is a draft or not. */ + draft?: boolean; + /** The ID of the workflow scheme. */ + id?: number; + /** + * The issue type to workflow mappings, where each mapping is an issue type ID and workflow name pair. Note that an + * issue type can only be mapped to one workflow in a workflow scheme. + */ + issueTypeMappings?: {}; + /** The issue types available in Jira. */ + issueTypes?: {}; + /** + * The date-time that the draft workflow scheme was last modified. A modification is a change to the issue + * type-project mappings only. This property does not apply to non-draft workflows. + */ + lastModified?: string; + lastModifiedUser?: User; + /** + * The name of the workflow scheme. The name must be unique. The maximum length is 255 characters. Required when + * creating a workflow scheme. + */ + name?: string; + /** + * For draft workflow schemes, this property is the name of the default workflow for the original workflow scheme. The + * default workflow has _All Unassigned Issue Types_ assigned to it in Jira. + */ + originalDefaultWorkflow?: string; + /** + * For draft workflow schemes, this property is the issue type to workflow mappings for the original workflow scheme, + * where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one + * workflow in a workflow scheme. + */ + originalIssueTypeMappings?: {}; + self?: string; + /** + * Whether to create or update a draft workflow scheme when updating an active workflow scheme. An active workflow + * scheme is a workflow scheme that is used by at least one project. The following examples show how this property + * works: + * + * Update an active workflow scheme with `updateDraftIfNeeded` set to `true`: If a draft workflow scheme exists, it is + * updated. Otherwise, a draft workflow scheme is created. Update an active workflow scheme with `updateDraftIfNeeded` + * set to `false`: An error is returned, as active workflow schemes cannot be updated. Update an inactive workflow + * scheme with `updateDraftIfNeeded` set to `true`: The workflow scheme is updated, as inactive workflow schemes do + * not require drafts to update. + * + * Defaults to `false`. + */ + updateDraftIfNeeded?: boolean; +} diff --git a/src/version2/models/workflowScheme.ts b/src/version2/models/workflowScheme.ts deleted file mode 100644 index a894928ef..000000000 --- a/src/version2/models/workflowScheme.ts +++ /dev/null @@ -1,61 +0,0 @@ -import type { User } from './user.js'; - -/** Details about a workflow scheme. */ -export interface WorkflowScheme { - /** - * The name of the default workflow for the workflow scheme. The default workflow has _All Unassigned Issue Types_ - * assigned to it in Jira. If `defaultWorkflow` is not specified when creating a workflow scheme, it is set to _Jira - * Workflow (jira)_. - */ - defaultWorkflow?: string; - /** The description of the workflow scheme. */ - description?: string; - /** Whether the workflow scheme is a draft or not. */ - draft?: boolean; - /** The ID of the workflow scheme. */ - id?: number; - /** - * The issue type to workflow mappings, where each mapping is an issue type ID and workflow name pair. Note that an - * issue type can only be mapped to one workflow in a workflow scheme. - */ - issueTypeMappings?: {}; - /** The issue types available in Jira. */ - issueTypes?: {}; - /** - * The date-time that the draft workflow scheme was last modified. A modification is a change to the issue - * type-project mappings only. This property does not apply to non-draft workflows. - */ - lastModified?: string; - lastModifiedUser?: User; - /** - * The name of the workflow scheme. The name must be unique. The maximum length is 255 characters. Required when - * creating a workflow scheme. - */ - name?: string; - /** - * For draft workflow schemes, this property is the name of the default workflow for the original workflow scheme. The - * default workflow has _All Unassigned Issue Types_ assigned to it in Jira. - */ - originalDefaultWorkflow?: string; - /** - * For draft workflow schemes, this property is the issue type to workflow mappings for the original workflow scheme, - * where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one - * workflow in a workflow scheme. - */ - originalIssueTypeMappings?: {}; - self?: string; - /** - * Whether to create or update a draft workflow scheme when updating an active workflow scheme. An active workflow - * scheme is a workflow scheme that is used by at least one project. The following examples show how this property - * works: - * - * Update an active workflow scheme with `updateDraftIfNeeded` set to `true`: If a draft workflow scheme exists, it is - * updated. Otherwise, a draft workflow scheme is created. Update an active workflow scheme with `updateDraftIfNeeded` - * set to `false`: An error is returned, as active workflow schemes cannot be updated. Update an inactive workflow - * scheme with `updateDraftIfNeeded` set to `true`: The workflow scheme is updated, as inactive workflow schemes do - * not require drafts to update. - * - * Defaults to `false`. - */ - updateDraftIfNeeded?: boolean; -} diff --git a/src/version2/models/workflowSchemeAssociations.mts b/src/version2/models/workflowSchemeAssociations.mts new file mode 100644 index 000000000..b14453a23 --- /dev/null +++ b/src/version2/models/workflowSchemeAssociations.mts @@ -0,0 +1,8 @@ +import type { WorkflowScheme } from './workflowScheme.mjs'; + +/** A workflow scheme along with a list of projects that use it. */ +export interface WorkflowSchemeAssociations { + /** The list of projects that use the workflow scheme. */ + projectIds: string[]; + workflowScheme?: WorkflowScheme; +} diff --git a/src/version2/models/workflowSchemeAssociations.ts b/src/version2/models/workflowSchemeAssociations.ts deleted file mode 100644 index ceef0974d..000000000 --- a/src/version2/models/workflowSchemeAssociations.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { WorkflowScheme } from './workflowScheme.js'; - -/** A workflow scheme along with a list of projects that use it. */ -export interface WorkflowSchemeAssociations { - /** The list of projects that use the workflow scheme. */ - projectIds: string[]; - workflowScheme?: WorkflowScheme; -} diff --git a/src/version2/models/workflowSchemeIdName.ts b/src/version2/models/workflowSchemeIdName.mts similarity index 100% rename from src/version2/models/workflowSchemeIdName.ts rename to src/version2/models/workflowSchemeIdName.mts diff --git a/src/version2/models/workflowSchemeProjectAssociation.ts b/src/version2/models/workflowSchemeProjectAssociation.mts similarity index 100% rename from src/version2/models/workflowSchemeProjectAssociation.ts rename to src/version2/models/workflowSchemeProjectAssociation.mts diff --git a/src/version2/models/workflowScope.mts b/src/version2/models/workflowScope.mts new file mode 100644 index 000000000..59c70d09e --- /dev/null +++ b/src/version2/models/workflowScope.mts @@ -0,0 +1,8 @@ +import type { ProjectId } from './projectId.mjs'; + +/** The scope of the workflow. */ +export interface WorkflowScope { + project?: ProjectId; + /** The scope of the workflow. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects. */ + type: string; +} diff --git a/src/version2/models/workflowScope.ts b/src/version2/models/workflowScope.ts deleted file mode 100644 index e1b7e5824..000000000 --- a/src/version2/models/workflowScope.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectId } from './projectId.js'; - -/** The scope of the workflow. */ -export interface WorkflowScope { - project?: ProjectId; - /** The scope of the workflow. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects. */ - type: string; -} diff --git a/src/version2/models/workflowStatus.mts b/src/version2/models/workflowStatus.mts new file mode 100644 index 000000000..bd34734ff --- /dev/null +++ b/src/version2/models/workflowStatus.mts @@ -0,0 +1,14 @@ +import { WorkflowStatusProperties } from './workflowStatusProperties.mjs'; + +/** Details of a workflow status. */ +export interface WorkflowStatus { + /** The ID of the issue status. */ + id: string; + /** The name of the status in the workflow. */ + name: string; + /** + * Additional properties that modify the behavior of issues in this status. Supports the properties + * `jira.issue.editable` and `issueEditable` (deprecated) that indicate whether issues are editable. + */ + properties?: WorkflowStatusProperties; +} diff --git a/src/version2/models/workflowStatus.ts b/src/version2/models/workflowStatus.ts deleted file mode 100644 index 77019f86d..000000000 --- a/src/version2/models/workflowStatus.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { WorkflowStatusProperties } from './workflowStatusProperties.js'; - -/** Details of a workflow status. */ -export interface WorkflowStatus { - /** The ID of the issue status. */ - id: string; - /** The name of the status in the workflow. */ - name: string; - /** - * Additional properties that modify the behavior of issues in this status. Supports the properties - * `jira.issue.editable` and `issueEditable` (deprecated) that indicate whether issues are editable. - */ - properties?: WorkflowStatusProperties; -} diff --git a/src/version2/models/workflowStatusAndPort.ts b/src/version2/models/workflowStatusAndPort.mts similarity index 100% rename from src/version2/models/workflowStatusAndPort.ts rename to src/version2/models/workflowStatusAndPort.mts diff --git a/src/version2/models/workflowStatusLayout.ts b/src/version2/models/workflowStatusLayout.mts similarity index 100% rename from src/version2/models/workflowStatusLayout.ts rename to src/version2/models/workflowStatusLayout.mts diff --git a/src/version2/models/workflowStatusProperties.ts b/src/version2/models/workflowStatusProperties.mts similarity index 100% rename from src/version2/models/workflowStatusProperties.ts rename to src/version2/models/workflowStatusProperties.mts diff --git a/src/version2/models/workflowStatusUpdate.ts b/src/version2/models/workflowStatusUpdate.mts similarity index 100% rename from src/version2/models/workflowStatusUpdate.ts rename to src/version2/models/workflowStatusUpdate.mts diff --git a/src/version2/models/workflowTransition.ts b/src/version2/models/workflowTransition.mts similarity index 100% rename from src/version2/models/workflowTransition.ts rename to src/version2/models/workflowTransition.mts diff --git a/src/version2/models/workflowTransitionProperty.ts b/src/version2/models/workflowTransitionProperty.mts similarity index 100% rename from src/version2/models/workflowTransitionProperty.ts rename to src/version2/models/workflowTransitionProperty.mts diff --git a/src/version2/models/workflowTransitionRule.ts b/src/version2/models/workflowTransitionRule.mts similarity index 100% rename from src/version2/models/workflowTransitionRule.ts rename to src/version2/models/workflowTransitionRule.mts diff --git a/src/version2/models/workflowTransitionRules.mts b/src/version2/models/workflowTransitionRules.mts new file mode 100644 index 000000000..b6e550ff7 --- /dev/null +++ b/src/version2/models/workflowTransitionRules.mts @@ -0,0 +1,13 @@ +import { ConnectWorkflowTransitionRule } from './connectWorkflowTransitionRule.mjs'; +import { WorkflowId } from './workflowId.mjs'; + +/** A workflow with transition rules. */ +export interface WorkflowTransitionRules { + workflowId: WorkflowId; + /** The list of post functions within the workflow. */ + postFunctions: ConnectWorkflowTransitionRule[]; + /** The list of conditions within the workflow. */ + conditions: ConnectWorkflowTransitionRule[]; + /** The list of validators within the workflow. */ + validators: ConnectWorkflowTransitionRule[]; +} diff --git a/src/version2/models/workflowTransitionRules.ts b/src/version2/models/workflowTransitionRules.ts deleted file mode 100644 index 0d52e688b..000000000 --- a/src/version2/models/workflowTransitionRules.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { ConnectWorkflowTransitionRule } from './connectWorkflowTransitionRule.js'; -import type { WorkflowId } from './workflowId.js'; - -/** A workflow with transition rules. */ -export interface WorkflowTransitionRules { - workflowId: WorkflowId; - /** The list of post functions within the workflow. */ - postFunctions: ConnectWorkflowTransitionRule[]; - /** The list of conditions within the workflow. */ - conditions: ConnectWorkflowTransitionRule[]; - /** The list of validators within the workflow. */ - validators: ConnectWorkflowTransitionRule[]; -} diff --git a/src/version2/models/workflowTransitionRulesDetails.mts b/src/version2/models/workflowTransitionRulesDetails.mts new file mode 100644 index 000000000..ca62a71f7 --- /dev/null +++ b/src/version2/models/workflowTransitionRulesDetails.mts @@ -0,0 +1,8 @@ +import { WorkflowId } from './workflowId.mjs'; + +/** Details about a workflow configuration update request. */ +export interface WorkflowTransitionRulesDetails { + workflowId: WorkflowId; + /** The list of connect workflow rule IDs. */ + workflowRuleIds: string[]; +} diff --git a/src/version2/models/workflowTransitionRulesDetails.ts b/src/version2/models/workflowTransitionRulesDetails.ts deleted file mode 100644 index 0b4422004..000000000 --- a/src/version2/models/workflowTransitionRulesDetails.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { WorkflowId } from './workflowId.js'; - -/** Details about a workflow configuration update request. */ -export interface WorkflowTransitionRulesDetails { - workflowId: WorkflowId; - /** The list of connect workflow rule IDs. */ - workflowRuleIds: string[]; -} diff --git a/src/version2/models/workflowTransitionRulesUpdate.mts b/src/version2/models/workflowTransitionRulesUpdate.mts new file mode 100644 index 000000000..882da8d8a --- /dev/null +++ b/src/version2/models/workflowTransitionRulesUpdate.mts @@ -0,0 +1,7 @@ +import type { WorkflowTransitionRules } from './workflowTransitionRules.mjs'; + +/** Details about a workflow configuration update request. */ +export interface WorkflowTransitionRulesUpdate { + /** The list of workflows with transition rules to update. */ + workflows: WorkflowTransitionRules[]; +} diff --git a/src/version2/models/workflowTransitionRulesUpdate.ts b/src/version2/models/workflowTransitionRulesUpdate.ts deleted file mode 100644 index 2e35aef39..000000000 --- a/src/version2/models/workflowTransitionRulesUpdate.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { WorkflowTransitionRules } from './workflowTransitionRules.js'; - -/** Details about a workflow configuration update request. */ -export interface WorkflowTransitionRulesUpdate { - /** The list of workflows with transition rules to update. */ - workflows: WorkflowTransitionRules[]; -} diff --git a/src/version2/models/workflowTransitionRulesUpdateErrorDetails.mts b/src/version2/models/workflowTransitionRulesUpdateErrorDetails.mts new file mode 100644 index 000000000..008fa96a2 --- /dev/null +++ b/src/version2/models/workflowTransitionRulesUpdateErrorDetails.mts @@ -0,0 +1,16 @@ +import { WorkflowId } from './workflowId.mjs'; + +/** Details of any errors encountered while updating workflow transition rules for a workflow. */ +export interface WorkflowTransitionRulesUpdateErrorDetails { + /** + * A list of transition rule update errors, indexed by the transition rule ID. Any transition rule that appears here + * wasn't updated. + */ + ruleUpdateErrors: {}; + /** + * The list of errors that specify why the workflow update failed. The workflow was not updated if the list contains + * any entries. + */ + updateErrors: string[]; + workflowId: WorkflowId; +} diff --git a/src/version2/models/workflowTransitionRulesUpdateErrorDetails.ts b/src/version2/models/workflowTransitionRulesUpdateErrorDetails.ts deleted file mode 100644 index 738c3f763..000000000 --- a/src/version2/models/workflowTransitionRulesUpdateErrorDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { WorkflowId } from './workflowId.js'; - -/** Details of any errors encountered while updating workflow transition rules for a workflow. */ -export interface WorkflowTransitionRulesUpdateErrorDetails { - /** - * A list of transition rule update errors, indexed by the transition rule ID. Any transition rule that appears here - * wasn't updated. - */ - ruleUpdateErrors: {}; - /** - * The list of errors that specify why the workflow update failed. The workflow was not updated if the list contains - * any entries. - */ - updateErrors: string[]; - workflowId: WorkflowId; -} diff --git a/src/version2/models/workflowTransitionRulesUpdateErrors.mts b/src/version2/models/workflowTransitionRulesUpdateErrors.mts new file mode 100644 index 000000000..ec25fe928 --- /dev/null +++ b/src/version2/models/workflowTransitionRulesUpdateErrors.mts @@ -0,0 +1,7 @@ +import { WorkflowTransitionRulesUpdateErrorDetails } from './workflowTransitionRulesUpdateErrorDetails.mjs'; + +/** Details of any errors encountered while updating workflow transition rules. */ +export interface WorkflowTransitionRulesUpdateErrors { + /** A list of workflows. */ + updateResults: WorkflowTransitionRulesUpdateErrorDetails[]; +} diff --git a/src/version2/models/workflowTransitionRulesUpdateErrors.ts b/src/version2/models/workflowTransitionRulesUpdateErrors.ts deleted file mode 100644 index 4409c9b7a..000000000 --- a/src/version2/models/workflowTransitionRulesUpdateErrors.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { WorkflowTransitionRulesUpdateErrorDetails } from './workflowTransitionRulesUpdateErrorDetails.js'; - -/** Details of any errors encountered while updating workflow transition rules. */ -export interface WorkflowTransitionRulesUpdateErrors { - /** A list of workflows. */ - updateResults: WorkflowTransitionRulesUpdateErrorDetails[]; -} diff --git a/src/version2/models/workflowTransitions.mts b/src/version2/models/workflowTransitions.mts new file mode 100644 index 000000000..0c70c61d3 --- /dev/null +++ b/src/version2/models/workflowTransitions.mts @@ -0,0 +1,31 @@ +import { ConditionGroupConfiguration } from './conditionGroupConfiguration.mjs'; +import { WorkflowRuleConfiguration } from './workflowRuleConfiguration.mjs'; +import { WorkflowStatusAndPort } from './workflowStatusAndPort.mjs'; +import { WorkflowTrigger } from './workflowTrigger.mjs'; + +/** The transitions of the workflow. */ +export interface WorkflowTransitions { + /** The post-functions of the transition. */ + actions?: WorkflowRuleConfiguration[]; + conditions?: ConditionGroupConfiguration; + /** The custom event ID of the transition. */ + customIssueEventId?: string; + /** The description of the transition. */ + description?: string; + /** The statuses the transition can start from. */ + from?: WorkflowStatusAndPort[]; + /** The ID of the transition. */ + id?: string; + /** The name of the transition. */ + name?: string; + /** The properties of the transition. */ + properties?: {}; + to?: WorkflowStatusAndPort; + transitionScreen?: WorkflowRuleConfiguration; + /** The triggers of the transition. */ + triggers?: WorkflowTrigger[]; + /** The transition type. */ + type?: string; + /** The validators of the transition. */ + validators?: WorkflowRuleConfiguration[]; +} diff --git a/src/version2/models/workflowTransitions.ts b/src/version2/models/workflowTransitions.ts deleted file mode 100644 index 046f8118e..000000000 --- a/src/version2/models/workflowTransitions.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { ConditionGroupConfiguration } from './conditionGroupConfiguration.js'; -import type { WorkflowRuleConfiguration } from './workflowRuleConfiguration.js'; -import type { WorkflowStatusAndPort } from './workflowStatusAndPort.js'; -import type { WorkflowTrigger } from './workflowTrigger.js'; - -/** The transitions of the workflow. */ -export interface WorkflowTransitions { - /** The post-functions of the transition. */ - actions?: WorkflowRuleConfiguration[]; - conditions?: ConditionGroupConfiguration; - /** The custom event ID of the transition. */ - customIssueEventId?: string; - /** The description of the transition. */ - description?: string; - /** The statuses the transition can start from. */ - from?: WorkflowStatusAndPort[]; - /** The ID of the transition. */ - id?: string; - /** The name of the transition. */ - name?: string; - /** The properties of the transition. */ - properties?: {}; - to?: WorkflowStatusAndPort; - transitionScreen?: WorkflowRuleConfiguration; - /** The triggers of the transition. */ - triggers?: WorkflowTrigger[]; - /** The transition type. */ - type?: string; - /** The validators of the transition. */ - validators?: WorkflowRuleConfiguration[]; -} diff --git a/src/version2/models/workflowTrigger.ts b/src/version2/models/workflowTrigger.mts similarity index 100% rename from src/version2/models/workflowTrigger.ts rename to src/version2/models/workflowTrigger.mts diff --git a/src/version2/models/workflowUpdate.mts b/src/version2/models/workflowUpdate.mts new file mode 100644 index 000000000..6ca41f24f --- /dev/null +++ b/src/version2/models/workflowUpdate.mts @@ -0,0 +1,24 @@ +import { DocumentVersion } from './documentVersion.mjs'; +import { StatusLayoutUpdate } from './statusLayoutUpdate.mjs'; +import { StatusMappingDTO } from './statusMappingDTO.mjs'; +import { StatusMigration } from './statusMigration.mjs'; +import { TransitionUpdateDTO } from './transitionUpdateDTO.mjs'; +import { WorkflowLayout } from './workflowLayout.mjs'; + +/** The details of the workflows to update. */ +export interface WorkflowUpdate { + /** The mapping of old to new status ID. */ + defaultStatusMappings?: StatusMigration[]; + /** The new description for this workflow. */ + description?: string; + /** The ID of this workflow. */ + id: string; + startPointLayout?: WorkflowLayout; + /** The mapping of old to new status ID for a specific project and issue type. */ + statusMappings?: StatusMappingDTO[]; + /** The statuses associated with this workflow. */ + statuses: StatusLayoutUpdate[]; + /** The transitions of this workflow. */ + transitions: TransitionUpdateDTO[]; + version: DocumentVersion; +} diff --git a/src/version2/models/workflowUpdate.ts b/src/version2/models/workflowUpdate.ts deleted file mode 100644 index 906965cc1..000000000 --- a/src/version2/models/workflowUpdate.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { DocumentVersion } from './documentVersion.js'; -import type { StatusLayoutUpdate } from './statusLayoutUpdate.js'; -import type { StatusMappingDTO } from './statusMappingDTO.js'; -import type { StatusMigration } from './statusMigration.js'; -import type { TransitionUpdateDTO } from './transitionUpdateDTO.js'; -import type { WorkflowLayout } from './workflowLayout.js'; - -/** The details of the workflows to update. */ -export interface WorkflowUpdate { - /** The mapping of old to new status ID. */ - defaultStatusMappings?: StatusMigration[]; - /** The new description for this workflow. */ - description?: string; - /** The ID of this workflow. */ - id: string; - startPointLayout?: WorkflowLayout; - /** The mapping of old to new status ID for a specific project and issue type. */ - statusMappings?: StatusMappingDTO[]; - /** The statuses associated with this workflow. */ - statuses: StatusLayoutUpdate[]; - /** The transitions of this workflow. */ - transitions: TransitionUpdateDTO[]; - version: DocumentVersion; -} diff --git a/src/version2/models/workflowUpdateRequest.mts b/src/version2/models/workflowUpdateRequest.mts new file mode 100644 index 000000000..da2ff7f8e --- /dev/null +++ b/src/version2/models/workflowUpdateRequest.mts @@ -0,0 +1,10 @@ +import { WorkflowStatusUpdate } from './workflowStatusUpdate.mjs'; +import { WorkflowUpdate } from './workflowUpdate.mjs'; + +/** The update workflows payload. */ +export interface WorkflowUpdateRequest { + /** The statuses to associate with the workflows. */ + statuses: WorkflowStatusUpdate[]; + /** The details of the workflows to update. */ + workflows: WorkflowUpdate[]; +} diff --git a/src/version2/models/workflowUpdateRequest.ts b/src/version2/models/workflowUpdateRequest.ts deleted file mode 100644 index cb5ab9aab..000000000 --- a/src/version2/models/workflowUpdateRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { WorkflowStatusUpdate } from './workflowStatusUpdate.js'; -import type { WorkflowUpdate } from './workflowUpdate.js'; - -/** The update workflows payload. */ -export interface WorkflowUpdateRequest { - /** The statuses to associate with the workflows. */ - statuses: WorkflowStatusUpdate[]; - /** The details of the workflows to update. */ - workflows: WorkflowUpdate[]; -} diff --git a/src/version2/models/workflowUpdateResponse.mts b/src/version2/models/workflowUpdateResponse.mts new file mode 100644 index 000000000..ad3b424cf --- /dev/null +++ b/src/version2/models/workflowUpdateResponse.mts @@ -0,0 +1,11 @@ +import { JiraWorkflow } from './jiraWorkflow.mjs'; +import { JiraWorkflowStatus } from './jiraWorkflowStatus.mjs'; + +export interface WorkflowUpdateResponse { + /** List of updated statuses. */ + statuses?: JiraWorkflowStatus[]; + /** If there is a [asynchronous task](#async-operations) operation, as a result of this update. */ + taskId?: string; + /** List of updated workflows. */ + workflows?: JiraWorkflow[]; +} diff --git a/src/version2/models/workflowUpdateResponse.ts b/src/version2/models/workflowUpdateResponse.ts deleted file mode 100644 index 26e4610e0..000000000 --- a/src/version2/models/workflowUpdateResponse.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { JiraWorkflow } from './jiraWorkflow.js'; -import type { JiraWorkflowStatus } from './jiraWorkflowStatus.js'; - -export interface WorkflowUpdateResponse { - /** List of updated statuses. */ - statuses?: JiraWorkflowStatus[]; - /** If there is a [asynchronous task](#async-operations) operation, as a result of this update. */ - taskId?: string; - /** List of updated workflows. */ - workflows?: JiraWorkflow[]; -} diff --git a/src/version2/models/workflowValidationError.mts b/src/version2/models/workflowValidationError.mts new file mode 100644 index 000000000..a16bd11d0 --- /dev/null +++ b/src/version2/models/workflowValidationError.mts @@ -0,0 +1,14 @@ +import { WorkflowElementReference } from './workflowElementReference.mjs'; + +/** The details about a workflow validation error. */ +export interface WorkflowValidationError { + /** An error code. */ + code?: string; + elementReference?: WorkflowElementReference; + /** The validation error level. */ + level?: string; + /** An error message. */ + message?: string; + /** The type of element the error or warning references. */ + type?: string; +} diff --git a/src/version2/models/workflowValidationError.ts b/src/version2/models/workflowValidationError.ts deleted file mode 100644 index 5c4bc3f38..000000000 --- a/src/version2/models/workflowValidationError.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { WorkflowElementReference } from './workflowElementReference.js'; - -/** The details about a workflow validation error. */ -export interface WorkflowValidationError { - /** An error code. */ - code?: string; - elementReference?: WorkflowElementReference; - /** The validation error level. */ - level?: string; - /** An error message. */ - message?: string; - /** The type of element the error or warning references. */ - type?: string; -} diff --git a/src/version2/models/workflowValidationErrorList.mts b/src/version2/models/workflowValidationErrorList.mts new file mode 100644 index 000000000..a731f8684 --- /dev/null +++ b/src/version2/models/workflowValidationErrorList.mts @@ -0,0 +1,6 @@ +import { WorkflowValidationError } from './workflowValidationError.mjs'; + +export interface WorkflowValidationErrorList { + /** The list of validation errors. */ + errors?: WorkflowValidationError[]; +} diff --git a/src/version2/models/workflowValidationErrorList.ts b/src/version2/models/workflowValidationErrorList.ts deleted file mode 100644 index 2d5da7229..000000000 --- a/src/version2/models/workflowValidationErrorList.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { WorkflowValidationError } from './workflowValidationError.js'; - -export interface WorkflowValidationErrorList { - /** The list of validation errors. */ - errors?: WorkflowValidationError[]; -} diff --git a/src/version2/models/workflowsWithTransitionRulesDetails.mts b/src/version2/models/workflowsWithTransitionRulesDetails.mts new file mode 100644 index 000000000..6a5b35ed9 --- /dev/null +++ b/src/version2/models/workflowsWithTransitionRulesDetails.mts @@ -0,0 +1,7 @@ +import { WorkflowTransitionRulesDetails } from './workflowTransitionRulesDetails.mjs'; + +/** Details of workflows and their transition rules to delete. */ +export interface WorkflowsWithTransitionRulesDetails { + /** The list of workflows with transition rules to delete. */ + workflows: WorkflowTransitionRulesDetails[]; +} diff --git a/src/version2/models/workflowsWithTransitionRulesDetails.ts b/src/version2/models/workflowsWithTransitionRulesDetails.ts deleted file mode 100644 index fb1b5197c..000000000 --- a/src/version2/models/workflowsWithTransitionRulesDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { WorkflowTransitionRulesDetails } from './workflowTransitionRulesDetails.js'; - -/** Details of workflows and their transition rules to delete. */ -export interface WorkflowsWithTransitionRulesDetails { - /** The list of workflows with transition rules to delete. */ - workflows: WorkflowTransitionRulesDetails[]; -} diff --git a/src/version2/models/worklog.mts b/src/version2/models/worklog.mts new file mode 100644 index 000000000..5533507f6 --- /dev/null +++ b/src/version2/models/worklog.mts @@ -0,0 +1,40 @@ +import { EntityProperty } from './entityProperty.mjs'; +import { UserDetails } from './userDetails.mjs'; +import { Visibility } from './visibility.mjs'; + +/** Details of a worklog. */ +export interface Worklog { + author?: UserDetails; + /** A comment about the worklog. Optional when creating or updating a worklog. */ + comment?: string; + /** The datetime on which the worklog was created. */ + created?: string; + /** The ID of the worklog record. */ + id?: string; + /** The ID of the issue this worklog is for. */ + issueId?: string; + /** Details of properties for the worklog. Optional when creating or updating a worklog. */ + properties?: EntityProperty[]; + /** The URL of the worklog item. */ + self?: string; + /** + * The datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a + * worklog. + */ + started?: string; + /** + * The time spent working on the issue as days (#d), hours (#h), or minutes (#m or #). Required when creating a + * worklog if `timeSpentSeconds` isn't provided. Optional when updating a worklog. Cannot be provided if + * `timeSpentSecond` is provided. + */ + timeSpent?: string; + /** + * The time in seconds spent working on the issue. Required when creating a worklog if `timeSpent` isn't provided. + * Optional when updating a worklog. Cannot be provided if `timeSpent` is provided. + */ + timeSpentSeconds?: number; + updateAuthor?: UserDetails; + /** The datetime on which the worklog was last updated. */ + updated?: string; + visibility?: Visibility; +} diff --git a/src/version2/models/worklog.ts b/src/version2/models/worklog.ts deleted file mode 100644 index 7e0dc6966..000000000 --- a/src/version2/models/worklog.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { EntityProperty } from './entityProperty.js'; -import type { UserDetails } from './userDetails.js'; -import type { Visibility } from './visibility.js'; - -/** Details of a worklog. */ -export interface Worklog { - author?: UserDetails; - /** A comment about the worklog. Optional when creating or updating a worklog. */ - comment?: string; - /** The datetime on which the worklog was created. */ - created?: string; - /** The ID of the worklog record. */ - id?: string; - /** The ID of the issue this worklog is for. */ - issueId?: string; - /** Details of properties for the worklog. Optional when creating or updating a worklog. */ - properties?: EntityProperty[]; - /** The URL of the worklog item. */ - self?: string; - /** - * The datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a - * worklog. - */ - started?: string; - /** - * The time spent working on the issue as days (#d), hours (#h), or minutes (#m or #). Required when creating a - * worklog if `timeSpentSeconds` isn't provided. Optional when updating a worklog. Cannot be provided if - * `timeSpentSecond` is provided. - */ - timeSpent?: string; - /** - * The time in seconds spent working on the issue. Required when creating a worklog if `timeSpent` isn't provided. - * Optional when updating a worklog. Cannot be provided if `timeSpent` is provided. - */ - timeSpentSeconds?: number; - updateAuthor?: UserDetails; - /** The datetime on which the worklog was last updated. */ - updated?: string; - visibility?: Visibility; -} diff --git a/src/version2/models/worklogIdsRequest.ts b/src/version2/models/worklogIdsRequest.mts similarity index 100% rename from src/version2/models/worklogIdsRequest.ts rename to src/version2/models/worklogIdsRequest.mts diff --git a/src/version2/myself.mts b/src/version2/myself.mts new file mode 100644 index 000000000..f6a305cba --- /dev/null +++ b/src/version2/myself.mts @@ -0,0 +1,234 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Myself { + constructor(private client: Client) {} + + /** + * Returns the value of a preference of the current user. + * + * Note that these keys are deprecated: + * + * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the + * instance. + * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the + * instance. + * + * Use [ Update a user + * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) + * from the user management REST API to manage timezone and locale instead. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPreference(parameters: Parameters.GetPreference, callback: Callback): Promise; + /** + * Returns the value of a preference of the current user. + * + * Note that these keys are deprecated: + * + * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the + * instance. + * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the + * instance. + * + * Use [ Update a user + * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) + * from the user management REST API to manage timezone and locale instead. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPreference(parameters: Parameters.GetPreference, callback?: never): Promise; + async getPreference(parameters: Parameters.GetPreference, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/mypreferences', + method: 'GET', + params: { + key: parameters.key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, + * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the + * following keys define system preferences that can be set or created: + * + * - _user.notifications.mimetype_ The mime type used in notifications sent to the user. Defaults to `html`. + * - _user.notify.own.changes_ Whether the user gets notified of their own changes. Defaults to `false`. + * - _user.default.share.private_ Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. + * Defaults to `true`. + * - _user.keyboard.shortcuts.disabled_ Whether keyboard shortcuts are disabled. Defaults to `false`. + * - _user.autowatch.disabled_ Whether the user automatically watches issues they create or add a comment to. By + * default, not set: the user takes the instance autowatch setting. + * + * Note that these keys are deprecated: + * + * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. + * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. + * + * Use [ Update a user + * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) + * from the user management REST API to manage timezone and locale instead. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async setPreference(parameters: Parameters.SetPreference, callback: Callback): Promise; + /** + * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, + * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the + * following keys define system preferences that can be set or created: + * + * - _user.notifications.mimetype_ The mime type used in notifications sent to the user. Defaults to `html`. + * - _user.notify.own.changes_ Whether the user gets notified of their own changes. Defaults to `false`. + * - _user.default.share.private_ Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. + * Defaults to `true`. + * - _user.keyboard.shortcuts.disabled_ Whether keyboard shortcuts are disabled. Defaults to `false`. + * - _user.autowatch.disabled_ Whether the user automatically watches issues they create or add a comment to. By + * default, not set: the user takes the instance autowatch setting. + * + * Note that these keys are deprecated: + * + * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. + * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. + * + * Use [ Update a user + * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) + * from the user management REST API to manage timezone and locale instead. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async setPreference(parameters: Parameters.SetPreference, callback?: never): Promise; + async setPreference(parameters: Parameters.SetPreference, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/mypreferences', + method: 'PUT', + headers: { + 'Content-Type': typeof parameters.value === 'string' ? 'text/plain' : 'application/json', + }, + params: { + key: parameters.key, + }, + data: parameters.value, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a preference of the user, which restores the default value of system defined settings. + * + * Note that these keys are deprecated: + * + * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. + * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. + * + * Use [ Update a user + * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) + * from the user management REST API to manage timezone and locale instead. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async removePreference(parameters: Parameters.RemovePreference, callback: Callback): Promise; + /** + * Deletes a preference of the user, which restores the default value of system defined settings. + * + * Note that these keys are deprecated: + * + * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. + * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. + * + * Use [ Update a user + * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) + * from the user management REST API to manage timezone and locale instead. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async removePreference(parameters: Parameters.RemovePreference, callback?: never): Promise; + async removePreference(parameters: Parameters.RemovePreference, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/mypreferences', + method: 'DELETE', + params: { + key: parameters.key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the locale for the user. + * + * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, + * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header + * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getLocale(callback: Callback): Promise; + /** + * Returns the locale for the user. + * + * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, + * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header + * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getLocale(callback?: never): Promise; + async getLocale(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/mypreferences/locale', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns details for the current user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getCurrentUser( + parameters: Parameters.GetCurrentUser | undefined, + callback: Callback, + ): Promise; + /** + * Returns details for the current user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getCurrentUser(parameters?: Parameters.GetCurrentUser, callback?: never): Promise; + async getCurrentUser( + parameters?: Parameters.GetCurrentUser, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/myself', + method: 'GET', + params: { + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/myself.ts b/src/version2/myself.ts deleted file mode 100644 index c8fc67c00..000000000 --- a/src/version2/myself.ts +++ /dev/null @@ -1,234 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Myself { - constructor(private client: Client) {} - - /** - * Returns the value of a preference of the current user. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the - * instance. - * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the - * instance. - * - * Use [ Update a user - * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) - * from the user management REST API to manage timezone and locale instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPreference(parameters: Parameters.GetPreference, callback: Callback): Promise; - /** - * Returns the value of a preference of the current user. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the - * instance. - * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the - * instance. - * - * Use [ Update a user - * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) - * from the user management REST API to manage timezone and locale instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPreference(parameters: Parameters.GetPreference, callback?: never): Promise; - async getPreference(parameters: Parameters.GetPreference, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/mypreferences', - method: 'GET', - params: { - key: parameters.key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, - * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the - * following keys define system preferences that can be set or created: - * - * - _user.notifications.mimetype_ The mime type used in notifications sent to the user. Defaults to `html`. - * - _user.notify.own.changes_ Whether the user gets notified of their own changes. Defaults to `false`. - * - _user.default.share.private_ Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. - * Defaults to `true`. - * - _user.keyboard.shortcuts.disabled_ Whether keyboard shortcuts are disabled. Defaults to `false`. - * - _user.autowatch.disabled_ Whether the user automatically watches issues they create or add a comment to. By - * default, not set: the user takes the instance autowatch setting. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. - * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. - * - * Use [ Update a user - * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) - * from the user management REST API to manage timezone and locale instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async setPreference(parameters: Parameters.SetPreference, callback: Callback): Promise; - /** - * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, - * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the - * following keys define system preferences that can be set or created: - * - * - _user.notifications.mimetype_ The mime type used in notifications sent to the user. Defaults to `html`. - * - _user.notify.own.changes_ Whether the user gets notified of their own changes. Defaults to `false`. - * - _user.default.share.private_ Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. - * Defaults to `true`. - * - _user.keyboard.shortcuts.disabled_ Whether keyboard shortcuts are disabled. Defaults to `false`. - * - _user.autowatch.disabled_ Whether the user automatically watches issues they create or add a comment to. By - * default, not set: the user takes the instance autowatch setting. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. - * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. - * - * Use [ Update a user - * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) - * from the user management REST API to manage timezone and locale instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async setPreference(parameters: Parameters.SetPreference, callback?: never): Promise; - async setPreference(parameters: Parameters.SetPreference, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/mypreferences', - method: 'PUT', - headers: { - 'Content-Type': typeof parameters.value === 'string' ? 'text/plain' : 'application/json', - }, - params: { - key: parameters.key, - }, - data: parameters.value, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a preference of the user, which restores the default value of system defined settings. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. - * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. - * - * Use [ Update a user - * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) - * from the user management REST API to manage timezone and locale instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async removePreference(parameters: Parameters.RemovePreference, callback: Callback): Promise; - /** - * Deletes a preference of the user, which restores the default value of system defined settings. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. - * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. - * - * Use [ Update a user - * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) - * from the user management REST API to manage timezone and locale instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async removePreference(parameters: Parameters.RemovePreference, callback?: never): Promise; - async removePreference(parameters: Parameters.RemovePreference, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/mypreferences', - method: 'DELETE', - params: { - key: parameters.key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the locale for the user. - * - * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, - * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header - * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getLocale(callback: Callback): Promise; - /** - * Returns the locale for the user. - * - * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, - * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header - * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getLocale(callback?: never): Promise; - async getLocale(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/mypreferences/locale', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns details for the current user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getCurrentUser( - parameters: Parameters.GetCurrentUser | undefined, - callback: Callback, - ): Promise; - /** - * Returns details for the current user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getCurrentUser(parameters?: Parameters.GetCurrentUser, callback?: never): Promise; - async getCurrentUser( - parameters?: Parameters.GetCurrentUser, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/myself', - method: 'GET', - params: { - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/parameters/addActorUsers.mts b/src/version2/parameters/addActorUsers.mts new file mode 100644 index 000000000..084642245 --- /dev/null +++ b/src/version2/parameters/addActorUsers.mts @@ -0,0 +1,11 @@ +import { ActorsMap } from '../models/index.mjs'; + +export interface AddActorUsers extends ActorsMap { + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: string; + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: number; +} diff --git a/src/version2/parameters/addActorUsers.ts b/src/version2/parameters/addActorUsers.ts deleted file mode 100644 index f6b37f2d1..000000000 --- a/src/version2/parameters/addActorUsers.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ActorsMap } from '../models/index.js'; - -export interface AddActorUsers extends ActorsMap { - /** The project ID or project key (case-sensitive). */ - projectIdOrKey: string; - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version2/parameters/addAttachment.ts b/src/version2/parameters/addAttachment.mts similarity index 100% rename from src/version2/parameters/addAttachment.ts rename to src/version2/parameters/addAttachment.mts diff --git a/src/version2/parameters/addComment.mts b/src/version2/parameters/addComment.mts new file mode 100644 index 000000000..d53266cda --- /dev/null +++ b/src/version2/parameters/addComment.mts @@ -0,0 +1,12 @@ +import { Comment } from '../models/index.mjs'; + +export interface AddComment extends Comment { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body + * rendered in HTML. + */ + expand?: string; +} diff --git a/src/version2/parameters/addComment.ts b/src/version2/parameters/addComment.ts deleted file mode 100644 index 60bc9ead1..000000000 --- a/src/version2/parameters/addComment.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Comment } from '../models/index.js'; - -export interface AddComment extends Comment { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body - * rendered in HTML. - */ - expand?: string; -} diff --git a/src/version2/parameters/addFieldToDefaultScreen.ts b/src/version2/parameters/addFieldToDefaultScreen.mts similarity index 100% rename from src/version2/parameters/addFieldToDefaultScreen.ts rename to src/version2/parameters/addFieldToDefaultScreen.mts diff --git a/src/version2/parameters/addGadget.mts b/src/version2/parameters/addGadget.mts new file mode 100644 index 000000000..52cfa03f8 --- /dev/null +++ b/src/version2/parameters/addGadget.mts @@ -0,0 +1,6 @@ +import { DashboardGadgetSettings } from '../models/index.mjs'; + +export interface AddGadget extends DashboardGadgetSettings { + /** The ID of the dashboard. */ + dashboardId: number; +} diff --git a/src/version2/parameters/addGadget.ts b/src/version2/parameters/addGadget.ts deleted file mode 100644 index 4181f8fec..000000000 --- a/src/version2/parameters/addGadget.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DashboardGadgetSettings } from '../models/index.js'; - -export interface AddGadget extends DashboardGadgetSettings { - /** The ID of the dashboard. */ - dashboardId: number; -} diff --git a/src/version2/parameters/addIssueTypesToContext.mts b/src/version2/parameters/addIssueTypesToContext.mts new file mode 100644 index 000000000..973ad9e1b --- /dev/null +++ b/src/version2/parameters/addIssueTypesToContext.mts @@ -0,0 +1,8 @@ +import { IssueTypeIds } from '../models/index.mjs'; + +export interface AddIssueTypesToContext extends IssueTypeIds { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/addIssueTypesToContext.ts b/src/version2/parameters/addIssueTypesToContext.ts deleted file mode 100644 index cb71755b9..000000000 --- a/src/version2/parameters/addIssueTypesToContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypeIds } from '../models/index.js'; - -export interface AddIssueTypesToContext extends IssueTypeIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/addIssueTypesToIssueTypeScheme.mts b/src/version2/parameters/addIssueTypesToIssueTypeScheme.mts new file mode 100644 index 000000000..e8768623b --- /dev/null +++ b/src/version2/parameters/addIssueTypesToIssueTypeScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeIds } from '../models/index.mjs'; + +export interface AddIssueTypesToIssueTypeScheme extends IssueTypeIds { + /** The ID of the issue type scheme. */ + issueTypeSchemeId: number; +} diff --git a/src/version2/parameters/addIssueTypesToIssueTypeScheme.ts b/src/version2/parameters/addIssueTypesToIssueTypeScheme.ts deleted file mode 100644 index a64a18724..000000000 --- a/src/version2/parameters/addIssueTypesToIssueTypeScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeIds } from '../models/index.js'; - -export interface AddIssueTypesToIssueTypeScheme extends IssueTypeIds { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; -} diff --git a/src/version2/parameters/addProjectRoleActorsToRole.mts b/src/version2/parameters/addProjectRoleActorsToRole.mts new file mode 100644 index 000000000..7e575742a --- /dev/null +++ b/src/version2/parameters/addProjectRoleActorsToRole.mts @@ -0,0 +1,9 @@ +import { ActorInput } from '../models/index.mjs'; + +export interface AddProjectRoleActorsToRole extends ActorInput { + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: number; +} diff --git a/src/version2/parameters/addProjectRoleActorsToRole.ts b/src/version2/parameters/addProjectRoleActorsToRole.ts deleted file mode 100644 index 539250fc6..000000000 --- a/src/version2/parameters/addProjectRoleActorsToRole.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ActorInput } from '../models/index.js'; - -export interface AddProjectRoleActorsToRole extends ActorInput { - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version2/parameters/addScreenTab.mts b/src/version2/parameters/addScreenTab.mts new file mode 100644 index 000000000..3ce2f3a87 --- /dev/null +++ b/src/version2/parameters/addScreenTab.mts @@ -0,0 +1,6 @@ +import { ScreenableTab } from '../models/index.mjs'; + +export interface AddScreenTab extends ScreenableTab { + /** The ID of the screen. */ + screenId: number; +} diff --git a/src/version2/parameters/addScreenTab.ts b/src/version2/parameters/addScreenTab.ts deleted file mode 100644 index 4b6ceee0e..000000000 --- a/src/version2/parameters/addScreenTab.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ScreenableTab } from '../models/index.js'; - -export interface AddScreenTab extends ScreenableTab { - /** The ID of the screen. */ - screenId: number; -} diff --git a/src/version2/parameters/addScreenTabField.mts b/src/version2/parameters/addScreenTabField.mts new file mode 100644 index 000000000..5bff26210 --- /dev/null +++ b/src/version2/parameters/addScreenTabField.mts @@ -0,0 +1,8 @@ +import { AddField } from '../models/index.mjs'; + +export interface AddScreenTabField extends AddField { + /** The ID of the screen. */ + screenId: number; + /** The ID of the screen tab. */ + tabId: number; +} diff --git a/src/version2/parameters/addScreenTabField.ts b/src/version2/parameters/addScreenTabField.ts deleted file mode 100644 index ddbb186ec..000000000 --- a/src/version2/parameters/addScreenTabField.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { AddField } from '../models/index.js'; - -export interface AddScreenTabField extends AddField { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; -} diff --git a/src/version2/parameters/addSecurityLevel.mts b/src/version2/parameters/addSecurityLevel.mts new file mode 100644 index 000000000..689187427 --- /dev/null +++ b/src/version2/parameters/addSecurityLevel.mts @@ -0,0 +1,6 @@ +import { AddSecuritySchemeLevelsRequest } from '../models/index.mjs'; + +export interface AddSecurityLevel extends AddSecuritySchemeLevelsRequest { + /** The ID of the issue security scheme. */ + schemeId: string; +} diff --git a/src/version2/parameters/addSecurityLevel.ts b/src/version2/parameters/addSecurityLevel.ts deleted file mode 100644 index d44c0103b..000000000 --- a/src/version2/parameters/addSecurityLevel.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AddSecuritySchemeLevelsRequest } from '../models/index.js'; - -export interface AddSecurityLevel extends AddSecuritySchemeLevelsRequest { - /** The ID of the issue security scheme. */ - schemeId: string; -} diff --git a/src/version2/parameters/addSecurityLevelMembers.mts b/src/version2/parameters/addSecurityLevelMembers.mts new file mode 100644 index 000000000..3ed3b0a6f --- /dev/null +++ b/src/version2/parameters/addSecurityLevelMembers.mts @@ -0,0 +1,8 @@ +import { SecuritySchemeMembersRequest } from '../models/index.mjs'; + +export interface AddSecurityLevelMembers extends SecuritySchemeMembersRequest { + /** The ID of the issue security scheme. */ + schemeId: string; + /** The ID of the issue security level. */ + levelId: string; +} diff --git a/src/version2/parameters/addSecurityLevelMembers.ts b/src/version2/parameters/addSecurityLevelMembers.ts deleted file mode 100644 index 6e3bffed9..000000000 --- a/src/version2/parameters/addSecurityLevelMembers.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { SecuritySchemeMembersRequest } from '../models/index.js'; - -export interface AddSecurityLevelMembers extends SecuritySchemeMembersRequest { - /** The ID of the issue security scheme. */ - schemeId: string; - /** The ID of the issue security level. */ - levelId: string; -} diff --git a/src/version2/parameters/addSharePermission.mts b/src/version2/parameters/addSharePermission.mts new file mode 100644 index 000000000..a55798ad1 --- /dev/null +++ b/src/version2/parameters/addSharePermission.mts @@ -0,0 +1,6 @@ +import { SharePermissionInput } from '../models/index.mjs'; + +export interface AddSharePermission extends SharePermissionInput { + /** The ID of the filter. */ + id: number; +} diff --git a/src/version2/parameters/addSharePermission.ts b/src/version2/parameters/addSharePermission.ts deleted file mode 100644 index 22aeee6cc..000000000 --- a/src/version2/parameters/addSharePermission.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { SharePermissionInput } from '../models/index.js'; - -export interface AddSharePermission extends SharePermissionInput { - /** The ID of the filter. */ - id: number; -} diff --git a/src/version2/parameters/addUserToGroup.mts b/src/version2/parameters/addUserToGroup.mts new file mode 100644 index 000000000..f123c8728 --- /dev/null +++ b/src/version2/parameters/addUserToGroup.mts @@ -0,0 +1,11 @@ +import { UpdateUserToGroup } from '../models/index.mjs'; + +export interface AddUserToGroup extends UpdateUserToGroup { + /** + * As a group's name can change, use of `groupId` is recommended to identify a group. The name of the group. This + * parameter cannot be used with the `groupId` parameter. + */ + groupName?: string; + /** The ID of the group. This parameter cannot be used with the `groupName` parameter. */ + groupId?: string; +} diff --git a/src/version2/parameters/addUserToGroup.ts b/src/version2/parameters/addUserToGroup.ts deleted file mode 100644 index c0e4eaa72..000000000 --- a/src/version2/parameters/addUserToGroup.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { UpdateUserToGroup } from '../models/index.js'; - -export interface AddUserToGroup extends UpdateUserToGroup { - /** - * As a group's name can change, use of `groupId` is recommended to identify a group. The name of the group. This - * parameter cannot be used with the `groupId` parameter. - */ - groupName?: string; - /** The ID of the group. This parameter cannot be used with the `groupName` parameter. */ - groupId?: string; -} diff --git a/src/version2/parameters/addVote.ts b/src/version2/parameters/addVote.mts similarity index 100% rename from src/version2/parameters/addVote.ts rename to src/version2/parameters/addVote.mts diff --git a/src/version2/parameters/addWatcher.ts b/src/version2/parameters/addWatcher.mts similarity index 100% rename from src/version2/parameters/addWatcher.ts rename to src/version2/parameters/addWatcher.mts diff --git a/src/version2/parameters/addWorklog.mts b/src/version2/parameters/addWorklog.mts new file mode 100644 index 000000000..1c1e1d2e8 --- /dev/null +++ b/src/version2/parameters/addWorklog.mts @@ -0,0 +1,39 @@ +import { Worklog } from '../models/index.mjs'; + +export interface AddWorklog extends Worklog { + /** The ID or key the issue. */ + issueIdOrKey: string; + /** Whether users watching the issue are notified by email. */ + notifyUsers?: boolean; + /** + * Defines how to update the issue's time estimate, the options are: + * + * - `new` Sets the estimate to a specific value, defined in `newEstimate`. + * - `leave` Leaves the estimate unchanged. + * - `manual` Reduces the estimate by amount specified in `reduceBy`. + * - `auto` Reduces the estimate by the value of `timeSpent` in the worklog. + */ + adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; + /** + * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For + * example, _2d_. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * The amount to reduce the issue's remaining estimate by, as days (#d), hours (#h), or minutes (#m). For example, + * _2d_. Required when `adjustEstimate` is `manual`. + */ + reduceBy?: string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about work logs in the response. This parameter accepts `properties`, which returns worklog + * properties. + */ + expand?: string; + /** + * Whether the worklog entry should be added to the issue even if the issue is not editable, because + * jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + */ + overrideEditableFlag?: boolean; +} diff --git a/src/version2/parameters/addWorklog.ts b/src/version2/parameters/addWorklog.ts deleted file mode 100644 index 626eebba1..000000000 --- a/src/version2/parameters/addWorklog.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { Worklog } from '../models/index.js'; - -export interface AddWorklog extends Worklog { - /** The ID or key the issue. */ - issueIdOrKey: string; - /** Whether users watching the issue are notified by email. */ - notifyUsers?: boolean; - /** - * Defines how to update the issue's time estimate, the options are: - * - * - `new` Sets the estimate to a specific value, defined in `newEstimate`. - * - `leave` Leaves the estimate unchanged. - * - `manual` Reduces the estimate by amount specified in `reduceBy`. - * - `auto` Reduces the estimate by the value of `timeSpent` in the worklog. - */ - adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; - /** - * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For - * example, _2d_. Required when `adjustEstimate` is `new`. - */ - newEstimate?: string; - /** - * The amount to reduce the issue's remaining estimate by, as days (#d), hours (#h), or minutes (#m). For example, - * _2d_. Required when `adjustEstimate` is `manual`. - */ - reduceBy?: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about work logs in the response. This parameter accepts `properties`, which returns worklog - * properties. - */ - expand?: string; - /** - * Whether the worklog entry should be added to the issue even if the issue is not editable, because - * jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. - */ - overrideEditableFlag?: boolean; -} diff --git a/src/version2/parameters/analyseExpression.mts b/src/version2/parameters/analyseExpression.mts new file mode 100644 index 000000000..8802ab65d --- /dev/null +++ b/src/version2/parameters/analyseExpression.mts @@ -0,0 +1,17 @@ +import { JiraExpressionForAnalysis } from '../models/index.mjs'; + +export interface AnalyseExpression extends JiraExpressionForAnalysis { + /** + * The check to perform: + * + * - `syntax` Each expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are + * validated. For example, the expression's length. + * - `type` EXPERIMENTAL. Each expression is type checked and the final type of the expression inferred. Any type errors + * that would result in the expression failure at runtime are reported. For example, accessing properties that don't + * exist or passing the wrong number of arguments to functions. Also performs the syntax check. + * - `complexity` EXPERIMENTAL. Determines the formulae for how many [expensive + * operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) each + * expression may execute. + */ + check?: 'syntax' | 'type' | 'complexity' | string; +} diff --git a/src/version2/parameters/analyseExpression.ts b/src/version2/parameters/analyseExpression.ts deleted file mode 100644 index 06f47b3c5..000000000 --- a/src/version2/parameters/analyseExpression.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { JiraExpressionForAnalysis } from '../models/index.js'; - -export interface AnalyseExpression extends JiraExpressionForAnalysis { - /** - * The check to perform: - * - * - `syntax` Each expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are - * validated. For example, the expression's length. - * - `type` EXPERIMENTAL. Each expression is type checked and the final type of the expression inferred. Any type errors - * that would result in the expression failure at runtime are reported. For example, accessing properties that don't - * exist or passing the wrong number of arguments to functions. Also performs the syntax check. - * - `complexity` EXPERIMENTAL. Determines the formulae for how many [expensive - * operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) each - * expression may execute. - */ - check?: 'syntax' | 'type' | 'complexity' | string; -} diff --git a/src/version2/parameters/appendMappingsForIssueTypeScreenScheme.mts b/src/version2/parameters/appendMappingsForIssueTypeScreenScheme.mts new file mode 100644 index 000000000..99bbd0dbc --- /dev/null +++ b/src/version2/parameters/appendMappingsForIssueTypeScreenScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeScreenSchemeMappingDetails } from '../models/index.mjs'; + +export interface AppendMappingsForIssueTypeScreenScheme extends IssueTypeScreenSchemeMappingDetails { + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: string; +} diff --git a/src/version2/parameters/appendMappingsForIssueTypeScreenScheme.ts b/src/version2/parameters/appendMappingsForIssueTypeScreenScheme.ts deleted file mode 100644 index ce746393e..000000000 --- a/src/version2/parameters/appendMappingsForIssueTypeScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeScreenSchemeMappingDetails } from '../models/index.js'; - -export interface AppendMappingsForIssueTypeScreenScheme extends IssueTypeScreenSchemeMappingDetails { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; -} diff --git a/src/version2/parameters/archiveIssues.ts b/src/version2/parameters/archiveIssues.mts similarity index 100% rename from src/version2/parameters/archiveIssues.ts rename to src/version2/parameters/archiveIssues.mts diff --git a/src/version2/parameters/archiveIssuesAsync.ts b/src/version2/parameters/archiveIssuesAsync.mts similarity index 100% rename from src/version2/parameters/archiveIssuesAsync.ts rename to src/version2/parameters/archiveIssuesAsync.mts diff --git a/src/version2/parameters/archiveProject.ts b/src/version2/parameters/archiveProject.mts similarity index 100% rename from src/version2/parameters/archiveProject.ts rename to src/version2/parameters/archiveProject.mts diff --git a/src/version2/parameters/assignFieldConfigurationSchemeToProject.mts b/src/version2/parameters/assignFieldConfigurationSchemeToProject.mts new file mode 100644 index 000000000..93d716314 --- /dev/null +++ b/src/version2/parameters/assignFieldConfigurationSchemeToProject.mts @@ -0,0 +1,3 @@ +import { FieldConfigurationSchemeProjectAssociation } from '../models/index.mjs'; + +export interface AssignFieldConfigurationSchemeToProject extends FieldConfigurationSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignFieldConfigurationSchemeToProject.ts b/src/version2/parameters/assignFieldConfigurationSchemeToProject.ts deleted file mode 100644 index 104a2fcec..000000000 --- a/src/version2/parameters/assignFieldConfigurationSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FieldConfigurationSchemeProjectAssociation } from '../models/index.js'; - -export interface AssignFieldConfigurationSchemeToProject extends FieldConfigurationSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignIssue.mts b/src/version2/parameters/assignIssue.mts new file mode 100644 index 000000000..dd52f8b27 --- /dev/null +++ b/src/version2/parameters/assignIssue.mts @@ -0,0 +1,15 @@ +import { User } from '../models/index.mjs'; + +export interface AssignIssue extends Omit { + /** The ID or key of the issue to be assigned. */ + issueIdOrKey: string; + + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. If passed `null` it will unassigned issue. + */ + accountId: string | null; + + /** Whether the user is active. */ + active?: boolean; +} diff --git a/src/version2/parameters/assignIssue.ts b/src/version2/parameters/assignIssue.ts deleted file mode 100644 index 03d836298..000000000 --- a/src/version2/parameters/assignIssue.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { User } from '../models/index.js'; - -export interface AssignIssue extends Omit { - /** The ID or key of the issue to be assigned. */ - issueIdOrKey: string; - - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. If passed `null` it will unassigned issue. - */ - accountId: string | null; - - /** Whether the user is active. */ - active?: boolean; -} diff --git a/src/version2/parameters/assignIssueTypeSchemeToProject.mts b/src/version2/parameters/assignIssueTypeSchemeToProject.mts new file mode 100644 index 000000000..2984b6cc1 --- /dev/null +++ b/src/version2/parameters/assignIssueTypeSchemeToProject.mts @@ -0,0 +1,3 @@ +import { IssueTypeSchemeProjectAssociation } from '../models/index.mjs'; + +export interface AssignIssueTypeSchemeToProject extends IssueTypeSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignIssueTypeSchemeToProject.ts b/src/version2/parameters/assignIssueTypeSchemeToProject.ts deleted file mode 100644 index 5feb00474..000000000 --- a/src/version2/parameters/assignIssueTypeSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueTypeSchemeProjectAssociation } from '../models/index.js'; - -export interface AssignIssueTypeSchemeToProject extends IssueTypeSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignIssueTypeScreenSchemeToProject.mts b/src/version2/parameters/assignIssueTypeScreenSchemeToProject.mts new file mode 100644 index 000000000..3a209ea08 --- /dev/null +++ b/src/version2/parameters/assignIssueTypeScreenSchemeToProject.mts @@ -0,0 +1,3 @@ +import { IssueTypeScreenSchemeProjectAssociation } from '../models/index.mjs'; + +export interface AssignIssueTypeScreenSchemeToProject extends IssueTypeScreenSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignIssueTypeScreenSchemeToProject.ts b/src/version2/parameters/assignIssueTypeScreenSchemeToProject.ts deleted file mode 100644 index 4b73b93d7..000000000 --- a/src/version2/parameters/assignIssueTypeScreenSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueTypeScreenSchemeProjectAssociation } from '../models/index.js'; - -export interface AssignIssueTypeScreenSchemeToProject extends IssueTypeScreenSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignPermissionScheme.mts b/src/version2/parameters/assignPermissionScheme.mts new file mode 100644 index 000000000..081619fa3 --- /dev/null +++ b/src/version2/parameters/assignPermissionScheme.mts @@ -0,0 +1,27 @@ +import { Id } from '../models/index.mjs'; + +export interface AssignPermissionScheme extends Id { + /** The project ID or project key (case sensitive). */ + projectKeyOrId: string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Note that permissions are included when + * you specify any value. Expand options include: + * + * - `all` Returns all expandable information. + * - `field` Returns information about the custom field granted the permission. + * - `group` Returns information about the group that is granted the permission. + * - `permissions` Returns all permission grants for each permission scheme. + * - `projectRole` Returns information about the project role granted the permission. + * - `user` Returns information about the user who is granted the permission. + */ + expand?: + | 'all' + | 'field' + | 'group' + | 'permissions' + | 'projectRole' + | 'user' + | ('all' | 'field' | 'group' | 'permissions' | 'projectRole' | 'user')[] + | string; +} diff --git a/src/version2/parameters/assignPermissionScheme.ts b/src/version2/parameters/assignPermissionScheme.ts deleted file mode 100644 index ec054d0bb..000000000 --- a/src/version2/parameters/assignPermissionScheme.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { Id } from '../models/index.js'; - -export interface AssignPermissionScheme extends Id { - /** The project ID or project key (case sensitive). */ - projectKeyOrId: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Note that permissions are included when - * you specify any value. Expand options include: - * - * - `all` Returns all expandable information. - * - `field` Returns information about the custom field granted the permission. - * - `group` Returns information about the group that is granted the permission. - * - `permissions` Returns all permission grants for each permission scheme. - * - `projectRole` Returns information about the project role granted the permission. - * - `user` Returns information about the user who is granted the permission. - */ - expand?: - | 'all' - | 'field' - | 'group' - | 'permissions' - | 'projectRole' - | 'user' - | ('all' | 'field' | 'group' | 'permissions' | 'projectRole' | 'user')[] - | string; -} diff --git a/src/version2/parameters/assignProjectsToCustomFieldContext.mts b/src/version2/parameters/assignProjectsToCustomFieldContext.mts new file mode 100644 index 000000000..d8b4b090a --- /dev/null +++ b/src/version2/parameters/assignProjectsToCustomFieldContext.mts @@ -0,0 +1,8 @@ +import { ProjectIds } from '../models/index.mjs'; + +export interface AssignProjectsToCustomFieldContext extends ProjectIds { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/assignProjectsToCustomFieldContext.ts b/src/version2/parameters/assignProjectsToCustomFieldContext.ts deleted file mode 100644 index b64937d11..000000000 --- a/src/version2/parameters/assignProjectsToCustomFieldContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectIds } from '../models/index.js'; - -export interface AssignProjectsToCustomFieldContext extends ProjectIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/assignSchemeToProject.mts b/src/version2/parameters/assignSchemeToProject.mts new file mode 100644 index 000000000..31f221013 --- /dev/null +++ b/src/version2/parameters/assignSchemeToProject.mts @@ -0,0 +1,3 @@ +import { WorkflowSchemeProjectAssociation } from '../models/index.mjs'; + +export interface AssignSchemeToProject extends WorkflowSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignSchemeToProject.ts b/src/version2/parameters/assignSchemeToProject.ts deleted file mode 100644 index ce9bc2b4c..000000000 --- a/src/version2/parameters/assignSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WorkflowSchemeProjectAssociation } from '../models/index.js'; - -export interface AssignSchemeToProject extends WorkflowSchemeProjectAssociation {} diff --git a/src/version2/parameters/associateSchemesToProjects.mts b/src/version2/parameters/associateSchemesToProjects.mts new file mode 100644 index 000000000..75576ca86 --- /dev/null +++ b/src/version2/parameters/associateSchemesToProjects.mts @@ -0,0 +1,11 @@ +import { OldToNewSecurityLevelMappings } from '../models/index.mjs'; + +/** Issue security scheme, project, and remapping details. */ +export interface AssociateSchemesToProjects { + /** The list of scheme levels which should be remapped to new levels of the issue security scheme. */ + oldToNewSecurityLevelMappings: OldToNewSecurityLevelMappings[]; + /** The ID of the project. */ + projectId: string; + /** The ID of the issue security scheme. Providing null will clear the association with the issue security scheme. */ + schemeId: string; +} diff --git a/src/version2/parameters/associateSchemesToProjects.ts b/src/version2/parameters/associateSchemesToProjects.ts deleted file mode 100644 index 97a4d8c33..000000000 --- a/src/version2/parameters/associateSchemesToProjects.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { OldToNewSecurityLevelMappings } from '../models/index.js'; - -/** Issue security scheme, project, and remapping details. */ -export interface AssociateSchemesToProjects { - /** The list of scheme levels which should be remapped to new levels of the issue security scheme. */ - oldToNewSecurityLevelMappings: OldToNewSecurityLevelMappings[]; - /** The ID of the project. */ - projectId: string; - /** The ID of the issue security scheme. Providing null will clear the association with the issue security scheme. */ - schemeId: string; -} diff --git a/src/version2/parameters/bulkDeleteIssueProperty.mts b/src/version2/parameters/bulkDeleteIssueProperty.mts new file mode 100644 index 000000000..bfc78d867 --- /dev/null +++ b/src/version2/parameters/bulkDeleteIssueProperty.mts @@ -0,0 +1,6 @@ +import { IssueFilterForBulkPropertyDelete } from '../models/index.mjs'; + +export interface BulkDeleteIssueProperty extends IssueFilterForBulkPropertyDelete { + /** The key of the property. */ + propertyKey: string; +} diff --git a/src/version2/parameters/bulkDeleteIssueProperty.ts b/src/version2/parameters/bulkDeleteIssueProperty.ts deleted file mode 100644 index 7668bddf8..000000000 --- a/src/version2/parameters/bulkDeleteIssueProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueFilterForBulkPropertyDelete } from '../models/index.js'; - -export interface BulkDeleteIssueProperty extends IssueFilterForBulkPropertyDelete { - /** The key of the property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/bulkEditDashboards.mts b/src/version2/parameters/bulkEditDashboards.mts new file mode 100644 index 000000000..086014cee --- /dev/null +++ b/src/version2/parameters/bulkEditDashboards.mts @@ -0,0 +1,13 @@ +import { BulkChangeOwnerDetails, PermissionDetails } from '../models/index.mjs'; + +/** Details of a request to bulk edit shareable entity. */ +export interface BulkEditDashboards { + /** Allowed action for bulk edit shareable entity */ + action: string; + changeOwnerDetails?: BulkChangeOwnerDetails; + /** The id list of shareable entities to be changed. */ + entityIds: number[]; + /** Whether the actions are executed by users with Administer Jira global permission. */ + extendAdminPermissions?: boolean; + permissionDetails?: PermissionDetails; +} diff --git a/src/version2/parameters/bulkEditDashboards.ts b/src/version2/parameters/bulkEditDashboards.ts deleted file mode 100644 index f9c7283e1..000000000 --- a/src/version2/parameters/bulkEditDashboards.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { BulkChangeOwnerDetails, PermissionDetails } from '../models/index.js'; - -/** Details of a request to bulk edit shareable entity. */ -export interface BulkEditDashboards { - /** Allowed action for bulk edit shareable entity */ - action: string; - changeOwnerDetails?: BulkChangeOwnerDetails; - /** The id list of shareable entities to be changed. */ - entityIds: number[]; - /** Whether the actions are executed by users with Administer Jira global permission. */ - extendAdminPermissions?: boolean; - permissionDetails?: PermissionDetails; -} diff --git a/src/version2/parameters/bulkGetGroups.ts b/src/version2/parameters/bulkGetGroups.mts similarity index 100% rename from src/version2/parameters/bulkGetGroups.ts rename to src/version2/parameters/bulkGetGroups.mts diff --git a/src/version2/parameters/bulkGetUsers.ts b/src/version2/parameters/bulkGetUsers.mts similarity index 100% rename from src/version2/parameters/bulkGetUsers.ts rename to src/version2/parameters/bulkGetUsers.mts diff --git a/src/version2/parameters/bulkGetUsersMigration.ts b/src/version2/parameters/bulkGetUsersMigration.mts similarity index 100% rename from src/version2/parameters/bulkGetUsersMigration.ts rename to src/version2/parameters/bulkGetUsersMigration.mts diff --git a/src/version2/parameters/bulkSetIssuePropertiesByIssue.mts b/src/version2/parameters/bulkSetIssuePropertiesByIssue.mts new file mode 100644 index 000000000..b96e5308d --- /dev/null +++ b/src/version2/parameters/bulkSetIssuePropertiesByIssue.mts @@ -0,0 +1,3 @@ +import { MultiIssueEntityProperties } from '../models/index.mjs'; + +export interface BulkSetIssuePropertiesByIssue extends MultiIssueEntityProperties {} diff --git a/src/version2/parameters/bulkSetIssuePropertiesByIssue.ts b/src/version2/parameters/bulkSetIssuePropertiesByIssue.ts deleted file mode 100644 index 38c08c7ba..000000000 --- a/src/version2/parameters/bulkSetIssuePropertiesByIssue.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { MultiIssueEntityProperties } from '../models/index.js'; - -export interface BulkSetIssuePropertiesByIssue extends MultiIssueEntityProperties {} diff --git a/src/version2/parameters/bulkSetIssueProperty.mts b/src/version2/parameters/bulkSetIssueProperty.mts new file mode 100644 index 000000000..457f8d21b --- /dev/null +++ b/src/version2/parameters/bulkSetIssueProperty.mts @@ -0,0 +1,6 @@ +import { BulkIssuePropertyUpdateRequest } from '../models/index.mjs'; + +export interface BulkSetIssueProperty extends BulkIssuePropertyUpdateRequest { + /** The key of the property. The maximum length is 255 characters. */ + propertyKey: string; +} diff --git a/src/version2/parameters/bulkSetIssueProperty.ts b/src/version2/parameters/bulkSetIssueProperty.ts deleted file mode 100644 index 199013c62..000000000 --- a/src/version2/parameters/bulkSetIssueProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { BulkIssuePropertyUpdateRequest } from '../models/index.js'; - -export interface BulkSetIssueProperty extends BulkIssuePropertyUpdateRequest { - /** The key of the property. The maximum length is 255 characters. */ - propertyKey: string; -} diff --git a/src/version2/parameters/bulkSetIssuesProperties.mts b/src/version2/parameters/bulkSetIssuesProperties.mts new file mode 100644 index 000000000..f6df48500 --- /dev/null +++ b/src/version2/parameters/bulkSetIssuesProperties.mts @@ -0,0 +1,3 @@ +import { IssueEntityProperties } from '../models/index.mjs'; + +export interface BulkSetIssuesProperties extends IssueEntityProperties {} diff --git a/src/version2/parameters/bulkSetIssuesProperties.ts b/src/version2/parameters/bulkSetIssuesProperties.ts deleted file mode 100644 index 66b8a3b9f..000000000 --- a/src/version2/parameters/bulkSetIssuesProperties.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueEntityProperties } from '../models/index.js'; - -export interface BulkSetIssuesProperties extends IssueEntityProperties {} diff --git a/src/version2/parameters/cancelTask.ts b/src/version2/parameters/cancelTask.mts similarity index 100% rename from src/version2/parameters/cancelTask.ts rename to src/version2/parameters/cancelTask.mts diff --git a/src/version2/parameters/changeFilterOwner.ts b/src/version2/parameters/changeFilterOwner.mts similarity index 100% rename from src/version2/parameters/changeFilterOwner.ts rename to src/version2/parameters/changeFilterOwner.mts diff --git a/src/version2/parameters/copyDashboard.mts b/src/version2/parameters/copyDashboard.mts new file mode 100644 index 000000000..823362922 --- /dev/null +++ b/src/version2/parameters/copyDashboard.mts @@ -0,0 +1,5 @@ +import { DashboardDetails } from '../models/index.mjs'; + +export interface CopyDashboard extends DashboardDetails { + id: string; +} diff --git a/src/version2/parameters/copyDashboard.ts b/src/version2/parameters/copyDashboard.ts deleted file mode 100644 index 42352f534..000000000 --- a/src/version2/parameters/copyDashboard.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { DashboardDetails } from '../models/index.js'; - -export interface CopyDashboard extends DashboardDetails { - id: string; -} diff --git a/src/version2/parameters/createComponent.mts b/src/version2/parameters/createComponent.mts new file mode 100644 index 000000000..82765b579 --- /dev/null +++ b/src/version2/parameters/createComponent.mts @@ -0,0 +1,3 @@ +import { ProjectComponent } from '../models/index.mjs'; + +export interface CreateComponent extends ProjectComponent {} diff --git a/src/version2/parameters/createComponent.ts b/src/version2/parameters/createComponent.ts deleted file mode 100644 index 38f3d035c..000000000 --- a/src/version2/parameters/createComponent.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ProjectComponent } from '../models/index.js'; - -export interface CreateComponent extends ProjectComponent {} diff --git a/src/version2/parameters/createCustomField.mts b/src/version2/parameters/createCustomField.mts new file mode 100644 index 000000000..409f21d32 --- /dev/null +++ b/src/version2/parameters/createCustomField.mts @@ -0,0 +1,3 @@ +import { CustomFieldDefinitionJson } from '../models/index.mjs'; + +export interface CreateCustomField extends CustomFieldDefinitionJson {} diff --git a/src/version2/parameters/createCustomField.ts b/src/version2/parameters/createCustomField.ts deleted file mode 100644 index 7d5ccdd84..000000000 --- a/src/version2/parameters/createCustomField.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CustomFieldDefinitionJson } from '../models/index.js'; - -export interface CreateCustomField extends CustomFieldDefinitionJson {} diff --git a/src/version2/parameters/createCustomFieldContext.ts b/src/version2/parameters/createCustomFieldContext.mts similarity index 100% rename from src/version2/parameters/createCustomFieldContext.ts rename to src/version2/parameters/createCustomFieldContext.mts diff --git a/src/version2/parameters/createCustomFieldOption.mts b/src/version2/parameters/createCustomFieldOption.mts new file mode 100644 index 000000000..67c684ab5 --- /dev/null +++ b/src/version2/parameters/createCustomFieldOption.mts @@ -0,0 +1,8 @@ +import { BulkCustomFieldOptionCreateRequest } from '../models/index.mjs'; + +export interface CreateCustomFieldOption extends BulkCustomFieldOptionCreateRequest { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/createCustomFieldOption.ts b/src/version2/parameters/createCustomFieldOption.ts deleted file mode 100644 index 523002b53..000000000 --- a/src/version2/parameters/createCustomFieldOption.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { BulkCustomFieldOptionCreateRequest } from '../models/index.js'; - -export interface CreateCustomFieldOption extends BulkCustomFieldOptionCreateRequest { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/createDashboard.mts b/src/version2/parameters/createDashboard.mts new file mode 100644 index 000000000..08358b794 --- /dev/null +++ b/src/version2/parameters/createDashboard.mts @@ -0,0 +1,6 @@ +import { DashboardDetails, SharePermission } from '../models/index.mjs'; + +export interface CreateDashboard extends Omit { + /** The edit permissions for the dashboard. */ + editPermissions?: SharePermission[]; +} diff --git a/src/version2/parameters/createDashboard.ts b/src/version2/parameters/createDashboard.ts deleted file mode 100644 index 440a75e89..000000000 --- a/src/version2/parameters/createDashboard.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DashboardDetails, SharePermission } from '../models/index.js'; - -export interface CreateDashboard extends Omit { - /** The edit permissions for the dashboard. */ - editPermissions?: SharePermission[]; -} diff --git a/src/version2/parameters/createFieldConfiguration.mts b/src/version2/parameters/createFieldConfiguration.mts new file mode 100644 index 000000000..fafce9fb0 --- /dev/null +++ b/src/version2/parameters/createFieldConfiguration.mts @@ -0,0 +1,3 @@ +import { FieldConfigurationDetails } from '../models/index.mjs'; + +export interface CreateFieldConfiguration extends FieldConfigurationDetails {} diff --git a/src/version2/parameters/createFieldConfiguration.ts b/src/version2/parameters/createFieldConfiguration.ts deleted file mode 100644 index a10298777..000000000 --- a/src/version2/parameters/createFieldConfiguration.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FieldConfigurationDetails } from '../models/index.js'; - -export interface CreateFieldConfiguration extends FieldConfigurationDetails {} diff --git a/src/version2/parameters/createFieldConfigurationScheme.mts b/src/version2/parameters/createFieldConfigurationScheme.mts new file mode 100644 index 000000000..9383fe66d --- /dev/null +++ b/src/version2/parameters/createFieldConfigurationScheme.mts @@ -0,0 +1,3 @@ +import { UpdateFieldConfigurationSchemeDetails } from '../models/index.mjs'; + +export interface CreateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails {} diff --git a/src/version2/parameters/createFieldConfigurationScheme.ts b/src/version2/parameters/createFieldConfigurationScheme.ts deleted file mode 100644 index 4aa9d0c83..000000000 --- a/src/version2/parameters/createFieldConfigurationScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { UpdateFieldConfigurationSchemeDetails } from '../models/index.js'; - -export interface CreateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails {} diff --git a/src/version2/parameters/createFilter.mts b/src/version2/parameters/createFilter.mts new file mode 100644 index 000000000..87526234c --- /dev/null +++ b/src/version2/parameters/createFilter.mts @@ -0,0 +1,23 @@ +import { Filter } from '../models/index.mjs'; + +export interface CreateFilter extends Filter { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that + * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it + * doesn't list any users. The list of users returned is limited to 1000, to access additional users append + * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use + * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't + * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of + * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to + * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be created. + * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; +} diff --git a/src/version2/parameters/createFilter.ts b/src/version2/parameters/createFilter.ts deleted file mode 100644 index 179b9064d..000000000 --- a/src/version2/parameters/createFilter.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { Filter } from '../models/index.js'; - -export interface CreateFilter extends Filter { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that - * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it - * doesn't list any users. The list of users returned is limited to 1000, to access additional users append - * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use - * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't - * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of - * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to - * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. - */ - expand?: string; - /** - * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be created. - * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideSharePermissions?: boolean; -} diff --git a/src/version2/parameters/createGroup.mts b/src/version2/parameters/createGroup.mts new file mode 100644 index 000000000..fcd378a1b --- /dev/null +++ b/src/version2/parameters/createGroup.mts @@ -0,0 +1,5 @@ +import { AddGroup } from '../models/index.mjs'; + +export interface CreateGroup extends AddGroup { + [key: string]: any; +} diff --git a/src/version2/parameters/createGroup.ts b/src/version2/parameters/createGroup.ts deleted file mode 100644 index a927114f0..000000000 --- a/src/version2/parameters/createGroup.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AddGroup } from '../models/index.js'; - -export interface CreateGroup extends AddGroup { - [key: string]: any; -} diff --git a/src/version2/parameters/createIssue.mts b/src/version2/parameters/createIssue.mts new file mode 100644 index 000000000..926ac476d --- /dev/null +++ b/src/version2/parameters/createIssue.mts @@ -0,0 +1,62 @@ +import { IssueUpdateDetails, Project, TimeTrackingDetails } from '../models/index.mjs'; + +export interface CreateIssue extends Omit { + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown + * under **Projects** in Jira. When provided, the issue type and request type are added to the user's history for a + * project. These values are then used to provide defaults on the issue create screen. + */ + updateHistory?: boolean; + + /** + * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field + * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are + * required, use `update`. Fields included in here cannot be included in `update`. + */ + fields: { + [key: string]: any; + summary: string; + project: Partial; + issuetype: { + id?: string | number; + name?: string; + }; + parent?: { + [key: string]: any; + key?: string; + }; + components?: Array<{ + [key: string]: any; + id?: string | number; + }>; + description?: string; + reporter?: { + [key: string]: any; + id?: string | number; + }; + fixVersions?: Array<{ + [key: string]: any; + id?: string | number; + }>; + priority?: { + [key: string]: any; + id?: string | number; + }; + labels?: string[]; + timetracking?: TimeTrackingDetails; + security?: { + [key: string]: any; + id?: string | number; + }; + environment?: any; + versions?: Array<{ + [key: string]: any; + id?: string | number; + }>; + duedate?: string; + assignee?: { + [key: string]: any; + id?: string | number; + }; + }; +} diff --git a/src/version2/parameters/createIssue.ts b/src/version2/parameters/createIssue.ts deleted file mode 100644 index 565980460..000000000 --- a/src/version2/parameters/createIssue.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { IssueUpdateDetails, Project, TimeTrackingDetails } from '../models/index.js'; - -export interface CreateIssue extends Omit { - /** - * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown - * under **Projects** in Jira. When provided, the issue type and request type are added to the user's history for a - * project. These values are then used to provide defaults on the issue create screen. - */ - updateHistory?: boolean; - - /** - * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field - * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are - * required, use `update`. Fields included in here cannot be included in `update`. - */ - fields: { - [key: string]: any; - summary: string; - project: Partial; - issuetype: { - id?: string | number; - name?: string; - }; - parent?: { - [key: string]: any; - key?: string; - }; - components?: Array<{ - [key: string]: any; - id?: string | number; - }>; - description?: string; - reporter?: { - [key: string]: any; - id?: string | number; - }; - fixVersions?: Array<{ - [key: string]: any; - id?: string | number; - }>; - priority?: { - [key: string]: any; - id?: string | number; - }; - labels?: string[]; - timetracking?: TimeTrackingDetails; - security?: { - [key: string]: any; - id?: string | number; - }; - environment?: any; - versions?: Array<{ - [key: string]: any; - id?: string | number; - }>; - duedate?: string; - assignee?: { - [key: string]: any; - id?: string | number; - }; - }; -} diff --git a/src/version2/parameters/createIssueFieldOption.mts b/src/version2/parameters/createIssueFieldOption.mts new file mode 100644 index 000000000..c8ce1bed3 --- /dev/null +++ b/src/version2/parameters/createIssueFieldOption.mts @@ -0,0 +1,14 @@ +import { IssueFieldOptionCreate } from '../models/index.mjs'; + +export interface CreateIssueFieldOption extends IssueFieldOptionCreate { + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For + * example, `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: string; +} diff --git a/src/version2/parameters/createIssueFieldOption.ts b/src/version2/parameters/createIssueFieldOption.ts deleted file mode 100644 index d91c2ad72..000000000 --- a/src/version2/parameters/createIssueFieldOption.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { IssueFieldOptionCreate } from '../models/index.js'; - -export interface CreateIssueFieldOption extends IssueFieldOptionCreate { - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; -} diff --git a/src/version2/parameters/createIssueLinkType.mts b/src/version2/parameters/createIssueLinkType.mts new file mode 100644 index 000000000..e51df2f5e --- /dev/null +++ b/src/version2/parameters/createIssueLinkType.mts @@ -0,0 +1,3 @@ +import { IssueLinkType } from '../models/index.mjs'; + +export interface CreateIssueLinkType extends IssueLinkType {} diff --git a/src/version2/parameters/createIssueLinkType.ts b/src/version2/parameters/createIssueLinkType.ts deleted file mode 100644 index 664b24d7d..000000000 --- a/src/version2/parameters/createIssueLinkType.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueLinkType } from '../models/index.js'; - -export interface CreateIssueLinkType extends IssueLinkType {} diff --git a/src/version2/parameters/createIssueSecurityScheme.mts b/src/version2/parameters/createIssueSecurityScheme.mts new file mode 100644 index 000000000..20cbb444a --- /dev/null +++ b/src/version2/parameters/createIssueSecurityScheme.mts @@ -0,0 +1,3 @@ +import { CreateIssueSecuritySchemeDetails } from '../models/index.mjs'; + +export interface CreateIssueSecurityScheme extends CreateIssueSecuritySchemeDetails {} diff --git a/src/version2/parameters/createIssueSecurityScheme.ts b/src/version2/parameters/createIssueSecurityScheme.ts deleted file mode 100644 index bd2355565..000000000 --- a/src/version2/parameters/createIssueSecurityScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateIssueSecuritySchemeDetails } from '../models/index.js'; - -export interface CreateIssueSecurityScheme extends CreateIssueSecuritySchemeDetails {} diff --git a/src/version2/parameters/createIssueType.mts b/src/version2/parameters/createIssueType.mts new file mode 100644 index 000000000..6181ab8fd --- /dev/null +++ b/src/version2/parameters/createIssueType.mts @@ -0,0 +1,3 @@ +import { IssueTypeCreate } from '../models/index.mjs'; + +export interface CreateIssueType extends IssueTypeCreate {} diff --git a/src/version2/parameters/createIssueType.ts b/src/version2/parameters/createIssueType.ts deleted file mode 100644 index d8eed240e..000000000 --- a/src/version2/parameters/createIssueType.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueTypeCreate } from '../models/index.js'; - -export interface CreateIssueType extends IssueTypeCreate {} diff --git a/src/version2/parameters/createIssueTypeAvatar.ts b/src/version2/parameters/createIssueTypeAvatar.mts similarity index 100% rename from src/version2/parameters/createIssueTypeAvatar.ts rename to src/version2/parameters/createIssueTypeAvatar.mts diff --git a/src/version2/parameters/createIssueTypeScheme.mts b/src/version2/parameters/createIssueTypeScheme.mts new file mode 100644 index 000000000..79cd33aab --- /dev/null +++ b/src/version2/parameters/createIssueTypeScheme.mts @@ -0,0 +1,3 @@ +import { IssueTypeSchemeDetails } from '../models/index.mjs'; + +export interface CreateIssueTypeScheme extends IssueTypeSchemeDetails {} diff --git a/src/version2/parameters/createIssueTypeScheme.ts b/src/version2/parameters/createIssueTypeScheme.ts deleted file mode 100644 index 643fdb4ad..000000000 --- a/src/version2/parameters/createIssueTypeScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueTypeSchemeDetails } from '../models/index.js'; - -export interface CreateIssueTypeScheme extends IssueTypeSchemeDetails {} diff --git a/src/version2/parameters/createIssueTypeScreenScheme.mts b/src/version2/parameters/createIssueTypeScreenScheme.mts new file mode 100644 index 000000000..65857ffb9 --- /dev/null +++ b/src/version2/parameters/createIssueTypeScreenScheme.mts @@ -0,0 +1,3 @@ +import { IssueTypeScreenSchemeDetails } from '../models/index.mjs'; + +export interface CreateIssueTypeScreenScheme extends IssueTypeScreenSchemeDetails {} diff --git a/src/version2/parameters/createIssueTypeScreenScheme.ts b/src/version2/parameters/createIssueTypeScreenScheme.ts deleted file mode 100644 index 776830e37..000000000 --- a/src/version2/parameters/createIssueTypeScreenScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueTypeScreenSchemeDetails } from '../models/index.js'; - -export interface CreateIssueTypeScreenScheme extends IssueTypeScreenSchemeDetails {} diff --git a/src/version2/parameters/createIssues.mts b/src/version2/parameters/createIssues.mts new file mode 100644 index 000000000..556e0719f --- /dev/null +++ b/src/version2/parameters/createIssues.mts @@ -0,0 +1,3 @@ +import { IssuesUpdate } from '../models/index.mjs'; + +export interface CreateIssues extends IssuesUpdate {} diff --git a/src/version2/parameters/createIssues.ts b/src/version2/parameters/createIssues.ts deleted file mode 100644 index f86696a2a..000000000 --- a/src/version2/parameters/createIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssuesUpdate } from '../models/index.js'; - -export interface CreateIssues extends IssuesUpdate {} diff --git a/src/version2/parameters/createNotificationScheme.mts b/src/version2/parameters/createNotificationScheme.mts new file mode 100644 index 000000000..adb278e8d --- /dev/null +++ b/src/version2/parameters/createNotificationScheme.mts @@ -0,0 +1,3 @@ +import { CreateNotificationSchemeDetails } from '../models/index.mjs'; + +export interface CreateNotificationScheme extends CreateNotificationSchemeDetails {} diff --git a/src/version2/parameters/createNotificationScheme.ts b/src/version2/parameters/createNotificationScheme.ts deleted file mode 100644 index c7b6be674..000000000 --- a/src/version2/parameters/createNotificationScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateNotificationSchemeDetails } from '../models/index.js'; - -export interface CreateNotificationScheme extends CreateNotificationSchemeDetails {} diff --git a/src/version2/parameters/createOrUpdateRemoteIssueLink.mts b/src/version2/parameters/createOrUpdateRemoteIssueLink.mts new file mode 100644 index 000000000..db8e7d203 --- /dev/null +++ b/src/version2/parameters/createOrUpdateRemoteIssueLink.mts @@ -0,0 +1,6 @@ +import { RemoteIssueLinkRequest } from '../models/index.mjs'; + +export interface CreateOrUpdateRemoteIssueLink extends RemoteIssueLinkRequest { + /** The ID or key of the issue. */ + issueIdOrKey: string; +} diff --git a/src/version2/parameters/createOrUpdateRemoteIssueLink.ts b/src/version2/parameters/createOrUpdateRemoteIssueLink.ts deleted file mode 100644 index 7a4e299c5..000000000 --- a/src/version2/parameters/createOrUpdateRemoteIssueLink.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { RemoteIssueLinkRequest } from '../models/index.js'; - -export interface CreateOrUpdateRemoteIssueLink extends RemoteIssueLinkRequest { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/createPermissionGrant.mts b/src/version2/parameters/createPermissionGrant.mts new file mode 100644 index 000000000..97c105cb6 --- /dev/null +++ b/src/version2/parameters/createPermissionGrant.mts @@ -0,0 +1,16 @@ +import { PermissionGrant } from '../models/index.mjs'; + +export interface CreatePermissionGrant extends PermissionGrant { + /** The ID of the permission scheme in which to create a new permission grant. */ + schemeId: number; + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * `permissions` Returns all permission grants for each permission scheme. `user` Returns information about the user + * who is granted the permission. `group` Returns information about the group that is granted the permission. + * `projectRole` Returns information about the project role granted the permission. `field` Returns information about + * the custom field granted the permission. `all` Returns all expandable information. + */ + expand?: string; +} diff --git a/src/version2/parameters/createPermissionGrant.ts b/src/version2/parameters/createPermissionGrant.ts deleted file mode 100644 index c9190819d..000000000 --- a/src/version2/parameters/createPermissionGrant.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { PermissionGrant } from '../models/index.js'; - -export interface CreatePermissionGrant extends PermissionGrant { - /** The ID of the permission scheme in which to create a new permission grant. */ - schemeId: number; - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * `permissions` Returns all permission grants for each permission scheme. `user` Returns information about the user - * who is granted the permission. `group` Returns information about the group that is granted the permission. - * `projectRole` Returns information about the project role granted the permission. `field` Returns information about - * the custom field granted the permission. `all` Returns all expandable information. - */ - expand?: string; -} diff --git a/src/version2/parameters/createPermissionScheme.mts b/src/version2/parameters/createPermissionScheme.mts new file mode 100644 index 000000000..0a1bb35ff --- /dev/null +++ b/src/version2/parameters/createPermissionScheme.mts @@ -0,0 +1,25 @@ +import { PermissionScheme } from '../models/index.mjs'; + +export interface CreatePermissionScheme extends Omit { + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * - `all` Returns all expandable information. + * - `field` Returns information about the custom field granted the permission. + * - `group` Returns information about the group that is granted the permission. + * - `permissions` Returns all permission grants for each permission scheme. + * - `projectRole` Returns information about the project role granted the permission. + * - `user` Returns information about the user who is granted the permission. + */ + expand?: + | 'all' + | 'field' + | 'group' + | 'permissions' + | 'projectRole' + | 'user' + | ('all' | 'field' | 'group' | 'permissions' | 'projectRole' | 'user')[] + | string + | string[]; +} diff --git a/src/version2/parameters/createPermissionScheme.ts b/src/version2/parameters/createPermissionScheme.ts deleted file mode 100644 index 817484a79..000000000 --- a/src/version2/parameters/createPermissionScheme.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { PermissionScheme } from '../models/index.js'; - -export interface CreatePermissionScheme extends Omit { - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * - `all` Returns all expandable information. - * - `field` Returns information about the custom field granted the permission. - * - `group` Returns information about the group that is granted the permission. - * - `permissions` Returns all permission grants for each permission scheme. - * - `projectRole` Returns information about the project role granted the permission. - * - `user` Returns information about the user who is granted the permission. - */ - expand?: - | 'all' - | 'field' - | 'group' - | 'permissions' - | 'projectRole' - | 'user' - | ('all' | 'field' | 'group' | 'permissions' | 'projectRole' | 'user')[] - | string - | string[]; -} diff --git a/src/version2/parameters/createPriority.mts b/src/version2/parameters/createPriority.mts new file mode 100644 index 000000000..118720599 --- /dev/null +++ b/src/version2/parameters/createPriority.mts @@ -0,0 +1,3 @@ +import { CreatePriorityDetails } from '../models/index.mjs'; + +export interface CreatePriority extends CreatePriorityDetails {} diff --git a/src/version2/parameters/createPriority.ts b/src/version2/parameters/createPriority.ts deleted file mode 100644 index d9df2d764..000000000 --- a/src/version2/parameters/createPriority.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreatePriorityDetails } from '../models/index.js'; - -export interface CreatePriority extends CreatePriorityDetails {} diff --git a/src/version2/parameters/createProject.mts b/src/version2/parameters/createProject.mts new file mode 100644 index 000000000..d9a484ab8 --- /dev/null +++ b/src/version2/parameters/createProject.mts @@ -0,0 +1,3 @@ +import { CreateProjectDetails } from '../models/index.mjs'; + +export interface CreateProject extends CreateProjectDetails {} diff --git a/src/version2/parameters/createProject.ts b/src/version2/parameters/createProject.ts deleted file mode 100644 index da72e8b06..000000000 --- a/src/version2/parameters/createProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateProjectDetails } from '../models/index.js'; - -export interface CreateProject extends CreateProjectDetails {} diff --git a/src/version2/parameters/createProjectAvatar.ts b/src/version2/parameters/createProjectAvatar.mts similarity index 100% rename from src/version2/parameters/createProjectAvatar.ts rename to src/version2/parameters/createProjectAvatar.mts diff --git a/src/version2/parameters/createProjectCategory.mts b/src/version2/parameters/createProjectCategory.mts new file mode 100644 index 000000000..4f9bf350f --- /dev/null +++ b/src/version2/parameters/createProjectCategory.mts @@ -0,0 +1,3 @@ +import { ProjectCategory } from '../models/index.mjs'; + +export interface CreateProjectCategory extends ProjectCategory {} diff --git a/src/version2/parameters/createProjectCategory.ts b/src/version2/parameters/createProjectCategory.ts deleted file mode 100644 index 5a4d73ce1..000000000 --- a/src/version2/parameters/createProjectCategory.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ProjectCategory } from '../models/index.js'; - -export interface CreateProjectCategory extends ProjectCategory {} diff --git a/src/version2/parameters/createProjectRole.mts b/src/version2/parameters/createProjectRole.mts new file mode 100644 index 000000000..96e800bad --- /dev/null +++ b/src/version2/parameters/createProjectRole.mts @@ -0,0 +1,3 @@ +import { CreateUpdateRoleRequest } from '../models/index.mjs'; + +export interface CreateProjectRole extends CreateUpdateRoleRequest {} diff --git a/src/version2/parameters/createProjectRole.ts b/src/version2/parameters/createProjectRole.ts deleted file mode 100644 index bc1129ad2..000000000 --- a/src/version2/parameters/createProjectRole.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateUpdateRoleRequest } from '../models/index.js'; - -export interface CreateProjectRole extends CreateUpdateRoleRequest {} diff --git a/src/version2/parameters/createResolution.mts b/src/version2/parameters/createResolution.mts new file mode 100644 index 000000000..5027d7a38 --- /dev/null +++ b/src/version2/parameters/createResolution.mts @@ -0,0 +1,5 @@ +import { CreateResolutionDetails } from '../models/index.mjs'; + +export interface CreateResolution extends CreateResolutionDetails { + [key: string]: any; +} diff --git a/src/version2/parameters/createResolution.ts b/src/version2/parameters/createResolution.ts deleted file mode 100644 index 409a33510..000000000 --- a/src/version2/parameters/createResolution.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CreateResolutionDetails } from '../models/index.js'; - -export interface CreateResolution extends CreateResolutionDetails { - [key: string]: any; -} diff --git a/src/version2/parameters/createScreen.mts b/src/version2/parameters/createScreen.mts new file mode 100644 index 000000000..eb6da4bf2 --- /dev/null +++ b/src/version2/parameters/createScreen.mts @@ -0,0 +1,3 @@ +import { ScreenDetails } from '../models/index.mjs'; + +export interface CreateScreen extends ScreenDetails {} diff --git a/src/version2/parameters/createScreen.ts b/src/version2/parameters/createScreen.ts deleted file mode 100644 index 8c8a16a98..000000000 --- a/src/version2/parameters/createScreen.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ScreenDetails } from '../models/index.js'; - -export interface CreateScreen extends ScreenDetails {} diff --git a/src/version2/parameters/createScreenScheme.mts b/src/version2/parameters/createScreenScheme.mts new file mode 100644 index 000000000..8bf3d2df0 --- /dev/null +++ b/src/version2/parameters/createScreenScheme.mts @@ -0,0 +1,3 @@ +import { ScreenSchemeDetails } from '../models/index.mjs'; + +export interface CreateScreenScheme extends ScreenSchemeDetails {} diff --git a/src/version2/parameters/createScreenScheme.ts b/src/version2/parameters/createScreenScheme.ts deleted file mode 100644 index dcca7d96b..000000000 --- a/src/version2/parameters/createScreenScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ScreenSchemeDetails } from '../models/index.js'; - -export interface CreateScreenScheme extends ScreenSchemeDetails {} diff --git a/src/version2/parameters/createStatuses.mts b/src/version2/parameters/createStatuses.mts new file mode 100644 index 000000000..062949a39 --- /dev/null +++ b/src/version2/parameters/createStatuses.mts @@ -0,0 +1,3 @@ +import { StatusCreateRequest } from '../models/index.mjs'; + +export interface CreateStatuses extends StatusCreateRequest {} diff --git a/src/version2/parameters/createStatuses.ts b/src/version2/parameters/createStatuses.ts deleted file mode 100644 index 0eb765f17..000000000 --- a/src/version2/parameters/createStatuses.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { StatusCreateRequest } from '../models/index.js'; - -export interface CreateStatuses extends StatusCreateRequest {} diff --git a/src/version2/parameters/createUiModification.mts b/src/version2/parameters/createUiModification.mts new file mode 100644 index 000000000..410d9e327 --- /dev/null +++ b/src/version2/parameters/createUiModification.mts @@ -0,0 +1,3 @@ +import { CreateUiModificationDetails } from '../models/index.mjs'; + +export interface CreateUiModification extends CreateUiModificationDetails {} diff --git a/src/version2/parameters/createUiModification.ts b/src/version2/parameters/createUiModification.ts deleted file mode 100644 index b6efaba78..000000000 --- a/src/version2/parameters/createUiModification.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateUiModificationDetails } from '../models/index.js'; - -export interface CreateUiModification extends CreateUiModificationDetails {} diff --git a/src/version2/parameters/createUser.mts b/src/version2/parameters/createUser.mts new file mode 100644 index 000000000..f76f95c89 --- /dev/null +++ b/src/version2/parameters/createUser.mts @@ -0,0 +1,3 @@ +import { NewUserDetails } from '../models/index.mjs'; + +export interface CreateUser extends NewUserDetails {} diff --git a/src/version2/parameters/createUser.ts b/src/version2/parameters/createUser.ts deleted file mode 100644 index 34e04a5a7..000000000 --- a/src/version2/parameters/createUser.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { NewUserDetails } from '../models/index.js'; - -export interface CreateUser extends NewUserDetails {} diff --git a/src/version2/parameters/createVersion.mts b/src/version2/parameters/createVersion.mts new file mode 100644 index 000000000..44e2c9cbb --- /dev/null +++ b/src/version2/parameters/createVersion.mts @@ -0,0 +1,3 @@ +import { Version } from '../models/index.mjs'; + +export interface CreateVersion extends Version {} diff --git a/src/version2/parameters/createVersion.ts b/src/version2/parameters/createVersion.ts deleted file mode 100644 index f95e77627..000000000 --- a/src/version2/parameters/createVersion.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Version } from '../models/index.js'; - -export interface CreateVersion extends Version {} diff --git a/src/version2/parameters/createWorkflow.mts b/src/version2/parameters/createWorkflow.mts new file mode 100644 index 000000000..e1be64396 --- /dev/null +++ b/src/version2/parameters/createWorkflow.mts @@ -0,0 +1,3 @@ +import { CreateWorkflowDetails } from '../models/index.mjs'; + +export interface CreateWorkflow extends CreateWorkflowDetails {} diff --git a/src/version2/parameters/createWorkflow.ts b/src/version2/parameters/createWorkflow.ts deleted file mode 100644 index 957d08df8..000000000 --- a/src/version2/parameters/createWorkflow.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateWorkflowDetails } from '../models/index.js'; - -export interface CreateWorkflow extends CreateWorkflowDetails {} diff --git a/src/version2/parameters/createWorkflowScheme.mts b/src/version2/parameters/createWorkflowScheme.mts new file mode 100644 index 000000000..432890465 --- /dev/null +++ b/src/version2/parameters/createWorkflowScheme.mts @@ -0,0 +1,3 @@ +import { WorkflowScheme } from '../models/index.mjs'; + +export interface CreateWorkflowScheme extends WorkflowScheme {} diff --git a/src/version2/parameters/createWorkflowScheme.ts b/src/version2/parameters/createWorkflowScheme.ts deleted file mode 100644 index 4a147a312..000000000 --- a/src/version2/parameters/createWorkflowScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WorkflowScheme } from '../models/index.js'; - -export interface CreateWorkflowScheme extends WorkflowScheme {} diff --git a/src/version2/parameters/createWorkflowSchemeDraftFromParent.ts b/src/version2/parameters/createWorkflowSchemeDraftFromParent.mts similarity index 100% rename from src/version2/parameters/createWorkflowSchemeDraftFromParent.ts rename to src/version2/parameters/createWorkflowSchemeDraftFromParent.mts diff --git a/src/version2/parameters/createWorkflowTransitionProperty.mts b/src/version2/parameters/createWorkflowTransitionProperty.mts new file mode 100644 index 000000000..3c700f25f --- /dev/null +++ b/src/version2/parameters/createWorkflowTransitionProperty.mts @@ -0,0 +1,21 @@ +import { WorkflowTransitionProperty } from '../models/index.mjs'; + +export interface CreateWorkflowTransitionProperty extends WorkflowTransitionProperty { + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown + * next to the transition. + */ + transitionId: number; + /** + * The key of the property being added, also known as the name of the property. Set this to the same value as the + * `key` defined in the request body. + */ + key: string; + /** The name of the workflow that the transition belongs to. */ + workflowName: string; + /** + * The workflow status. Set to _live_ for inactive workflows or _draft_ for draft workflows. Active workflows cannot + * be edited. + */ + workflowMode?: 'live' | 'draft' | string; +} diff --git a/src/version2/parameters/createWorkflowTransitionProperty.ts b/src/version2/parameters/createWorkflowTransitionProperty.ts deleted file mode 100644 index ea92fa565..000000000 --- a/src/version2/parameters/createWorkflowTransitionProperty.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { WorkflowTransitionProperty } from '../models/index.js'; - -export interface CreateWorkflowTransitionProperty extends WorkflowTransitionProperty { - /** - * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown - * next to the transition. - */ - transitionId: number; - /** - * The key of the property being added, also known as the name of the property. Set this to the same value as the - * `key` defined in the request body. - */ - key: string; - /** The name of the workflow that the transition belongs to. */ - workflowName: string; - /** - * The workflow status. Set to _live_ for inactive workflows or _draft_ for draft workflows. Active workflows cannot - * be edited. - */ - workflowMode?: 'live' | 'draft' | string; -} diff --git a/src/version2/parameters/createWorkflows.mts b/src/version2/parameters/createWorkflows.mts new file mode 100644 index 000000000..70039122f --- /dev/null +++ b/src/version2/parameters/createWorkflows.mts @@ -0,0 +1,3 @@ +import { WorkflowCreateRequest } from '../models/index.mjs'; + +export interface CreateWorkflows extends WorkflowCreateRequest {} diff --git a/src/version2/parameters/createWorkflows.ts b/src/version2/parameters/createWorkflows.ts deleted file mode 100644 index 67b159b24..000000000 --- a/src/version2/parameters/createWorkflows.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WorkflowCreateRequest } from '../models/index.js'; - -export interface CreateWorkflows extends WorkflowCreateRequest {} diff --git a/src/version2/parameters/deleteActor.ts b/src/version2/parameters/deleteActor.mts similarity index 100% rename from src/version2/parameters/deleteActor.ts rename to src/version2/parameters/deleteActor.mts diff --git a/src/version2/parameters/deleteAddonProperty.ts b/src/version2/parameters/deleteAddonProperty.mts similarity index 100% rename from src/version2/parameters/deleteAddonProperty.ts rename to src/version2/parameters/deleteAddonProperty.mts diff --git a/src/version2/parameters/deleteAndReplaceVersion.mts b/src/version2/parameters/deleteAndReplaceVersion.mts new file mode 100644 index 000000000..9eac1c0ea --- /dev/null +++ b/src/version2/parameters/deleteAndReplaceVersion.mts @@ -0,0 +1,15 @@ +import { CustomFieldReplacement } from '../models/index.mjs'; + +export interface DeleteAndReplaceVersion { + /** The ID of the version. */ + id: string; + /** The ID of the version to update `fixVersion` to when the field contains the deleted version. */ + moveFixIssuesTo?: number; + /** The ID of the version to update `affectedVersion` to when the field contains the deleted version. */ + moveAffectedIssuesTo?: number; + /** + * An array of custom field IDs (`customFieldId`) and version IDs (`moveTo`) to update when the fields contain the + * deleted version. + */ + customFieldReplacementList?: CustomFieldReplacement[]; +} diff --git a/src/version2/parameters/deleteAndReplaceVersion.ts b/src/version2/parameters/deleteAndReplaceVersion.ts deleted file mode 100644 index 4c4ba2954..000000000 --- a/src/version2/parameters/deleteAndReplaceVersion.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { CustomFieldReplacement } from '../models/index.js'; - -export interface DeleteAndReplaceVersion { - /** The ID of the version. */ - id: string; - /** The ID of the version to update `fixVersion` to when the field contains the deleted version. */ - moveFixIssuesTo?: number; - /** The ID of the version to update `affectedVersion` to when the field contains the deleted version. */ - moveAffectedIssuesTo?: number; - /** - * An array of custom field IDs (`customFieldId`) and version IDs (`moveTo`) to update when the fields contain the - * deleted version. - */ - customFieldReplacementList?: CustomFieldReplacement[]; -} diff --git a/src/version2/parameters/deleteAppProperty.ts b/src/version2/parameters/deleteAppProperty.mts similarity index 100% rename from src/version2/parameters/deleteAppProperty.ts rename to src/version2/parameters/deleteAppProperty.mts diff --git a/src/version2/parameters/deleteAvatar.ts b/src/version2/parameters/deleteAvatar.mts similarity index 100% rename from src/version2/parameters/deleteAvatar.ts rename to src/version2/parameters/deleteAvatar.mts diff --git a/src/version2/parameters/deleteComment.ts b/src/version2/parameters/deleteComment.mts similarity index 100% rename from src/version2/parameters/deleteComment.ts rename to src/version2/parameters/deleteComment.mts diff --git a/src/version2/parameters/deleteCommentProperty.ts b/src/version2/parameters/deleteCommentProperty.mts similarity index 100% rename from src/version2/parameters/deleteCommentProperty.ts rename to src/version2/parameters/deleteCommentProperty.mts diff --git a/src/version2/parameters/deleteComponent.ts b/src/version2/parameters/deleteComponent.mts similarity index 100% rename from src/version2/parameters/deleteComponent.ts rename to src/version2/parameters/deleteComponent.mts diff --git a/src/version2/parameters/deleteCustomField.ts b/src/version2/parameters/deleteCustomField.mts similarity index 100% rename from src/version2/parameters/deleteCustomField.ts rename to src/version2/parameters/deleteCustomField.mts diff --git a/src/version2/parameters/deleteCustomFieldContext.ts b/src/version2/parameters/deleteCustomFieldContext.mts similarity index 100% rename from src/version2/parameters/deleteCustomFieldContext.ts rename to src/version2/parameters/deleteCustomFieldContext.mts diff --git a/src/version2/parameters/deleteCustomFieldOption.ts b/src/version2/parameters/deleteCustomFieldOption.mts similarity index 100% rename from src/version2/parameters/deleteCustomFieldOption.ts rename to src/version2/parameters/deleteCustomFieldOption.mts diff --git a/src/version2/parameters/deleteDashboard.ts b/src/version2/parameters/deleteDashboard.mts similarity index 100% rename from src/version2/parameters/deleteDashboard.ts rename to src/version2/parameters/deleteDashboard.mts diff --git a/src/version2/parameters/deleteDashboardItemProperty.ts b/src/version2/parameters/deleteDashboardItemProperty.mts similarity index 100% rename from src/version2/parameters/deleteDashboardItemProperty.ts rename to src/version2/parameters/deleteDashboardItemProperty.mts diff --git a/src/version2/parameters/deleteDefaultWorkflow.ts b/src/version2/parameters/deleteDefaultWorkflow.mts similarity index 100% rename from src/version2/parameters/deleteDefaultWorkflow.ts rename to src/version2/parameters/deleteDefaultWorkflow.mts diff --git a/src/version2/parameters/deleteDraftDefaultWorkflow.ts b/src/version2/parameters/deleteDraftDefaultWorkflow.mts similarity index 100% rename from src/version2/parameters/deleteDraftDefaultWorkflow.ts rename to src/version2/parameters/deleteDraftDefaultWorkflow.mts diff --git a/src/version2/parameters/deleteDraftWorkflowMapping.ts b/src/version2/parameters/deleteDraftWorkflowMapping.mts similarity index 100% rename from src/version2/parameters/deleteDraftWorkflowMapping.ts rename to src/version2/parameters/deleteDraftWorkflowMapping.mts diff --git a/src/version2/parameters/deleteFavouriteForFilter.ts b/src/version2/parameters/deleteFavouriteForFilter.mts similarity index 100% rename from src/version2/parameters/deleteFavouriteForFilter.ts rename to src/version2/parameters/deleteFavouriteForFilter.mts diff --git a/src/version2/parameters/deleteFieldConfiguration.ts b/src/version2/parameters/deleteFieldConfiguration.mts similarity index 100% rename from src/version2/parameters/deleteFieldConfiguration.ts rename to src/version2/parameters/deleteFieldConfiguration.mts diff --git a/src/version2/parameters/deleteFieldConfigurationScheme.ts b/src/version2/parameters/deleteFieldConfigurationScheme.mts similarity index 100% rename from src/version2/parameters/deleteFieldConfigurationScheme.ts rename to src/version2/parameters/deleteFieldConfigurationScheme.mts diff --git a/src/version2/parameters/deleteFilter.ts b/src/version2/parameters/deleteFilter.mts similarity index 100% rename from src/version2/parameters/deleteFilter.ts rename to src/version2/parameters/deleteFilter.mts diff --git a/src/version2/parameters/deleteInactiveWorkflow.ts b/src/version2/parameters/deleteInactiveWorkflow.mts similarity index 100% rename from src/version2/parameters/deleteInactiveWorkflow.ts rename to src/version2/parameters/deleteInactiveWorkflow.mts diff --git a/src/version2/parameters/deleteIssue.ts b/src/version2/parameters/deleteIssue.mts similarity index 100% rename from src/version2/parameters/deleteIssue.ts rename to src/version2/parameters/deleteIssue.mts diff --git a/src/version2/parameters/deleteIssueFieldOption.ts b/src/version2/parameters/deleteIssueFieldOption.mts similarity index 100% rename from src/version2/parameters/deleteIssueFieldOption.ts rename to src/version2/parameters/deleteIssueFieldOption.mts diff --git a/src/version2/parameters/deleteIssueLink.ts b/src/version2/parameters/deleteIssueLink.mts similarity index 100% rename from src/version2/parameters/deleteIssueLink.ts rename to src/version2/parameters/deleteIssueLink.mts diff --git a/src/version2/parameters/deleteIssueLinkType.ts b/src/version2/parameters/deleteIssueLinkType.mts similarity index 100% rename from src/version2/parameters/deleteIssueLinkType.ts rename to src/version2/parameters/deleteIssueLinkType.mts diff --git a/src/version2/parameters/deleteIssueProperty.ts b/src/version2/parameters/deleteIssueProperty.mts similarity index 100% rename from src/version2/parameters/deleteIssueProperty.ts rename to src/version2/parameters/deleteIssueProperty.mts diff --git a/src/version2/parameters/deleteIssueType.ts b/src/version2/parameters/deleteIssueType.mts similarity index 100% rename from src/version2/parameters/deleteIssueType.ts rename to src/version2/parameters/deleteIssueType.mts diff --git a/src/version2/parameters/deleteIssueTypeProperty.ts b/src/version2/parameters/deleteIssueTypeProperty.mts similarity index 100% rename from src/version2/parameters/deleteIssueTypeProperty.ts rename to src/version2/parameters/deleteIssueTypeProperty.mts diff --git a/src/version2/parameters/deleteIssueTypeScheme.ts b/src/version2/parameters/deleteIssueTypeScheme.mts similarity index 100% rename from src/version2/parameters/deleteIssueTypeScheme.ts rename to src/version2/parameters/deleteIssueTypeScheme.mts diff --git a/src/version2/parameters/deleteIssueTypeScreenScheme.ts b/src/version2/parameters/deleteIssueTypeScreenScheme.mts similarity index 100% rename from src/version2/parameters/deleteIssueTypeScreenScheme.ts rename to src/version2/parameters/deleteIssueTypeScreenScheme.mts diff --git a/src/version2/parameters/deleteNotificationScheme.ts b/src/version2/parameters/deleteNotificationScheme.mts similarity index 100% rename from src/version2/parameters/deleteNotificationScheme.ts rename to src/version2/parameters/deleteNotificationScheme.mts diff --git a/src/version2/parameters/deletePermissionScheme.ts b/src/version2/parameters/deletePermissionScheme.mts similarity index 100% rename from src/version2/parameters/deletePermissionScheme.ts rename to src/version2/parameters/deletePermissionScheme.mts diff --git a/src/version2/parameters/deletePermissionSchemeEntity.ts b/src/version2/parameters/deletePermissionSchemeEntity.mts similarity index 100% rename from src/version2/parameters/deletePermissionSchemeEntity.ts rename to src/version2/parameters/deletePermissionSchemeEntity.mts diff --git a/src/version2/parameters/deleteProject.ts b/src/version2/parameters/deleteProject.mts similarity index 100% rename from src/version2/parameters/deleteProject.ts rename to src/version2/parameters/deleteProject.mts diff --git a/src/version2/parameters/deleteProjectAsynchronously.ts b/src/version2/parameters/deleteProjectAsynchronously.mts similarity index 100% rename from src/version2/parameters/deleteProjectAsynchronously.ts rename to src/version2/parameters/deleteProjectAsynchronously.mts diff --git a/src/version2/parameters/deleteProjectAvatar.ts b/src/version2/parameters/deleteProjectAvatar.mts similarity index 100% rename from src/version2/parameters/deleteProjectAvatar.ts rename to src/version2/parameters/deleteProjectAvatar.mts diff --git a/src/version2/parameters/deleteProjectProperty.ts b/src/version2/parameters/deleteProjectProperty.mts similarity index 100% rename from src/version2/parameters/deleteProjectProperty.ts rename to src/version2/parameters/deleteProjectProperty.mts diff --git a/src/version2/parameters/deleteProjectRole.ts b/src/version2/parameters/deleteProjectRole.mts similarity index 100% rename from src/version2/parameters/deleteProjectRole.ts rename to src/version2/parameters/deleteProjectRole.mts diff --git a/src/version2/parameters/deleteProjectRoleActorsFromRole.ts b/src/version2/parameters/deleteProjectRoleActorsFromRole.mts similarity index 100% rename from src/version2/parameters/deleteProjectRoleActorsFromRole.ts rename to src/version2/parameters/deleteProjectRoleActorsFromRole.mts diff --git a/src/version2/parameters/deleteRemoteIssueLinkByGlobalId.ts b/src/version2/parameters/deleteRemoteIssueLinkByGlobalId.mts similarity index 100% rename from src/version2/parameters/deleteRemoteIssueLinkByGlobalId.ts rename to src/version2/parameters/deleteRemoteIssueLinkByGlobalId.mts diff --git a/src/version2/parameters/deleteRemoteIssueLinkById.ts b/src/version2/parameters/deleteRemoteIssueLinkById.mts similarity index 100% rename from src/version2/parameters/deleteRemoteIssueLinkById.ts rename to src/version2/parameters/deleteRemoteIssueLinkById.mts diff --git a/src/version2/parameters/deleteResolution.ts b/src/version2/parameters/deleteResolution.mts similarity index 100% rename from src/version2/parameters/deleteResolution.ts rename to src/version2/parameters/deleteResolution.mts diff --git a/src/version2/parameters/deleteScreen.ts b/src/version2/parameters/deleteScreen.mts similarity index 100% rename from src/version2/parameters/deleteScreen.ts rename to src/version2/parameters/deleteScreen.mts diff --git a/src/version2/parameters/deleteScreenScheme.ts b/src/version2/parameters/deleteScreenScheme.mts similarity index 100% rename from src/version2/parameters/deleteScreenScheme.ts rename to src/version2/parameters/deleteScreenScheme.mts diff --git a/src/version2/parameters/deleteScreenTab.ts b/src/version2/parameters/deleteScreenTab.mts similarity index 100% rename from src/version2/parameters/deleteScreenTab.ts rename to src/version2/parameters/deleteScreenTab.mts diff --git a/src/version2/parameters/deleteSecurityScheme.ts b/src/version2/parameters/deleteSecurityScheme.mts similarity index 100% rename from src/version2/parameters/deleteSecurityScheme.ts rename to src/version2/parameters/deleteSecurityScheme.mts diff --git a/src/version2/parameters/deleteSharePermission.ts b/src/version2/parameters/deleteSharePermission.mts similarity index 100% rename from src/version2/parameters/deleteSharePermission.ts rename to src/version2/parameters/deleteSharePermission.mts diff --git a/src/version2/parameters/deleteStatusesById.ts b/src/version2/parameters/deleteStatusesById.mts similarity index 100% rename from src/version2/parameters/deleteStatusesById.ts rename to src/version2/parameters/deleteStatusesById.mts diff --git a/src/version2/parameters/deleteUiModification.ts b/src/version2/parameters/deleteUiModification.mts similarity index 100% rename from src/version2/parameters/deleteUiModification.ts rename to src/version2/parameters/deleteUiModification.mts diff --git a/src/version2/parameters/deleteUserProperty.ts b/src/version2/parameters/deleteUserProperty.mts similarity index 100% rename from src/version2/parameters/deleteUserProperty.ts rename to src/version2/parameters/deleteUserProperty.mts diff --git a/src/version2/parameters/deleteWebhookById.mts b/src/version2/parameters/deleteWebhookById.mts new file mode 100644 index 000000000..56e014fe8 --- /dev/null +++ b/src/version2/parameters/deleteWebhookById.mts @@ -0,0 +1,3 @@ +import { ContainerForWebhookIDs } from '../models/index.mjs'; + +export interface DeleteWebhookById extends ContainerForWebhookIDs {} diff --git a/src/version2/parameters/deleteWebhookById.ts b/src/version2/parameters/deleteWebhookById.ts deleted file mode 100644 index 9d3a99a1b..000000000 --- a/src/version2/parameters/deleteWebhookById.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ContainerForWebhookIDs } from '../models/index.js'; - -export interface DeleteWebhookById extends ContainerForWebhookIDs {} diff --git a/src/version2/parameters/deleteWorkflowMapping.ts b/src/version2/parameters/deleteWorkflowMapping.mts similarity index 100% rename from src/version2/parameters/deleteWorkflowMapping.ts rename to src/version2/parameters/deleteWorkflowMapping.mts diff --git a/src/version2/parameters/deleteWorkflowScheme.ts b/src/version2/parameters/deleteWorkflowScheme.mts similarity index 100% rename from src/version2/parameters/deleteWorkflowScheme.ts rename to src/version2/parameters/deleteWorkflowScheme.mts diff --git a/src/version2/parameters/deleteWorkflowSchemeDraft.ts b/src/version2/parameters/deleteWorkflowSchemeDraft.mts similarity index 100% rename from src/version2/parameters/deleteWorkflowSchemeDraft.ts rename to src/version2/parameters/deleteWorkflowSchemeDraft.mts diff --git a/src/version2/parameters/deleteWorkflowSchemeDraftIssueType.ts b/src/version2/parameters/deleteWorkflowSchemeDraftIssueType.mts similarity index 100% rename from src/version2/parameters/deleteWorkflowSchemeDraftIssueType.ts rename to src/version2/parameters/deleteWorkflowSchemeDraftIssueType.mts diff --git a/src/version2/parameters/deleteWorkflowSchemeIssueType.ts b/src/version2/parameters/deleteWorkflowSchemeIssueType.mts similarity index 100% rename from src/version2/parameters/deleteWorkflowSchemeIssueType.ts rename to src/version2/parameters/deleteWorkflowSchemeIssueType.mts diff --git a/src/version2/parameters/deleteWorkflowTransitionProperty.ts b/src/version2/parameters/deleteWorkflowTransitionProperty.mts similarity index 100% rename from src/version2/parameters/deleteWorkflowTransitionProperty.ts rename to src/version2/parameters/deleteWorkflowTransitionProperty.mts diff --git a/src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.mts b/src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.mts new file mode 100644 index 000000000..6981ed625 --- /dev/null +++ b/src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.mts @@ -0,0 +1,3 @@ +import { WorkflowsWithTransitionRulesDetails } from '../models/index.mjs'; + +export interface DeleteWorkflowTransitionRuleConfigurations extends WorkflowsWithTransitionRulesDetails {} diff --git a/src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.ts b/src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.ts deleted file mode 100644 index 1bde9fa1b..000000000 --- a/src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WorkflowsWithTransitionRulesDetails } from '../models/index.js'; - -export interface DeleteWorkflowTransitionRuleConfigurations extends WorkflowsWithTransitionRulesDetails {} diff --git a/src/version2/parameters/deleteWorklog.ts b/src/version2/parameters/deleteWorklog.mts similarity index 100% rename from src/version2/parameters/deleteWorklog.ts rename to src/version2/parameters/deleteWorklog.mts diff --git a/src/version2/parameters/deleteWorklogProperty.ts b/src/version2/parameters/deleteWorklogProperty.mts similarity index 100% rename from src/version2/parameters/deleteWorklogProperty.ts rename to src/version2/parameters/deleteWorklogProperty.mts diff --git a/src/version2/parameters/doTransition.mts b/src/version2/parameters/doTransition.mts new file mode 100644 index 000000000..4c396774d --- /dev/null +++ b/src/version2/parameters/doTransition.mts @@ -0,0 +1,6 @@ +import { IssueUpdateDetails } from '../models/index.mjs'; + +export interface DoTransition extends IssueUpdateDetails { + /** The ID or key of the issue. */ + issueIdOrKey: string; +} diff --git a/src/version2/parameters/doTransition.ts b/src/version2/parameters/doTransition.ts deleted file mode 100644 index df7599edb..000000000 --- a/src/version2/parameters/doTransition.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueUpdateDetails } from '../models/index.js'; - -export interface DoTransition extends IssueUpdateDetails { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/editIssue.mts b/src/version2/parameters/editIssue.mts new file mode 100644 index 000000000..ef0429137 --- /dev/null +++ b/src/version2/parameters/editIssue.mts @@ -0,0 +1,31 @@ +import { IssueUpdateDetails } from '../models/index.mjs'; + +export interface EditIssue extends IssueUpdateDetails { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** + * Whether a notification email about the issue update is sent to all watchers. To disable the notification, + * administer Jira or administer project permissions are required. If the user doesn't have the necessary permission + * the request is ignored. + */ + notifyUsers?: boolean; + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect app users with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of + * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideScreenSecurity?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of + * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + /** + * Whether the response should contain the issue with fields edited in this request. The returned issue will have the + * same format as in the [Get issue API](#api-rest-api-3-issue-issueidorkey-get). + */ + returnIssue?: boolean; + /** The Get issue API expand parameter to use in the response if the `returnIssue` parameter is `true`. */ + expand?: string; +} diff --git a/src/version2/parameters/editIssue.ts b/src/version2/parameters/editIssue.ts deleted file mode 100644 index 267930c4d..000000000 --- a/src/version2/parameters/editIssue.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { IssueUpdateDetails } from '../models/index.js'; - -export interface EditIssue extends IssueUpdateDetails { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * Whether a notification email about the issue update is sent to all watchers. To disable the notification, - * administer Jira or administer project permissions are required. If the user doesn't have the necessary permission - * the request is ignored. - */ - notifyUsers?: boolean; - /** - * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect app users with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of - * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideScreenSecurity?: boolean; - /** - * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of - * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideEditableFlag?: boolean; - /** - * Whether the response should contain the issue with fields edited in this request. The returned issue will have the - * same format as in the [Get issue API](#api-rest-api-3-issue-issueidorkey-get). - */ - returnIssue?: boolean; - /** The Get issue API expand parameter to use in the response if the `returnIssue` parameter is `true`. */ - expand?: string; -} diff --git a/src/version2/parameters/evaluateJiraExpression.mts b/src/version2/parameters/evaluateJiraExpression.mts new file mode 100644 index 000000000..e79085e36 --- /dev/null +++ b/src/version2/parameters/evaluateJiraExpression.mts @@ -0,0 +1,13 @@ +import { JiraExpressionEvalRequest } from '../models/index.mjs'; + +export interface EvaluateJiraExpression extends JiraExpressionEvalRequest { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts `meta.complexity` that returns information about the expression + * complexity. For example, the number of expensive operations used by the expression and how close the expression is + * to reaching the [complexity + * limit](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions). Useful when designing + * and debugging your expressions. + */ + expand?: string; +} diff --git a/src/version2/parameters/evaluateJiraExpression.ts b/src/version2/parameters/evaluateJiraExpression.ts deleted file mode 100644 index 14347b38b..000000000 --- a/src/version2/parameters/evaluateJiraExpression.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { JiraExpressionEvalRequest } from '../models/index.js'; - -export interface EvaluateJiraExpression extends JiraExpressionEvalRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts `meta.complexity` that returns information about the expression - * complexity. For example, the number of expensive operations used by the expression and how close the expression is - * to reaching the [complexity - * limit](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions). Useful when designing - * and debugging your expressions. - */ - expand?: string; -} diff --git a/src/version2/parameters/expandAttachmentForHumans.ts b/src/version2/parameters/expandAttachmentForHumans.mts similarity index 100% rename from src/version2/parameters/expandAttachmentForHumans.ts rename to src/version2/parameters/expandAttachmentForHumans.mts diff --git a/src/version2/parameters/expandAttachmentForMachines.ts b/src/version2/parameters/expandAttachmentForMachines.mts similarity index 100% rename from src/version2/parameters/expandAttachmentForMachines.ts rename to src/version2/parameters/expandAttachmentForMachines.mts diff --git a/src/version2/parameters/exportArchivedIssues.mts b/src/version2/parameters/exportArchivedIssues.mts new file mode 100644 index 000000000..819cb4343 --- /dev/null +++ b/src/version2/parameters/exportArchivedIssues.mts @@ -0,0 +1,14 @@ +import { DateRangeFilter } from '../models/index.mjs'; + +/** Details of a filter for exporting archived issues. */ +export interface ExportArchivedIssues { + /** List archived issues archived by a specified account ID. */ + archivedBy?: string[]; + archivedDateRange?: DateRangeFilter; + /** List archived issues with a specified issue type ID. */ + issueTypes?: string[]; + /** List archived issues with a specified project key. */ + projects?: string[]; + /** List archived issues where the reporter is a specified account ID. */ + reporters?: string[]; +} diff --git a/src/version2/parameters/exportArchivedIssues.ts b/src/version2/parameters/exportArchivedIssues.ts deleted file mode 100644 index aec263c5a..000000000 --- a/src/version2/parameters/exportArchivedIssues.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { DateRangeFilter } from '../models/index.js'; - -/** Details of a filter for exporting archived issues. */ -export interface ExportArchivedIssues { - /** List archived issues archived by a specified account ID. */ - archivedBy?: string[]; - archivedDateRange?: DateRangeFilter; - /** List archived issues with a specified issue type ID. */ - issueTypes?: string[]; - /** List archived issues with a specified project key. */ - projects?: string[]; - /** List archived issues where the reporter is a specified account ID. */ - reporters?: string[]; -} diff --git a/src/version2/parameters/findAssignableUsers.ts b/src/version2/parameters/findAssignableUsers.mts similarity index 100% rename from src/version2/parameters/findAssignableUsers.ts rename to src/version2/parameters/findAssignableUsers.mts diff --git a/src/version2/parameters/findBulkAssignableUsers.ts b/src/version2/parameters/findBulkAssignableUsers.mts similarity index 100% rename from src/version2/parameters/findBulkAssignableUsers.ts rename to src/version2/parameters/findBulkAssignableUsers.mts diff --git a/src/version2/parameters/findGroups.ts b/src/version2/parameters/findGroups.mts similarity index 100% rename from src/version2/parameters/findGroups.ts rename to src/version2/parameters/findGroups.mts diff --git a/src/version2/parameters/findUserKeysByQuery.ts b/src/version2/parameters/findUserKeysByQuery.mts similarity index 100% rename from src/version2/parameters/findUserKeysByQuery.ts rename to src/version2/parameters/findUserKeysByQuery.mts diff --git a/src/version2/parameters/findUsers.ts b/src/version2/parameters/findUsers.mts similarity index 100% rename from src/version2/parameters/findUsers.ts rename to src/version2/parameters/findUsers.mts diff --git a/src/version2/parameters/findUsersAndGroups.ts b/src/version2/parameters/findUsersAndGroups.mts similarity index 100% rename from src/version2/parameters/findUsersAndGroups.ts rename to src/version2/parameters/findUsersAndGroups.mts diff --git a/src/version2/parameters/findUsersByQuery.ts b/src/version2/parameters/findUsersByQuery.mts similarity index 100% rename from src/version2/parameters/findUsersByQuery.ts rename to src/version2/parameters/findUsersByQuery.mts diff --git a/src/version2/parameters/findUsersForPicker.ts b/src/version2/parameters/findUsersForPicker.mts similarity index 100% rename from src/version2/parameters/findUsersForPicker.ts rename to src/version2/parameters/findUsersForPicker.mts diff --git a/src/version2/parameters/findUsersWithAllPermissions.ts b/src/version2/parameters/findUsersWithAllPermissions.mts similarity index 100% rename from src/version2/parameters/findUsersWithAllPermissions.ts rename to src/version2/parameters/findUsersWithAllPermissions.mts diff --git a/src/version2/parameters/findUsersWithBrowsePermission.ts b/src/version2/parameters/findUsersWithBrowsePermission.mts similarity index 100% rename from src/version2/parameters/findUsersWithBrowsePermission.ts rename to src/version2/parameters/findUsersWithBrowsePermission.mts diff --git a/src/version2/parameters/fullyUpdateProjectRole.mts b/src/version2/parameters/fullyUpdateProjectRole.mts new file mode 100644 index 000000000..ecf84fea5 --- /dev/null +++ b/src/version2/parameters/fullyUpdateProjectRole.mts @@ -0,0 +1,9 @@ +import { CreateUpdateRoleRequest } from '../models/index.mjs'; + +export interface FullyUpdateProjectRole extends CreateUpdateRoleRequest { + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: number; +} diff --git a/src/version2/parameters/fullyUpdateProjectRole.ts b/src/version2/parameters/fullyUpdateProjectRole.ts deleted file mode 100644 index 8e9ed77cc..000000000 --- a/src/version2/parameters/fullyUpdateProjectRole.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { CreateUpdateRoleRequest } from '../models/index.js'; - -export interface FullyUpdateProjectRole extends CreateUpdateRoleRequest { - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version2/parameters/getAccessibleProjectTypeByKey.ts b/src/version2/parameters/getAccessibleProjectTypeByKey.mts similarity index 100% rename from src/version2/parameters/getAccessibleProjectTypeByKey.ts rename to src/version2/parameters/getAccessibleProjectTypeByKey.mts diff --git a/src/version2/parameters/getAddonProperties.ts b/src/version2/parameters/getAddonProperties.mts similarity index 100% rename from src/version2/parameters/getAddonProperties.ts rename to src/version2/parameters/getAddonProperties.mts diff --git a/src/version2/parameters/getAddonProperty.ts b/src/version2/parameters/getAddonProperty.mts similarity index 100% rename from src/version2/parameters/getAddonProperty.ts rename to src/version2/parameters/getAddonProperty.mts diff --git a/src/version2/parameters/getAllDashboards.ts b/src/version2/parameters/getAllDashboards.mts similarity index 100% rename from src/version2/parameters/getAllDashboards.ts rename to src/version2/parameters/getAllDashboards.mts diff --git a/src/version2/parameters/getAllFieldConfigurationSchemes.ts b/src/version2/parameters/getAllFieldConfigurationSchemes.mts similarity index 100% rename from src/version2/parameters/getAllFieldConfigurationSchemes.ts rename to src/version2/parameters/getAllFieldConfigurationSchemes.mts diff --git a/src/version2/parameters/getAllFieldConfigurations.ts b/src/version2/parameters/getAllFieldConfigurations.mts similarity index 100% rename from src/version2/parameters/getAllFieldConfigurations.ts rename to src/version2/parameters/getAllFieldConfigurations.mts diff --git a/src/version2/parameters/getAllGadgets.ts b/src/version2/parameters/getAllGadgets.mts similarity index 100% rename from src/version2/parameters/getAllGadgets.ts rename to src/version2/parameters/getAllGadgets.mts diff --git a/src/version2/parameters/getAllIssueFieldOptions.ts b/src/version2/parameters/getAllIssueFieldOptions.mts similarity index 100% rename from src/version2/parameters/getAllIssueFieldOptions.ts rename to src/version2/parameters/getAllIssueFieldOptions.mts diff --git a/src/version2/parameters/getAllIssueTypeSchemes.ts b/src/version2/parameters/getAllIssueTypeSchemes.mts similarity index 100% rename from src/version2/parameters/getAllIssueTypeSchemes.ts rename to src/version2/parameters/getAllIssueTypeSchemes.mts diff --git a/src/version2/parameters/getAllLabels.ts b/src/version2/parameters/getAllLabels.mts similarity index 100% rename from src/version2/parameters/getAllLabels.ts rename to src/version2/parameters/getAllLabels.mts diff --git a/src/version2/parameters/getAllPermissionSchemes.ts b/src/version2/parameters/getAllPermissionSchemes.mts similarity index 100% rename from src/version2/parameters/getAllPermissionSchemes.ts rename to src/version2/parameters/getAllPermissionSchemes.mts diff --git a/src/version2/parameters/getAllProjectAvatars.ts b/src/version2/parameters/getAllProjectAvatars.mts similarity index 100% rename from src/version2/parameters/getAllProjectAvatars.ts rename to src/version2/parameters/getAllProjectAvatars.mts diff --git a/src/version2/parameters/getAllScreenTabFields.ts b/src/version2/parameters/getAllScreenTabFields.mts similarity index 100% rename from src/version2/parameters/getAllScreenTabFields.ts rename to src/version2/parameters/getAllScreenTabFields.mts diff --git a/src/version2/parameters/getAllScreenTabs.ts b/src/version2/parameters/getAllScreenTabs.mts similarity index 100% rename from src/version2/parameters/getAllScreenTabs.ts rename to src/version2/parameters/getAllScreenTabs.mts diff --git a/src/version2/parameters/getAllStatuses.ts b/src/version2/parameters/getAllStatuses.mts similarity index 100% rename from src/version2/parameters/getAllStatuses.ts rename to src/version2/parameters/getAllStatuses.mts diff --git a/src/version2/parameters/getAllSystemAvatars.ts b/src/version2/parameters/getAllSystemAvatars.mts similarity index 100% rename from src/version2/parameters/getAllSystemAvatars.ts rename to src/version2/parameters/getAllSystemAvatars.mts diff --git a/src/version2/parameters/getAllUsers.ts b/src/version2/parameters/getAllUsers.mts similarity index 100% rename from src/version2/parameters/getAllUsers.ts rename to src/version2/parameters/getAllUsers.mts diff --git a/src/version2/parameters/getAllUsersDefault.ts b/src/version2/parameters/getAllUsersDefault.mts similarity index 100% rename from src/version2/parameters/getAllUsersDefault.ts rename to src/version2/parameters/getAllUsersDefault.mts diff --git a/src/version2/parameters/getAllWorkflowSchemes.ts b/src/version2/parameters/getAllWorkflowSchemes.mts similarity index 100% rename from src/version2/parameters/getAllWorkflowSchemes.ts rename to src/version2/parameters/getAllWorkflowSchemes.mts diff --git a/src/version2/parameters/getAlternativeIssueTypes.ts b/src/version2/parameters/getAlternativeIssueTypes.mts similarity index 100% rename from src/version2/parameters/getAlternativeIssueTypes.ts rename to src/version2/parameters/getAlternativeIssueTypes.mts diff --git a/src/version2/parameters/getApplicationProperty.ts b/src/version2/parameters/getApplicationProperty.mts similarity index 100% rename from src/version2/parameters/getApplicationProperty.ts rename to src/version2/parameters/getApplicationProperty.mts diff --git a/src/version2/parameters/getApplicationRole.ts b/src/version2/parameters/getApplicationRole.mts similarity index 100% rename from src/version2/parameters/getApplicationRole.ts rename to src/version2/parameters/getApplicationRole.mts diff --git a/src/version2/parameters/getAssignedPermissionScheme.ts b/src/version2/parameters/getAssignedPermissionScheme.mts similarity index 100% rename from src/version2/parameters/getAssignedPermissionScheme.ts rename to src/version2/parameters/getAssignedPermissionScheme.mts diff --git a/src/version2/parameters/getAttachment.ts b/src/version2/parameters/getAttachment.mts similarity index 100% rename from src/version2/parameters/getAttachment.ts rename to src/version2/parameters/getAttachment.mts diff --git a/src/version2/parameters/getAttachmentContent.ts b/src/version2/parameters/getAttachmentContent.mts similarity index 100% rename from src/version2/parameters/getAttachmentContent.ts rename to src/version2/parameters/getAttachmentContent.mts diff --git a/src/version2/parameters/getAttachmentThumbnail.ts b/src/version2/parameters/getAttachmentThumbnail.mts similarity index 100% rename from src/version2/parameters/getAttachmentThumbnail.ts rename to src/version2/parameters/getAttachmentThumbnail.mts diff --git a/src/version2/parameters/getAuditRecords.ts b/src/version2/parameters/getAuditRecords.mts similarity index 100% rename from src/version2/parameters/getAuditRecords.ts rename to src/version2/parameters/getAuditRecords.mts diff --git a/src/version2/parameters/getAutoCompletePost.mts b/src/version2/parameters/getAutoCompletePost.mts new file mode 100644 index 000000000..4128979f5 --- /dev/null +++ b/src/version2/parameters/getAutoCompletePost.mts @@ -0,0 +1,3 @@ +import { SearchAutoComplete } from '../models/index.mjs'; + +export interface GetAutoCompletePost extends SearchAutoComplete {} diff --git a/src/version2/parameters/getAutoCompletePost.ts b/src/version2/parameters/getAutoCompletePost.ts deleted file mode 100644 index 975a05c68..000000000 --- a/src/version2/parameters/getAutoCompletePost.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SearchAutoComplete } from '../models/index.js'; - -export interface GetAutoCompletePost extends SearchAutoComplete {} diff --git a/src/version2/parameters/getAvailableScreenFields.ts b/src/version2/parameters/getAvailableScreenFields.mts similarity index 100% rename from src/version2/parameters/getAvailableScreenFields.ts rename to src/version2/parameters/getAvailableScreenFields.mts diff --git a/src/version2/parameters/getAvatarImageByID.ts b/src/version2/parameters/getAvatarImageByID.mts similarity index 100% rename from src/version2/parameters/getAvatarImageByID.ts rename to src/version2/parameters/getAvatarImageByID.mts diff --git a/src/version2/parameters/getAvatarImageByOwner.ts b/src/version2/parameters/getAvatarImageByOwner.mts similarity index 100% rename from src/version2/parameters/getAvatarImageByOwner.ts rename to src/version2/parameters/getAvatarImageByOwner.mts diff --git a/src/version2/parameters/getAvatarImageByType.ts b/src/version2/parameters/getAvatarImageByType.mts similarity index 100% rename from src/version2/parameters/getAvatarImageByType.ts rename to src/version2/parameters/getAvatarImageByType.mts diff --git a/src/version2/parameters/getAvatars.ts b/src/version2/parameters/getAvatars.mts similarity index 100% rename from src/version2/parameters/getAvatars.ts rename to src/version2/parameters/getAvatars.mts diff --git a/src/version2/parameters/getBulkPermissions.mts b/src/version2/parameters/getBulkPermissions.mts new file mode 100644 index 000000000..e8f237419 --- /dev/null +++ b/src/version2/parameters/getBulkPermissions.mts @@ -0,0 +1,3 @@ +import { BulkPermissionsRequest } from '../models/index.mjs'; + +export interface GetBulkPermissions extends BulkPermissionsRequest {} diff --git a/src/version2/parameters/getBulkPermissions.ts b/src/version2/parameters/getBulkPermissions.ts deleted file mode 100644 index 433650350..000000000 --- a/src/version2/parameters/getBulkPermissions.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { BulkPermissionsRequest } from '../models/index.js'; - -export interface GetBulkPermissions extends BulkPermissionsRequest {} diff --git a/src/version2/parameters/getChangeLogs.ts b/src/version2/parameters/getChangeLogs.mts similarity index 100% rename from src/version2/parameters/getChangeLogs.ts rename to src/version2/parameters/getChangeLogs.mts diff --git a/src/version2/parameters/getChangeLogsByIds.mts b/src/version2/parameters/getChangeLogsByIds.mts new file mode 100644 index 000000000..873e9d688 --- /dev/null +++ b/src/version2/parameters/getChangeLogsByIds.mts @@ -0,0 +1,6 @@ +import { IssueChangelogIds } from '../models/index.mjs'; + +export interface GetChangeLogsByIds extends IssueChangelogIds { + /** The ID or key of the issue. */ + issueIdOrKey: string; +} diff --git a/src/version2/parameters/getChangeLogsByIds.ts b/src/version2/parameters/getChangeLogsByIds.ts deleted file mode 100644 index 8e46cbc51..000000000 --- a/src/version2/parameters/getChangeLogsByIds.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueChangelogIds } from '../models/index.js'; - -export interface GetChangeLogsByIds extends IssueChangelogIds { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/getColumns.ts b/src/version2/parameters/getColumns.mts similarity index 100% rename from src/version2/parameters/getColumns.ts rename to src/version2/parameters/getColumns.mts diff --git a/src/version2/parameters/getComment.ts b/src/version2/parameters/getComment.mts similarity index 100% rename from src/version2/parameters/getComment.ts rename to src/version2/parameters/getComment.mts diff --git a/src/version2/parameters/getCommentProperty.ts b/src/version2/parameters/getCommentProperty.mts similarity index 100% rename from src/version2/parameters/getCommentProperty.ts rename to src/version2/parameters/getCommentProperty.mts diff --git a/src/version2/parameters/getCommentPropertyKeys.ts b/src/version2/parameters/getCommentPropertyKeys.mts similarity index 100% rename from src/version2/parameters/getCommentPropertyKeys.ts rename to src/version2/parameters/getCommentPropertyKeys.mts diff --git a/src/version2/parameters/getComments.ts b/src/version2/parameters/getComments.mts similarity index 100% rename from src/version2/parameters/getComments.ts rename to src/version2/parameters/getComments.mts diff --git a/src/version2/parameters/getCommentsByIds.mts b/src/version2/parameters/getCommentsByIds.mts new file mode 100644 index 000000000..8fce63f12 --- /dev/null +++ b/src/version2/parameters/getCommentsByIds.mts @@ -0,0 +1,11 @@ +import { IssueCommentListRequest } from '../models/index.mjs'; + +export interface GetCommentsByIds extends IssueCommentListRequest { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts a comma-separated list. Expand options include: + * + * `renderedBody` Returns the comment body rendered in HTML. `properties` Returns the comment's properties. + */ + expand?: string; +} diff --git a/src/version2/parameters/getCommentsByIds.ts b/src/version2/parameters/getCommentsByIds.ts deleted file mode 100644 index 25bb0b2f9..000000000 --- a/src/version2/parameters/getCommentsByIds.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { IssueCommentListRequest } from '../models/index.js'; - -export interface GetCommentsByIds extends IssueCommentListRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `renderedBody` Returns the comment body rendered in HTML. `properties` Returns the comment's properties. - */ - expand?: string; -} diff --git a/src/version2/parameters/getComponent.ts b/src/version2/parameters/getComponent.mts similarity index 100% rename from src/version2/parameters/getComponent.ts rename to src/version2/parameters/getComponent.mts diff --git a/src/version2/parameters/getComponentRelatedIssues.ts b/src/version2/parameters/getComponentRelatedIssues.mts similarity index 100% rename from src/version2/parameters/getComponentRelatedIssues.ts rename to src/version2/parameters/getComponentRelatedIssues.mts diff --git a/src/version2/parameters/getContextsForField.ts b/src/version2/parameters/getContextsForField.mts similarity index 100% rename from src/version2/parameters/getContextsForField.ts rename to src/version2/parameters/getContextsForField.mts diff --git a/src/version2/parameters/getCreateIssueMeta.ts b/src/version2/parameters/getCreateIssueMeta.mts similarity index 100% rename from src/version2/parameters/getCreateIssueMeta.ts rename to src/version2/parameters/getCreateIssueMeta.mts diff --git a/src/version2/parameters/getCurrentUser.ts b/src/version2/parameters/getCurrentUser.mts similarity index 100% rename from src/version2/parameters/getCurrentUser.ts rename to src/version2/parameters/getCurrentUser.mts diff --git a/src/version2/parameters/getCustomFieldConfiguration.ts b/src/version2/parameters/getCustomFieldConfiguration.mts similarity index 100% rename from src/version2/parameters/getCustomFieldConfiguration.ts rename to src/version2/parameters/getCustomFieldConfiguration.mts diff --git a/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.mts b/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.mts new file mode 100644 index 000000000..7cd730085 --- /dev/null +++ b/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.mts @@ -0,0 +1,10 @@ +import { ProjectIssueTypeMappings } from '../models/index.mjs'; + +export interface GetCustomFieldContextsForProjectsAndIssueTypes extends ProjectIssueTypeMappings { + /** The ID of the custom field. */ + fieldId: string; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.ts b/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.ts deleted file mode 100644 index 5157e8450..000000000 --- a/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ProjectIssueTypeMappings } from '../models/index.js'; - -export interface GetCustomFieldContextsForProjectsAndIssueTypes extends ProjectIssueTypeMappings { - /** The ID of the custom field. */ - fieldId: string; - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; -} diff --git a/src/version2/parameters/getCustomFieldOption.ts b/src/version2/parameters/getCustomFieldOption.mts similarity index 100% rename from src/version2/parameters/getCustomFieldOption.ts rename to src/version2/parameters/getCustomFieldOption.mts diff --git a/src/version2/parameters/getDashboard.ts b/src/version2/parameters/getDashboard.mts similarity index 100% rename from src/version2/parameters/getDashboard.ts rename to src/version2/parameters/getDashboard.mts diff --git a/src/version2/parameters/getDashboardItemProperty.ts b/src/version2/parameters/getDashboardItemProperty.mts similarity index 100% rename from src/version2/parameters/getDashboardItemProperty.ts rename to src/version2/parameters/getDashboardItemProperty.mts diff --git a/src/version2/parameters/getDashboardItemPropertyKeys.ts b/src/version2/parameters/getDashboardItemPropertyKeys.mts similarity index 100% rename from src/version2/parameters/getDashboardItemPropertyKeys.ts rename to src/version2/parameters/getDashboardItemPropertyKeys.mts diff --git a/src/version2/parameters/getDashboardsPaginated.ts b/src/version2/parameters/getDashboardsPaginated.mts similarity index 100% rename from src/version2/parameters/getDashboardsPaginated.ts rename to src/version2/parameters/getDashboardsPaginated.mts diff --git a/src/version2/parameters/getDefaultValues.ts b/src/version2/parameters/getDefaultValues.mts similarity index 100% rename from src/version2/parameters/getDefaultValues.ts rename to src/version2/parameters/getDefaultValues.mts diff --git a/src/version2/parameters/getDefaultWorkflow.ts b/src/version2/parameters/getDefaultWorkflow.mts similarity index 100% rename from src/version2/parameters/getDefaultWorkflow.ts rename to src/version2/parameters/getDefaultWorkflow.mts diff --git a/src/version2/parameters/getDraftDefaultWorkflow.ts b/src/version2/parameters/getDraftDefaultWorkflow.mts similarity index 100% rename from src/version2/parameters/getDraftDefaultWorkflow.ts rename to src/version2/parameters/getDraftDefaultWorkflow.mts diff --git a/src/version2/parameters/getDraftWorkflow.ts b/src/version2/parameters/getDraftWorkflow.mts similarity index 100% rename from src/version2/parameters/getDraftWorkflow.ts rename to src/version2/parameters/getDraftWorkflow.mts diff --git a/src/version2/parameters/getDynamicWebhooksForApp.ts b/src/version2/parameters/getDynamicWebhooksForApp.mts similarity index 100% rename from src/version2/parameters/getDynamicWebhooksForApp.ts rename to src/version2/parameters/getDynamicWebhooksForApp.mts diff --git a/src/version2/parameters/getEditIssueMeta.ts b/src/version2/parameters/getEditIssueMeta.mts similarity index 100% rename from src/version2/parameters/getEditIssueMeta.ts rename to src/version2/parameters/getEditIssueMeta.mts diff --git a/src/version2/parameters/getFailedWebhooks.ts b/src/version2/parameters/getFailedWebhooks.mts similarity index 100% rename from src/version2/parameters/getFailedWebhooks.ts rename to src/version2/parameters/getFailedWebhooks.mts diff --git a/src/version2/parameters/getFavouriteFilters.ts b/src/version2/parameters/getFavouriteFilters.mts similarity index 100% rename from src/version2/parameters/getFavouriteFilters.ts rename to src/version2/parameters/getFavouriteFilters.mts diff --git a/src/version2/parameters/getFeaturesForProject.ts b/src/version2/parameters/getFeaturesForProject.mts similarity index 100% rename from src/version2/parameters/getFeaturesForProject.ts rename to src/version2/parameters/getFeaturesForProject.mts diff --git a/src/version2/parameters/getFieldAutoCompleteForQueryString.ts b/src/version2/parameters/getFieldAutoCompleteForQueryString.mts similarity index 100% rename from src/version2/parameters/getFieldAutoCompleteForQueryString.ts rename to src/version2/parameters/getFieldAutoCompleteForQueryString.mts diff --git a/src/version2/parameters/getFieldConfigurationItems.ts b/src/version2/parameters/getFieldConfigurationItems.mts similarity index 100% rename from src/version2/parameters/getFieldConfigurationItems.ts rename to src/version2/parameters/getFieldConfigurationItems.mts diff --git a/src/version2/parameters/getFieldConfigurationSchemeMappings.ts b/src/version2/parameters/getFieldConfigurationSchemeMappings.mts similarity index 100% rename from src/version2/parameters/getFieldConfigurationSchemeMappings.ts rename to src/version2/parameters/getFieldConfigurationSchemeMappings.mts diff --git a/src/version2/parameters/getFieldConfigurationSchemeProjectMapping.ts b/src/version2/parameters/getFieldConfigurationSchemeProjectMapping.mts similarity index 100% rename from src/version2/parameters/getFieldConfigurationSchemeProjectMapping.ts rename to src/version2/parameters/getFieldConfigurationSchemeProjectMapping.mts diff --git a/src/version2/parameters/getFieldsPaginated.ts b/src/version2/parameters/getFieldsPaginated.mts similarity index 100% rename from src/version2/parameters/getFieldsPaginated.ts rename to src/version2/parameters/getFieldsPaginated.mts diff --git a/src/version2/parameters/getFilter.ts b/src/version2/parameters/getFilter.mts similarity index 100% rename from src/version2/parameters/getFilter.ts rename to src/version2/parameters/getFilter.mts diff --git a/src/version2/parameters/getFiltersPaginated.mts b/src/version2/parameters/getFiltersPaginated.mts new file mode 100644 index 000000000..65299eb85 --- /dev/null +++ b/src/version2/parameters/getFiltersPaginated.mts @@ -0,0 +1,115 @@ +export interface GetFiltersPaginated { + /** String used to perform a case-insensitive partial match with `name`. */ + filterName?: string; + /** + * User account ID used to return filters with the matching `owner.accountId`. This parameter cannot be used with + * `owner`. + */ + accountId?: string; + /** + * As a group's name can change, use of `groupId` is recommended to identify a group. Group name used to returns + * filters that are shared with a group that matches `sharePermissions.group.groupname`. This parameter cannot be used + * with the `groupId` parameter. + */ + groupname?: string; + /** + * Group ID used to returns filters that are shared with a group that matches `sharePermissions.group.groupId`. This + * parameter cannot be used with the `groupname` parameter. + */ + groupId?: string; + /** Project ID used to returns filters that are shared with a project that matches `sharePermissions.project.id`. */ + projectId?: number; + /** + * The list of filter IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * `id=10000&id=10001`. Do not exceed 200 filter IDs. + */ + id?: number[]; + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * - `description` Sorts by filter description. Note that this sorting works independently of whether the expand to + * display the description field is in use. + * - `favourite_count` Sorts by the count of how many users have this filter as a favorite. + * - `is_favourite` Sorts by whether the filter is marked as a favorite. + * - `id` Sorts by filter ID. + * - `name` Sorts by filter name. + * - `owner` Sorts by the ID of the filter owner. + * - `is_shared` Sorts by whether the filter is shared. + */ + orderBy?: + | 'description' + | '-description' + | '+description' + | 'favourite_count' + | '-favourite_count' + | '+favourite_count' + | 'id' + | '-id' + | '+id' + | 'is_favourite' + | '-is_favourite' + | '+is_favourite' + | 'name' + | '-name' + | '+name' + | 'owner' + | '-owner' + | '+owner' + | 'is_shared' + | '-is_shared' + | '+is_shared' + | string; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `description` Returns the description of the filter. + * - `favourite` Returns an indicator of whether the user has set the filter as a favorite. + * - `favouritedCount` Returns a count of how many users have set this filter as a favorite. + * - `jql` Returns the Jql query that the filter uses. + * - `owner` Returns the owner of the filter. + * - `searchUrl` Returns a URL to perform the filter's Jql query. + * - `sharePermissions` Returns the share permissions defined for the filter. + * - `editPermissions` Returns the edit permissions defined for the filter. + * - `isWritable` Returns whether the current user has permission to edit the filter. + * - `subscriptions` Returns the users that are subscribed to the filter. + * - `viewUrl` Returns a URL to view the filter. + */ + expand?: + | 'description' + | 'favourite' + | 'favouritedCount' + | 'jql' + | 'owner' + | 'searchUrl' + | 'sharePermissions' + | 'editPermissions' + | 'isWritable' + | 'subscriptions' + | 'viewUrl' + | ( + | 'description' + | 'favourite' + | 'favouritedCount' + | 'jql' + | 'owner' + | 'searchUrl' + | 'sharePermissions' + | 'editPermissions' + | 'isWritable' + | 'subscriptions' + | 'viewUrl' + )[] + | string + | string[]; + + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. + * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; +} diff --git a/src/version2/parameters/getFiltersPaginated.ts b/src/version2/parameters/getFiltersPaginated.ts deleted file mode 100644 index 8dbaac430..000000000 --- a/src/version2/parameters/getFiltersPaginated.ts +++ /dev/null @@ -1,115 +0,0 @@ -export interface GetFiltersPaginated { - /** String used to perform a case-insensitive partial match with `name`. */ - filterName?: string; - /** - * User account ID used to return filters with the matching `owner.accountId`. This parameter cannot be used with - * `owner`. - */ - accountId?: string; - /** - * As a group's name can change, use of `groupId` is recommended to identify a group. Group name used to returns - * filters that are shared with a group that matches `sharePermissions.group.groupname`. This parameter cannot be used - * with the `groupId` parameter. - */ - groupname?: string; - /** - * Group ID used to returns filters that are shared with a group that matches `sharePermissions.group.groupId`. This - * parameter cannot be used with the `groupname` parameter. - */ - groupId?: string; - /** Project ID used to returns filters that are shared with a project that matches `sharePermissions.project.id`. */ - projectId?: number; - /** - * The list of filter IDs. To include multiple IDs, provide an ampersand-separated list. For example, - * `id=10000&id=10001`. Do not exceed 200 filter IDs. - */ - id?: number[]; - /** - * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: - * - * - `description` Sorts by filter description. Note that this sorting works independently of whether the expand to - * display the description field is in use. - * - `favourite_count` Sorts by the count of how many users have this filter as a favorite. - * - `is_favourite` Sorts by whether the filter is marked as a favorite. - * - `id` Sorts by filter ID. - * - `name` Sorts by filter name. - * - `owner` Sorts by the ID of the filter owner. - * - `is_shared` Sorts by whether the filter is shared. - */ - orderBy?: - | 'description' - | '-description' - | '+description' - | 'favourite_count' - | '-favourite_count' - | '+favourite_count' - | 'id' - | '-id' - | '+id' - | 'is_favourite' - | '-is_favourite' - | '+is_favourite' - | 'name' - | '-name' - | '+name' - | 'owner' - | '-owner' - | '+owner' - | 'is_shared' - | '-is_shared' - | '+is_shared' - | string; - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `description` Returns the description of the filter. - * - `favourite` Returns an indicator of whether the user has set the filter as a favorite. - * - `favouritedCount` Returns a count of how many users have set this filter as a favorite. - * - `jql` Returns the JQL query that the filter uses. - * - `owner` Returns the owner of the filter. - * - `searchUrl` Returns a URL to perform the filter's JQL query. - * - `sharePermissions` Returns the share permissions defined for the filter. - * - `editPermissions` Returns the edit permissions defined for the filter. - * - `isWritable` Returns whether the current user has permission to edit the filter. - * - `subscriptions` Returns the users that are subscribed to the filter. - * - `viewUrl` Returns a URL to view the filter. - */ - expand?: - | 'description' - | 'favourite' - | 'favouritedCount' - | 'jql' - | 'owner' - | 'searchUrl' - | 'sharePermissions' - | 'editPermissions' - | 'isWritable' - | 'subscriptions' - | 'viewUrl' - | ( - | 'description' - | 'favourite' - | 'favouritedCount' - | 'jql' - | 'owner' - | 'searchUrl' - | 'sharePermissions' - | 'editPermissions' - | 'isWritable' - | 'subscriptions' - | 'viewUrl' - )[] - | string - | string[]; - - /** - * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. - * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideSharePermissions?: boolean; -} diff --git a/src/version2/parameters/getHierarchy.ts b/src/version2/parameters/getHierarchy.mts similarity index 100% rename from src/version2/parameters/getHierarchy.ts rename to src/version2/parameters/getHierarchy.mts diff --git a/src/version2/parameters/getIdsOfWorklogsDeletedSince.ts b/src/version2/parameters/getIdsOfWorklogsDeletedSince.mts similarity index 100% rename from src/version2/parameters/getIdsOfWorklogsDeletedSince.ts rename to src/version2/parameters/getIdsOfWorklogsDeletedSince.mts diff --git a/src/version2/parameters/getIdsOfWorklogsModifiedSince.ts b/src/version2/parameters/getIdsOfWorklogsModifiedSince.mts similarity index 100% rename from src/version2/parameters/getIdsOfWorklogsModifiedSince.ts rename to src/version2/parameters/getIdsOfWorklogsModifiedSince.mts diff --git a/src/version2/parameters/getIsWatchingIssueBulk.mts b/src/version2/parameters/getIsWatchingIssueBulk.mts new file mode 100644 index 000000000..3616bfd38 --- /dev/null +++ b/src/version2/parameters/getIsWatchingIssueBulk.mts @@ -0,0 +1,3 @@ +import { IssueList } from '../models/index.mjs'; + +export interface GetIsWatchingIssueBulk extends IssueList {} diff --git a/src/version2/parameters/getIsWatchingIssueBulk.ts b/src/version2/parameters/getIsWatchingIssueBulk.ts deleted file mode 100644 index 97d8ecaa4..000000000 --- a/src/version2/parameters/getIsWatchingIssueBulk.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueList } from '../models/index.js'; - -export interface GetIsWatchingIssueBulk extends IssueList {} diff --git a/src/version2/parameters/getIssue.mts b/src/version2/parameters/getIssue.mts new file mode 100644 index 000000000..2d598a493 --- /dev/null +++ b/src/version2/parameters/getIssue.mts @@ -0,0 +1,70 @@ +export interface GetIssue { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** + * A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a + * subset of fields. Allowed values: + * + * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to + * exclude. + * + * Examples: + * + * `summary,comment` Returns only the summary and comments fields. `-description` Returns all (default) fields except + * description. `*navigable,-comment` Returns all navigable fields except comment. + * + * This parameter may be specified multiple times. For example, `fields=field1,field2& fields=field3`. + * + * Note: All fields are returned by default. This differs from [Search for issues using Jql + * (GET)](#api-rest-api-2-search-get) and [Search for issues using Jql (POST)](#api-rest-api-2-search-post) where the + * default is all navigable fields. + */ + fields?: string[]; + /** + * Whether fields in `fields` are referenced by keys rather than IDs. This parameter is useful where fields have been + * added by a connect app and a field's key may differ from its ID. + */ + fieldsByKeys?: boolean; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about the issues in the response. This parameter accepts a comma-separated list. Expand options + * include: + * + * - `renderedFields` Returns field values rendered in HTML format. + * - `names` Returns the display name of each field. -`schema` Returns the schema describing a field type. + * - `transitions` Returns all possible transitions for the issue. + * - `editmeta` Returns information about how each field can be edited. + * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * - `versionedRepresentations` Returns a JSON array for each version of a field's value, with the highest number + * representing the most recent version. Note: When included in the request, the `fields` parameter is ignored. + */ + expand?: + | 'renderedFields' + | 'names' + | 'transitions' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | ('renderedFields' | 'names' | 'transitions' | 'editmeta' | 'changelog' | 'versionedRepresentations')[] + | string + | string[]; + /** + * A list of issue properties to return for the issue. This parameter accepts a comma-separated list. Allowed values: + * + * `*all` Returns all issue properties. Any issue property key, prefixed with a minus to exclude. + * + * Examples: + * + * `*all` Returns all properties. `*all,-prop1` Returns all properties except `prop1`. `prop1,prop2` Returns `prop1` + * and `prop2` properties. + * + * This parameter may be specified multiple times. For example, `properties=prop1,prop2& properties=prop3`. + */ + properties?: string[]; + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown + * under **Projects** in Jira. This also populates the [Jql issues search](#api-rest-api-2-search-get) `lastViewed` + * field. + */ + updateHistory?: boolean; +} diff --git a/src/version2/parameters/getIssue.ts b/src/version2/parameters/getIssue.ts deleted file mode 100644 index 683b42939..000000000 --- a/src/version2/parameters/getIssue.ts +++ /dev/null @@ -1,70 +0,0 @@ -export interface GetIssue { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a - * subset of fields. Allowed values: - * - * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to - * exclude. - * - * Examples: - * - * `summary,comment` Returns only the summary and comments fields. `-description` Returns all (default) fields except - * description. `*navigable,-comment` Returns all navigable fields except comment. - * - * This parameter may be specified multiple times. For example, `fields=field1,field2& fields=field3`. - * - * Note: All fields are returned by default. This differs from [Search for issues using JQL - * (GET)](#api-rest-api-2-search-get) and [Search for issues using JQL (POST)](#api-rest-api-2-search-post) where the - * default is all navigable fields. - */ - fields?: string[]; - /** - * Whether fields in `fields` are referenced by keys rather than IDs. This parameter is useful where fields have been - * added by a connect app and a field's key may differ from its ID. - */ - fieldsByKeys?: boolean; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about the issues in the response. This parameter accepts a comma-separated list. Expand options - * include: - * - * - `renderedFields` Returns field values rendered in HTML format. - * - `names` Returns the display name of each field. -`schema` Returns the schema describing a field type. - * - `transitions` Returns all possible transitions for the issue. - * - `editmeta` Returns information about how each field can be edited. - * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. - * - `versionedRepresentations` Returns a JSON array for each version of a field's value, with the highest number - * representing the most recent version. Note: When included in the request, the `fields` parameter is ignored. - */ - expand?: - | 'renderedFields' - | 'names' - | 'transitions' - | 'editmeta' - | 'changelog' - | 'versionedRepresentations' - | ('renderedFields' | 'names' | 'transitions' | 'editmeta' | 'changelog' | 'versionedRepresentations')[] - | string - | string[]; - /** - * A list of issue properties to return for the issue. This parameter accepts a comma-separated list. Allowed values: - * - * `*all` Returns all issue properties. Any issue property key, prefixed with a minus to exclude. - * - * Examples: - * - * `*all` Returns all properties. `*all,-prop1` Returns all properties except `prop1`. `prop1,prop2` Returns `prop1` - * and `prop2` properties. - * - * This parameter may be specified multiple times. For example, `properties=prop1,prop2& properties=prop3`. - */ - properties?: string[]; - /** - * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown - * under **Projects** in Jira. This also populates the [JQL issues search](#api-rest-api-2-search-get) `lastViewed` - * field. - */ - updateHistory?: boolean; -} diff --git a/src/version2/parameters/getIssueFieldOption.ts b/src/version2/parameters/getIssueFieldOption.mts similarity index 100% rename from src/version2/parameters/getIssueFieldOption.ts rename to src/version2/parameters/getIssueFieldOption.mts diff --git a/src/version2/parameters/getIssueLink.ts b/src/version2/parameters/getIssueLink.mts similarity index 100% rename from src/version2/parameters/getIssueLink.ts rename to src/version2/parameters/getIssueLink.mts diff --git a/src/version2/parameters/getIssueLinkType.ts b/src/version2/parameters/getIssueLinkType.mts similarity index 100% rename from src/version2/parameters/getIssueLinkType.ts rename to src/version2/parameters/getIssueLinkType.mts diff --git a/src/version2/parameters/getIssuePickerResource.mts b/src/version2/parameters/getIssuePickerResource.mts new file mode 100644 index 000000000..aed2154c1 --- /dev/null +++ b/src/version2/parameters/getIssuePickerResource.mts @@ -0,0 +1,23 @@ +export interface GetIssuePickerResource { + /** A string to match against text fields in the issue such as title, description, or comments. */ + query?: string; + /** + * A Jql query defining a list of issues to search for the query term. Note that `username` and `userkey` cannot be + * used as search terms for this parameter, due to privacy reasons. Use `accountId` instead. + */ + currentJQL?: string; + /** + * The key of an issue to exclude from search results. For example, the issue the user is viewing when they perform + * this query. + */ + currentIssueKey?: string; + /** The ID of a project that suggested issues must belong to. */ + currentProjectId?: string; + /** Indicate whether to include subtasks in the suggestions list. */ + showSubTasks?: boolean; + /** + * When `currentIssueKey` is a subtask, whether to include the parent issue in the suggestions if it matches the + * query. + */ + showSubTaskParent?: boolean; +} diff --git a/src/version2/parameters/getIssuePickerResource.ts b/src/version2/parameters/getIssuePickerResource.ts deleted file mode 100644 index 762048d32..000000000 --- a/src/version2/parameters/getIssuePickerResource.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface GetIssuePickerResource { - /** A string to match against text fields in the issue such as title, description, or comments. */ - query?: string; - /** - * A JQL query defining a list of issues to search for the query term. Note that `username` and `userkey` cannot be - * used as search terms for this parameter, due to privacy reasons. Use `accountId` instead. - */ - currentJQL?: string; - /** - * The key of an issue to exclude from search results. For example, the issue the user is viewing when they perform - * this query. - */ - currentIssueKey?: string; - /** The ID of a project that suggested issues must belong to. */ - currentProjectId?: string; - /** Indicate whether to include subtasks in the suggestions list. */ - showSubTasks?: boolean; - /** - * When `currentIssueKey` is a subtask, whether to include the parent issue in the suggestions if it matches the - * query. - */ - showSubTaskParent?: boolean; -} diff --git a/src/version2/parameters/getIssueProperty.ts b/src/version2/parameters/getIssueProperty.mts similarity index 100% rename from src/version2/parameters/getIssueProperty.ts rename to src/version2/parameters/getIssueProperty.mts diff --git a/src/version2/parameters/getIssuePropertyKeys.ts b/src/version2/parameters/getIssuePropertyKeys.mts similarity index 100% rename from src/version2/parameters/getIssuePropertyKeys.ts rename to src/version2/parameters/getIssuePropertyKeys.mts diff --git a/src/version2/parameters/getIssueSecurityLevel.ts b/src/version2/parameters/getIssueSecurityLevel.mts similarity index 100% rename from src/version2/parameters/getIssueSecurityLevel.ts rename to src/version2/parameters/getIssueSecurityLevel.mts diff --git a/src/version2/parameters/getIssueSecurityLevelMembers.ts b/src/version2/parameters/getIssueSecurityLevelMembers.mts similarity index 100% rename from src/version2/parameters/getIssueSecurityLevelMembers.ts rename to src/version2/parameters/getIssueSecurityLevelMembers.mts diff --git a/src/version2/parameters/getIssueSecurityScheme.ts b/src/version2/parameters/getIssueSecurityScheme.mts similarity index 100% rename from src/version2/parameters/getIssueSecurityScheme.ts rename to src/version2/parameters/getIssueSecurityScheme.mts diff --git a/src/version2/parameters/getIssueType.ts b/src/version2/parameters/getIssueType.mts similarity index 100% rename from src/version2/parameters/getIssueType.ts rename to src/version2/parameters/getIssueType.mts diff --git a/src/version2/parameters/getIssueTypeMappingsForContexts.ts b/src/version2/parameters/getIssueTypeMappingsForContexts.mts similarity index 100% rename from src/version2/parameters/getIssueTypeMappingsForContexts.ts rename to src/version2/parameters/getIssueTypeMappingsForContexts.mts diff --git a/src/version2/parameters/getIssueTypeProperty.ts b/src/version2/parameters/getIssueTypeProperty.mts similarity index 100% rename from src/version2/parameters/getIssueTypeProperty.ts rename to src/version2/parameters/getIssueTypeProperty.mts diff --git a/src/version2/parameters/getIssueTypePropertyKeys.ts b/src/version2/parameters/getIssueTypePropertyKeys.mts similarity index 100% rename from src/version2/parameters/getIssueTypePropertyKeys.ts rename to src/version2/parameters/getIssueTypePropertyKeys.mts diff --git a/src/version2/parameters/getIssueTypeSchemeForProjects.ts b/src/version2/parameters/getIssueTypeSchemeForProjects.mts similarity index 100% rename from src/version2/parameters/getIssueTypeSchemeForProjects.ts rename to src/version2/parameters/getIssueTypeSchemeForProjects.mts diff --git a/src/version2/parameters/getIssueTypeSchemesMapping.ts b/src/version2/parameters/getIssueTypeSchemesMapping.mts similarity index 100% rename from src/version2/parameters/getIssueTypeSchemesMapping.ts rename to src/version2/parameters/getIssueTypeSchemesMapping.mts diff --git a/src/version2/parameters/getIssueTypeScreenSchemeMappings.ts b/src/version2/parameters/getIssueTypeScreenSchemeMappings.mts similarity index 100% rename from src/version2/parameters/getIssueTypeScreenSchemeMappings.ts rename to src/version2/parameters/getIssueTypeScreenSchemeMappings.mts diff --git a/src/version2/parameters/getIssueTypeScreenSchemeProjectAssociations.ts b/src/version2/parameters/getIssueTypeScreenSchemeProjectAssociations.mts similarity index 100% rename from src/version2/parameters/getIssueTypeScreenSchemeProjectAssociations.ts rename to src/version2/parameters/getIssueTypeScreenSchemeProjectAssociations.mts diff --git a/src/version2/parameters/getIssueTypeScreenSchemes.ts b/src/version2/parameters/getIssueTypeScreenSchemes.mts similarity index 100% rename from src/version2/parameters/getIssueTypeScreenSchemes.ts rename to src/version2/parameters/getIssueTypeScreenSchemes.mts diff --git a/src/version2/parameters/getIssueTypesForProject.ts b/src/version2/parameters/getIssueTypesForProject.mts similarity index 100% rename from src/version2/parameters/getIssueTypesForProject.ts rename to src/version2/parameters/getIssueTypesForProject.mts diff --git a/src/version2/parameters/getIssueWatchers.ts b/src/version2/parameters/getIssueWatchers.mts similarity index 100% rename from src/version2/parameters/getIssueWatchers.ts rename to src/version2/parameters/getIssueWatchers.mts diff --git a/src/version2/parameters/getIssueWorklog.ts b/src/version2/parameters/getIssueWorklog.mts similarity index 100% rename from src/version2/parameters/getIssueWorklog.ts rename to src/version2/parameters/getIssueWorklog.mts diff --git a/src/version2/parameters/getMyFilters.ts b/src/version2/parameters/getMyFilters.mts similarity index 100% rename from src/version2/parameters/getMyFilters.ts rename to src/version2/parameters/getMyFilters.mts diff --git a/src/version2/parameters/getMyPermissions.ts b/src/version2/parameters/getMyPermissions.mts similarity index 100% rename from src/version2/parameters/getMyPermissions.ts rename to src/version2/parameters/getMyPermissions.mts diff --git a/src/version2/parameters/getNotificationScheme.ts b/src/version2/parameters/getNotificationScheme.mts similarity index 100% rename from src/version2/parameters/getNotificationScheme.ts rename to src/version2/parameters/getNotificationScheme.mts diff --git a/src/version2/parameters/getNotificationSchemeForProject.ts b/src/version2/parameters/getNotificationSchemeForProject.mts similarity index 100% rename from src/version2/parameters/getNotificationSchemeForProject.ts rename to src/version2/parameters/getNotificationSchemeForProject.mts diff --git a/src/version2/parameters/getNotificationSchemeToProjectMappings.ts b/src/version2/parameters/getNotificationSchemeToProjectMappings.mts similarity index 100% rename from src/version2/parameters/getNotificationSchemeToProjectMappings.ts rename to src/version2/parameters/getNotificationSchemeToProjectMappings.mts diff --git a/src/version2/parameters/getNotificationSchemes.ts b/src/version2/parameters/getNotificationSchemes.mts similarity index 100% rename from src/version2/parameters/getNotificationSchemes.ts rename to src/version2/parameters/getNotificationSchemes.mts diff --git a/src/version2/parameters/getOptionsForContext.ts b/src/version2/parameters/getOptionsForContext.mts similarity index 100% rename from src/version2/parameters/getOptionsForContext.ts rename to src/version2/parameters/getOptionsForContext.mts diff --git a/src/version2/parameters/getPermissionScheme.ts b/src/version2/parameters/getPermissionScheme.mts similarity index 100% rename from src/version2/parameters/getPermissionScheme.ts rename to src/version2/parameters/getPermissionScheme.mts diff --git a/src/version2/parameters/getPermissionSchemeGrant.ts b/src/version2/parameters/getPermissionSchemeGrant.mts similarity index 100% rename from src/version2/parameters/getPermissionSchemeGrant.ts rename to src/version2/parameters/getPermissionSchemeGrant.mts diff --git a/src/version2/parameters/getPermissionSchemeGrants.ts b/src/version2/parameters/getPermissionSchemeGrants.mts similarity index 100% rename from src/version2/parameters/getPermissionSchemeGrants.ts rename to src/version2/parameters/getPermissionSchemeGrants.mts diff --git a/src/version2/parameters/getPermittedProjects.mts b/src/version2/parameters/getPermittedProjects.mts new file mode 100644 index 000000000..8f4096475 --- /dev/null +++ b/src/version2/parameters/getPermittedProjects.mts @@ -0,0 +1,3 @@ +import { PermissionsKeys } from '../models/index.mjs'; + +export interface GetPermittedProjects extends PermissionsKeys {} diff --git a/src/version2/parameters/getPermittedProjects.ts b/src/version2/parameters/getPermittedProjects.ts deleted file mode 100644 index 1c8b6a94b..000000000 --- a/src/version2/parameters/getPermittedProjects.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { PermissionsKeys } from '../models/index.js'; - -export interface GetPermittedProjects extends PermissionsKeys {} diff --git a/src/version2/parameters/getPrecomputations.ts b/src/version2/parameters/getPrecomputations.mts similarity index 100% rename from src/version2/parameters/getPrecomputations.ts rename to src/version2/parameters/getPrecomputations.mts diff --git a/src/version2/parameters/getPreference.ts b/src/version2/parameters/getPreference.mts similarity index 100% rename from src/version2/parameters/getPreference.ts rename to src/version2/parameters/getPreference.mts diff --git a/src/version2/parameters/getPriority.ts b/src/version2/parameters/getPriority.mts similarity index 100% rename from src/version2/parameters/getPriority.ts rename to src/version2/parameters/getPriority.mts diff --git a/src/version2/parameters/getProject.ts b/src/version2/parameters/getProject.mts similarity index 100% rename from src/version2/parameters/getProject.ts rename to src/version2/parameters/getProject.mts diff --git a/src/version2/parameters/getProjectCategoryById.ts b/src/version2/parameters/getProjectCategoryById.mts similarity index 100% rename from src/version2/parameters/getProjectCategoryById.ts rename to src/version2/parameters/getProjectCategoryById.mts diff --git a/src/version2/parameters/getProjectComponents.ts b/src/version2/parameters/getProjectComponents.mts similarity index 100% rename from src/version2/parameters/getProjectComponents.ts rename to src/version2/parameters/getProjectComponents.mts diff --git a/src/version2/parameters/getProjectComponentsPaginated.ts b/src/version2/parameters/getProjectComponentsPaginated.mts similarity index 100% rename from src/version2/parameters/getProjectComponentsPaginated.ts rename to src/version2/parameters/getProjectComponentsPaginated.mts diff --git a/src/version2/parameters/getProjectContextMapping.ts b/src/version2/parameters/getProjectContextMapping.mts similarity index 100% rename from src/version2/parameters/getProjectContextMapping.ts rename to src/version2/parameters/getProjectContextMapping.mts diff --git a/src/version2/parameters/getProjectEmail.ts b/src/version2/parameters/getProjectEmail.mts similarity index 100% rename from src/version2/parameters/getProjectEmail.ts rename to src/version2/parameters/getProjectEmail.mts diff --git a/src/version2/parameters/getProjectIssueSecurityScheme.ts b/src/version2/parameters/getProjectIssueSecurityScheme.mts similarity index 100% rename from src/version2/parameters/getProjectIssueSecurityScheme.ts rename to src/version2/parameters/getProjectIssueSecurityScheme.mts diff --git a/src/version2/parameters/getProjectProperty.ts b/src/version2/parameters/getProjectProperty.mts similarity index 100% rename from src/version2/parameters/getProjectProperty.ts rename to src/version2/parameters/getProjectProperty.mts diff --git a/src/version2/parameters/getProjectPropertyKeys.ts b/src/version2/parameters/getProjectPropertyKeys.mts similarity index 100% rename from src/version2/parameters/getProjectPropertyKeys.ts rename to src/version2/parameters/getProjectPropertyKeys.mts diff --git a/src/version2/parameters/getProjectRole.ts b/src/version2/parameters/getProjectRole.mts similarity index 100% rename from src/version2/parameters/getProjectRole.ts rename to src/version2/parameters/getProjectRole.mts diff --git a/src/version2/parameters/getProjectRoleActorsForRole.ts b/src/version2/parameters/getProjectRoleActorsForRole.mts similarity index 100% rename from src/version2/parameters/getProjectRoleActorsForRole.ts rename to src/version2/parameters/getProjectRoleActorsForRole.mts diff --git a/src/version2/parameters/getProjectRoleById.ts b/src/version2/parameters/getProjectRoleById.mts similarity index 100% rename from src/version2/parameters/getProjectRoleById.ts rename to src/version2/parameters/getProjectRoleById.mts diff --git a/src/version2/parameters/getProjectRoleDetails.ts b/src/version2/parameters/getProjectRoleDetails.mts similarity index 100% rename from src/version2/parameters/getProjectRoleDetails.ts rename to src/version2/parameters/getProjectRoleDetails.mts diff --git a/src/version2/parameters/getProjectRoles.ts b/src/version2/parameters/getProjectRoles.mts similarity index 100% rename from src/version2/parameters/getProjectRoles.ts rename to src/version2/parameters/getProjectRoles.mts diff --git a/src/version2/parameters/getProjectTypeByKey.ts b/src/version2/parameters/getProjectTypeByKey.mts similarity index 100% rename from src/version2/parameters/getProjectTypeByKey.ts rename to src/version2/parameters/getProjectTypeByKey.mts diff --git a/src/version2/parameters/getProjectVersions.ts b/src/version2/parameters/getProjectVersions.mts similarity index 100% rename from src/version2/parameters/getProjectVersions.ts rename to src/version2/parameters/getProjectVersions.mts diff --git a/src/version2/parameters/getProjectVersionsPaginated.ts b/src/version2/parameters/getProjectVersionsPaginated.mts similarity index 100% rename from src/version2/parameters/getProjectVersionsPaginated.ts rename to src/version2/parameters/getProjectVersionsPaginated.mts diff --git a/src/version2/parameters/getProjectsForIssueTypeScreenScheme.ts b/src/version2/parameters/getProjectsForIssueTypeScreenScheme.mts similarity index 100% rename from src/version2/parameters/getProjectsForIssueTypeScreenScheme.ts rename to src/version2/parameters/getProjectsForIssueTypeScreenScheme.mts diff --git a/src/version2/parameters/getRecent.ts b/src/version2/parameters/getRecent.mts similarity index 100% rename from src/version2/parameters/getRecent.ts rename to src/version2/parameters/getRecent.mts diff --git a/src/version2/parameters/getRemoteIssueLinkById.ts b/src/version2/parameters/getRemoteIssueLinkById.mts similarity index 100% rename from src/version2/parameters/getRemoteIssueLinkById.ts rename to src/version2/parameters/getRemoteIssueLinkById.mts diff --git a/src/version2/parameters/getRemoteIssueLinks.ts b/src/version2/parameters/getRemoteIssueLinks.mts similarity index 100% rename from src/version2/parameters/getRemoteIssueLinks.ts rename to src/version2/parameters/getRemoteIssueLinks.mts diff --git a/src/version2/parameters/getScreenSchemes.ts b/src/version2/parameters/getScreenSchemes.mts similarity index 100% rename from src/version2/parameters/getScreenSchemes.ts rename to src/version2/parameters/getScreenSchemes.mts diff --git a/src/version2/parameters/getScreens.ts b/src/version2/parameters/getScreens.mts similarity index 100% rename from src/version2/parameters/getScreens.ts rename to src/version2/parameters/getScreens.mts diff --git a/src/version2/parameters/getScreensForField.ts b/src/version2/parameters/getScreensForField.mts similarity index 100% rename from src/version2/parameters/getScreensForField.ts rename to src/version2/parameters/getScreensForField.mts diff --git a/src/version2/parameters/getSecurityLevelMembers.ts b/src/version2/parameters/getSecurityLevelMembers.mts similarity index 100% rename from src/version2/parameters/getSecurityLevelMembers.ts rename to src/version2/parameters/getSecurityLevelMembers.mts diff --git a/src/version2/parameters/getSecurityLevels.ts b/src/version2/parameters/getSecurityLevels.mts similarity index 100% rename from src/version2/parameters/getSecurityLevels.ts rename to src/version2/parameters/getSecurityLevels.mts diff --git a/src/version2/parameters/getSecurityLevelsForProject.ts b/src/version2/parameters/getSecurityLevelsForProject.mts similarity index 100% rename from src/version2/parameters/getSecurityLevelsForProject.ts rename to src/version2/parameters/getSecurityLevelsForProject.mts diff --git a/src/version2/parameters/getSelectableIssueFieldOptions.ts b/src/version2/parameters/getSelectableIssueFieldOptions.mts similarity index 100% rename from src/version2/parameters/getSelectableIssueFieldOptions.ts rename to src/version2/parameters/getSelectableIssueFieldOptions.mts diff --git a/src/version2/parameters/getSharePermission.ts b/src/version2/parameters/getSharePermission.mts similarity index 100% rename from src/version2/parameters/getSharePermission.ts rename to src/version2/parameters/getSharePermission.mts diff --git a/src/version2/parameters/getSharePermissions.ts b/src/version2/parameters/getSharePermissions.mts similarity index 100% rename from src/version2/parameters/getSharePermissions.ts rename to src/version2/parameters/getSharePermissions.mts diff --git a/src/version2/parameters/getStatus.ts b/src/version2/parameters/getStatus.mts similarity index 100% rename from src/version2/parameters/getStatus.ts rename to src/version2/parameters/getStatus.mts diff --git a/src/version2/parameters/getStatusCategory.ts b/src/version2/parameters/getStatusCategory.mts similarity index 100% rename from src/version2/parameters/getStatusCategory.ts rename to src/version2/parameters/getStatusCategory.mts diff --git a/src/version2/parameters/getStatusesById.ts b/src/version2/parameters/getStatusesById.mts similarity index 100% rename from src/version2/parameters/getStatusesById.ts rename to src/version2/parameters/getStatusesById.mts diff --git a/src/version2/parameters/getTask.ts b/src/version2/parameters/getTask.mts similarity index 100% rename from src/version2/parameters/getTask.ts rename to src/version2/parameters/getTask.mts diff --git a/src/version2/parameters/getTransitions.ts b/src/version2/parameters/getTransitions.mts similarity index 100% rename from src/version2/parameters/getTransitions.ts rename to src/version2/parameters/getTransitions.mts diff --git a/src/version2/parameters/getTrashedFieldsPaginated.ts b/src/version2/parameters/getTrashedFieldsPaginated.mts similarity index 100% rename from src/version2/parameters/getTrashedFieldsPaginated.ts rename to src/version2/parameters/getTrashedFieldsPaginated.mts diff --git a/src/version2/parameters/getUiModifications.ts b/src/version2/parameters/getUiModifications.mts similarity index 100% rename from src/version2/parameters/getUiModifications.ts rename to src/version2/parameters/getUiModifications.mts diff --git a/src/version2/parameters/getUser.ts b/src/version2/parameters/getUser.mts similarity index 100% rename from src/version2/parameters/getUser.ts rename to src/version2/parameters/getUser.mts diff --git a/src/version2/parameters/getUserDefaultColumns.ts b/src/version2/parameters/getUserDefaultColumns.mts similarity index 100% rename from src/version2/parameters/getUserDefaultColumns.ts rename to src/version2/parameters/getUserDefaultColumns.mts diff --git a/src/version2/parameters/getUserEmail.ts b/src/version2/parameters/getUserEmail.mts similarity index 100% rename from src/version2/parameters/getUserEmail.ts rename to src/version2/parameters/getUserEmail.mts diff --git a/src/version2/parameters/getUserEmailBulk.ts b/src/version2/parameters/getUserEmailBulk.mts similarity index 100% rename from src/version2/parameters/getUserEmailBulk.ts rename to src/version2/parameters/getUserEmailBulk.mts diff --git a/src/version2/parameters/getUserGroups.ts b/src/version2/parameters/getUserGroups.mts similarity index 100% rename from src/version2/parameters/getUserGroups.ts rename to src/version2/parameters/getUserGroups.mts diff --git a/src/version2/parameters/getUserProperty.ts b/src/version2/parameters/getUserProperty.mts similarity index 100% rename from src/version2/parameters/getUserProperty.ts rename to src/version2/parameters/getUserProperty.mts diff --git a/src/version2/parameters/getUserPropertyKeys.ts b/src/version2/parameters/getUserPropertyKeys.mts similarity index 100% rename from src/version2/parameters/getUserPropertyKeys.ts rename to src/version2/parameters/getUserPropertyKeys.mts diff --git a/src/version2/parameters/getUsersFromGroup.ts b/src/version2/parameters/getUsersFromGroup.mts similarity index 100% rename from src/version2/parameters/getUsersFromGroup.ts rename to src/version2/parameters/getUsersFromGroup.mts diff --git a/src/version2/parameters/getValidProjectKey.ts b/src/version2/parameters/getValidProjectKey.mts similarity index 100% rename from src/version2/parameters/getValidProjectKey.ts rename to src/version2/parameters/getValidProjectKey.mts diff --git a/src/version2/parameters/getValidProjectName.ts b/src/version2/parameters/getValidProjectName.mts similarity index 100% rename from src/version2/parameters/getValidProjectName.ts rename to src/version2/parameters/getValidProjectName.mts diff --git a/src/version2/parameters/getVersion.ts b/src/version2/parameters/getVersion.mts similarity index 100% rename from src/version2/parameters/getVersion.ts rename to src/version2/parameters/getVersion.mts diff --git a/src/version2/parameters/getVersionRelatedIssues.ts b/src/version2/parameters/getVersionRelatedIssues.mts similarity index 100% rename from src/version2/parameters/getVersionRelatedIssues.ts rename to src/version2/parameters/getVersionRelatedIssues.mts diff --git a/src/version2/parameters/getVersionUnresolvedIssues.ts b/src/version2/parameters/getVersionUnresolvedIssues.mts similarity index 100% rename from src/version2/parameters/getVersionUnresolvedIssues.ts rename to src/version2/parameters/getVersionUnresolvedIssues.mts diff --git a/src/version2/parameters/getVisibleIssueFieldOptions.ts b/src/version2/parameters/getVisibleIssueFieldOptions.mts similarity index 100% rename from src/version2/parameters/getVisibleIssueFieldOptions.ts rename to src/version2/parameters/getVisibleIssueFieldOptions.mts diff --git a/src/version2/parameters/getVotes.ts b/src/version2/parameters/getVotes.mts similarity index 100% rename from src/version2/parameters/getVotes.ts rename to src/version2/parameters/getVotes.mts diff --git a/src/version2/parameters/getWorkflow.ts b/src/version2/parameters/getWorkflow.mts similarity index 100% rename from src/version2/parameters/getWorkflow.ts rename to src/version2/parameters/getWorkflow.mts diff --git a/src/version2/parameters/getWorkflowScheme.ts b/src/version2/parameters/getWorkflowScheme.mts similarity index 100% rename from src/version2/parameters/getWorkflowScheme.ts rename to src/version2/parameters/getWorkflowScheme.mts diff --git a/src/version2/parameters/getWorkflowSchemeDraft.ts b/src/version2/parameters/getWorkflowSchemeDraft.mts similarity index 100% rename from src/version2/parameters/getWorkflowSchemeDraft.ts rename to src/version2/parameters/getWorkflowSchemeDraft.mts diff --git a/src/version2/parameters/getWorkflowSchemeDraftIssueType.ts b/src/version2/parameters/getWorkflowSchemeDraftIssueType.mts similarity index 100% rename from src/version2/parameters/getWorkflowSchemeDraftIssueType.ts rename to src/version2/parameters/getWorkflowSchemeDraftIssueType.mts diff --git a/src/version2/parameters/getWorkflowSchemeIssueType.ts b/src/version2/parameters/getWorkflowSchemeIssueType.mts similarity index 100% rename from src/version2/parameters/getWorkflowSchemeIssueType.ts rename to src/version2/parameters/getWorkflowSchemeIssueType.mts diff --git a/src/version2/parameters/getWorkflowSchemeProjectAssociations.ts b/src/version2/parameters/getWorkflowSchemeProjectAssociations.mts similarity index 100% rename from src/version2/parameters/getWorkflowSchemeProjectAssociations.ts rename to src/version2/parameters/getWorkflowSchemeProjectAssociations.mts diff --git a/src/version2/parameters/getWorkflowTransitionProperties.ts b/src/version2/parameters/getWorkflowTransitionProperties.mts similarity index 100% rename from src/version2/parameters/getWorkflowTransitionProperties.ts rename to src/version2/parameters/getWorkflowTransitionProperties.mts diff --git a/src/version2/parameters/getWorkflowTransitionRuleConfigurations.ts b/src/version2/parameters/getWorkflowTransitionRuleConfigurations.mts similarity index 100% rename from src/version2/parameters/getWorkflowTransitionRuleConfigurations.ts rename to src/version2/parameters/getWorkflowTransitionRuleConfigurations.mts diff --git a/src/version2/parameters/getWorkflowsPaginated.ts b/src/version2/parameters/getWorkflowsPaginated.mts similarity index 100% rename from src/version2/parameters/getWorkflowsPaginated.ts rename to src/version2/parameters/getWorkflowsPaginated.mts diff --git a/src/version2/parameters/getWorklog.ts b/src/version2/parameters/getWorklog.mts similarity index 100% rename from src/version2/parameters/getWorklog.ts rename to src/version2/parameters/getWorklog.mts diff --git a/src/version2/parameters/getWorklogProperty.ts b/src/version2/parameters/getWorklogProperty.mts similarity index 100% rename from src/version2/parameters/getWorklogProperty.ts rename to src/version2/parameters/getWorklogProperty.mts diff --git a/src/version2/parameters/getWorklogPropertyKeys.ts b/src/version2/parameters/getWorklogPropertyKeys.mts similarity index 100% rename from src/version2/parameters/getWorklogPropertyKeys.ts rename to src/version2/parameters/getWorklogPropertyKeys.mts diff --git a/src/version2/parameters/getWorklogsForIds.mts b/src/version2/parameters/getWorklogsForIds.mts new file mode 100644 index 000000000..71ef38dab --- /dev/null +++ b/src/version2/parameters/getWorklogsForIds.mts @@ -0,0 +1,10 @@ +import { WorklogIdsRequest } from '../models/index.mjs'; + +export interface GetWorklogsForIds extends WorklogIdsRequest { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about worklogs in the response. This parameter accepts `properties` that returns the properties of each + * worklog. + */ + expand?: string; +} diff --git a/src/version2/parameters/getWorklogsForIds.ts b/src/version2/parameters/getWorklogsForIds.ts deleted file mode 100644 index 8fc733493..000000000 --- a/src/version2/parameters/getWorklogsForIds.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { WorklogIdsRequest } from '../models/index.js'; - -export interface GetWorklogsForIds extends WorklogIdsRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about worklogs in the response. This parameter accepts `properties` that returns the properties of each - * worklog. - */ - expand?: string; -} diff --git a/src/version2/parameters/index.mts b/src/version2/parameters/index.mts new file mode 100644 index 000000000..67909c4aa --- /dev/null +++ b/src/version2/parameters/index.mts @@ -0,0 +1,469 @@ +export * from './addActorUsers.mjs'; +export * from './addAttachment.mjs'; +export * from './addComment.mjs'; +export * from './addFieldToDefaultScreen.mjs'; +export * from './addGadget.mjs'; +export * from './addIssueTypesToContext.mjs'; +export * from './addIssueTypesToIssueTypeScheme.mjs'; +export * from './addProjectRoleActorsToRole.mjs'; +export * from './addScreenTab.mjs'; +export * from './addScreenTabField.mjs'; +export * from './addSecurityLevel.mjs'; +export * from './addSecurityLevelMembers.mjs'; +export * from './addSharePermission.mjs'; +export * from './addUserToGroup.mjs'; +export * from './addVote.mjs'; +export * from './addWatcher.mjs'; +export * from './addWorklog.mjs'; +export * from './analyseExpression.mjs'; +export * from './appendMappingsForIssueTypeScreenScheme.mjs'; +export * from './archiveIssues.mjs'; +export * from './archiveIssuesAsync.mjs'; +export * from './archiveProject.mjs'; +export * from './assignFieldConfigurationSchemeToProject.mjs'; +export * from './assignIssue.mjs'; +export * from './assignIssueTypeSchemeToProject.mjs'; +export * from './assignIssueTypeScreenSchemeToProject.mjs'; +export * from './assignPermissionScheme.mjs'; +export * from './assignProjectsToCustomFieldContext.mjs'; +export * from './assignSchemeToProject.mjs'; +export * from './associateSchemesToProjects.mjs'; +export * from './bulkDeleteIssueProperty.mjs'; +export * from './bulkEditDashboards.mjs'; +export * from './bulkGetGroups.mjs'; +export * from './bulkGetUsers.mjs'; +export * from './bulkGetUsersMigration.mjs'; +export * from './bulkSetIssuePropertiesByIssue.mjs'; +export * from './bulkSetIssueProperty.mjs'; +export * from './bulkSetIssuesProperties.mjs'; +export * from './cancelTask.mjs'; +export * from './changeFilterOwner.mjs'; +export * from './copyDashboard.mjs'; +export * from './createComponent.mjs'; +export * from './createCustomField.mjs'; +export * from './createCustomFieldContext.mjs'; +export * from './createCustomFieldOption.mjs'; +export * from './createDashboard.mjs'; +export * from './createFieldConfiguration.mjs'; +export * from './createFieldConfigurationScheme.mjs'; +export * from './createFilter.mjs'; +export * from './createGroup.mjs'; +export * from './createIssue.mjs'; +export * from './createIssueFieldOption.mjs'; +export * from './createIssueLinkType.mjs'; +export * from './createIssues.mjs'; +export * from './createIssueSecurityScheme.mjs'; +export * from './createIssueType.mjs'; +export * from './createIssueTypeAvatar.mjs'; +export * from './createIssueTypeScheme.mjs'; +export * from './createIssueTypeScreenScheme.mjs'; +export * from './createNotificationScheme.mjs'; +export * from './createOrUpdateRemoteIssueLink.mjs'; +export * from './createPermissionGrant.mjs'; +export * from './createPermissionScheme.mjs'; +export * from './createPriority.mjs'; +export * from './createProject.mjs'; +export * from './createProjectAvatar.mjs'; +export * from './createProjectCategory.mjs'; +export * from './createProjectRole.mjs'; +export * from './createResolution.mjs'; +export * from './createScreen.mjs'; +export * from './createScreenScheme.mjs'; +export * from './createStatuses.mjs'; +export * from './createUiModification.mjs'; +export * from './createUser.mjs'; +export * from './createVersion.mjs'; +export * from './createWorkflow.mjs'; +export * from './createWorkflows.mjs'; +export * from './createWorkflowScheme.mjs'; +export * from './createWorkflowSchemeDraftFromParent.mjs'; +export * from './createWorkflowTransitionProperty.mjs'; +export * from './deleteActor.mjs'; +export * from './deleteAddonProperty.mjs'; +export * from './deleteAndReplaceVersion.mjs'; +export * from './deleteAppProperty.mjs'; +export * from './deleteAvatar.mjs'; +export * from './deleteComment.mjs'; +export * from './deleteCommentProperty.mjs'; +export * from './deleteComponent.mjs'; +export * from './deleteCustomField.mjs'; +export * from './deleteCustomFieldContext.mjs'; +export * from './deleteCustomFieldOption.mjs'; +export * from './deleteDashboard.mjs'; +export * from './deleteDashboardItemProperty.mjs'; +export * from './deleteDefaultWorkflow.mjs'; +export * from './deleteDraftDefaultWorkflow.mjs'; +export * from './deleteDraftWorkflowMapping.mjs'; +export * from './deleteFavouriteForFilter.mjs'; +export * from './deleteFieldConfiguration.mjs'; +export * from './deleteFieldConfigurationScheme.mjs'; +export * from './deleteFilter.mjs'; +export * from './deleteInactiveWorkflow.mjs'; +export * from './deleteIssue.mjs'; +export * from './deleteIssueFieldOption.mjs'; +export * from './deleteIssueLink.mjs'; +export * from './deleteIssueLinkType.mjs'; +export * from './deleteIssueProperty.mjs'; +export * from './deleteIssueType.mjs'; +export * from './deleteIssueTypeProperty.mjs'; +export * from './deleteIssueTypeScheme.mjs'; +export * from './deleteIssueTypeScreenScheme.mjs'; +export * from './deleteNotificationScheme.mjs'; +export * from './deletePermissionScheme.mjs'; +export * from './deletePermissionSchemeEntity.mjs'; +export * from './deleteProject.mjs'; +export * from './deleteProjectAsynchronously.mjs'; +export * from './deleteProjectAvatar.mjs'; +export * from './deleteProjectProperty.mjs'; +export * from './deleteProjectRole.mjs'; +export * from './deleteProjectRoleActorsFromRole.mjs'; +export * from './deleteRemoteIssueLinkByGlobalId.mjs'; +export * from './deleteRemoteIssueLinkById.mjs'; +export * from './deleteResolution.mjs'; +export * from './deleteScreen.mjs'; +export * from './deleteScreenScheme.mjs'; +export * from './deleteScreenTab.mjs'; +export * from './deleteSecurityScheme.mjs'; +export * from './deleteSharePermission.mjs'; +export * from './deleteStatusesById.mjs'; +export * from './deleteUiModification.mjs'; +export * from './deleteUserProperty.mjs'; +export * from './deleteWebhookById.mjs'; +export * from './deleteWorkflowMapping.mjs'; +export * from './deleteWorkflowScheme.mjs'; +export * from './deleteWorkflowSchemeDraft.mjs'; +export * from './deleteWorkflowSchemeDraftIssueType.mjs'; +export * from './deleteWorkflowSchemeIssueType.mjs'; +export * from './deleteWorkflowTransitionProperty.mjs'; +export * from './deleteWorkflowTransitionRuleConfigurations.mjs'; +export * from './deleteWorklog.mjs'; +export * from './deleteWorklogProperty.mjs'; +export * from './doTransition.mjs'; +export * from './editIssue.mjs'; +export * from './evaluateJiraExpression.mjs'; +export * from './expandAttachmentForHumans.mjs'; +export * from './expandAttachmentForMachines.mjs'; +export * from './exportArchivedIssues.mjs'; +export * from './findAssignableUsers.mjs'; +export * from './findBulkAssignableUsers.mjs'; +export * from './findGroups.mjs'; +export * from './findUserKeysByQuery.mjs'; +export * from './findUsers.mjs'; +export * from './findUsersAndGroups.mjs'; +export * from './findUsersByQuery.mjs'; +export * from './findUsersForPicker.mjs'; +export * from './findUsersWithAllPermissions.mjs'; +export * from './findUsersWithBrowsePermission.mjs'; +export * from './fullyUpdateProjectRole.mjs'; +export * from './getAccessibleProjectTypeByKey.mjs'; +export * from './getAddonProperties.mjs'; +export * from './getAddonProperty.mjs'; +export * from './getAllDashboards.mjs'; +export * from './getAllFieldConfigurations.mjs'; +export * from './getAllFieldConfigurationSchemes.mjs'; +export * from './getAllGadgets.mjs'; +export * from './getAllIssueFieldOptions.mjs'; +export * from './getAllIssueTypeSchemes.mjs'; +export * from './getAllLabels.mjs'; +export * from './getAllPermissionSchemes.mjs'; +export * from './getAllProjectAvatars.mjs'; +export * from './getAllScreenTabFields.mjs'; +export * from './getAllScreenTabs.mjs'; +export * from './getAllStatuses.mjs'; +export * from './getAllSystemAvatars.mjs'; +export * from './getAllUsers.mjs'; +export * from './getAllUsersDefault.mjs'; +export * from './getAllWorkflowSchemes.mjs'; +export * from './getAlternativeIssueTypes.mjs'; +export * from './getApplicationProperty.mjs'; +export * from './getApplicationRole.mjs'; +export * from './getAssignedPermissionScheme.mjs'; +export * from './getAttachment.mjs'; +export * from './getAttachmentContent.mjs'; +export * from './getAttachmentThumbnail.mjs'; +export * from './getAuditRecords.mjs'; +export * from './getAutoCompletePost.mjs'; +export * from './getAvailableScreenFields.mjs'; +export * from './getAvatarImageByID.mjs'; +export * from './getAvatarImageByOwner.mjs'; +export * from './getAvatarImageByType.mjs'; +export * from './getAvatars.mjs'; +export * from './getBulkPermissions.mjs'; +export * from './getChangeLogs.mjs'; +export * from './getChangeLogsByIds.mjs'; +export * from './getColumns.mjs'; +export * from './getComment.mjs'; +export * from './getCommentProperty.mjs'; +export * from './getCommentPropertyKeys.mjs'; +export * from './getComments.mjs'; +export * from './getCommentsByIds.mjs'; +export * from './getComponent.mjs'; +export * from './getComponentRelatedIssues.mjs'; +export * from './getContextsForField.mjs'; +export * from './getCreateIssueMeta.mjs'; +export * from './getCurrentUser.mjs'; +export * from './getCustomFieldConfiguration.mjs'; +export * from './getCustomFieldContextsForProjectsAndIssueTypes.mjs'; +export * from './getCustomFieldOption.mjs'; +export * from './getDashboard.mjs'; +export * from './getDashboardItemProperty.mjs'; +export * from './getDashboardItemPropertyKeys.mjs'; +export * from './getDashboardsPaginated.mjs'; +export * from './getDefaultValues.mjs'; +export * from './getDefaultWorkflow.mjs'; +export * from './getDraftDefaultWorkflow.mjs'; +export * from './getDraftWorkflow.mjs'; +export * from './getDynamicWebhooksForApp.mjs'; +export * from './getEditIssueMeta.mjs'; +export * from './getFailedWebhooks.mjs'; +export * from './getFavouriteFilters.mjs'; +export * from './getFeaturesForProject.mjs'; +export * from './getFieldAutoCompleteForQueryString.mjs'; +export * from './getFieldConfigurationItems.mjs'; +export * from './getFieldConfigurationSchemeMappings.mjs'; +export * from './getFieldConfigurationSchemeProjectMapping.mjs'; +export * from './getFieldsPaginated.mjs'; +export * from './getFilter.mjs'; +export * from './getFiltersPaginated.mjs'; +export * from './getHierarchy.mjs'; +export * from './getIdsOfWorklogsDeletedSince.mjs'; +export * from './getIdsOfWorklogsModifiedSince.mjs'; +export * from './getIssue.mjs'; +export * from './getIssueFieldOption.mjs'; +export * from './getIssueLink.mjs'; +export * from './getIssueLinkType.mjs'; +export * from './getIssuePickerResource.mjs'; +export * from './getIssueProperty.mjs'; +export * from './getIssuePropertyKeys.mjs'; +export * from './getIssueSecurityLevel.mjs'; +export * from './getIssueSecurityLevelMembers.mjs'; +export * from './getIssueSecurityScheme.mjs'; +export * from './getIssueType.mjs'; +export * from './getIssueTypeMappingsForContexts.mjs'; +export * from './getIssueTypeProperty.mjs'; +export * from './getIssueTypePropertyKeys.mjs'; +export * from './getIssueTypeSchemeForProjects.mjs'; +export * from './getIssueTypeSchemesMapping.mjs'; +export * from './getIssueTypeScreenSchemeMappings.mjs'; +export * from './getIssueTypeScreenSchemeProjectAssociations.mjs'; +export * from './getIssueTypeScreenSchemes.mjs'; +export * from './getIssueTypesForProject.mjs'; +export * from './getIssueWatchers.mjs'; +export * from './getIssueWorklog.mjs'; +export * from './getIsWatchingIssueBulk.mjs'; +export * from './getMyFilters.mjs'; +export * from './getMyPermissions.mjs'; +export * from './getNotificationScheme.mjs'; +export * from './getNotificationSchemeForProject.mjs'; +export * from './getNotificationSchemes.mjs'; +export * from './getNotificationSchemeToProjectMappings.mjs'; +export * from './getOptionsForContext.mjs'; +export * from './getPermissionScheme.mjs'; +export * from './getPermissionSchemeGrant.mjs'; +export * from './getPermissionSchemeGrants.mjs'; +export * from './getPermittedProjects.mjs'; +export * from './getPrecomputations.mjs'; +export * from './getPreference.mjs'; +export * from './getPriority.mjs'; +export * from './getProject.mjs'; +export * from './getProjectCategoryById.mjs'; +export * from './getProjectComponents.mjs'; +export * from './getProjectComponentsPaginated.mjs'; +export * from './getProjectContextMapping.mjs'; +export * from './getProjectEmail.mjs'; +export * from './getProjectIssueSecurityScheme.mjs'; +export * from './getProjectProperty.mjs'; +export * from './getProjectPropertyKeys.mjs'; +export * from './getProjectRole.mjs'; +export * from './getProjectRoleActorsForRole.mjs'; +export * from './getProjectRoleById.mjs'; +export * from './getProjectRoleDetails.mjs'; +export * from './getProjectRoles.mjs'; +export * from './getProjectsForIssueTypeScreenScheme.mjs'; +export * from './getProjectTypeByKey.mjs'; +export * from './getProjectVersions.mjs'; +export * from './getProjectVersionsPaginated.mjs'; +export * from './getRecent.mjs'; +export * from './getRemoteIssueLinkById.mjs'; +export * from './getRemoteIssueLinks.mjs'; +export * from './getScreens.mjs'; +export * from './getScreenSchemes.mjs'; +export * from './getScreensForField.mjs'; +export * from './getSecurityLevelMembers.mjs'; +export * from './getSecurityLevels.mjs'; +export * from './getSecurityLevelsForProject.mjs'; +export * from './getSelectableIssueFieldOptions.mjs'; +export * from './getSharePermission.mjs'; +export * from './getSharePermissions.mjs'; +export * from './getStatus.mjs'; +export * from './getStatusCategory.mjs'; +export * from './getStatusesById.mjs'; +export * from './getTask.mjs'; +export * from './getTransitions.mjs'; +export * from './getTrashedFieldsPaginated.mjs'; +export * from './getUiModifications.mjs'; +export * from './getUser.mjs'; +export * from './getUserDefaultColumns.mjs'; +export * from './getUserEmail.mjs'; +export * from './getUserEmailBulk.mjs'; +export * from './getUserGroups.mjs'; +export * from './getUserProperty.mjs'; +export * from './getUserPropertyKeys.mjs'; +export * from './getUsersFromGroup.mjs'; +export * from './getValidProjectKey.mjs'; +export * from './getValidProjectName.mjs'; +export * from './getVersion.mjs'; +export * from './getVersionRelatedIssues.mjs'; +export * from './getVersionUnresolvedIssues.mjs'; +export * from './getVisibleIssueFieldOptions.mjs'; +export * from './getVotes.mjs'; +export * from './getWorkflow.mjs'; +export * from './getWorkflowScheme.mjs'; +export * from './getWorkflowSchemeDraft.mjs'; +export * from './getWorkflowSchemeDraftIssueType.mjs'; +export * from './getWorkflowSchemeIssueType.mjs'; +export * from './getWorkflowSchemeProjectAssociations.mjs'; +export * from './getWorkflowsPaginated.mjs'; +export * from './getWorkflowTransitionProperties.mjs'; +export * from './getWorkflowTransitionRuleConfigurations.mjs'; +export * from './getWorklog.mjs'; +export * from './getWorklogProperty.mjs'; +export * from './getWorklogPropertyKeys.mjs'; +export * from './getWorklogsForIds.mjs'; +export * from './linkIssues.mjs'; +export * from './matchIssues.mjs'; +export * from './mergeVersions.mjs'; +export * from './migrateQueries.mjs'; +export * from './movePriorities.mjs'; +export * from './moveResolutions.mjs'; +export * from './moveScreenTab.mjs'; +export * from './moveScreenTabField.mjs'; +export * from './moveVersion.mjs'; +export * from './notify.mjs'; +export * from './parseJqlQueries.mjs'; +export * from './partialUpdateProjectRole.mjs'; +export * from './publishDraftWorkflowScheme.mjs'; +export * from './putAddonProperty.mjs'; +export * from './putAppProperty.mjs'; +export * from './readWorkflows.mjs'; +export * from './refreshWebhooks.mjs'; +export * from './registerDynamicWebhooks.mjs'; +export * from './registerModules.mjs'; +export * from './removeAttachment.mjs'; +export * from './removeCustomFieldContextFromProjects.mjs'; +export * from './removeGadget.mjs'; +export * from './removeGroup.mjs'; +export * from './removeIssueTypeFromIssueTypeScheme.mjs'; +export * from './removeIssueTypesFromContext.mjs'; +export * from './removeIssueTypesFromGlobalFieldConfigurationScheme.mjs'; +export * from './removeLevel.mjs'; +export * from './removeMappingsFromIssueTypeScreenScheme.mjs'; +export * from './removeMemberFromSecurityLevel.mjs'; +export * from './removeModules.mjs'; +export * from './removeNotificationFromNotificationScheme.mjs'; +export * from './removePreference.mjs'; +export * from './removeProjectCategory.mjs'; +export * from './removeScreenTabField.mjs'; +export * from './removeUser.mjs'; +export * from './removeUserFromGroup.mjs'; +export * from './removeVote.mjs'; +export * from './removeWatcher.mjs'; +export * from './renameScreenTab.mjs'; +export * from './reorderCustomFieldOptions.mjs'; +export * from './reorderIssueTypesInIssueTypeScheme.mjs'; +export * from './replaceIssueFieldOption.mjs'; +export * from './resetColumns.mjs'; +export * from './resetUserColumns.mjs'; +export * from './restore.mjs'; +export * from './restoreCustomField.mjs'; +export * from './sanitiseJqlQueries.mjs'; +export * from './search.mjs'; +export * from './searchForIssuesUsingJql.mjs'; +export * from './searchForIssuesUsingJqlPost.mjs'; +export * from './searchPriorities.mjs'; +export * from './searchProjects.mjs'; +export * from './searchProjectsUsingSecuritySchemes.mjs'; +export * from './searchResolutions.mjs'; +export * from './searchSecuritySchemes.mjs'; +export * from './selectTimeTrackingImplementation.mjs'; +export * from './setActors.mjs'; +export * from './setApplicationProperty.mjs'; +export * from './setBanner.mjs'; +export * from './setColumns.mjs'; +export * from './setCommentProperty.mjs'; +export * from './setDashboardItemProperty.mjs'; +export * from './setDefaultLevels.mjs'; +export * from './setDefaultPriority.mjs'; +export * from './setDefaultResolution.mjs'; +export * from './setDefaultShareScope.mjs'; +export * from './setDefaultValues.mjs'; +export * from './setFavouriteForFilter.mjs'; +export * from './setFieldConfigurationSchemeMapping.mjs'; +export * from './setIssueProperty.mjs'; +export * from './setIssueTypeProperty.mjs'; +export * from './setPreference.mjs'; +export * from './setProjectProperty.mjs'; +export * from './setSharedTimeTrackingConfiguration.mjs'; +export * from './setUserColumns.mjs'; +export * from './setUserProperty.mjs'; +export * from './setWorkflowSchemeDraftIssueType.mjs'; +export * from './setWorkflowSchemeIssueType.mjs'; +export * from './setWorklogProperty.mjs'; +export * from './storeAvatar.mjs'; +export * from './toggleFeatureForProject.mjs'; +export * from './trashCustomField.mjs'; +export * from './unarchiveIssues.mjs'; +export * from './updateComment.mjs'; +export * from './updateComponent.mjs'; +export * from './updateCustomField.mjs'; +export * from './updateCustomFieldConfiguration.mjs'; +export * from './updateCustomFieldContext.mjs'; +export * from './updateCustomFieldOption.mjs'; +export * from './updateCustomFieldValue.mjs'; +export * from './updateDashboard.mjs'; +export * from './updateDefaultScreenScheme.mjs'; +export * from './updateDefaultWorkflow.mjs'; +export * from './updateDraftDefaultWorkflow.mjs'; +export * from './updateDraftWorkflowMapping.mjs'; +export * from './updateEntityPropertiesValue.mjs'; +export * from './updateFieldConfiguration.mjs'; +export * from './updateFieldConfigurationItems.mjs'; +export * from './updateFieldConfigurationScheme.mjs'; +export * from './updateFilter.mjs'; +export * from './updateGadget.mjs'; +export * from './updateIssueFieldOption.mjs'; +export * from './updateIssueFields.mjs'; +export * from './updateIssueLinkType.mjs'; +export * from './updateIssueSecurityScheme.mjs'; +export * from './updateIssueType.mjs'; +export * from './updateIssueTypeScheme.mjs'; +export * from './updateIssueTypeScreenScheme.mjs'; +export * from './updateMultipleCustomFieldValues.mjs'; +export * from './updateNotificationScheme.mjs'; +export * from './updatePermissionScheme.mjs'; +export * from './updatePrecomputations.mjs'; +export * from './updatePriority.mjs'; +export * from './updateProject.mjs'; +export * from './updateProjectAvatar.mjs'; +export * from './updateProjectCategory.mjs'; +export * from './updateProjectEmail.mjs'; +export * from './updateRemoteIssueLink.mjs'; +export * from './updateResolution.mjs'; +export * from './updateScreen.mjs'; +export * from './updateScreenScheme.mjs'; +export * from './updateSecurityLevel.mjs'; +export * from './updateStatuses.mjs'; +export * from './updateUiModification.mjs'; +export * from './updateVersion.mjs'; +export * from './updateWorkflowMapping.mjs'; +export * from './updateWorkflows.mjs'; +export * from './updateWorkflowScheme.mjs'; +export * from './updateWorkflowSchemeDraft.mjs'; +export * from './updateWorkflowTransitionProperty.mjs'; +export * from './updateWorkflowTransitionRuleConfigurations.mjs'; +export * from './updateWorklog.mjs'; +export * from './validateCreateWorkflows.mjs'; +export * from './validateProjectKey.mjs'; +export * from './validateUpdateWorkflows.mjs'; +export * from './workflowCapabilities.mjs'; +export * from './workflowRuleSearch.mjs'; diff --git a/src/version2/parameters/index.ts b/src/version2/parameters/index.ts deleted file mode 100644 index 641b4ecb6..000000000 --- a/src/version2/parameters/index.ts +++ /dev/null @@ -1,469 +0,0 @@ -export * from './addActorUsers.js'; -export * from './addAttachment.js'; -export * from './addComment.js'; -export * from './addFieldToDefaultScreen.js'; -export * from './addGadget.js'; -export * from './addIssueTypesToContext.js'; -export * from './addIssueTypesToIssueTypeScheme.js'; -export * from './addProjectRoleActorsToRole.js'; -export * from './addScreenTab.js'; -export * from './addScreenTabField.js'; -export * from './addSecurityLevel.js'; -export * from './addSecurityLevelMembers.js'; -export * from './addSharePermission.js'; -export * from './addUserToGroup.js'; -export * from './addVote.js'; -export * from './addWatcher.js'; -export * from './addWorklog.js'; -export * from './analyseExpression.js'; -export * from './appendMappingsForIssueTypeScreenScheme.js'; -export * from './archiveIssues.js'; -export * from './archiveIssuesAsync.js'; -export * from './archiveProject.js'; -export * from './assignFieldConfigurationSchemeToProject.js'; -export * from './assignIssue.js'; -export * from './assignIssueTypeSchemeToProject.js'; -export * from './assignIssueTypeScreenSchemeToProject.js'; -export * from './assignPermissionScheme.js'; -export * from './assignProjectsToCustomFieldContext.js'; -export * from './assignSchemeToProject.js'; -export * from './associateSchemesToProjects.js'; -export * from './bulkDeleteIssueProperty.js'; -export * from './bulkEditDashboards.js'; -export * from './bulkGetGroups.js'; -export * from './bulkGetUsers.js'; -export * from './bulkGetUsersMigration.js'; -export * from './bulkSetIssuePropertiesByIssue.js'; -export * from './bulkSetIssueProperty.js'; -export * from './bulkSetIssuesProperties.js'; -export * from './cancelTask.js'; -export * from './changeFilterOwner.js'; -export * from './copyDashboard.js'; -export * from './createComponent.js'; -export * from './createCustomField.js'; -export * from './createCustomFieldContext.js'; -export * from './createCustomFieldOption.js'; -export * from './createDashboard.js'; -export * from './createFieldConfiguration.js'; -export * from './createFieldConfigurationScheme.js'; -export * from './createFilter.js'; -export * from './createGroup.js'; -export * from './createIssue.js'; -export * from './createIssueFieldOption.js'; -export * from './createIssueLinkType.js'; -export * from './createIssues.js'; -export * from './createIssueSecurityScheme.js'; -export * from './createIssueType.js'; -export * from './createIssueTypeAvatar.js'; -export * from './createIssueTypeScheme.js'; -export * from './createIssueTypeScreenScheme.js'; -export * from './createNotificationScheme.js'; -export * from './createOrUpdateRemoteIssueLink.js'; -export * from './createPermissionGrant.js'; -export * from './createPermissionScheme.js'; -export * from './createPriority.js'; -export * from './createProject.js'; -export * from './createProjectAvatar.js'; -export * from './createProjectCategory.js'; -export * from './createProjectRole.js'; -export * from './createResolution.js'; -export * from './createScreen.js'; -export * from './createScreenScheme.js'; -export * from './createStatuses.js'; -export * from './createUiModification.js'; -export * from './createUser.js'; -export * from './createVersion.js'; -export * from './createWorkflow.js'; -export * from './createWorkflows.js'; -export * from './createWorkflowScheme.js'; -export * from './createWorkflowSchemeDraftFromParent.js'; -export * from './createWorkflowTransitionProperty.js'; -export * from './deleteActor.js'; -export * from './deleteAddonProperty.js'; -export * from './deleteAndReplaceVersion.js'; -export * from './deleteAppProperty.js'; -export * from './deleteAvatar.js'; -export * from './deleteComment.js'; -export * from './deleteCommentProperty.js'; -export * from './deleteComponent.js'; -export * from './deleteCustomField.js'; -export * from './deleteCustomFieldContext.js'; -export * from './deleteCustomFieldOption.js'; -export * from './deleteDashboard.js'; -export * from './deleteDashboardItemProperty.js'; -export * from './deleteDefaultWorkflow.js'; -export * from './deleteDraftDefaultWorkflow.js'; -export * from './deleteDraftWorkflowMapping.js'; -export * from './deleteFavouriteForFilter.js'; -export * from './deleteFieldConfiguration.js'; -export * from './deleteFieldConfigurationScheme.js'; -export * from './deleteFilter.js'; -export * from './deleteInactiveWorkflow.js'; -export * from './deleteIssue.js'; -export * from './deleteIssueFieldOption.js'; -export * from './deleteIssueLink.js'; -export * from './deleteIssueLinkType.js'; -export * from './deleteIssueProperty.js'; -export * from './deleteIssueType.js'; -export * from './deleteIssueTypeProperty.js'; -export * from './deleteIssueTypeScheme.js'; -export * from './deleteIssueTypeScreenScheme.js'; -export * from './deleteNotificationScheme.js'; -export * from './deletePermissionScheme.js'; -export * from './deletePermissionSchemeEntity.js'; -export * from './deleteProject.js'; -export * from './deleteProjectAsynchronously.js'; -export * from './deleteProjectAvatar.js'; -export * from './deleteProjectProperty.js'; -export * from './deleteProjectRole.js'; -export * from './deleteProjectRoleActorsFromRole.js'; -export * from './deleteRemoteIssueLinkByGlobalId.js'; -export * from './deleteRemoteIssueLinkById.js'; -export * from './deleteResolution.js'; -export * from './deleteScreen.js'; -export * from './deleteScreenScheme.js'; -export * from './deleteScreenTab.js'; -export * from './deleteSecurityScheme.js'; -export * from './deleteSharePermission.js'; -export * from './deleteStatusesById.js'; -export * from './deleteUiModification.js'; -export * from './deleteUserProperty.js'; -export * from './deleteWebhookById.js'; -export * from './deleteWorkflowMapping.js'; -export * from './deleteWorkflowScheme.js'; -export * from './deleteWorkflowSchemeDraft.js'; -export * from './deleteWorkflowSchemeDraftIssueType.js'; -export * from './deleteWorkflowSchemeIssueType.js'; -export * from './deleteWorkflowTransitionProperty.js'; -export * from './deleteWorkflowTransitionRuleConfigurations.js'; -export * from './deleteWorklog.js'; -export * from './deleteWorklogProperty.js'; -export * from './doTransition.js'; -export * from './editIssue.js'; -export * from './evaluateJiraExpression.js'; -export * from './expandAttachmentForHumans.js'; -export * from './expandAttachmentForMachines.js'; -export * from './exportArchivedIssues.js'; -export * from './findAssignableUsers.js'; -export * from './findBulkAssignableUsers.js'; -export * from './findGroups.js'; -export * from './findUserKeysByQuery.js'; -export * from './findUsers.js'; -export * from './findUsersAndGroups.js'; -export * from './findUsersByQuery.js'; -export * from './findUsersForPicker.js'; -export * from './findUsersWithAllPermissions.js'; -export * from './findUsersWithBrowsePermission.js'; -export * from './fullyUpdateProjectRole.js'; -export * from './getAccessibleProjectTypeByKey.js'; -export * from './getAddonProperties.js'; -export * from './getAddonProperty.js'; -export * from './getAllDashboards.js'; -export * from './getAllFieldConfigurations.js'; -export * from './getAllFieldConfigurationSchemes.js'; -export * from './getAllGadgets.js'; -export * from './getAllIssueFieldOptions.js'; -export * from './getAllIssueTypeSchemes.js'; -export * from './getAllLabels.js'; -export * from './getAllPermissionSchemes.js'; -export * from './getAllProjectAvatars.js'; -export * from './getAllScreenTabFields.js'; -export * from './getAllScreenTabs.js'; -export * from './getAllStatuses.js'; -export * from './getAllSystemAvatars.js'; -export * from './getAllUsers.js'; -export * from './getAllUsersDefault.js'; -export * from './getAllWorkflowSchemes.js'; -export * from './getAlternativeIssueTypes.js'; -export * from './getApplicationProperty.js'; -export * from './getApplicationRole.js'; -export * from './getAssignedPermissionScheme.js'; -export * from './getAttachment.js'; -export * from './getAttachmentContent.js'; -export * from './getAttachmentThumbnail.js'; -export * from './getAuditRecords.js'; -export * from './getAutoCompletePost.js'; -export * from './getAvailableScreenFields.js'; -export * from './getAvatarImageByID.js'; -export * from './getAvatarImageByOwner.js'; -export * from './getAvatarImageByType.js'; -export * from './getAvatars.js'; -export * from './getBulkPermissions.js'; -export * from './getChangeLogs.js'; -export * from './getChangeLogsByIds.js'; -export * from './getColumns.js'; -export * from './getComment.js'; -export * from './getCommentProperty.js'; -export * from './getCommentPropertyKeys.js'; -export * from './getComments.js'; -export * from './getCommentsByIds.js'; -export * from './getComponent.js'; -export * from './getComponentRelatedIssues.js'; -export * from './getContextsForField.js'; -export * from './getCreateIssueMeta.js'; -export * from './getCurrentUser.js'; -export * from './getCustomFieldConfiguration.js'; -export * from './getCustomFieldContextsForProjectsAndIssueTypes.js'; -export * from './getCustomFieldOption.js'; -export * from './getDashboard.js'; -export * from './getDashboardItemProperty.js'; -export * from './getDashboardItemPropertyKeys.js'; -export * from './getDashboardsPaginated.js'; -export * from './getDefaultValues.js'; -export * from './getDefaultWorkflow.js'; -export * from './getDraftDefaultWorkflow.js'; -export * from './getDraftWorkflow.js'; -export * from './getDynamicWebhooksForApp.js'; -export * from './getEditIssueMeta.js'; -export * from './getFailedWebhooks.js'; -export * from './getFavouriteFilters.js'; -export * from './getFeaturesForProject.js'; -export * from './getFieldAutoCompleteForQueryString.js'; -export * from './getFieldConfigurationItems.js'; -export * from './getFieldConfigurationSchemeMappings.js'; -export * from './getFieldConfigurationSchemeProjectMapping.js'; -export * from './getFieldsPaginated.js'; -export * from './getFilter.js'; -export * from './getFiltersPaginated.js'; -export * from './getHierarchy.js'; -export * from './getIdsOfWorklogsDeletedSince.js'; -export * from './getIdsOfWorklogsModifiedSince.js'; -export * from './getIssue.js'; -export * from './getIssueFieldOption.js'; -export * from './getIssueLink.js'; -export * from './getIssueLinkType.js'; -export * from './getIssuePickerResource.js'; -export * from './getIssueProperty.js'; -export * from './getIssuePropertyKeys.js'; -export * from './getIssueSecurityLevel.js'; -export * from './getIssueSecurityLevelMembers.js'; -export * from './getIssueSecurityScheme.js'; -export * from './getIssueType.js'; -export * from './getIssueTypeMappingsForContexts.js'; -export * from './getIssueTypeProperty.js'; -export * from './getIssueTypePropertyKeys.js'; -export * from './getIssueTypeSchemeForProjects.js'; -export * from './getIssueTypeSchemesMapping.js'; -export * from './getIssueTypeScreenSchemeMappings.js'; -export * from './getIssueTypeScreenSchemeProjectAssociations.js'; -export * from './getIssueTypeScreenSchemes.js'; -export * from './getIssueTypesForProject.js'; -export * from './getIssueWatchers.js'; -export * from './getIssueWorklog.js'; -export * from './getIsWatchingIssueBulk.js'; -export * from './getMyFilters.js'; -export * from './getMyPermissions.js'; -export * from './getNotificationScheme.js'; -export * from './getNotificationSchemeForProject.js'; -export * from './getNotificationSchemes.js'; -export * from './getNotificationSchemeToProjectMappings.js'; -export * from './getOptionsForContext.js'; -export * from './getPermissionScheme.js'; -export * from './getPermissionSchemeGrant.js'; -export * from './getPermissionSchemeGrants.js'; -export * from './getPermittedProjects.js'; -export * from './getPrecomputations.js'; -export * from './getPreference.js'; -export * from './getPriority.js'; -export * from './getProject.js'; -export * from './getProjectCategoryById.js'; -export * from './getProjectComponents.js'; -export * from './getProjectComponentsPaginated.js'; -export * from './getProjectContextMapping.js'; -export * from './getProjectEmail.js'; -export * from './getProjectIssueSecurityScheme.js'; -export * from './getProjectProperty.js'; -export * from './getProjectPropertyKeys.js'; -export * from './getProjectRole.js'; -export * from './getProjectRoleActorsForRole.js'; -export * from './getProjectRoleById.js'; -export * from './getProjectRoleDetails.js'; -export * from './getProjectRoles.js'; -export * from './getProjectsForIssueTypeScreenScheme.js'; -export * from './getProjectTypeByKey.js'; -export * from './getProjectVersions.js'; -export * from './getProjectVersionsPaginated.js'; -export * from './getRecent.js'; -export * from './getRemoteIssueLinkById.js'; -export * from './getRemoteIssueLinks.js'; -export * from './getScreens.js'; -export * from './getScreenSchemes.js'; -export * from './getScreensForField.js'; -export * from './getSecurityLevelMembers.js'; -export * from './getSecurityLevels.js'; -export * from './getSecurityLevelsForProject.js'; -export * from './getSelectableIssueFieldOptions.js'; -export * from './getSharePermission.js'; -export * from './getSharePermissions.js'; -export * from './getStatus.js'; -export * from './getStatusCategory.js'; -export * from './getStatusesById.js'; -export * from './getTask.js'; -export * from './getTransitions.js'; -export * from './getTrashedFieldsPaginated.js'; -export * from './getUiModifications.js'; -export * from './getUser.js'; -export * from './getUserDefaultColumns.js'; -export * from './getUserEmail.js'; -export * from './getUserEmailBulk.js'; -export * from './getUserGroups.js'; -export * from './getUserProperty.js'; -export * from './getUserPropertyKeys.js'; -export * from './getUsersFromGroup.js'; -export * from './getValidProjectKey.js'; -export * from './getValidProjectName.js'; -export * from './getVersion.js'; -export * from './getVersionRelatedIssues.js'; -export * from './getVersionUnresolvedIssues.js'; -export * from './getVisibleIssueFieldOptions.js'; -export * from './getVotes.js'; -export * from './getWorkflow.js'; -export * from './getWorkflowScheme.js'; -export * from './getWorkflowSchemeDraft.js'; -export * from './getWorkflowSchemeDraftIssueType.js'; -export * from './getWorkflowSchemeIssueType.js'; -export * from './getWorkflowSchemeProjectAssociations.js'; -export * from './getWorkflowsPaginated.js'; -export * from './getWorkflowTransitionProperties.js'; -export * from './getWorkflowTransitionRuleConfigurations.js'; -export * from './getWorklog.js'; -export * from './getWorklogProperty.js'; -export * from './getWorklogPropertyKeys.js'; -export * from './getWorklogsForIds.js'; -export * from './linkIssues.js'; -export * from './matchIssues.js'; -export * from './mergeVersions.js'; -export * from './migrateQueries.js'; -export * from './movePriorities.js'; -export * from './moveResolutions.js'; -export * from './moveScreenTab.js'; -export * from './moveScreenTabField.js'; -export * from './moveVersion.js'; -export * from './notify.js'; -export * from './parseJqlQueries.js'; -export * from './partialUpdateProjectRole.js'; -export * from './publishDraftWorkflowScheme.js'; -export * from './putAddonProperty.js'; -export * from './putAppProperty.js'; -export * from './readWorkflows.js'; -export * from './refreshWebhooks.js'; -export * from './registerDynamicWebhooks.js'; -export * from './registerModules.js'; -export * from './removeAttachment.js'; -export * from './removeCustomFieldContextFromProjects.js'; -export * from './removeGadget.js'; -export * from './removeGroup.js'; -export * from './removeIssueTypeFromIssueTypeScheme.js'; -export * from './removeIssueTypesFromContext.js'; -export * from './removeIssueTypesFromGlobalFieldConfigurationScheme.js'; -export * from './removeLevel.js'; -export * from './removeMappingsFromIssueTypeScreenScheme.js'; -export * from './removeMemberFromSecurityLevel.js'; -export * from './removeModules.js'; -export * from './removeNotificationFromNotificationScheme.js'; -export * from './removePreference.js'; -export * from './removeProjectCategory.js'; -export * from './removeScreenTabField.js'; -export * from './removeUser.js'; -export * from './removeUserFromGroup.js'; -export * from './removeVote.js'; -export * from './removeWatcher.js'; -export * from './renameScreenTab.js'; -export * from './reorderCustomFieldOptions.js'; -export * from './reorderIssueTypesInIssueTypeScheme.js'; -export * from './replaceIssueFieldOption.js'; -export * from './resetColumns.js'; -export * from './resetUserColumns.js'; -export * from './restore.js'; -export * from './restoreCustomField.js'; -export * from './sanitiseJqlQueries.js'; -export * from './search.js'; -export * from './searchForIssuesUsingJql.js'; -export * from './searchForIssuesUsingJqlPost.js'; -export * from './searchPriorities.js'; -export * from './searchProjects.js'; -export * from './searchProjectsUsingSecuritySchemes.js'; -export * from './searchResolutions.js'; -export * from './searchSecuritySchemes.js'; -export * from './selectTimeTrackingImplementation.js'; -export * from './setActors.js'; -export * from './setApplicationProperty.js'; -export * from './setBanner.js'; -export * from './setColumns.js'; -export * from './setCommentProperty.js'; -export * from './setDashboardItemProperty.js'; -export * from './setDefaultLevels.js'; -export * from './setDefaultPriority.js'; -export * from './setDefaultResolution.js'; -export * from './setDefaultShareScope.js'; -export * from './setDefaultValues.js'; -export * from './setFavouriteForFilter.js'; -export * from './setFieldConfigurationSchemeMapping.js'; -export * from './setIssueProperty.js'; -export * from './setIssueTypeProperty.js'; -export * from './setPreference.js'; -export * from './setProjectProperty.js'; -export * from './setSharedTimeTrackingConfiguration.js'; -export * from './setUserColumns.js'; -export * from './setUserProperty.js'; -export * from './setWorkflowSchemeDraftIssueType.js'; -export * from './setWorkflowSchemeIssueType.js'; -export * from './setWorklogProperty.js'; -export * from './storeAvatar.js'; -export * from './toggleFeatureForProject.js'; -export * from './trashCustomField.js'; -export * from './unarchiveIssues.js'; -export * from './updateComment.js'; -export * from './updateComponent.js'; -export * from './updateCustomField.js'; -export * from './updateCustomFieldConfiguration.js'; -export * from './updateCustomFieldContext.js'; -export * from './updateCustomFieldOption.js'; -export * from './updateCustomFieldValue.js'; -export * from './updateDashboard.js'; -export * from './updateDefaultScreenScheme.js'; -export * from './updateDefaultWorkflow.js'; -export * from './updateDraftDefaultWorkflow.js'; -export * from './updateDraftWorkflowMapping.js'; -export * from './updateEntityPropertiesValue.js'; -export * from './updateFieldConfiguration.js'; -export * from './updateFieldConfigurationItems.js'; -export * from './updateFieldConfigurationScheme.js'; -export * from './updateFilter.js'; -export * from './updateGadget.js'; -export * from './updateIssueFieldOption.js'; -export * from './updateIssueFields.js'; -export * from './updateIssueLinkType.js'; -export * from './updateIssueSecurityScheme.js'; -export * from './updateIssueType.js'; -export * from './updateIssueTypeScheme.js'; -export * from './updateIssueTypeScreenScheme.js'; -export * from './updateMultipleCustomFieldValues.js'; -export * from './updateNotificationScheme.js'; -export * from './updatePermissionScheme.js'; -export * from './updatePrecomputations.js'; -export * from './updatePriority.js'; -export * from './updateProject.js'; -export * from './updateProjectAvatar.js'; -export * from './updateProjectCategory.js'; -export * from './updateProjectEmail.js'; -export * from './updateRemoteIssueLink.js'; -export * from './updateResolution.js'; -export * from './updateScreen.js'; -export * from './updateScreenScheme.js'; -export * from './updateSecurityLevel.js'; -export * from './updateStatuses.js'; -export * from './updateUiModification.js'; -export * from './updateVersion.js'; -export * from './updateWorkflowMapping.js'; -export * from './updateWorkflows.js'; -export * from './updateWorkflowScheme.js'; -export * from './updateWorkflowSchemeDraft.js'; -export * from './updateWorkflowTransitionProperty.js'; -export * from './updateWorkflowTransitionRuleConfigurations.js'; -export * from './updateWorklog.js'; -export * from './validateCreateWorkflows.js'; -export * from './validateProjectKey.js'; -export * from './validateUpdateWorkflows.js'; -export * from './workflowCapabilities.js'; -export * from './workflowRuleSearch.js'; diff --git a/src/version2/parameters/linkIssues.mts b/src/version2/parameters/linkIssues.mts new file mode 100644 index 000000000..5b913d246 --- /dev/null +++ b/src/version2/parameters/linkIssues.mts @@ -0,0 +1,3 @@ +import { LinkIssueRequestJson } from '../models/index.mjs'; + +export interface LinkIssues extends LinkIssueRequestJson {} diff --git a/src/version2/parameters/linkIssues.ts b/src/version2/parameters/linkIssues.ts deleted file mode 100644 index f8b4b095c..000000000 --- a/src/version2/parameters/linkIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { LinkIssueRequestJson } from '../models/index.js'; - -export interface LinkIssues extends LinkIssueRequestJson {} diff --git a/src/version2/parameters/matchIssues.mts b/src/version2/parameters/matchIssues.mts new file mode 100644 index 000000000..10f28eb7e --- /dev/null +++ b/src/version2/parameters/matchIssues.mts @@ -0,0 +1,3 @@ +import { IssuesAndJQLQueries } from '../models/index.mjs'; + +export interface MatchIssues extends IssuesAndJQLQueries {} diff --git a/src/version2/parameters/matchIssues.ts b/src/version2/parameters/matchIssues.ts deleted file mode 100644 index 6ef7e314d..000000000 --- a/src/version2/parameters/matchIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssuesAndJQLQueries } from '../models/index.js'; - -export interface MatchIssues extends IssuesAndJQLQueries {} diff --git a/src/version2/parameters/mergeVersions.ts b/src/version2/parameters/mergeVersions.mts similarity index 100% rename from src/version2/parameters/mergeVersions.ts rename to src/version2/parameters/mergeVersions.mts diff --git a/src/version2/parameters/migrateQueries.mts b/src/version2/parameters/migrateQueries.mts new file mode 100644 index 000000000..6a6dd34d7 --- /dev/null +++ b/src/version2/parameters/migrateQueries.mts @@ -0,0 +1,3 @@ +import { JQLPersonalDataMigrationRequest } from '../models/index.mjs'; + +export interface MigrateQueries extends JQLPersonalDataMigrationRequest {} diff --git a/src/version2/parameters/migrateQueries.ts b/src/version2/parameters/migrateQueries.ts deleted file mode 100644 index aaac24678..000000000 --- a/src/version2/parameters/migrateQueries.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { JQLPersonalDataMigrationRequest } from '../models/index.js'; - -export interface MigrateQueries extends JQLPersonalDataMigrationRequest {} diff --git a/src/version2/parameters/movePriorities.mts b/src/version2/parameters/movePriorities.mts new file mode 100644 index 000000000..f9e8521f8 --- /dev/null +++ b/src/version2/parameters/movePriorities.mts @@ -0,0 +1,3 @@ +import { ReorderIssuePriorities } from '../models/index.mjs'; + +export interface MovePriorities extends ReorderIssuePriorities {} diff --git a/src/version2/parameters/movePriorities.ts b/src/version2/parameters/movePriorities.ts deleted file mode 100644 index 4462a3100..000000000 --- a/src/version2/parameters/movePriorities.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ReorderIssuePriorities } from '../models/index.js'; - -export interface MovePriorities extends ReorderIssuePriorities {} diff --git a/src/version2/parameters/moveResolutions.mts b/src/version2/parameters/moveResolutions.mts new file mode 100644 index 000000000..0e1d9a829 --- /dev/null +++ b/src/version2/parameters/moveResolutions.mts @@ -0,0 +1,3 @@ +import { ReorderIssueResolutionsRequest } from '../models/index.mjs'; + +export interface MoveResolutions extends ReorderIssueResolutionsRequest {} diff --git a/src/version2/parameters/moveResolutions.ts b/src/version2/parameters/moveResolutions.ts deleted file mode 100644 index 058416084..000000000 --- a/src/version2/parameters/moveResolutions.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ReorderIssueResolutionsRequest } from '../models/index.js'; - -export interface MoveResolutions extends ReorderIssueResolutionsRequest {} diff --git a/src/version2/parameters/moveScreenTab.ts b/src/version2/parameters/moveScreenTab.mts similarity index 100% rename from src/version2/parameters/moveScreenTab.ts rename to src/version2/parameters/moveScreenTab.mts diff --git a/src/version2/parameters/moveScreenTabField.mts b/src/version2/parameters/moveScreenTabField.mts new file mode 100644 index 000000000..0ed677e4e --- /dev/null +++ b/src/version2/parameters/moveScreenTabField.mts @@ -0,0 +1,10 @@ +import { MoveField } from '../models/index.mjs'; + +export interface MoveScreenTabField extends MoveField { + /** The ID of the screen. */ + screenId: number; + /** The ID of the screen tab. */ + tabId: number; + /** The ID of the field. */ + id: string; +} diff --git a/src/version2/parameters/moveScreenTabField.ts b/src/version2/parameters/moveScreenTabField.ts deleted file mode 100644 index b4090203b..000000000 --- a/src/version2/parameters/moveScreenTabField.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { MoveField } from '../models/index.js'; - -export interface MoveScreenTabField extends MoveField { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; - /** The ID of the field. */ - id: string; -} diff --git a/src/version2/parameters/moveVersion.mts b/src/version2/parameters/moveVersion.mts new file mode 100644 index 000000000..406cf9055 --- /dev/null +++ b/src/version2/parameters/moveVersion.mts @@ -0,0 +1,6 @@ +import { VersionMove } from '../models/index.mjs'; + +export interface MoveVersion extends VersionMove { + /** The ID of the version to be moved. */ + id: string; +} diff --git a/src/version2/parameters/moveVersion.ts b/src/version2/parameters/moveVersion.ts deleted file mode 100644 index 2537a26dd..000000000 --- a/src/version2/parameters/moveVersion.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { VersionMove } from '../models/index.js'; - -export interface MoveVersion extends VersionMove { - /** The ID of the version to be moved. */ - id: string; -} diff --git a/src/version2/parameters/notify.mts b/src/version2/parameters/notify.mts new file mode 100644 index 000000000..1485a4206 --- /dev/null +++ b/src/version2/parameters/notify.mts @@ -0,0 +1,6 @@ +import { Notification } from '../models/index.mjs'; + +export interface Notify extends Notification { + /** ID or key of the issue that the notification is sent for. */ + issueIdOrKey: string; +} diff --git a/src/version2/parameters/notify.ts b/src/version2/parameters/notify.ts deleted file mode 100644 index 3b176fd9d..000000000 --- a/src/version2/parameters/notify.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Notification } from '../models/index.js'; - -export interface Notify extends Notification { - /** ID or key of the issue that the notification is sent for. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/parseJqlQueries.mts b/src/version2/parameters/parseJqlQueries.mts new file mode 100644 index 000000000..5f8584cb2 --- /dev/null +++ b/src/version2/parameters/parseJqlQueries.mts @@ -0,0 +1,13 @@ +import { JqlQueriesToParse } from '../models/index.mjs'; + +export interface ParseJqlQueries extends JqlQueriesToParse { + /** + * How to validate the Jql query and treat the validation results. Validation options include: + * + * - `strict` Returns all errors. If validation fails, the query structure is not returned. + * - `warn` Returns all errors. If validation fails but the Jql query is correctly formed, the query structure is + * returned. + * - `none` No validation is performed. If Jql query is correctly formed, the query structure is returned. + */ + validation?: 'strict' | 'warn' | 'none' | string; +} diff --git a/src/version2/parameters/parseJqlQueries.ts b/src/version2/parameters/parseJqlQueries.ts deleted file mode 100644 index e256e6dd8..000000000 --- a/src/version2/parameters/parseJqlQueries.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { JqlQueriesToParse } from '../models/index.js'; - -export interface ParseJqlQueries extends JqlQueriesToParse { - /** - * How to validate the JQL query and treat the validation results. Validation options include: - * - * - `strict` Returns all errors. If validation fails, the query structure is not returned. - * - `warn` Returns all errors. If validation fails but the JQL query is correctly formed, the query structure is - * returned. - * - `none` No validation is performed. If JQL query is correctly formed, the query structure is returned. - */ - validation?: 'strict' | 'warn' | 'none' | string; -} diff --git a/src/version2/parameters/partialUpdateProjectRole.mts b/src/version2/parameters/partialUpdateProjectRole.mts new file mode 100644 index 000000000..d254d6b18 --- /dev/null +++ b/src/version2/parameters/partialUpdateProjectRole.mts @@ -0,0 +1,9 @@ +import { CreateUpdateRoleRequest } from '../models/index.mjs'; + +export interface PartialUpdateProjectRole extends CreateUpdateRoleRequest { + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: number; +} diff --git a/src/version2/parameters/partialUpdateProjectRole.ts b/src/version2/parameters/partialUpdateProjectRole.ts deleted file mode 100644 index 510e287fc..000000000 --- a/src/version2/parameters/partialUpdateProjectRole.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { CreateUpdateRoleRequest } from '../models/index.js'; - -export interface PartialUpdateProjectRole extends CreateUpdateRoleRequest { - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version2/parameters/publishDraftWorkflowScheme.mts b/src/version2/parameters/publishDraftWorkflowScheme.mts new file mode 100644 index 000000000..4befa82a0 --- /dev/null +++ b/src/version2/parameters/publishDraftWorkflowScheme.mts @@ -0,0 +1,9 @@ +import { StatusMapping } from '../models/index.mjs'; + +export interface PublishDraftWorkflowScheme { + /** The ID of the workflow scheme that the draft belongs to. */ + id: number; + /** Whether the request only performs a validation. */ + validateOnly?: boolean; + statusMappings?: StatusMapping[]; +} diff --git a/src/version2/parameters/publishDraftWorkflowScheme.ts b/src/version2/parameters/publishDraftWorkflowScheme.ts deleted file mode 100644 index 3d2cf8f40..000000000 --- a/src/version2/parameters/publishDraftWorkflowScheme.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { StatusMapping } from '../models/index.js'; - -export interface PublishDraftWorkflowScheme { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** Whether the request only performs a validation. */ - validateOnly?: boolean; - statusMappings?: StatusMapping[]; -} diff --git a/src/version2/parameters/putAddonProperty.ts b/src/version2/parameters/putAddonProperty.mts similarity index 100% rename from src/version2/parameters/putAddonProperty.ts rename to src/version2/parameters/putAddonProperty.mts diff --git a/src/version2/parameters/putAppProperty.ts b/src/version2/parameters/putAppProperty.mts similarity index 100% rename from src/version2/parameters/putAppProperty.ts rename to src/version2/parameters/putAppProperty.mts diff --git a/src/version2/parameters/readWorkflows.mts b/src/version2/parameters/readWorkflows.mts new file mode 100644 index 000000000..c88f2e373 --- /dev/null +++ b/src/version2/parameters/readWorkflows.mts @@ -0,0 +1,18 @@ +import { ProjectAndIssueTypePair } from '../models/index.mjs'; + +export interface ReadWorkflows { + /** The list of projects and issue types to query. */ + projectAndIssueTypes?: ProjectAndIssueTypePair[]; + /** The list of workflow IDs to query. */ + workflowIds?: string[]; + /** The list of workflow names to query. */ + workflowNames?: string[]; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * `workflows.usages` Returns the project and issue types that each workflow is associated with. `statuses.usages` + * Returns the project and issue types that each status is associated with. + */ + expand?: string; +} diff --git a/src/version2/parameters/readWorkflows.ts b/src/version2/parameters/readWorkflows.ts deleted file mode 100644 index 482b092fe..000000000 --- a/src/version2/parameters/readWorkflows.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { ProjectAndIssueTypePair } from '../models/index.js'; - -export interface ReadWorkflows { - /** The list of projects and issue types to query. */ - projectAndIssueTypes?: ProjectAndIssueTypePair[]; - /** The list of workflow IDs to query. */ - workflowIds?: string[]; - /** The list of workflow names to query. */ - workflowNames?: string[]; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `workflows.usages` Returns the project and issue types that each workflow is associated with. `statuses.usages` - * Returns the project and issue types that each status is associated with. - */ - expand?: string; -} diff --git a/src/version2/parameters/refreshWebhooks.mts b/src/version2/parameters/refreshWebhooks.mts new file mode 100644 index 000000000..33d4bceaa --- /dev/null +++ b/src/version2/parameters/refreshWebhooks.mts @@ -0,0 +1,3 @@ +import { ContainerForWebhookIDs } from '../models/index.mjs'; + +export interface RefreshWebhooks extends ContainerForWebhookIDs {} diff --git a/src/version2/parameters/refreshWebhooks.ts b/src/version2/parameters/refreshWebhooks.ts deleted file mode 100644 index a7fcb0f72..000000000 --- a/src/version2/parameters/refreshWebhooks.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ContainerForWebhookIDs } from '../models/index.js'; - -export interface RefreshWebhooks extends ContainerForWebhookIDs {} diff --git a/src/version2/parameters/registerDynamicWebhooks.mts b/src/version2/parameters/registerDynamicWebhooks.mts new file mode 100644 index 000000000..b88825dc5 --- /dev/null +++ b/src/version2/parameters/registerDynamicWebhooks.mts @@ -0,0 +1,3 @@ +import { WebhookRegistrationDetails } from '../models/index.mjs'; + +export interface RegisterDynamicWebhooks extends WebhookRegistrationDetails {} diff --git a/src/version2/parameters/registerDynamicWebhooks.ts b/src/version2/parameters/registerDynamicWebhooks.ts deleted file mode 100644 index efe7f5c28..000000000 --- a/src/version2/parameters/registerDynamicWebhooks.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WebhookRegistrationDetails } from '../models/index.js'; - -export interface RegisterDynamicWebhooks extends WebhookRegistrationDetails {} diff --git a/src/version2/parameters/registerModules.mts b/src/version2/parameters/registerModules.mts new file mode 100644 index 000000000..3d88a2183 --- /dev/null +++ b/src/version2/parameters/registerModules.mts @@ -0,0 +1,3 @@ +import { ConnectModules } from '../models/index.mjs'; + +export interface RegisterModules extends ConnectModules {} diff --git a/src/version2/parameters/registerModules.ts b/src/version2/parameters/registerModules.ts deleted file mode 100644 index 4672e7393..000000000 --- a/src/version2/parameters/registerModules.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ConnectModules } from '../models/index.js'; - -export interface RegisterModules extends ConnectModules {} diff --git a/src/version2/parameters/removeAttachment.ts b/src/version2/parameters/removeAttachment.mts similarity index 100% rename from src/version2/parameters/removeAttachment.ts rename to src/version2/parameters/removeAttachment.mts diff --git a/src/version2/parameters/removeCustomFieldContextFromProjects.mts b/src/version2/parameters/removeCustomFieldContextFromProjects.mts new file mode 100644 index 000000000..b1c3958a0 --- /dev/null +++ b/src/version2/parameters/removeCustomFieldContextFromProjects.mts @@ -0,0 +1,8 @@ +import { ProjectIds } from '../models/index.mjs'; + +export interface RemoveCustomFieldContextFromProjects extends ProjectIds { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/removeCustomFieldContextFromProjects.ts b/src/version2/parameters/removeCustomFieldContextFromProjects.ts deleted file mode 100644 index 10400c536..000000000 --- a/src/version2/parameters/removeCustomFieldContextFromProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectIds } from '../models/index.js'; - -export interface RemoveCustomFieldContextFromProjects extends ProjectIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/removeGadget.ts b/src/version2/parameters/removeGadget.mts similarity index 100% rename from src/version2/parameters/removeGadget.ts rename to src/version2/parameters/removeGadget.mts diff --git a/src/version2/parameters/removeGroup.ts b/src/version2/parameters/removeGroup.mts similarity index 100% rename from src/version2/parameters/removeGroup.ts rename to src/version2/parameters/removeGroup.mts diff --git a/src/version2/parameters/removeIssueTypeFromIssueTypeScheme.ts b/src/version2/parameters/removeIssueTypeFromIssueTypeScheme.mts similarity index 100% rename from src/version2/parameters/removeIssueTypeFromIssueTypeScheme.ts rename to src/version2/parameters/removeIssueTypeFromIssueTypeScheme.mts diff --git a/src/version2/parameters/removeIssueTypesFromContext.mts b/src/version2/parameters/removeIssueTypesFromContext.mts new file mode 100644 index 000000000..cc50dcd40 --- /dev/null +++ b/src/version2/parameters/removeIssueTypesFromContext.mts @@ -0,0 +1,8 @@ +import { IssueTypeIds } from '../models/index.mjs'; + +export interface RemoveIssueTypesFromContext extends IssueTypeIds { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/removeIssueTypesFromContext.ts b/src/version2/parameters/removeIssueTypesFromContext.ts deleted file mode 100644 index f810fb377..000000000 --- a/src/version2/parameters/removeIssueTypesFromContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypeIds } from '../models/index.js'; - -export interface RemoveIssueTypesFromContext extends IssueTypeIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.mts b/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.mts new file mode 100644 index 000000000..f78e9be21 --- /dev/null +++ b/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeIdsToRemove } from '../models/index.mjs'; + +export interface RemoveIssueTypesFromGlobalFieldConfigurationScheme extends IssueTypeIdsToRemove { + /** The ID of the field configuration scheme. */ + id: number; +} diff --git a/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts b/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts deleted file mode 100644 index 72bd7f2b8..000000000 --- a/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeIdsToRemove } from '../models/index.js'; - -export interface RemoveIssueTypesFromGlobalFieldConfigurationScheme extends IssueTypeIdsToRemove { - /** The ID of the field configuration scheme. */ - id: number; -} diff --git a/src/version2/parameters/removeLevel.ts b/src/version2/parameters/removeLevel.mts similarity index 100% rename from src/version2/parameters/removeLevel.ts rename to src/version2/parameters/removeLevel.mts diff --git a/src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.mts b/src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.mts new file mode 100644 index 000000000..117d550ce --- /dev/null +++ b/src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeIds } from '../models/index.mjs'; + +export interface RemoveMappingsFromIssueTypeScreenScheme extends IssueTypeIds { + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: string; +} diff --git a/src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.ts b/src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.ts deleted file mode 100644 index 9525f31fe..000000000 --- a/src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeIds } from '../models/index.js'; - -export interface RemoveMappingsFromIssueTypeScreenScheme extends IssueTypeIds { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; -} diff --git a/src/version2/parameters/removeMemberFromSecurityLevel.ts b/src/version2/parameters/removeMemberFromSecurityLevel.mts similarity index 100% rename from src/version2/parameters/removeMemberFromSecurityLevel.ts rename to src/version2/parameters/removeMemberFromSecurityLevel.mts diff --git a/src/version2/parameters/removeModules.ts b/src/version2/parameters/removeModules.mts similarity index 100% rename from src/version2/parameters/removeModules.ts rename to src/version2/parameters/removeModules.mts diff --git a/src/version2/parameters/removeNotificationFromNotificationScheme.ts b/src/version2/parameters/removeNotificationFromNotificationScheme.mts similarity index 100% rename from src/version2/parameters/removeNotificationFromNotificationScheme.ts rename to src/version2/parameters/removeNotificationFromNotificationScheme.mts diff --git a/src/version2/parameters/removePreference.ts b/src/version2/parameters/removePreference.mts similarity index 100% rename from src/version2/parameters/removePreference.ts rename to src/version2/parameters/removePreference.mts diff --git a/src/version2/parameters/removeProjectCategory.ts b/src/version2/parameters/removeProjectCategory.mts similarity index 100% rename from src/version2/parameters/removeProjectCategory.ts rename to src/version2/parameters/removeProjectCategory.mts diff --git a/src/version2/parameters/removeScreenTabField.ts b/src/version2/parameters/removeScreenTabField.mts similarity index 100% rename from src/version2/parameters/removeScreenTabField.ts rename to src/version2/parameters/removeScreenTabField.mts diff --git a/src/version2/parameters/removeUser.ts b/src/version2/parameters/removeUser.mts similarity index 100% rename from src/version2/parameters/removeUser.ts rename to src/version2/parameters/removeUser.mts diff --git a/src/version2/parameters/removeUserFromGroup.ts b/src/version2/parameters/removeUserFromGroup.mts similarity index 100% rename from src/version2/parameters/removeUserFromGroup.ts rename to src/version2/parameters/removeUserFromGroup.mts diff --git a/src/version2/parameters/removeVote.ts b/src/version2/parameters/removeVote.mts similarity index 100% rename from src/version2/parameters/removeVote.ts rename to src/version2/parameters/removeVote.mts diff --git a/src/version2/parameters/removeWatcher.ts b/src/version2/parameters/removeWatcher.mts similarity index 100% rename from src/version2/parameters/removeWatcher.ts rename to src/version2/parameters/removeWatcher.mts diff --git a/src/version2/parameters/renameScreenTab.mts b/src/version2/parameters/renameScreenTab.mts new file mode 100644 index 000000000..593fc3705 --- /dev/null +++ b/src/version2/parameters/renameScreenTab.mts @@ -0,0 +1,8 @@ +import { ScreenableTab } from '../models/index.mjs'; + +export interface RenameScreenTab extends ScreenableTab { + /** The ID of the screen. */ + screenId: number; + /** The ID of the screen tab. */ + tabId: number; +} diff --git a/src/version2/parameters/renameScreenTab.ts b/src/version2/parameters/renameScreenTab.ts deleted file mode 100644 index f3c458556..000000000 --- a/src/version2/parameters/renameScreenTab.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ScreenableTab } from '../models/index.js'; - -export interface RenameScreenTab extends ScreenableTab { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; -} diff --git a/src/version2/parameters/reorderCustomFieldOptions.mts b/src/version2/parameters/reorderCustomFieldOptions.mts new file mode 100644 index 000000000..9d2f7ff59 --- /dev/null +++ b/src/version2/parameters/reorderCustomFieldOptions.mts @@ -0,0 +1,8 @@ +import { OrderOfCustomFieldOptions } from '../models/index.mjs'; + +export interface ReorderCustomFieldOptions extends OrderOfCustomFieldOptions { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/reorderCustomFieldOptions.ts b/src/version2/parameters/reorderCustomFieldOptions.ts deleted file mode 100644 index 5490d7582..000000000 --- a/src/version2/parameters/reorderCustomFieldOptions.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { OrderOfCustomFieldOptions } from '../models/index.js'; - -export interface ReorderCustomFieldOptions extends OrderOfCustomFieldOptions { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/reorderIssueTypesInIssueTypeScheme.mts b/src/version2/parameters/reorderIssueTypesInIssueTypeScheme.mts new file mode 100644 index 000000000..d9f4c6061 --- /dev/null +++ b/src/version2/parameters/reorderIssueTypesInIssueTypeScheme.mts @@ -0,0 +1,6 @@ +import { OrderOfIssueTypes } from '../models/index.mjs'; + +export interface ReorderIssueTypesInIssueTypeScheme extends OrderOfIssueTypes { + /** The ID of the issue type scheme. */ + issueTypeSchemeId: number; +} diff --git a/src/version2/parameters/reorderIssueTypesInIssueTypeScheme.ts b/src/version2/parameters/reorderIssueTypesInIssueTypeScheme.ts deleted file mode 100644 index 357a2a352..000000000 --- a/src/version2/parameters/reorderIssueTypesInIssueTypeScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { OrderOfIssueTypes } from '../models/index.js'; - -export interface ReorderIssueTypesInIssueTypeScheme extends OrderOfIssueTypes { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; -} diff --git a/src/version2/parameters/replaceIssueFieldOption.mts b/src/version2/parameters/replaceIssueFieldOption.mts new file mode 100644 index 000000000..b4ea74aa7 --- /dev/null +++ b/src/version2/parameters/replaceIssueFieldOption.mts @@ -0,0 +1,28 @@ +export interface ReplaceIssueFieldOption { + /** The ID of the option that will replace the currently selected option. */ + replaceWith?: number; + /** A Jql query that specifies the issues to be updated. For example, _project=10000_. */ + jql?: string; + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect and Forge app + * users with admin permission. + */ + overrideScreenSecurity?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect and Forge app + * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For + * example, `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: string; + /** The ID of the option to be deselected. */ + optionId: number; +} diff --git a/src/version2/parameters/replaceIssueFieldOption.ts b/src/version2/parameters/replaceIssueFieldOption.ts deleted file mode 100644 index f18489195..000000000 --- a/src/version2/parameters/replaceIssueFieldOption.ts +++ /dev/null @@ -1,28 +0,0 @@ -export interface ReplaceIssueFieldOption { - /** The ID of the option that will replace the currently selected option. */ - replaceWith?: number; - /** A JQL query that specifies the issues to be updated. For example, _project=10000_. */ - jql?: string; - /** - * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect and Forge app - * users with admin permission. - */ - overrideScreenSecurity?: boolean; - /** - * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect and Forge app - * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideEditableFlag?: boolean; - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; - /** The ID of the option to be deselected. */ - optionId: number; -} diff --git a/src/version2/parameters/resetColumns.ts b/src/version2/parameters/resetColumns.mts similarity index 100% rename from src/version2/parameters/resetColumns.ts rename to src/version2/parameters/resetColumns.mts diff --git a/src/version2/parameters/resetUserColumns.ts b/src/version2/parameters/resetUserColumns.mts similarity index 100% rename from src/version2/parameters/resetUserColumns.ts rename to src/version2/parameters/resetUserColumns.mts diff --git a/src/version2/parameters/restore.ts b/src/version2/parameters/restore.mts similarity index 100% rename from src/version2/parameters/restore.ts rename to src/version2/parameters/restore.mts diff --git a/src/version2/parameters/restoreCustomField.ts b/src/version2/parameters/restoreCustomField.mts similarity index 100% rename from src/version2/parameters/restoreCustomField.ts rename to src/version2/parameters/restoreCustomField.mts diff --git a/src/version2/parameters/sanitiseJqlQueries.mts b/src/version2/parameters/sanitiseJqlQueries.mts new file mode 100644 index 000000000..d9517074f --- /dev/null +++ b/src/version2/parameters/sanitiseJqlQueries.mts @@ -0,0 +1,3 @@ +import { JqlQueriesToSanitize } from '../models/index.mjs'; + +export interface SanitiseJqlQueries extends JqlQueriesToSanitize {} diff --git a/src/version2/parameters/sanitiseJqlQueries.ts b/src/version2/parameters/sanitiseJqlQueries.ts deleted file mode 100644 index 42b1a0a51..000000000 --- a/src/version2/parameters/sanitiseJqlQueries.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { JqlQueriesToSanitize } from '../models/index.js'; - -export interface SanitiseJqlQueries extends JqlQueriesToSanitize {} diff --git a/src/version2/parameters/search.ts b/src/version2/parameters/search.mts similarity index 100% rename from src/version2/parameters/search.ts rename to src/version2/parameters/search.mts diff --git a/src/version2/parameters/searchForIssuesUsingJql.mts b/src/version2/parameters/searchForIssuesUsingJql.mts new file mode 100644 index 000000000..9b15598d8 --- /dev/null +++ b/src/version2/parameters/searchForIssuesUsingJql.mts @@ -0,0 +1,79 @@ +export interface SearchForIssuesUsingJql { + /** + * The [Jql](https://confluence.atlassian.com/x/egORLQ) that defines the search. Note: + * + * If no Jql expression is provided, all issues are returned. `username` and `userkey` cannot be used as search terms + * due to privacy reasons. Use `accountId` instead. If a user has hidden their email address in their user profile, + * partial matches of the email address will not find the user. An exact match is required. + */ + jql?: string; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** + * The maximum number of items to return per page. To manage page size, Jira may return fewer items per page where a + * large number of fields are requested. The greatest number of items returned per page is achieved when requesting + * `id` or `key` only. + */ + maxResults?: number; + /** + * Determines how to validate the Jql query and treat the validation results. Supported values are: + * + * - `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). + * - `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for + * - `strict`. `false` _Deprecated_ A legacy synonym for `warn`. + * + * Note: If the Jql is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. + */ + validateQuery?: 'strict' | 'warn' | 'none' | string; + /** + * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a + * comma-separated list. Expand options include: + * + * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to + * exclude. + * + * Examples: + * + * `summary,comment` Returns only the summary and comments fields. `-description` Returns all navigable (default) + * fields except description. `*all,-comment` Returns all fields except comments. + * + * This parameter may be specified multiple times. For example, `fields=field1,field2&fields=field3`. + * + * Note: All navigable fields are returned by default. This differs from [GET + * issue](#api-rest-api-2-issue-issueIdOrKey-get) where the default is all fields. + */ + fields?: string[]; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about issues in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `renderedFields` Returns field values rendered in HTML format. + * - `names` Returns the display name of each field. + * - `schema` Returns the schema describing a field type. + * - `transitions` Returns all possible transitions for the issue. + * - `operations` Returns all possible operations for the issue. + * - `editmeta` Returns information about how each field can be edited. + * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each + * version of a field's value, with the highest numbered item representing the most recent version. + */ + expand?: + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | string + | string[]; + /** + * A list of issue property keys for issue properties to include in the results. This parameter accepts a + * comma-separated list. Multiple properties can also be provided using an ampersand separated list. For example, + * `properties=prop1,prop2&properties=prop3`. A maximum of 5 issue property keys can be specified. + */ + properties?: string[]; + /** Reference fields by their key (rather than ID). */ + fieldsByKeys?: boolean; +} diff --git a/src/version2/parameters/searchForIssuesUsingJql.ts b/src/version2/parameters/searchForIssuesUsingJql.ts deleted file mode 100644 index bb85f45ae..000000000 --- a/src/version2/parameters/searchForIssuesUsingJql.ts +++ /dev/null @@ -1,79 +0,0 @@ -export interface SearchForIssuesUsingJql { - /** - * The [JQL](https://confluence.atlassian.com/x/egORLQ) that defines the search. Note: - * - * If no JQL expression is provided, all issues are returned. `username` and `userkey` cannot be used as search terms - * due to privacy reasons. Use `accountId` instead. If a user has hidden their email address in their user profile, - * partial matches of the email address will not find the user. An exact match is required. - */ - jql?: string; - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** - * The maximum number of items to return per page. To manage page size, Jira may return fewer items per page where a - * large number of fields are requested. The greatest number of items returned per page is achieved when requesting - * `id` or `key` only. - */ - maxResults?: number; - /** - * Determines how to validate the JQL query and treat the validation results. Supported values are: - * - * - `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). - * - `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for - * - `strict`. `false` _Deprecated_ A legacy synonym for `warn`. - * - * Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. - */ - validateQuery?: 'strict' | 'warn' | 'none' | string; - /** - * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a - * comma-separated list. Expand options include: - * - * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to - * exclude. - * - * Examples: - * - * `summary,comment` Returns only the summary and comments fields. `-description` Returns all navigable (default) - * fields except description. `*all,-comment` Returns all fields except comments. - * - * This parameter may be specified multiple times. For example, `fields=field1,field2&fields=field3`. - * - * Note: All navigable fields are returned by default. This differs from [GET - * issue](#api-rest-api-2-issue-issueIdOrKey-get) where the default is all fields. - */ - fields?: string[]; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about issues in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `renderedFields` Returns field values rendered in HTML format. - * - `names` Returns the display name of each field. - * - `schema` Returns the schema describing a field type. - * - `transitions` Returns all possible transitions for the issue. - * - `operations` Returns all possible operations for the issue. - * - `editmeta` Returns information about how each field can be edited. - * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. - * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each - * version of a field's value, with the highest numbered item representing the most recent version. - */ - expand?: - | 'renderedFields' - | 'names' - | 'schema' - | 'transitions' - | 'operations' - | 'editmeta' - | 'changelog' - | 'versionedRepresentations' - | string - | string[]; - /** - * A list of issue property keys for issue properties to include in the results. This parameter accepts a - * comma-separated list. Multiple properties can also be provided using an ampersand separated list. For example, - * `properties=prop1,prop2&properties=prop3`. A maximum of 5 issue property keys can be specified. - */ - properties?: string[]; - /** Reference fields by their key (rather than ID). */ - fieldsByKeys?: boolean; -} diff --git a/src/version2/parameters/searchForIssuesUsingJqlPost.mts b/src/version2/parameters/searchForIssuesUsingJqlPost.mts new file mode 100644 index 000000000..d087fe638 --- /dev/null +++ b/src/version2/parameters/searchForIssuesUsingJqlPost.mts @@ -0,0 +1,3 @@ +import { SearchRequest } from '../models/index.mjs'; + +export interface SearchForIssuesUsingJqlPost extends SearchRequest {} diff --git a/src/version2/parameters/searchForIssuesUsingJqlPost.ts b/src/version2/parameters/searchForIssuesUsingJqlPost.ts deleted file mode 100644 index a78ee34ac..000000000 --- a/src/version2/parameters/searchForIssuesUsingJqlPost.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SearchRequest } from '../models/index.js'; - -export interface SearchForIssuesUsingJqlPost extends SearchRequest {} diff --git a/src/version2/parameters/searchPriorities.ts b/src/version2/parameters/searchPriorities.mts similarity index 100% rename from src/version2/parameters/searchPriorities.ts rename to src/version2/parameters/searchPriorities.mts diff --git a/src/version2/parameters/searchProjects.ts b/src/version2/parameters/searchProjects.mts similarity index 100% rename from src/version2/parameters/searchProjects.ts rename to src/version2/parameters/searchProjects.mts diff --git a/src/version2/parameters/searchProjectsUsingSecuritySchemes.ts b/src/version2/parameters/searchProjectsUsingSecuritySchemes.mts similarity index 100% rename from src/version2/parameters/searchProjectsUsingSecuritySchemes.ts rename to src/version2/parameters/searchProjectsUsingSecuritySchemes.mts diff --git a/src/version2/parameters/searchResolutions.ts b/src/version2/parameters/searchResolutions.mts similarity index 100% rename from src/version2/parameters/searchResolutions.ts rename to src/version2/parameters/searchResolutions.mts diff --git a/src/version2/parameters/searchSecuritySchemes.ts b/src/version2/parameters/searchSecuritySchemes.mts similarity index 100% rename from src/version2/parameters/searchSecuritySchemes.ts rename to src/version2/parameters/searchSecuritySchemes.mts diff --git a/src/version2/parameters/selectTimeTrackingImplementation.mts b/src/version2/parameters/selectTimeTrackingImplementation.mts new file mode 100644 index 000000000..bc2fb949f --- /dev/null +++ b/src/version2/parameters/selectTimeTrackingImplementation.mts @@ -0,0 +1,3 @@ +import { TimeTrackingProvider } from '../models/index.mjs'; + +export interface SelectTimeTrackingImplementation extends TimeTrackingProvider {} diff --git a/src/version2/parameters/selectTimeTrackingImplementation.ts b/src/version2/parameters/selectTimeTrackingImplementation.ts deleted file mode 100644 index 0e1e48c1c..000000000 --- a/src/version2/parameters/selectTimeTrackingImplementation.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TimeTrackingProvider } from '../models/index.js'; - -export interface SelectTimeTrackingImplementation extends TimeTrackingProvider {} diff --git a/src/version2/parameters/setActors.mts b/src/version2/parameters/setActors.mts new file mode 100644 index 000000000..195f1ba56 --- /dev/null +++ b/src/version2/parameters/setActors.mts @@ -0,0 +1,11 @@ +import { ProjectRoleActorsUpdate } from '../models/index.mjs'; + +export interface SetActors extends ProjectRoleActorsUpdate { + /** The project ID or project key (case sensitive). */ + projectIdOrKey: string; + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role + * IDs. + */ + id: number; +} diff --git a/src/version2/parameters/setActors.ts b/src/version2/parameters/setActors.ts deleted file mode 100644 index f750462c1..000000000 --- a/src/version2/parameters/setActors.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ProjectRoleActorsUpdate } from '../models/index.js'; - -export interface SetActors extends ProjectRoleActorsUpdate { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version2/parameters/setApplicationProperty.mts b/src/version2/parameters/setApplicationProperty.mts new file mode 100644 index 000000000..a729fce3b --- /dev/null +++ b/src/version2/parameters/setApplicationProperty.mts @@ -0,0 +1,14 @@ +import { SimpleApplicationProperty } from '../models/index.mjs'; + +export interface SetApplicationProperty extends SimpleApplicationProperty { + /** The key of the application property to update. */ + id: string; + + body?: { + /** The ID of the application property. */ + id?: string; + + /** The new value. */ + value?: string; + }; +} diff --git a/src/version2/parameters/setApplicationProperty.ts b/src/version2/parameters/setApplicationProperty.ts deleted file mode 100644 index 2788ded31..000000000 --- a/src/version2/parameters/setApplicationProperty.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { SimpleApplicationProperty } from '../models/index.js'; - -export interface SetApplicationProperty extends SimpleApplicationProperty { - /** The key of the application property to update. */ - id: string; - - body?: { - /** The ID of the application property. */ - id?: string; - - /** The new value. */ - value?: string; - }; -} diff --git a/src/version2/parameters/setBanner.mts b/src/version2/parameters/setBanner.mts new file mode 100644 index 000000000..29ff18a39 --- /dev/null +++ b/src/version2/parameters/setBanner.mts @@ -0,0 +1,3 @@ +import { AnnouncementBannerConfigurationUpdate } from '../models/index.mjs'; + +export interface SetBanner extends AnnouncementBannerConfigurationUpdate {} diff --git a/src/version2/parameters/setBanner.ts b/src/version2/parameters/setBanner.ts deleted file mode 100644 index 943309dc1..000000000 --- a/src/version2/parameters/setBanner.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { AnnouncementBannerConfigurationUpdate } from '../models/index.js'; - -export interface SetBanner extends AnnouncementBannerConfigurationUpdate {} diff --git a/src/version2/parameters/setColumns.ts b/src/version2/parameters/setColumns.mts similarity index 100% rename from src/version2/parameters/setColumns.ts rename to src/version2/parameters/setColumns.mts diff --git a/src/version2/parameters/setCommentProperty.ts b/src/version2/parameters/setCommentProperty.mts similarity index 100% rename from src/version2/parameters/setCommentProperty.ts rename to src/version2/parameters/setCommentProperty.mts diff --git a/src/version2/parameters/setDashboardItemProperty.ts b/src/version2/parameters/setDashboardItemProperty.mts similarity index 100% rename from src/version2/parameters/setDashboardItemProperty.ts rename to src/version2/parameters/setDashboardItemProperty.mts diff --git a/src/version2/parameters/setDefaultLevels.mts b/src/version2/parameters/setDefaultLevels.mts new file mode 100644 index 000000000..34c8ce77b --- /dev/null +++ b/src/version2/parameters/setDefaultLevels.mts @@ -0,0 +1,3 @@ +import { SetDefaultLevelsRequest } from '../models/index.mjs'; + +export interface SetDefaultLevels extends SetDefaultLevelsRequest {} diff --git a/src/version2/parameters/setDefaultLevels.ts b/src/version2/parameters/setDefaultLevels.ts deleted file mode 100644 index 03104ef79..000000000 --- a/src/version2/parameters/setDefaultLevels.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SetDefaultLevelsRequest } from '../models/index.js'; - -export interface SetDefaultLevels extends SetDefaultLevelsRequest {} diff --git a/src/version2/parameters/setDefaultPriority.mts b/src/version2/parameters/setDefaultPriority.mts new file mode 100644 index 000000000..c21ba5cc6 --- /dev/null +++ b/src/version2/parameters/setDefaultPriority.mts @@ -0,0 +1,3 @@ +import { SetDefaultPriorityRequest } from '../models/index.mjs'; + +export interface SetDefaultPriority extends SetDefaultPriorityRequest {} diff --git a/src/version2/parameters/setDefaultPriority.ts b/src/version2/parameters/setDefaultPriority.ts deleted file mode 100644 index a6bec9517..000000000 --- a/src/version2/parameters/setDefaultPriority.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SetDefaultPriorityRequest } from '../models/index.js'; - -export interface SetDefaultPriority extends SetDefaultPriorityRequest {} diff --git a/src/version2/parameters/setDefaultResolution.mts b/src/version2/parameters/setDefaultResolution.mts new file mode 100644 index 000000000..7231abde6 --- /dev/null +++ b/src/version2/parameters/setDefaultResolution.mts @@ -0,0 +1,3 @@ +import { SetDefaultResolutionRequest } from '../models/index.mjs'; + +export interface SetDefaultResolution extends SetDefaultResolutionRequest {} diff --git a/src/version2/parameters/setDefaultResolution.ts b/src/version2/parameters/setDefaultResolution.ts deleted file mode 100644 index 53ed1d093..000000000 --- a/src/version2/parameters/setDefaultResolution.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SetDefaultResolutionRequest } from '../models/index.js'; - -export interface SetDefaultResolution extends SetDefaultResolutionRequest {} diff --git a/src/version2/parameters/setDefaultShareScope.mts b/src/version2/parameters/setDefaultShareScope.mts new file mode 100644 index 000000000..f915d2df5 --- /dev/null +++ b/src/version2/parameters/setDefaultShareScope.mts @@ -0,0 +1,3 @@ +import { DefaultShareScope } from '../models/index.mjs'; + +export interface SetDefaultShareScope extends DefaultShareScope {} diff --git a/src/version2/parameters/setDefaultShareScope.ts b/src/version2/parameters/setDefaultShareScope.ts deleted file mode 100644 index fa5f5f799..000000000 --- a/src/version2/parameters/setDefaultShareScope.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { DefaultShareScope } from '../models/index.js'; - -export interface SetDefaultShareScope extends DefaultShareScope {} diff --git a/src/version2/parameters/setDefaultValues.mts b/src/version2/parameters/setDefaultValues.mts new file mode 100644 index 000000000..9359c4d77 --- /dev/null +++ b/src/version2/parameters/setDefaultValues.mts @@ -0,0 +1,6 @@ +import { CustomFieldContextDefaultValueUpdate } from '../models/index.mjs'; + +export interface SetDefaultValues extends CustomFieldContextDefaultValueUpdate { + /** The ID of the custom field. */ + fieldId: string; +} diff --git a/src/version2/parameters/setDefaultValues.ts b/src/version2/parameters/setDefaultValues.ts deleted file mode 100644 index c08e6eb98..000000000 --- a/src/version2/parameters/setDefaultValues.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CustomFieldContextDefaultValueUpdate } from '../models/index.js'; - -export interface SetDefaultValues extends CustomFieldContextDefaultValueUpdate { - /** The ID of the custom field. */ - fieldId: string; -} diff --git a/src/version2/parameters/setFavouriteForFilter.ts b/src/version2/parameters/setFavouriteForFilter.mts similarity index 100% rename from src/version2/parameters/setFavouriteForFilter.ts rename to src/version2/parameters/setFavouriteForFilter.mts diff --git a/src/version2/parameters/setFieldConfigurationSchemeMapping.mts b/src/version2/parameters/setFieldConfigurationSchemeMapping.mts new file mode 100644 index 000000000..a782ef41d --- /dev/null +++ b/src/version2/parameters/setFieldConfigurationSchemeMapping.mts @@ -0,0 +1,6 @@ +import { AssociateFieldConfigurationsWithIssueTypesRequest } from '../models/index.mjs'; + +export interface SetFieldConfigurationSchemeMapping extends AssociateFieldConfigurationsWithIssueTypesRequest { + /** The ID of the field configuration scheme. */ + id: number; +} diff --git a/src/version2/parameters/setFieldConfigurationSchemeMapping.ts b/src/version2/parameters/setFieldConfigurationSchemeMapping.ts deleted file mode 100644 index d12f80738..000000000 --- a/src/version2/parameters/setFieldConfigurationSchemeMapping.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AssociateFieldConfigurationsWithIssueTypesRequest } from '../models/index.js'; - -export interface SetFieldConfigurationSchemeMapping extends AssociateFieldConfigurationsWithIssueTypesRequest { - /** The ID of the field configuration scheme. */ - id: number; -} diff --git a/src/version2/parameters/setIssueProperty.ts b/src/version2/parameters/setIssueProperty.mts similarity index 100% rename from src/version2/parameters/setIssueProperty.ts rename to src/version2/parameters/setIssueProperty.mts diff --git a/src/version2/parameters/setIssueTypeProperty.ts b/src/version2/parameters/setIssueTypeProperty.mts similarity index 100% rename from src/version2/parameters/setIssueTypeProperty.ts rename to src/version2/parameters/setIssueTypeProperty.mts diff --git a/src/version2/parameters/setPreference.ts b/src/version2/parameters/setPreference.mts similarity index 100% rename from src/version2/parameters/setPreference.ts rename to src/version2/parameters/setPreference.mts diff --git a/src/version2/parameters/setProjectProperty.ts b/src/version2/parameters/setProjectProperty.mts similarity index 100% rename from src/version2/parameters/setProjectProperty.ts rename to src/version2/parameters/setProjectProperty.mts diff --git a/src/version2/parameters/setSharedTimeTrackingConfiguration.mts b/src/version2/parameters/setSharedTimeTrackingConfiguration.mts new file mode 100644 index 000000000..e97c080ff --- /dev/null +++ b/src/version2/parameters/setSharedTimeTrackingConfiguration.mts @@ -0,0 +1,3 @@ +import { TimeTrackingConfiguration } from '../models/index.mjs'; + +export interface SetSharedTimeTrackingConfiguration extends TimeTrackingConfiguration {} diff --git a/src/version2/parameters/setSharedTimeTrackingConfiguration.ts b/src/version2/parameters/setSharedTimeTrackingConfiguration.ts deleted file mode 100644 index 6725860be..000000000 --- a/src/version2/parameters/setSharedTimeTrackingConfiguration.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TimeTrackingConfiguration } from '../models/index.js'; - -export interface SetSharedTimeTrackingConfiguration extends TimeTrackingConfiguration {} diff --git a/src/version2/parameters/setUserColumns.ts b/src/version2/parameters/setUserColumns.mts similarity index 100% rename from src/version2/parameters/setUserColumns.ts rename to src/version2/parameters/setUserColumns.mts diff --git a/src/version2/parameters/setUserProperty.ts b/src/version2/parameters/setUserProperty.mts similarity index 100% rename from src/version2/parameters/setUserProperty.ts rename to src/version2/parameters/setUserProperty.mts diff --git a/src/version2/parameters/setWorkflowSchemeDraftIssueType.mts b/src/version2/parameters/setWorkflowSchemeDraftIssueType.mts new file mode 100644 index 000000000..630b5e159 --- /dev/null +++ b/src/version2/parameters/setWorkflowSchemeDraftIssueType.mts @@ -0,0 +1,22 @@ +import { IssueTypeWorkflowMapping } from '../models/index.mjs'; + +export interface SetWorkflowSchemeDraftIssueType extends IssueTypeWorkflowMapping { + /** The ID of the workflow scheme that the draft belongs to. */ + id: number; + /** The ID of the issue type. */ + issueType: string; + + /** Details about the mapping between an issue type and a workflow. */ + details: { + /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ + issueType?: string; + /** The name of the workflow. */ + workflow?: string; + /** + * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the + * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types + * mapping. + */ + updateDraftIfNeeded?: boolean; + }; +} diff --git a/src/version2/parameters/setWorkflowSchemeDraftIssueType.ts b/src/version2/parameters/setWorkflowSchemeDraftIssueType.ts deleted file mode 100644 index 615b5fd88..000000000 --- a/src/version2/parameters/setWorkflowSchemeDraftIssueType.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { IssueTypeWorkflowMapping } from '../models/index.js'; - -export interface SetWorkflowSchemeDraftIssueType extends IssueTypeWorkflowMapping { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** The ID of the issue type. */ - issueType: string; - - /** Details about the mapping between an issue type and a workflow. */ - details: { - /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ - issueType?: string; - /** The name of the workflow. */ - workflow?: string; - /** - * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the - * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types - * mapping. - */ - updateDraftIfNeeded?: boolean; - }; -} diff --git a/src/version2/parameters/setWorkflowSchemeIssueType.mts b/src/version2/parameters/setWorkflowSchemeIssueType.mts new file mode 100644 index 000000000..d38a0496d --- /dev/null +++ b/src/version2/parameters/setWorkflowSchemeIssueType.mts @@ -0,0 +1,24 @@ +import { IssueTypeWorkflowMapping } from '../models/index.mjs'; + +export interface SetWorkflowSchemeIssueType extends IssueTypeWorkflowMapping { + /** The ID of the workflow scheme. */ + id: number; + /** The ID of the issue type. */ + issueType: string; + + /** Details about the mapping between an issue type and a workflow. */ + details: { + /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ + issueType?: string; + + /** The name of the workflow. */ + workflow?: string; + + /** + * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the + * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types + * mapping. + */ + updateDraftIfNeeded?: boolean; + }; +} diff --git a/src/version2/parameters/setWorkflowSchemeIssueType.ts b/src/version2/parameters/setWorkflowSchemeIssueType.ts deleted file mode 100644 index c300ffc00..000000000 --- a/src/version2/parameters/setWorkflowSchemeIssueType.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { IssueTypeWorkflowMapping } from '../models/index.js'; - -export interface SetWorkflowSchemeIssueType extends IssueTypeWorkflowMapping { - /** The ID of the workflow scheme. */ - id: number; - /** The ID of the issue type. */ - issueType: string; - - /** Details about the mapping between an issue type and a workflow. */ - details: { - /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ - issueType?: string; - - /** The name of the workflow. */ - workflow?: string; - - /** - * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the - * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types - * mapping. - */ - updateDraftIfNeeded?: boolean; - }; -} diff --git a/src/version2/parameters/setWorklogProperty.ts b/src/version2/parameters/setWorklogProperty.mts similarity index 100% rename from src/version2/parameters/setWorklogProperty.ts rename to src/version2/parameters/setWorklogProperty.mts diff --git a/src/version2/parameters/storeAvatar.ts b/src/version2/parameters/storeAvatar.mts similarity index 100% rename from src/version2/parameters/storeAvatar.ts rename to src/version2/parameters/storeAvatar.mts diff --git a/src/version2/parameters/toggleFeatureForProject.mts b/src/version2/parameters/toggleFeatureForProject.mts new file mode 100644 index 000000000..3bcd5cfab --- /dev/null +++ b/src/version2/parameters/toggleFeatureForProject.mts @@ -0,0 +1,8 @@ +import { ProjectFeatureToggleRequest } from '../models/index.mjs'; + +export interface ToggleFeatureForProject extends ProjectFeatureToggleRequest { + /** The ID or (case-sensitive) key of the project. */ + projectIdOrKey: string; + /** The key of the feature. */ + featureKey: string; +} diff --git a/src/version2/parameters/toggleFeatureForProject.ts b/src/version2/parameters/toggleFeatureForProject.ts deleted file mode 100644 index b6b01dc2f..000000000 --- a/src/version2/parameters/toggleFeatureForProject.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectFeatureToggleRequest } from '../models/index.js'; - -export interface ToggleFeatureForProject extends ProjectFeatureToggleRequest { - /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; - /** The key of the feature. */ - featureKey: string; -} diff --git a/src/version2/parameters/trashCustomField.ts b/src/version2/parameters/trashCustomField.mts similarity index 100% rename from src/version2/parameters/trashCustomField.ts rename to src/version2/parameters/trashCustomField.mts diff --git a/src/version2/parameters/unarchiveIssues.ts b/src/version2/parameters/unarchiveIssues.mts similarity index 100% rename from src/version2/parameters/unarchiveIssues.ts rename to src/version2/parameters/unarchiveIssues.mts diff --git a/src/version2/parameters/updateComment.mts b/src/version2/parameters/updateComment.mts new file mode 100644 index 000000000..8f7af1b0f --- /dev/null +++ b/src/version2/parameters/updateComment.mts @@ -0,0 +1,22 @@ +import { Comment } from '../models/index.mjs'; + +export interface UpdateComment extends Comment { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** The ID of the comment. */ + id: string; + /** Whether users are notified when a comment is updated. */ + notifyUsers?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with + * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on + * behalf of users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body + * rendered in HTML. + */ + expand?: 'renderedBody' | ['renderedBody'] | string | string[]; +} diff --git a/src/version2/parameters/updateComment.ts b/src/version2/parameters/updateComment.ts deleted file mode 100644 index b050fba94..000000000 --- a/src/version2/parameters/updateComment.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { Comment } from '../models/index.js'; - -export interface UpdateComment extends Comment { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the comment. */ - id: string; - /** Whether users are notified when a comment is updated. */ - notifyUsers?: boolean; - /** - * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with - * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on - * behalf of users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideEditableFlag?: boolean; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body - * rendered in HTML. - */ - expand?: 'renderedBody' | ['renderedBody'] | string | string[]; -} diff --git a/src/version2/parameters/updateComponent.mts b/src/version2/parameters/updateComponent.mts new file mode 100644 index 000000000..83eaa7ed4 --- /dev/null +++ b/src/version2/parameters/updateComponent.mts @@ -0,0 +1,6 @@ +import { ProjectComponent } from '../models/index.mjs'; + +export interface UpdateComponent extends ProjectComponent { + /** The ID of the component. */ + id: string; +} diff --git a/src/version2/parameters/updateComponent.ts b/src/version2/parameters/updateComponent.ts deleted file mode 100644 index 99e70f0e1..000000000 --- a/src/version2/parameters/updateComponent.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ProjectComponent } from '../models/index.js'; - -export interface UpdateComponent extends ProjectComponent { - /** The ID of the component. */ - id: string; -} diff --git a/src/version2/parameters/updateCustomField.mts b/src/version2/parameters/updateCustomField.mts new file mode 100644 index 000000000..92185635d --- /dev/null +++ b/src/version2/parameters/updateCustomField.mts @@ -0,0 +1,6 @@ +import { UpdateCustomFieldDetails } from '../models/index.mjs'; + +export interface UpdateCustomField extends UpdateCustomFieldDetails { + /** The ID of the custom field. */ + fieldId: string; +} diff --git a/src/version2/parameters/updateCustomField.ts b/src/version2/parameters/updateCustomField.ts deleted file mode 100644 index 819d71266..000000000 --- a/src/version2/parameters/updateCustomField.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateCustomFieldDetails } from '../models/index.js'; - -export interface UpdateCustomField extends UpdateCustomFieldDetails { - /** The ID of the custom field. */ - fieldId: string; -} diff --git a/src/version2/parameters/updateCustomFieldConfiguration.mts b/src/version2/parameters/updateCustomFieldConfiguration.mts new file mode 100644 index 000000000..01de512fb --- /dev/null +++ b/src/version2/parameters/updateCustomFieldConfiguration.mts @@ -0,0 +1,6 @@ +import { CustomFieldConfigurations } from '../models/index.mjs'; + +export interface UpdateCustomFieldConfiguration extends CustomFieldConfigurations { + /** The ID or key of the custom field, for example `customfield_10000`. */ + fieldIdOrKey: string; +} diff --git a/src/version2/parameters/updateCustomFieldConfiguration.ts b/src/version2/parameters/updateCustomFieldConfiguration.ts deleted file mode 100644 index 4c1ae86b2..000000000 --- a/src/version2/parameters/updateCustomFieldConfiguration.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CustomFieldConfigurations } from '../models/index.js'; - -export interface UpdateCustomFieldConfiguration extends CustomFieldConfigurations { - /** The ID or key of the custom field, for example `customfield_10000`. */ - fieldIdOrKey: string; -} diff --git a/src/version2/parameters/updateCustomFieldContext.mts b/src/version2/parameters/updateCustomFieldContext.mts new file mode 100644 index 000000000..bf7f31a74 --- /dev/null +++ b/src/version2/parameters/updateCustomFieldContext.mts @@ -0,0 +1,8 @@ +import { CustomFieldContextUpdateDetails } from '../models/index.mjs'; + +export interface UpdateCustomFieldContext extends CustomFieldContextUpdateDetails { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/updateCustomFieldContext.ts b/src/version2/parameters/updateCustomFieldContext.ts deleted file mode 100644 index f04305c5c..000000000 --- a/src/version2/parameters/updateCustomFieldContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CustomFieldContextUpdateDetails } from '../models/index.js'; - -export interface UpdateCustomFieldContext extends CustomFieldContextUpdateDetails { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/updateCustomFieldOption.mts b/src/version2/parameters/updateCustomFieldOption.mts new file mode 100644 index 000000000..65cf799f0 --- /dev/null +++ b/src/version2/parameters/updateCustomFieldOption.mts @@ -0,0 +1,8 @@ +import { BulkCustomFieldOptionUpdateRequest } from '../models/index.mjs'; + +export interface UpdateCustomFieldOption extends BulkCustomFieldOptionUpdateRequest { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/updateCustomFieldOption.ts b/src/version2/parameters/updateCustomFieldOption.ts deleted file mode 100644 index df4b85436..000000000 --- a/src/version2/parameters/updateCustomFieldOption.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { BulkCustomFieldOptionUpdateRequest } from '../models/index.js'; - -export interface UpdateCustomFieldOption extends BulkCustomFieldOptionUpdateRequest { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/updateCustomFieldValue.mts b/src/version2/parameters/updateCustomFieldValue.mts new file mode 100644 index 000000000..cb327bfa1 --- /dev/null +++ b/src/version2/parameters/updateCustomFieldValue.mts @@ -0,0 +1,8 @@ +import { CustomFieldValueUpdateDetails } from '../models/index.mjs'; + +export interface UpdateCustomFieldValue extends CustomFieldValueUpdateDetails { + /** The ID or key of the custom field. For example, `customfield_10010`. */ + fieldIdOrKey: string; + /** Whether to generate a changelog for this update. */ + generateChangelog?: boolean; +} diff --git a/src/version2/parameters/updateCustomFieldValue.ts b/src/version2/parameters/updateCustomFieldValue.ts deleted file mode 100644 index 146c932e8..000000000 --- a/src/version2/parameters/updateCustomFieldValue.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CustomFieldValueUpdateDetails } from '../models/index.js'; - -export interface UpdateCustomFieldValue extends CustomFieldValueUpdateDetails { - /** The ID or key of the custom field. For example, `customfield_10010`. */ - fieldIdOrKey: string; - /** Whether to generate a changelog for this update. */ - generateChangelog?: boolean; -} diff --git a/src/version2/parameters/updateDashboard.mts b/src/version2/parameters/updateDashboard.mts new file mode 100644 index 000000000..e180543c8 --- /dev/null +++ b/src/version2/parameters/updateDashboard.mts @@ -0,0 +1,6 @@ +import { DashboardDetails } from '../models/index.mjs'; + +export interface UpdateDashboard extends DashboardDetails { + /** The ID of the dashboard to update. */ + id: string; +} diff --git a/src/version2/parameters/updateDashboard.ts b/src/version2/parameters/updateDashboard.ts deleted file mode 100644 index e0200a626..000000000 --- a/src/version2/parameters/updateDashboard.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DashboardDetails } from '../models/index.js'; - -export interface UpdateDashboard extends DashboardDetails { - /** The ID of the dashboard to update. */ - id: string; -} diff --git a/src/version2/parameters/updateDefaultScreenScheme.ts b/src/version2/parameters/updateDefaultScreenScheme.mts similarity index 100% rename from src/version2/parameters/updateDefaultScreenScheme.ts rename to src/version2/parameters/updateDefaultScreenScheme.mts diff --git a/src/version2/parameters/updateDefaultWorkflow.mts b/src/version2/parameters/updateDefaultWorkflow.mts new file mode 100644 index 000000000..26baa37fe --- /dev/null +++ b/src/version2/parameters/updateDefaultWorkflow.mts @@ -0,0 +1,6 @@ +import { DefaultWorkflow } from '../models/index.mjs'; + +export interface UpdateDefaultWorkflow extends DefaultWorkflow { + /** The ID of the workflow scheme. */ + id: number; +} diff --git a/src/version2/parameters/updateDefaultWorkflow.ts b/src/version2/parameters/updateDefaultWorkflow.ts deleted file mode 100644 index f9067e0af..000000000 --- a/src/version2/parameters/updateDefaultWorkflow.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DefaultWorkflow } from '../models/index.js'; - -export interface UpdateDefaultWorkflow extends DefaultWorkflow { - /** The ID of the workflow scheme. */ - id: number; -} diff --git a/src/version2/parameters/updateDraftDefaultWorkflow.mts b/src/version2/parameters/updateDraftDefaultWorkflow.mts new file mode 100644 index 000000000..7ea28013a --- /dev/null +++ b/src/version2/parameters/updateDraftDefaultWorkflow.mts @@ -0,0 +1,6 @@ +import { DefaultWorkflow } from '../models/index.mjs'; + +export interface UpdateDraftDefaultWorkflow extends DefaultWorkflow { + /** The ID of the workflow scheme that the draft belongs to. */ + id: number; +} diff --git a/src/version2/parameters/updateDraftDefaultWorkflow.ts b/src/version2/parameters/updateDraftDefaultWorkflow.ts deleted file mode 100644 index a61f2b5ad..000000000 --- a/src/version2/parameters/updateDraftDefaultWorkflow.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DefaultWorkflow } from '../models/index.js'; - -export interface UpdateDraftDefaultWorkflow extends DefaultWorkflow { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; -} diff --git a/src/version2/parameters/updateDraftWorkflowMapping.mts b/src/version2/parameters/updateDraftWorkflowMapping.mts new file mode 100644 index 000000000..43a88b8ce --- /dev/null +++ b/src/version2/parameters/updateDraftWorkflowMapping.mts @@ -0,0 +1,8 @@ +import { IssueTypesWorkflowMapping } from '../models/index.mjs'; + +export interface UpdateDraftWorkflowMapping extends IssueTypesWorkflowMapping { + /** The ID of the workflow scheme that the draft belongs to. */ + id: number; + /** The name of the workflow. */ + workflowName: string; +} diff --git a/src/version2/parameters/updateDraftWorkflowMapping.ts b/src/version2/parameters/updateDraftWorkflowMapping.ts deleted file mode 100644 index 3758d6384..000000000 --- a/src/version2/parameters/updateDraftWorkflowMapping.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypesWorkflowMapping } from '../models/index.js'; - -export interface UpdateDraftWorkflowMapping extends IssueTypesWorkflowMapping { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** The name of the workflow. */ - workflowName: string; -} diff --git a/src/version2/parameters/updateEntityPropertiesValue.mts b/src/version2/parameters/updateEntityPropertiesValue.mts new file mode 100644 index 000000000..286fe02fa --- /dev/null +++ b/src/version2/parameters/updateEntityPropertiesValue.mts @@ -0,0 +1,22 @@ +import { EntityPropertyDetails } from '../models/index.mjs'; + +export interface UpdateEntityPropertiesValue { + /** The app migration transfer ID. */ + transferId: string; + /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ + accountId: string; + /** The type indicating the object that contains the entity properties. */ + entityType: + | 'IssueProperty' + | 'CommentProperty' + | 'DashboardItemProperty' + | 'IssueTypeProperty' + | 'ProjectProperty' + | 'UserProperty' + | 'WorklogProperty' + | 'BoardProperty' + | 'SprintProperty' + | string; + + entities?: Array; +} diff --git a/src/version2/parameters/updateEntityPropertiesValue.ts b/src/version2/parameters/updateEntityPropertiesValue.ts deleted file mode 100644 index d0f68ff61..000000000 --- a/src/version2/parameters/updateEntityPropertiesValue.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { EntityPropertyDetails } from '../models/index.js'; - -export interface UpdateEntityPropertiesValue { - /** The app migration transfer ID. */ - transferId: string; - /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ - accountId: string; - /** The type indicating the object that contains the entity properties. */ - entityType: - | 'IssueProperty' - | 'CommentProperty' - | 'DashboardItemProperty' - | 'IssueTypeProperty' - | 'ProjectProperty' - | 'UserProperty' - | 'WorklogProperty' - | 'BoardProperty' - | 'SprintProperty' - | string; - - entities?: Array; -} diff --git a/src/version2/parameters/updateFieldConfiguration.mts b/src/version2/parameters/updateFieldConfiguration.mts new file mode 100644 index 000000000..6c0eebad8 --- /dev/null +++ b/src/version2/parameters/updateFieldConfiguration.mts @@ -0,0 +1,6 @@ +import { FieldConfigurationDetails } from '../models/index.mjs'; + +export interface UpdateFieldConfiguration extends FieldConfigurationDetails { + /** The ID of the field configuration. */ + id: number; +} diff --git a/src/version2/parameters/updateFieldConfiguration.ts b/src/version2/parameters/updateFieldConfiguration.ts deleted file mode 100644 index 2e4e24792..000000000 --- a/src/version2/parameters/updateFieldConfiguration.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { FieldConfigurationDetails } from '../models/index.js'; - -export interface UpdateFieldConfiguration extends FieldConfigurationDetails { - /** The ID of the field configuration. */ - id: number; -} diff --git a/src/version2/parameters/updateFieldConfigurationItems.mts b/src/version2/parameters/updateFieldConfigurationItems.mts new file mode 100644 index 000000000..da43ec28a --- /dev/null +++ b/src/version2/parameters/updateFieldConfigurationItems.mts @@ -0,0 +1,6 @@ +import { FieldConfigurationItemsDetails } from '../models/index.mjs'; + +export interface UpdateFieldConfigurationItems extends FieldConfigurationItemsDetails { + /** The ID of the field configuration. */ + id: number; +} diff --git a/src/version2/parameters/updateFieldConfigurationItems.ts b/src/version2/parameters/updateFieldConfigurationItems.ts deleted file mode 100644 index e6da23d2d..000000000 --- a/src/version2/parameters/updateFieldConfigurationItems.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { FieldConfigurationItemsDetails } from '../models/index.js'; - -export interface UpdateFieldConfigurationItems extends FieldConfigurationItemsDetails { - /** The ID of the field configuration. */ - id: number; -} diff --git a/src/version2/parameters/updateFieldConfigurationScheme.mts b/src/version2/parameters/updateFieldConfigurationScheme.mts new file mode 100644 index 000000000..da4f130a3 --- /dev/null +++ b/src/version2/parameters/updateFieldConfigurationScheme.mts @@ -0,0 +1,6 @@ +import { UpdateFieldConfigurationSchemeDetails } from '../models/index.mjs'; + +export interface UpdateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails { + /** The ID of the field configuration scheme. */ + id: number; +} diff --git a/src/version2/parameters/updateFieldConfigurationScheme.ts b/src/version2/parameters/updateFieldConfigurationScheme.ts deleted file mode 100644 index 9904250c8..000000000 --- a/src/version2/parameters/updateFieldConfigurationScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateFieldConfigurationSchemeDetails } from '../models/index.js'; - -export interface UpdateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails { - /** The ID of the field configuration scheme. */ - id: number; -} diff --git a/src/version2/parameters/updateFilter.mts b/src/version2/parameters/updateFilter.mts new file mode 100644 index 000000000..b0951784d --- /dev/null +++ b/src/version2/parameters/updateFilter.mts @@ -0,0 +1,25 @@ +import { Filter } from '../models/index.mjs'; + +export interface UpdateFilter extends Omit { + /** The ID of the filter to update. */ + id: number; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that + * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it + * doesn't list any users. The list of users returned is limited to 1000, to access additional users append + * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use + * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't + * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of + * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to + * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable the addition of any share permissions to filters. + * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; +} diff --git a/src/version2/parameters/updateFilter.ts b/src/version2/parameters/updateFilter.ts deleted file mode 100644 index c3151c40d..000000000 --- a/src/version2/parameters/updateFilter.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { Filter } from '../models/index.js'; - -export interface UpdateFilter extends Omit { - /** The ID of the filter to update. */ - id: number; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that - * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it - * doesn't list any users. The list of users returned is limited to 1000, to access additional users append - * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use - * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't - * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of - * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to - * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. - */ - expand?: string; - /** - * EXPERIMENTAL: Whether share permissions are overridden to enable the addition of any share permissions to filters. - * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideSharePermissions?: boolean; -} diff --git a/src/version2/parameters/updateGadget.mts b/src/version2/parameters/updateGadget.mts new file mode 100644 index 000000000..f6b2c56f8 --- /dev/null +++ b/src/version2/parameters/updateGadget.mts @@ -0,0 +1,8 @@ +import { DashboardGadgetUpdateRequest } from '../models/index.mjs'; + +export interface UpdateGadget extends DashboardGadgetUpdateRequest { + /** The ID of the dashboard. */ + dashboardId: number; + /** The ID of the gadget. */ + gadgetId: number; +} diff --git a/src/version2/parameters/updateGadget.ts b/src/version2/parameters/updateGadget.ts deleted file mode 100644 index 8514bbd03..000000000 --- a/src/version2/parameters/updateGadget.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { DashboardGadgetUpdateRequest } from '../models/index.js'; - -export interface UpdateGadget extends DashboardGadgetUpdateRequest { - /** The ID of the dashboard. */ - dashboardId: number; - /** The ID of the gadget. */ - gadgetId: number; -} diff --git a/src/version2/parameters/updateIssueFieldOption.mts b/src/version2/parameters/updateIssueFieldOption.mts new file mode 100644 index 000000000..ac4c227db --- /dev/null +++ b/src/version2/parameters/updateIssueFieldOption.mts @@ -0,0 +1,16 @@ +import { IssueFieldOption } from '../models/index.mjs'; + +export interface UpdateIssueFieldOption extends IssueFieldOption { + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For + * example, `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: string; + /** The ID of the option to be updated. */ + optionId: number; +} diff --git a/src/version2/parameters/updateIssueFieldOption.ts b/src/version2/parameters/updateIssueFieldOption.ts deleted file mode 100644 index 94236edbd..000000000 --- a/src/version2/parameters/updateIssueFieldOption.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { IssueFieldOption } from '../models/index.js'; - -export interface UpdateIssueFieldOption extends IssueFieldOption { - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; - /** The ID of the option to be updated. */ - optionId: number; -} diff --git a/src/version2/parameters/updateIssueFields.mts b/src/version2/parameters/updateIssueFields.mts new file mode 100644 index 000000000..2928b6b9b --- /dev/null +++ b/src/version2/parameters/updateIssueFields.mts @@ -0,0 +1,8 @@ +import { ConnectCustomFieldValues } from '../models/index.mjs'; + +export interface UpdateIssueFields extends ConnectCustomFieldValues { + /** The ID of the transfer. */ + transferId: string; + /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ + accountId: string; +} diff --git a/src/version2/parameters/updateIssueFields.ts b/src/version2/parameters/updateIssueFields.ts deleted file mode 100644 index f944a92ed..000000000 --- a/src/version2/parameters/updateIssueFields.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ConnectCustomFieldValues } from '../models/index.js'; - -export interface UpdateIssueFields extends ConnectCustomFieldValues { - /** The ID of the transfer. */ - transferId: string; - /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ - accountId: string; -} diff --git a/src/version2/parameters/updateIssueLinkType.mts b/src/version2/parameters/updateIssueLinkType.mts new file mode 100644 index 000000000..2dcdc0b23 --- /dev/null +++ b/src/version2/parameters/updateIssueLinkType.mts @@ -0,0 +1,6 @@ +import { IssueLinkType } from '../models/index.mjs'; + +export interface UpdateIssueLinkType extends IssueLinkType { + /** The ID of the issue link type. */ + issueLinkTypeId: string; +} diff --git a/src/version2/parameters/updateIssueLinkType.ts b/src/version2/parameters/updateIssueLinkType.ts deleted file mode 100644 index 70b1474f9..000000000 --- a/src/version2/parameters/updateIssueLinkType.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueLinkType } from '../models/index.js'; - -export interface UpdateIssueLinkType extends IssueLinkType { - /** The ID of the issue link type. */ - issueLinkTypeId: string; -} diff --git a/src/version2/parameters/updateIssueSecurityScheme.mts b/src/version2/parameters/updateIssueSecurityScheme.mts new file mode 100644 index 000000000..d7a384098 --- /dev/null +++ b/src/version2/parameters/updateIssueSecurityScheme.mts @@ -0,0 +1,6 @@ +import { UpdateIssueSecuritySchemeRequest } from '../models/index.mjs'; + +export interface UpdateIssueSecurityScheme extends UpdateIssueSecuritySchemeRequest { + /** The ID of the issue security scheme. */ + id: string; +} diff --git a/src/version2/parameters/updateIssueSecurityScheme.ts b/src/version2/parameters/updateIssueSecurityScheme.ts deleted file mode 100644 index a4ba65125..000000000 --- a/src/version2/parameters/updateIssueSecurityScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateIssueSecuritySchemeRequest } from '../models/index.js'; - -export interface UpdateIssueSecurityScheme extends UpdateIssueSecuritySchemeRequest { - /** The ID of the issue security scheme. */ - id: string; -} diff --git a/src/version2/parameters/updateIssueType.mts b/src/version2/parameters/updateIssueType.mts new file mode 100644 index 000000000..934664605 --- /dev/null +++ b/src/version2/parameters/updateIssueType.mts @@ -0,0 +1,6 @@ +import { IssueTypeUpdate } from '../models/index.mjs'; + +export interface UpdateIssueType extends IssueTypeUpdate { + /** The ID of the issue type. */ + id: string; +} diff --git a/src/version2/parameters/updateIssueType.ts b/src/version2/parameters/updateIssueType.ts deleted file mode 100644 index 32061e2bd..000000000 --- a/src/version2/parameters/updateIssueType.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeUpdate } from '../models/index.js'; - -export interface UpdateIssueType extends IssueTypeUpdate { - /** The ID of the issue type. */ - id: string; -} diff --git a/src/version2/parameters/updateIssueTypeScheme.mts b/src/version2/parameters/updateIssueTypeScheme.mts new file mode 100644 index 000000000..c968a35bd --- /dev/null +++ b/src/version2/parameters/updateIssueTypeScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeSchemeUpdateDetails } from '../models/index.mjs'; + +export interface UpdateIssueTypeScheme extends IssueTypeSchemeUpdateDetails { + /** The ID of the issue type scheme. */ + issueTypeSchemeId: number; +} diff --git a/src/version2/parameters/updateIssueTypeScheme.ts b/src/version2/parameters/updateIssueTypeScheme.ts deleted file mode 100644 index 2edc63c41..000000000 --- a/src/version2/parameters/updateIssueTypeScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeSchemeUpdateDetails } from '../models/index.js'; - -export interface UpdateIssueTypeScheme extends IssueTypeSchemeUpdateDetails { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; -} diff --git a/src/version2/parameters/updateIssueTypeScreenScheme.mts b/src/version2/parameters/updateIssueTypeScreenScheme.mts new file mode 100644 index 000000000..c13563a8a --- /dev/null +++ b/src/version2/parameters/updateIssueTypeScreenScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeScreenSchemeUpdateDetails } from '../models/index.mjs'; + +export interface UpdateIssueTypeScreenScheme extends IssueTypeScreenSchemeUpdateDetails { + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: string; +} diff --git a/src/version2/parameters/updateIssueTypeScreenScheme.ts b/src/version2/parameters/updateIssueTypeScreenScheme.ts deleted file mode 100644 index 0ca5221d8..000000000 --- a/src/version2/parameters/updateIssueTypeScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeScreenSchemeUpdateDetails } from '../models/index.js'; - -export interface UpdateIssueTypeScreenScheme extends IssueTypeScreenSchemeUpdateDetails { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; -} diff --git a/src/version2/parameters/updateMultipleCustomFieldValues.mts b/src/version2/parameters/updateMultipleCustomFieldValues.mts new file mode 100644 index 000000000..cc7672a3d --- /dev/null +++ b/src/version2/parameters/updateMultipleCustomFieldValues.mts @@ -0,0 +1,6 @@ +import { MultipleCustomFieldValuesUpdateDetails } from '../models/index.mjs'; + +export interface UpdateMultipleCustomFieldValues extends MultipleCustomFieldValuesUpdateDetails { + /** Whether to generate a changelog for this update. */ + generateChangelog?: boolean; +} diff --git a/src/version2/parameters/updateMultipleCustomFieldValues.ts b/src/version2/parameters/updateMultipleCustomFieldValues.ts deleted file mode 100644 index ee984b47b..000000000 --- a/src/version2/parameters/updateMultipleCustomFieldValues.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { MultipleCustomFieldValuesUpdateDetails } from '../models/index.js'; - -export interface UpdateMultipleCustomFieldValues extends MultipleCustomFieldValuesUpdateDetails { - /** Whether to generate a changelog for this update. */ - generateChangelog?: boolean; -} diff --git a/src/version2/parameters/updateNotificationScheme.mts b/src/version2/parameters/updateNotificationScheme.mts new file mode 100644 index 000000000..5374c83b0 --- /dev/null +++ b/src/version2/parameters/updateNotificationScheme.mts @@ -0,0 +1,6 @@ +import { UpdateNotificationSchemeDetails } from '../models/index.mjs'; + +export interface UpdateNotificationScheme extends UpdateNotificationSchemeDetails { + /** The ID of the notification scheme. */ + id: string; +} diff --git a/src/version2/parameters/updateNotificationScheme.ts b/src/version2/parameters/updateNotificationScheme.ts deleted file mode 100644 index c242aa92f..000000000 --- a/src/version2/parameters/updateNotificationScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateNotificationSchemeDetails } from '../models/index.js'; - -export interface UpdateNotificationScheme extends UpdateNotificationSchemeDetails { - /** The ID of the notification scheme. */ - id: string; -} diff --git a/src/version2/parameters/updatePermissionScheme.mts b/src/version2/parameters/updatePermissionScheme.mts new file mode 100644 index 000000000..0cd431f69 --- /dev/null +++ b/src/version2/parameters/updatePermissionScheme.mts @@ -0,0 +1,16 @@ +import { PermissionScheme } from '../models/index.mjs'; + +export interface UpdatePermissionScheme extends PermissionScheme { + /** The ID of the permission scheme to update. */ + schemeId: number; + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * `all` Returns all expandable information. `field` Returns information about the custom field granted the + * permission. `group` Returns information about the group that is granted the permission. `permissions` Returns all + * permission grants for each permission scheme. `projectRole` Returns information about the project role granted the + * permission. `user` Returns information about the user who is granted the permission. + */ + expand?: string; +} diff --git a/src/version2/parameters/updatePermissionScheme.ts b/src/version2/parameters/updatePermissionScheme.ts deleted file mode 100644 index e7a8926fb..000000000 --- a/src/version2/parameters/updatePermissionScheme.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { PermissionScheme } from '../models/index.js'; - -export interface UpdatePermissionScheme extends PermissionScheme { - /** The ID of the permission scheme to update. */ - schemeId: number; - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * `all` Returns all expandable information. `field` Returns information about the custom field granted the - * permission. `group` Returns information about the group that is granted the permission. `permissions` Returns all - * permission grants for each permission scheme. `projectRole` Returns information about the project role granted the - * permission. `user` Returns information about the user who is granted the permission. - */ - expand?: string; -} diff --git a/src/version2/parameters/updatePrecomputations.mts b/src/version2/parameters/updatePrecomputations.mts new file mode 100644 index 000000000..6b7b3a1d4 --- /dev/null +++ b/src/version2/parameters/updatePrecomputations.mts @@ -0,0 +1,3 @@ +import { JqlFunctionPrecomputationUpdateRequest } from '../models/index.mjs'; + +export interface UpdatePrecomputations extends JqlFunctionPrecomputationUpdateRequest {} diff --git a/src/version2/parameters/updatePrecomputations.ts b/src/version2/parameters/updatePrecomputations.ts deleted file mode 100644 index 301f51cb8..000000000 --- a/src/version2/parameters/updatePrecomputations.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { JqlFunctionPrecomputationUpdateRequest } from '../models/index.js'; - -export interface UpdatePrecomputations extends JqlFunctionPrecomputationUpdateRequest {} diff --git a/src/version2/parameters/updatePriority.mts b/src/version2/parameters/updatePriority.mts new file mode 100644 index 000000000..bb6d71864 --- /dev/null +++ b/src/version2/parameters/updatePriority.mts @@ -0,0 +1,6 @@ +import { UpdatePriorityDetails } from '../models/index.mjs'; + +export interface UpdatePriority extends UpdatePriorityDetails { + /** The ID of the issue priority. */ + id: string; +} diff --git a/src/version2/parameters/updatePriority.ts b/src/version2/parameters/updatePriority.ts deleted file mode 100644 index f3d3fb075..000000000 --- a/src/version2/parameters/updatePriority.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdatePriorityDetails } from '../models/index.js'; - -export interface UpdatePriority extends UpdatePriorityDetails { - /** The ID of the issue priority. */ - id: string; -} diff --git a/src/version2/parameters/updateProject.mts b/src/version2/parameters/updateProject.mts new file mode 100644 index 000000000..22500816d --- /dev/null +++ b/src/version2/parameters/updateProject.mts @@ -0,0 +1,57 @@ +import { UpdateProjectDetails } from '../models/index.mjs'; + +export interface UpdateProject extends UpdateProjectDetails { + /** The project ID or project key (case sensitive). */ + projectIdOrKey: string; + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes), which + * defines the application-specific feature set. If you don't specify the project template you have to specify the + * project type. + */ + projectTypeKey?: 'business' | 'service_desk' | 'software' | string; + /** + * A predefined configuration for a project. The type of the `projectTemplateKey` must match with the type of the + * `projectTypeKey`. + */ + projectTemplateKey?: + | 'com.atlassian.jira-core-project-templates:jira-core-simplified-content-management' + | 'com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval' + | 'com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking' + | 'com.atlassian.jira-core-project-templates:jira-core-simplified-process-control' + | 'com.atlassian.jira-core-project-templates:jira-core-simplified-procurement' + | 'com.atlassian.jira-core-project-templates:jira-core-simplified-project-management' + | 'com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment' + | 'com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking' + | 'com.atlassian.servicedesk:simplified-it-service-management' + | 'com.atlassian.servicedesk:simplified-general-service-desk' + | 'com.atlassian.servicedesk:simplified-internal-service-desk' + | 'com.atlassian.servicedesk:simplified-external-service-desk' + | 'com.atlassian.servicedesk:simplified-hr-service-desk' + | 'com.atlassian.servicedesk:simplified-facilities-service-desk' + | 'com.atlassian.servicedesk:simplified-legal-service-desk' + | 'com.pyxis.greenhopper.jira:gh-simplified-agility-kanban' + | 'com.pyxis.greenhopper.jira:gh-simplified-agility-scrum' + | 'com.pyxis.greenhopper.jira:gh-simplified-basic' + | 'com.pyxis.greenhopper.jira:gh-simplified-kanban-classic' + | 'com.pyxis.greenhopper.jira:gh-simplified-scrum-classic' + | string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Note that the project description, + * issue types, and project lead are included in all responses by default. Expand options include: + * + * - `description` The project description. + * - `issueTypes` The issue types associated with the project. + * - `lead` The project lead. + * - `projectKeys` All project keys associated with the project. + */ + expand?: + | 'description' + | 'issueTypes' + | 'lead' + | 'projectKeys' + | ('description' | 'issueTypes' | 'lead' | 'projectKeys')[] + | string + | string[]; +} diff --git a/src/version2/parameters/updateProject.ts b/src/version2/parameters/updateProject.ts deleted file mode 100644 index 08781edd1..000000000 --- a/src/version2/parameters/updateProject.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { UpdateProjectDetails } from '../models/index.js'; - -export interface UpdateProject extends UpdateProjectDetails { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes), which - * defines the application-specific feature set. If you don't specify the project template you have to specify the - * project type. - */ - projectTypeKey?: 'business' | 'service_desk' | 'software' | string; - /** - * A predefined configuration for a project. The type of the `projectTemplateKey` must match with the type of the - * `projectTypeKey`. - */ - projectTemplateKey?: - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-content-management' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-process-control' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-procurement' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-project-management' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment' - | 'com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking' - | 'com.atlassian.servicedesk:simplified-it-service-management' - | 'com.atlassian.servicedesk:simplified-general-service-desk' - | 'com.atlassian.servicedesk:simplified-internal-service-desk' - | 'com.atlassian.servicedesk:simplified-external-service-desk' - | 'com.atlassian.servicedesk:simplified-hr-service-desk' - | 'com.atlassian.servicedesk:simplified-facilities-service-desk' - | 'com.atlassian.servicedesk:simplified-legal-service-desk' - | 'com.pyxis.greenhopper.jira:gh-simplified-agility-kanban' - | 'com.pyxis.greenhopper.jira:gh-simplified-agility-scrum' - | 'com.pyxis.greenhopper.jira:gh-simplified-basic' - | 'com.pyxis.greenhopper.jira:gh-simplified-kanban-classic' - | 'com.pyxis.greenhopper.jira:gh-simplified-scrum-classic' - | string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Note that the project description, - * issue types, and project lead are included in all responses by default. Expand options include: - * - * - `description` The project description. - * - `issueTypes` The issue types associated with the project. - * - `lead` The project lead. - * - `projectKeys` All project keys associated with the project. - */ - expand?: - | 'description' - | 'issueTypes' - | 'lead' - | 'projectKeys' - | ('description' | 'issueTypes' | 'lead' | 'projectKeys')[] - | string - | string[]; -} diff --git a/src/version2/parameters/updateProjectAvatar.mts b/src/version2/parameters/updateProjectAvatar.mts new file mode 100644 index 000000000..5759946c9 --- /dev/null +++ b/src/version2/parameters/updateProjectAvatar.mts @@ -0,0 +1,6 @@ +import { Avatar } from '../models/index.mjs'; + +export interface UpdateProjectAvatar extends Avatar { + /** The ID or (case-sensitive) key of the project. */ + projectIdOrKey: string; +} diff --git a/src/version2/parameters/updateProjectAvatar.ts b/src/version2/parameters/updateProjectAvatar.ts deleted file mode 100644 index e8d64e8ff..000000000 --- a/src/version2/parameters/updateProjectAvatar.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Avatar } from '../models/index.js'; - -export interface UpdateProjectAvatar extends Avatar { - /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; -} diff --git a/src/version2/parameters/updateProjectCategory.mts b/src/version2/parameters/updateProjectCategory.mts new file mode 100644 index 000000000..5518f22fd --- /dev/null +++ b/src/version2/parameters/updateProjectCategory.mts @@ -0,0 +1,5 @@ +import { ProjectCategory } from '../models/index.mjs'; + +export interface UpdateProjectCategory extends Omit { + id: number; +} diff --git a/src/version2/parameters/updateProjectCategory.ts b/src/version2/parameters/updateProjectCategory.ts deleted file mode 100644 index 2f2a7aeaa..000000000 --- a/src/version2/parameters/updateProjectCategory.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { ProjectCategory } from '../models/index.js'; - -export interface UpdateProjectCategory extends Omit { - id: number; -} diff --git a/src/version2/parameters/updateProjectEmail.mts b/src/version2/parameters/updateProjectEmail.mts new file mode 100644 index 000000000..fcf15aabb --- /dev/null +++ b/src/version2/parameters/updateProjectEmail.mts @@ -0,0 +1,6 @@ +import { ProjectEmailAddress } from '../models/index.mjs'; + +export interface UpdateProjectEmail extends ProjectEmailAddress { + /** The project ID. */ + projectId: number; +} diff --git a/src/version2/parameters/updateProjectEmail.ts b/src/version2/parameters/updateProjectEmail.ts deleted file mode 100644 index 110c3c1d9..000000000 --- a/src/version2/parameters/updateProjectEmail.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ProjectEmailAddress } from '../models/index.js'; - -export interface UpdateProjectEmail extends ProjectEmailAddress { - /** The project ID. */ - projectId: number; -} diff --git a/src/version2/parameters/updateRemoteIssueLink.mts b/src/version2/parameters/updateRemoteIssueLink.mts new file mode 100644 index 000000000..5d0702075 --- /dev/null +++ b/src/version2/parameters/updateRemoteIssueLink.mts @@ -0,0 +1,8 @@ +import { RemoteIssueLinkRequest } from '../models/index.mjs'; + +export interface UpdateRemoteIssueLink extends RemoteIssueLinkRequest { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** The ID of the remote issue link. */ + linkId: string; +} diff --git a/src/version2/parameters/updateRemoteIssueLink.ts b/src/version2/parameters/updateRemoteIssueLink.ts deleted file mode 100644 index a426ea9aa..000000000 --- a/src/version2/parameters/updateRemoteIssueLink.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { RemoteIssueLinkRequest } from '../models/index.js'; - -export interface UpdateRemoteIssueLink extends RemoteIssueLinkRequest { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the remote issue link. */ - linkId: string; -} diff --git a/src/version2/parameters/updateResolution.mts b/src/version2/parameters/updateResolution.mts new file mode 100644 index 000000000..0bbc9d1cd --- /dev/null +++ b/src/version2/parameters/updateResolution.mts @@ -0,0 +1,6 @@ +import { UpdateResolutionDetails } from '../models/index.mjs'; + +export interface UpdateResolution extends UpdateResolutionDetails { + /** The ID of the issue resolution. */ + id: string; +} diff --git a/src/version2/parameters/updateResolution.ts b/src/version2/parameters/updateResolution.ts deleted file mode 100644 index 3f20f9e35..000000000 --- a/src/version2/parameters/updateResolution.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateResolutionDetails } from '../models/index.js'; - -export interface UpdateResolution extends UpdateResolutionDetails { - /** The ID of the issue resolution. */ - id: string; -} diff --git a/src/version2/parameters/updateScreen.mts b/src/version2/parameters/updateScreen.mts new file mode 100644 index 000000000..70c1100c0 --- /dev/null +++ b/src/version2/parameters/updateScreen.mts @@ -0,0 +1,6 @@ +import { UpdateScreenDetails } from '../models/index.mjs'; + +export interface UpdateScreen extends UpdateScreenDetails { + /** The ID of the screen. */ + screenId: number; +} diff --git a/src/version2/parameters/updateScreen.ts b/src/version2/parameters/updateScreen.ts deleted file mode 100644 index 0c1742964..000000000 --- a/src/version2/parameters/updateScreen.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateScreenDetails } from '../models/index.js'; - -export interface UpdateScreen extends UpdateScreenDetails { - /** The ID of the screen. */ - screenId: number; -} diff --git a/src/version2/parameters/updateScreenScheme.mts b/src/version2/parameters/updateScreenScheme.mts new file mode 100644 index 000000000..023292e8a --- /dev/null +++ b/src/version2/parameters/updateScreenScheme.mts @@ -0,0 +1,6 @@ +import { UpdateScreenSchemeDetails } from '../models/index.mjs'; + +export interface UpdateScreenScheme extends UpdateScreenSchemeDetails { + /** The ID of the screen scheme. */ + screenSchemeId: string; +} diff --git a/src/version2/parameters/updateScreenScheme.ts b/src/version2/parameters/updateScreenScheme.ts deleted file mode 100644 index 9648252a0..000000000 --- a/src/version2/parameters/updateScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateScreenSchemeDetails } from '../models/index.js'; - -export interface UpdateScreenScheme extends UpdateScreenSchemeDetails { - /** The ID of the screen scheme. */ - screenSchemeId: string; -} diff --git a/src/version2/parameters/updateSecurityLevel.mts b/src/version2/parameters/updateSecurityLevel.mts new file mode 100644 index 000000000..f7764e51c --- /dev/null +++ b/src/version2/parameters/updateSecurityLevel.mts @@ -0,0 +1,8 @@ +import { UpdateIssueSecurityLevelDetails } from '../models/index.mjs'; + +export interface UpdateSecurityLevel extends UpdateIssueSecurityLevelDetails { + /** The ID of the issue security scheme level belongs to. */ + schemeId: string; + /** The ID of the issue security level to update. */ + levelId: string; +} diff --git a/src/version2/parameters/updateSecurityLevel.ts b/src/version2/parameters/updateSecurityLevel.ts deleted file mode 100644 index 687fc3e27..000000000 --- a/src/version2/parameters/updateSecurityLevel.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { UpdateIssueSecurityLevelDetails } from '../models/index.js'; - -export interface UpdateSecurityLevel extends UpdateIssueSecurityLevelDetails { - /** The ID of the issue security scheme level belongs to. */ - schemeId: string; - /** The ID of the issue security level to update. */ - levelId: string; -} diff --git a/src/version2/parameters/updateStatuses.mts b/src/version2/parameters/updateStatuses.mts new file mode 100644 index 000000000..7e701dc09 --- /dev/null +++ b/src/version2/parameters/updateStatuses.mts @@ -0,0 +1,3 @@ +import { StatusUpdateRequest } from '../models/index.mjs'; + +export interface UpdateStatuses extends StatusUpdateRequest {} diff --git a/src/version2/parameters/updateStatuses.ts b/src/version2/parameters/updateStatuses.ts deleted file mode 100644 index 66d710de3..000000000 --- a/src/version2/parameters/updateStatuses.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { StatusUpdateRequest } from '../models/index.js'; - -export interface UpdateStatuses extends StatusUpdateRequest {} diff --git a/src/version2/parameters/updateUiModification.mts b/src/version2/parameters/updateUiModification.mts new file mode 100644 index 000000000..c8610f285 --- /dev/null +++ b/src/version2/parameters/updateUiModification.mts @@ -0,0 +1,6 @@ +import { UpdateUiModificationDetails } from '../models/index.mjs'; + +export interface UpdateUiModification extends UpdateUiModificationDetails { + /** The ID of the UI modification. */ + uiModificationId: string; +} diff --git a/src/version2/parameters/updateUiModification.ts b/src/version2/parameters/updateUiModification.ts deleted file mode 100644 index 233d4270e..000000000 --- a/src/version2/parameters/updateUiModification.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateUiModificationDetails } from '../models/index.js'; - -export interface UpdateUiModification extends UpdateUiModificationDetails { - /** The ID of the UI modification. */ - uiModificationId: string; -} diff --git a/src/version2/parameters/updateVersion.mts b/src/version2/parameters/updateVersion.mts new file mode 100644 index 000000000..738c6cd15 --- /dev/null +++ b/src/version2/parameters/updateVersion.mts @@ -0,0 +1,6 @@ +import { Version } from '../models/index.mjs'; + +export interface UpdateVersion extends Version { + /** The ID of the version. */ + id: string; +} diff --git a/src/version2/parameters/updateVersion.ts b/src/version2/parameters/updateVersion.ts deleted file mode 100644 index 92fd341ca..000000000 --- a/src/version2/parameters/updateVersion.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Version } from '../models/index.js'; - -export interface UpdateVersion extends Version { - /** The ID of the version. */ - id: string; -} diff --git a/src/version2/parameters/updateWorkflowMapping.mts b/src/version2/parameters/updateWorkflowMapping.mts new file mode 100644 index 000000000..5d533f369 --- /dev/null +++ b/src/version2/parameters/updateWorkflowMapping.mts @@ -0,0 +1,8 @@ +import { IssueTypesWorkflowMapping } from '../models/index.mjs'; + +export interface UpdateWorkflowMapping extends IssueTypesWorkflowMapping { + /** The ID of the workflow scheme. */ + id: number; + /** The name of the workflow. */ + workflowName: string; +} diff --git a/src/version2/parameters/updateWorkflowMapping.ts b/src/version2/parameters/updateWorkflowMapping.ts deleted file mode 100644 index ebd271b02..000000000 --- a/src/version2/parameters/updateWorkflowMapping.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypesWorkflowMapping } from '../models/index.js'; - -export interface UpdateWorkflowMapping extends IssueTypesWorkflowMapping { - /** The ID of the workflow scheme. */ - id: number; - /** The name of the workflow. */ - workflowName: string; -} diff --git a/src/version2/parameters/updateWorkflowScheme.mts b/src/version2/parameters/updateWorkflowScheme.mts new file mode 100644 index 000000000..0311bfff1 --- /dev/null +++ b/src/version2/parameters/updateWorkflowScheme.mts @@ -0,0 +1,9 @@ +import { WorkflowScheme } from '../models/index.mjs'; + +export interface UpdateWorkflowScheme extends WorkflowScheme { + /** + * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the + * URL as `schemeId`. For example, _schemeId=10301_. + */ + id: number; +} diff --git a/src/version2/parameters/updateWorkflowScheme.ts b/src/version2/parameters/updateWorkflowScheme.ts deleted file mode 100644 index fd6007dca..000000000 --- a/src/version2/parameters/updateWorkflowScheme.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { WorkflowScheme } from '../models/index.js'; - -export interface UpdateWorkflowScheme extends WorkflowScheme { - /** - * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the - * URL as `schemeId`. For example, _schemeId=10301_. - */ - id: number; -} diff --git a/src/version2/parameters/updateWorkflowSchemeDraft.mts b/src/version2/parameters/updateWorkflowSchemeDraft.mts new file mode 100644 index 000000000..ba6eca727 --- /dev/null +++ b/src/version2/parameters/updateWorkflowSchemeDraft.mts @@ -0,0 +1,6 @@ +import { WorkflowScheme } from '../models/index.mjs'; + +export interface UpdateWorkflowSchemeDraft extends WorkflowScheme { + /** The ID of the active workflow scheme that the draft was created from. */ + id: number; +} diff --git a/src/version2/parameters/updateWorkflowSchemeDraft.ts b/src/version2/parameters/updateWorkflowSchemeDraft.ts deleted file mode 100644 index 70a2b581d..000000000 --- a/src/version2/parameters/updateWorkflowSchemeDraft.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { WorkflowScheme } from '../models/index.js'; - -export interface UpdateWorkflowSchemeDraft extends WorkflowScheme { - /** The ID of the active workflow scheme that the draft was created from. */ - id: number; -} diff --git a/src/version2/parameters/updateWorkflowTransitionProperty.mts b/src/version2/parameters/updateWorkflowTransitionProperty.mts new file mode 100644 index 000000000..191f633ea --- /dev/null +++ b/src/version2/parameters/updateWorkflowTransitionProperty.mts @@ -0,0 +1,21 @@ +import { WorkflowTransitionProperty } from '../models/index.mjs'; + +export interface UpdateWorkflowTransitionProperty extends WorkflowTransitionProperty { + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown + * next to the transition. + */ + transitionId: number; + /** + * The key of the property being updated, also known as the name of the property. Set this to the same value as the + * `key` defined in the request body. + */ + key: string; + /** The name of the workflow that the transition belongs to. */ + workflowName: string; + /** + * The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot + * be edited. + */ + workflowMode?: 'live' | 'draft' | string; +} diff --git a/src/version2/parameters/updateWorkflowTransitionProperty.ts b/src/version2/parameters/updateWorkflowTransitionProperty.ts deleted file mode 100644 index a6b5ab677..000000000 --- a/src/version2/parameters/updateWorkflowTransitionProperty.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { WorkflowTransitionProperty } from '../models/index.js'; - -export interface UpdateWorkflowTransitionProperty extends WorkflowTransitionProperty { - /** - * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown - * next to the transition. - */ - transitionId: number; - /** - * The key of the property being updated, also known as the name of the property. Set this to the same value as the - * `key` defined in the request body. - */ - key: string; - /** The name of the workflow that the transition belongs to. */ - workflowName: string; - /** - * The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot - * be edited. - */ - workflowMode?: 'live' | 'draft' | string; -} diff --git a/src/version2/parameters/updateWorkflowTransitionRuleConfigurations.mts b/src/version2/parameters/updateWorkflowTransitionRuleConfigurations.mts new file mode 100644 index 000000000..2aa7613b0 --- /dev/null +++ b/src/version2/parameters/updateWorkflowTransitionRuleConfigurations.mts @@ -0,0 +1,3 @@ +import { WorkflowTransitionRulesUpdate } from '../models/index.mjs'; + +export interface UpdateWorkflowTransitionRuleConfigurations extends WorkflowTransitionRulesUpdate {} diff --git a/src/version2/parameters/updateWorkflowTransitionRuleConfigurations.ts b/src/version2/parameters/updateWorkflowTransitionRuleConfigurations.ts deleted file mode 100644 index 90ae8c673..000000000 --- a/src/version2/parameters/updateWorkflowTransitionRuleConfigurations.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WorkflowTransitionRulesUpdate } from '../models/index.js'; - -export interface UpdateWorkflowTransitionRuleConfigurations extends WorkflowTransitionRulesUpdate {} diff --git a/src/version2/parameters/updateWorkflows.mts b/src/version2/parameters/updateWorkflows.mts new file mode 100644 index 000000000..5b8603616 --- /dev/null +++ b/src/version2/parameters/updateWorkflows.mts @@ -0,0 +1,12 @@ +import { WorkflowUpdateRequest } from '../models/index.mjs'; + +export interface UpdateWorkflows extends WorkflowUpdateRequest { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * `workflows.usages` Returns the project and issue types that each workflow is associated with. `statuses.usages` + * Returns the project and issue types that each status is associated with. + */ + expand?: string; +} diff --git a/src/version2/parameters/updateWorkflows.ts b/src/version2/parameters/updateWorkflows.ts deleted file mode 100644 index 70e11da01..000000000 --- a/src/version2/parameters/updateWorkflows.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { WorkflowUpdateRequest } from '../models/index.js'; - -export interface UpdateWorkflows extends WorkflowUpdateRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `workflows.usages` Returns the project and issue types that each workflow is associated with. `statuses.usages` - * Returns the project and issue types that each status is associated with. - */ - expand?: string; -} diff --git a/src/version2/parameters/updateWorklog.mts b/src/version2/parameters/updateWorklog.mts new file mode 100644 index 000000000..6b94c12a5 --- /dev/null +++ b/src/version2/parameters/updateWorklog.mts @@ -0,0 +1,35 @@ +import { Worklog } from '../models/index.mjs'; + +export interface UpdateWorklog extends Worklog { + /** The ID or key the issue. */ + issueIdOrKey: string; + /** The ID of the worklog. */ + id: string; + /** Whether users watching the issue are notified by email. */ + notifyUsers?: boolean; + /** + * Defines how to update the issue's time estimate, the options are: + * + * - `new` Sets the estimate to a specific value, defined in `newEstimate`. + * - `leave` Leaves the estimate unchanged. + * - `auto` Updates the estimate by the difference between the original and updated value of `timeSpent` or + * `timeSpentSeconds`. + */ + adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; + /** + * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For + * example, _2d_. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about worklogs in the response. This parameter accepts `properties`, which returns worklog properties. + */ + expand?: string; + /** + * Whether the worklog should be added to the issue even if the issue is not editable. For example, because the issue + * is closed. Connect and Forge app users with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + */ + overrideEditableFlag?: boolean; +} diff --git a/src/version2/parameters/updateWorklog.ts b/src/version2/parameters/updateWorklog.ts deleted file mode 100644 index af0c53aa5..000000000 --- a/src/version2/parameters/updateWorklog.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { Worklog } from '../models/index.js'; - -export interface UpdateWorklog extends Worklog { - /** The ID or key the issue. */ - issueIdOrKey: string; - /** The ID of the worklog. */ - id: string; - /** Whether users watching the issue are notified by email. */ - notifyUsers?: boolean; - /** - * Defines how to update the issue's time estimate, the options are: - * - * - `new` Sets the estimate to a specific value, defined in `newEstimate`. - * - `leave` Leaves the estimate unchanged. - * - `auto` Updates the estimate by the difference between the original and updated value of `timeSpent` or - * `timeSpentSeconds`. - */ - adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; - /** - * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For - * example, _2d_. Required when `adjustEstimate` is `new`. - */ - newEstimate?: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about worklogs in the response. This parameter accepts `properties`, which returns worklog properties. - */ - expand?: string; - /** - * Whether the worklog should be added to the issue even if the issue is not editable. For example, because the issue - * is closed. Connect and Forge app users with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. - */ - overrideEditableFlag?: boolean; -} diff --git a/src/version2/parameters/validateCreateWorkflows.mts b/src/version2/parameters/validateCreateWorkflows.mts new file mode 100644 index 000000000..d3483e07c --- /dev/null +++ b/src/version2/parameters/validateCreateWorkflows.mts @@ -0,0 +1,6 @@ +import { ValidationOptionsForCreate, WorkflowCreateRequest } from '../models/index.mjs'; + +export interface ValidateCreateWorkflows { + payload: WorkflowCreateRequest; + validationOptions?: ValidationOptionsForCreate; +} diff --git a/src/version2/parameters/validateCreateWorkflows.ts b/src/version2/parameters/validateCreateWorkflows.ts deleted file mode 100644 index fd44e0b67..000000000 --- a/src/version2/parameters/validateCreateWorkflows.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ValidationOptionsForCreate, WorkflowCreateRequest } from '../models/index.js'; - -export interface ValidateCreateWorkflows { - payload: WorkflowCreateRequest; - validationOptions?: ValidationOptionsForCreate; -} diff --git a/src/version2/parameters/validateProjectKey.ts b/src/version2/parameters/validateProjectKey.mts similarity index 100% rename from src/version2/parameters/validateProjectKey.ts rename to src/version2/parameters/validateProjectKey.mts diff --git a/src/version2/parameters/validateUpdateWorkflows.mts b/src/version2/parameters/validateUpdateWorkflows.mts new file mode 100644 index 000000000..17347e2cf --- /dev/null +++ b/src/version2/parameters/validateUpdateWorkflows.mts @@ -0,0 +1,6 @@ +import { ValidationOptionsForUpdate, WorkflowUpdateRequest } from '../models/index.mjs'; + +export interface ValidateUpdateWorkflows { + payload: WorkflowUpdateRequest; + validationOptions?: ValidationOptionsForUpdate; +} diff --git a/src/version2/parameters/validateUpdateWorkflows.ts b/src/version2/parameters/validateUpdateWorkflows.ts deleted file mode 100644 index f04b85e6f..000000000 --- a/src/version2/parameters/validateUpdateWorkflows.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ValidationOptionsForUpdate, WorkflowUpdateRequest } from '../models/index.js'; - -export interface ValidateUpdateWorkflows { - payload: WorkflowUpdateRequest; - validationOptions?: ValidationOptionsForUpdate; -} diff --git a/src/version2/parameters/workflowCapabilities.ts b/src/version2/parameters/workflowCapabilities.mts similarity index 100% rename from src/version2/parameters/workflowCapabilities.ts rename to src/version2/parameters/workflowCapabilities.mts diff --git a/src/version2/parameters/workflowRuleSearch.mts b/src/version2/parameters/workflowRuleSearch.mts new file mode 100644 index 000000000..65b1dc274 --- /dev/null +++ b/src/version2/parameters/workflowRuleSearch.mts @@ -0,0 +1,6 @@ +import { WorkflowRulesSearch } from '../models/index.mjs'; + +export interface WorkflowRuleSearch extends WorkflowRulesSearch { + /** The app migration transfer ID. */ + transferId: string; +} diff --git a/src/version2/parameters/workflowRuleSearch.ts b/src/version2/parameters/workflowRuleSearch.ts deleted file mode 100644 index a48c50fc8..000000000 --- a/src/version2/parameters/workflowRuleSearch.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { WorkflowRulesSearch } from '../models/index.js'; - -export interface WorkflowRuleSearch extends WorkflowRulesSearch { - /** The app migration transfer ID. */ - transferId: string; -} diff --git a/src/version2/permissionSchemes.mts b/src/version2/permissionSchemes.mts new file mode 100644 index 000000000..7a6999246 --- /dev/null +++ b/src/version2/permissionSchemes.mts @@ -0,0 +1,560 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class PermissionSchemes { + constructor(private client: Client) {} + + /** + * Returns all permission schemes. + * + * ### About permission schemes and grants + * + * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a + * `permission`. + * + * #### Holder object + * + * The `holder` object contains information about the user or group being granted the permission. For example, the + * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the + * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and + * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. The `holder` object is defined by the + * following properties: + * + * - `type` Identifies the user or group (see the list of types below). + * - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the + * `type`. For example, if the `type` is a group, then you need to specify the group name. + * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the + * group ID. For other `type` it has the same value as `parameter` + * + * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some + * types may not have a `parameter` or `value`): + * + * - `anyone` Grant for anonymous users. + * - `applicationRole` Grant for users with access to the specified application (application name, application name). + * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. + * - `assignee` Grant for the user currently assigned to an issue. + * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). + * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field + * ID, `value` : custom field ID). + * - `projectLead` Grant for a project lead. + * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). + * - `reporter` Grant for the user who reported the issue. + * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not + * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more + * information. + * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is + * deprecated and the account ID should be used, `value` : user ID). + * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : + * custom field ID). + * + * #### Built-in permissions + * + * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define + * custom permissions. See the [project + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation + * for more information. + * + * **Project permissions** + * + * - `ADMINISTER_PROJECTS` + * - `BROWSE_PROJECTS` + * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) + * - `SERVICEDESK_AGENT` (Jira Service Desk only) + * - `VIEW_DEV_TOOLS` (Jira Software only) + * - `VIEW_READONLY_WORKFLOW` + * + * **Issue permissions** + * + * - `ASSIGNABLE_USER` + * - `ASSIGN_ISSUES` + * - `CLOSE_ISSUES` + * - `CREATE_ISSUES` + * - `DELETE_ISSUES` + * - `EDIT_ISSUES` + * - `LINK_ISSUES` + * - `MODIFY_REPORTER` + * - `MOVE_ISSUES` + * - `RESOLVE_ISSUES` + * - `SCHEDULE_ISSUES` + * - `SET_ISSUE_SECURITY` + * - `TRANSITION_ISSUES` + * + * **Voters and watchers permissions** + * + * - `MANAGE_WATCHERS` + * - `VIEW_VOTERS_AND_WATCHERS` + * + * **Comments permissions** + * + * - `ADD_COMMENTS` + * - `DELETE_ALL_COMMENTS` + * - `DELETE_OWN_COMMENTS` + * - `EDIT_ALL_COMMENTS` + * - `EDIT_OWN_COMMENTS` + * + * **Attachments permissions** + * + * - `CREATE_ATTACHMENTS` + * - `DELETE_ALL_ATTACHMENTS` + * - `DELETE_OWN_ATTACHMENTS` + * + * **Time tracking permissions** + * + * - `DELETE_ALL_WORKLOGS` + * - `DELETE_OWN_WORKLOGS` + * - `EDIT_ALL_WORKLOGS` + * - `EDIT_OWN_WORKLOGS` + * - `WORK_ON_ISSUES` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAllPermissionSchemes( + parameters: Parameters.GetAllPermissionSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns all permission schemes. + * + * ### About permission schemes and grants + * + * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a + * `permission`. + * + * #### Holder object + * + * The `holder` object contains information about the user or group being granted the permission. For example, the + * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the + * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and + * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. The `holder` object is defined by the + * following properties: + * + * - `type` Identifies the user or group (see the list of types below). + * - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the + * `type`. For example, if the `type` is a group, then you need to specify the group name. + * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the + * group ID. For other `type` it has the same value as `parameter` + * + * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some + * types may not have a `parameter` or `value`): + * + * - `anyone` Grant for anonymous users. + * - `applicationRole` Grant for users with access to the specified application (application name, application name). + * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. + * - `assignee` Grant for the user currently assigned to an issue. + * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). + * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field + * ID, `value` : custom field ID). + * - `projectLead` Grant for a project lead. + * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). + * - `reporter` Grant for the user who reported the issue. + * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not + * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more + * information. + * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is + * deprecated and the account ID should be used, `value` : user ID). + * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : + * custom field ID). + * + * #### Built-in permissions + * + * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define + * custom permissions. See the [project + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation + * for more information. + * + * **Project permissions** + * + * - `ADMINISTER_PROJECTS` + * - `BROWSE_PROJECTS` + * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) + * - `SERVICEDESK_AGENT` (Jira Service Desk only) + * - `VIEW_DEV_TOOLS` (Jira Software only) + * - `VIEW_READONLY_WORKFLOW` + * + * **Issue permissions** + * + * - `ASSIGNABLE_USER` + * - `ASSIGN_ISSUES` + * - `CLOSE_ISSUES` + * - `CREATE_ISSUES` + * - `DELETE_ISSUES` + * - `EDIT_ISSUES` + * - `LINK_ISSUES` + * - `MODIFY_REPORTER` + * - `MOVE_ISSUES` + * - `RESOLVE_ISSUES` + * - `SCHEDULE_ISSUES` + * - `SET_ISSUE_SECURITY` + * - `TRANSITION_ISSUES` + * + * **Voters and watchers permissions** + * + * - `MANAGE_WATCHERS` + * - `VIEW_VOTERS_AND_WATCHERS` + * + * **Comments permissions** + * + * - `ADD_COMMENTS` + * - `DELETE_ALL_COMMENTS` + * - `DELETE_OWN_COMMENTS` + * - `EDIT_ALL_COMMENTS` + * - `EDIT_OWN_COMMENTS` + * + * **Attachments permissions** + * + * - `CREATE_ATTACHMENTS` + * - `DELETE_ALL_ATTACHMENTS` + * - `DELETE_OWN_ATTACHMENTS` + * + * **Time tracking permissions** + * + * - `DELETE_ALL_WORKLOGS` + * - `DELETE_OWN_WORKLOGS` + * - `EDIT_ALL_WORKLOGS` + * - `EDIT_OWN_WORKLOGS` + * - `WORK_ON_ISSUES` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAllPermissionSchemes( + parameters?: Parameters.GetAllPermissionSchemes, + callback?: never, + ): Promise; + async getAllPermissionSchemes( + parameters?: Parameters.GetAllPermissionSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/permissionscheme', + method: 'GET', + params: { + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission + * grants. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPermissionScheme( + parameters: Parameters.CreatePermissionScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission + * grants. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPermissionScheme( + parameters?: Parameters.CreatePermissionScheme, + callback?: never, + ): Promise; + async createPermissionScheme( + parameters?: Parameters.CreatePermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/permissionscheme', + method: 'POST', + params: { + expand: parameters?.expand, + }, + data: { + ...parameters, + expand: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionScheme( + parameters: Parameters.GetPermissionScheme | string, + callback: Callback, + ): Promise; + /** + * Returns a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionScheme( + parameters: Parameters.GetPermissionScheme | string, + callback?: never, + ): Promise; + async getPermissionScheme( + parameters: Parameters.GetPermissionScheme | string, + callback?: Callback, + ): Promise { + const schemeId = typeof parameters === 'string' ? parameters : parameters.schemeId; + + const config: RequestConfig = { + url: `/rest/api/2/permissionscheme/${schemeId}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a permission scheme. Below are some important things to note when using this resource: + * + * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all + * existing_ grants. + * - If you want to update only the name and description, then do not send a permissions list in the request. + * - Sending an empty list will remove all permission grants from the permission scheme. + * + * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission + * grant](#api-rest-api-2-permissionscheme-schemeId-permission-post) or [Delete permission scheme + * entity](#api-rest-api-2-permissionscheme-schemeId-permission-permissionId-delete). + * + * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for + * more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updatePermissionScheme( + parameters: Parameters.UpdatePermissionScheme, + callback: Callback, + ): Promise; + /** + * Updates a permission scheme. Below are some important things to note when using this resource: + * + * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all + * existing_ grants. + * - If you want to update only the name and description, then do not send a permissions list in the request. + * - Sending an empty list will remove all permission grants from the permission scheme. + * + * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission + * grant](#api-rest-api-2-permissionscheme-schemeId-permission-post) or [Delete permission scheme + * entity](#api-rest-api-2-permissionscheme-schemeId-permission-permissionId-delete). + * + * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for + * more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updatePermissionScheme( + parameters: Parameters.UpdatePermissionScheme, + callback?: never, + ): Promise; + async updatePermissionScheme( + parameters: Parameters.UpdatePermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/permissionscheme/${parameters.schemeId}`, + method: 'PUT', + params: { + expand: parameters.expand, + }, + data: { + ...parameters, + schemeId: undefined, + expand: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePermissionScheme( + parameters: Parameters.DeletePermissionScheme, + callback: Callback, + ): Promise; + /** + * Deletes a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePermissionScheme(parameters: Parameters.DeletePermissionScheme, callback?: never): Promise; + async deletePermissionScheme( + parameters: Parameters.DeletePermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/permissionscheme/${parameters.schemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all permission grants for a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionSchemeGrants( + parameters: Parameters.GetPermissionSchemeGrants, + callback: Callback, + ): Promise; + /** + * Returns all permission grants for a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionSchemeGrants( + parameters: Parameters.GetPermissionSchemeGrants, + callback?: never, + ): Promise; + async getPermissionSchemeGrants( + parameters: Parameters.GetPermissionSchemeGrants, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a permission grant in a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPermissionGrant( + parameters: Parameters.CreatePermissionGrant, + callback: Callback, + ): Promise; + /** + * Creates a permission grant in a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPermissionGrant( + parameters: Parameters.CreatePermissionGrant, + callback?: never, + ): Promise; + async createPermissionGrant( + parameters: Parameters.CreatePermissionGrant, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission`, + method: 'POST', + params: { + expand: parameters.expand, + }, + data: { + id: parameters.id, + self: parameters.self, + holder: parameters.holder, + permission: parameters.permission, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a permission grant. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionSchemeGrant( + parameters: Parameters.GetPermissionSchemeGrant, + callback: Callback, + ): Promise; + /** + * Returns a permission grant. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionSchemeGrant( + parameters: Parameters.GetPermissionSchemeGrant, + callback?: never, + ): Promise; + async getPermissionSchemeGrant( + parameters: Parameters.GetPermissionSchemeGrant, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a permission grant from a permission scheme. See [About permission schemes and + * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePermissionSchemeEntity( + parameters: Parameters.DeletePermissionSchemeEntity, + callback: Callback, + ): Promise; + /** + * Deletes a permission grant from a permission scheme. See [About permission schemes and + * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePermissionSchemeEntity( + parameters: Parameters.DeletePermissionSchemeEntity, + callback?: never, + ): Promise; + async deletePermissionSchemeEntity( + parameters: Parameters.DeletePermissionSchemeEntity, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/permissionSchemes.ts b/src/version2/permissionSchemes.ts deleted file mode 100644 index 1bd9c8aa5..000000000 --- a/src/version2/permissionSchemes.ts +++ /dev/null @@ -1,560 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class PermissionSchemes { - constructor(private client: Client) {} - - /** - * Returns all permission schemes. - * - * ### About permission schemes and grants - * - * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a - * `permission`. - * - * #### Holder object - * - * The `holder` object contains information about the user or group being granted the permission. For example, the - * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the - * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and - * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. The `holder` object is defined by the - * following properties: - * - * - `type` Identifies the user or group (see the list of types below). - * - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the - * `type`. For example, if the `type` is a group, then you need to specify the group name. - * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the - * group ID. For other `type` it has the same value as `parameter` - * - * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some - * types may not have a `parameter` or `value`): - * - * - `anyone` Grant for anonymous users. - * - `applicationRole` Grant for users with access to the specified application (application name, application name). - * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. - * - `assignee` Grant for the user currently assigned to an issue. - * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). - * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field - * ID, `value` : custom field ID). - * - `projectLead` Grant for a project lead. - * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). - * - `reporter` Grant for the user who reported the issue. - * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not - * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more - * information. - * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is - * deprecated and the account ID should be used, `value` : user ID). - * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : - * custom field ID). - * - * #### Built-in permissions - * - * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define - * custom permissions. See the [project - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation - * for more information. - * - * **Project permissions** - * - * - `ADMINISTER_PROJECTS` - * - `BROWSE_PROJECTS` - * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) - * - `SERVICEDESK_AGENT` (Jira Service Desk only) - * - `VIEW_DEV_TOOLS` (Jira Software only) - * - `VIEW_READONLY_WORKFLOW` - * - * **Issue permissions** - * - * - `ASSIGNABLE_USER` - * - `ASSIGN_ISSUES` - * - `CLOSE_ISSUES` - * - `CREATE_ISSUES` - * - `DELETE_ISSUES` - * - `EDIT_ISSUES` - * - `LINK_ISSUES` - * - `MODIFY_REPORTER` - * - `MOVE_ISSUES` - * - `RESOLVE_ISSUES` - * - `SCHEDULE_ISSUES` - * - `SET_ISSUE_SECURITY` - * - `TRANSITION_ISSUES` - * - * **Voters and watchers permissions** - * - * - `MANAGE_WATCHERS` - * - `VIEW_VOTERS_AND_WATCHERS` - * - * **Comments permissions** - * - * - `ADD_COMMENTS` - * - `DELETE_ALL_COMMENTS` - * - `DELETE_OWN_COMMENTS` - * - `EDIT_ALL_COMMENTS` - * - `EDIT_OWN_COMMENTS` - * - * **Attachments permissions** - * - * - `CREATE_ATTACHMENTS` - * - `DELETE_ALL_ATTACHMENTS` - * - `DELETE_OWN_ATTACHMENTS` - * - * **Time tracking permissions** - * - * - `DELETE_ALL_WORKLOGS` - * - `DELETE_OWN_WORKLOGS` - * - `EDIT_ALL_WORKLOGS` - * - `EDIT_OWN_WORKLOGS` - * - `WORK_ON_ISSUES` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllPermissionSchemes( - parameters: Parameters.GetAllPermissionSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns all permission schemes. - * - * ### About permission schemes and grants - * - * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a - * `permission`. - * - * #### Holder object - * - * The `holder` object contains information about the user or group being granted the permission. For example, the - * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the - * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and - * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. The `holder` object is defined by the - * following properties: - * - * - `type` Identifies the user or group (see the list of types below). - * - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the - * `type`. For example, if the `type` is a group, then you need to specify the group name. - * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the - * group ID. For other `type` it has the same value as `parameter` - * - * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some - * types may not have a `parameter` or `value`): - * - * - `anyone` Grant for anonymous users. - * - `applicationRole` Grant for users with access to the specified application (application name, application name). - * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. - * - `assignee` Grant for the user currently assigned to an issue. - * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). - * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field - * ID, `value` : custom field ID). - * - `projectLead` Grant for a project lead. - * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). - * - `reporter` Grant for the user who reported the issue. - * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not - * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more - * information. - * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is - * deprecated and the account ID should be used, `value` : user ID). - * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : - * custom field ID). - * - * #### Built-in permissions - * - * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define - * custom permissions. See the [project - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation - * for more information. - * - * **Project permissions** - * - * - `ADMINISTER_PROJECTS` - * - `BROWSE_PROJECTS` - * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) - * - `SERVICEDESK_AGENT` (Jira Service Desk only) - * - `VIEW_DEV_TOOLS` (Jira Software only) - * - `VIEW_READONLY_WORKFLOW` - * - * **Issue permissions** - * - * - `ASSIGNABLE_USER` - * - `ASSIGN_ISSUES` - * - `CLOSE_ISSUES` - * - `CREATE_ISSUES` - * - `DELETE_ISSUES` - * - `EDIT_ISSUES` - * - `LINK_ISSUES` - * - `MODIFY_REPORTER` - * - `MOVE_ISSUES` - * - `RESOLVE_ISSUES` - * - `SCHEDULE_ISSUES` - * - `SET_ISSUE_SECURITY` - * - `TRANSITION_ISSUES` - * - * **Voters and watchers permissions** - * - * - `MANAGE_WATCHERS` - * - `VIEW_VOTERS_AND_WATCHERS` - * - * **Comments permissions** - * - * - `ADD_COMMENTS` - * - `DELETE_ALL_COMMENTS` - * - `DELETE_OWN_COMMENTS` - * - `EDIT_ALL_COMMENTS` - * - `EDIT_OWN_COMMENTS` - * - * **Attachments permissions** - * - * - `CREATE_ATTACHMENTS` - * - `DELETE_ALL_ATTACHMENTS` - * - `DELETE_OWN_ATTACHMENTS` - * - * **Time tracking permissions** - * - * - `DELETE_ALL_WORKLOGS` - * - `DELETE_OWN_WORKLOGS` - * - `EDIT_ALL_WORKLOGS` - * - `EDIT_OWN_WORKLOGS` - * - `WORK_ON_ISSUES` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllPermissionSchemes( - parameters?: Parameters.GetAllPermissionSchemes, - callback?: never, - ): Promise; - async getAllPermissionSchemes( - parameters?: Parameters.GetAllPermissionSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/permissionscheme', - method: 'GET', - params: { - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission - * grants. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPermissionScheme( - parameters: Parameters.CreatePermissionScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission - * grants. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPermissionScheme( - parameters?: Parameters.CreatePermissionScheme, - callback?: never, - ): Promise; - async createPermissionScheme( - parameters?: Parameters.CreatePermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/permissionscheme', - method: 'POST', - params: { - expand: parameters?.expand, - }, - data: { - ...parameters, - expand: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionScheme( - parameters: Parameters.GetPermissionScheme | string, - callback: Callback, - ): Promise; - /** - * Returns a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionScheme( - parameters: Parameters.GetPermissionScheme | string, - callback?: never, - ): Promise; - async getPermissionScheme( - parameters: Parameters.GetPermissionScheme | string, - callback?: Callback, - ): Promise { - const schemeId = typeof parameters === 'string' ? parameters : parameters.schemeId; - - const config: RequestConfig = { - url: `/rest/api/2/permissionscheme/${schemeId}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a permission scheme. Below are some important things to note when using this resource: - * - * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all - * existing_ grants. - * - If you want to update only the name and description, then do not send a permissions list in the request. - * - Sending an empty list will remove all permission grants from the permission scheme. - * - * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission - * grant](#api-rest-api-2-permissionscheme-schemeId-permission-post) or [Delete permission scheme - * entity](#api-rest-api-2-permissionscheme-schemeId-permission-permissionId-delete). - * - * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for - * more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updatePermissionScheme( - parameters: Parameters.UpdatePermissionScheme, - callback: Callback, - ): Promise; - /** - * Updates a permission scheme. Below are some important things to note when using this resource: - * - * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all - * existing_ grants. - * - If you want to update only the name and description, then do not send a permissions list in the request. - * - Sending an empty list will remove all permission grants from the permission scheme. - * - * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission - * grant](#api-rest-api-2-permissionscheme-schemeId-permission-post) or [Delete permission scheme - * entity](#api-rest-api-2-permissionscheme-schemeId-permission-permissionId-delete). - * - * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for - * more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updatePermissionScheme( - parameters: Parameters.UpdatePermissionScheme, - callback?: never, - ): Promise; - async updatePermissionScheme( - parameters: Parameters.UpdatePermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/permissionscheme/${parameters.schemeId}`, - method: 'PUT', - params: { - expand: parameters.expand, - }, - data: { - ...parameters, - schemeId: undefined, - expand: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deletePermissionScheme( - parameters: Parameters.DeletePermissionScheme, - callback: Callback, - ): Promise; - /** - * Deletes a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deletePermissionScheme(parameters: Parameters.DeletePermissionScheme, callback?: never): Promise; - async deletePermissionScheme( - parameters: Parameters.DeletePermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/permissionscheme/${parameters.schemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all permission grants for a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrants( - parameters: Parameters.GetPermissionSchemeGrants, - callback: Callback, - ): Promise; - /** - * Returns all permission grants for a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrants( - parameters: Parameters.GetPermissionSchemeGrants, - callback?: never, - ): Promise; - async getPermissionSchemeGrants( - parameters: Parameters.GetPermissionSchemeGrants, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a permission grant in a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPermissionGrant( - parameters: Parameters.CreatePermissionGrant, - callback: Callback, - ): Promise; - /** - * Creates a permission grant in a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPermissionGrant( - parameters: Parameters.CreatePermissionGrant, - callback?: never, - ): Promise; - async createPermissionGrant( - parameters: Parameters.CreatePermissionGrant, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission`, - method: 'POST', - params: { - expand: parameters.expand, - }, - data: { - id: parameters.id, - self: parameters.self, - holder: parameters.holder, - permission: parameters.permission, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a permission grant. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrant( - parameters: Parameters.GetPermissionSchemeGrant, - callback: Callback, - ): Promise; - /** - * Returns a permission grant. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrant( - parameters: Parameters.GetPermissionSchemeGrant, - callback?: never, - ): Promise; - async getPermissionSchemeGrant( - parameters: Parameters.GetPermissionSchemeGrant, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a permission grant from a permission scheme. See [About permission schemes and - * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deletePermissionSchemeEntity( - parameters: Parameters.DeletePermissionSchemeEntity, - callback: Callback, - ): Promise; - /** - * Deletes a permission grant from a permission scheme. See [About permission schemes and - * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deletePermissionSchemeEntity( - parameters: Parameters.DeletePermissionSchemeEntity, - callback?: never, - ): Promise; - async deletePermissionSchemeEntity( - parameters: Parameters.DeletePermissionSchemeEntity, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/permissions.mts b/src/version2/permissions.mts new file mode 100644 index 000000000..9fe49f063 --- /dev/null +++ b/src/version2/permissions.mts @@ -0,0 +1,236 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Permissions { + constructor(private client: Client) {} + + /** + * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be + * obtained in a global, project, issue or comment context. + * + * The user is reported as having a project permission: + * + * - In the global context, if the user has the project permission in any project. + * - For a project, where the project permission is determined using issue data, if the user meets the permission's + * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. + * - For an issue, where a project permission is determined using issue data, if the user has the permission in the + * issue. Otherwise, if the user has the project permission in the project containing the issue. + * - For a comment, where the user has both the permission to browse the comment and the project permission for the + * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose + * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. + * + * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a + * project context but may not have the permission for any or all issues. For example, if Reporters have the + * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a + * project, because any user can be a reporter. However, if they are not the user who reported the issue queried they + * would not have EDIT_ISSUES permission for that issue. + * + * Global permissions are unaffected by context. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getMyPermissions( + parameters: Parameters.GetMyPermissions | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be + * obtained in a global, project, issue or comment context. + * + * The user is reported as having a project permission: + * + * - In the global context, if the user has the project permission in any project. + * - For a project, where the project permission is determined using issue data, if the user meets the permission's + * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. + * - For an issue, where a project permission is determined using issue data, if the user has the permission in the + * issue. Otherwise, if the user has the project permission in the project containing the issue. + * - For a comment, where the user has both the permission to browse the comment and the project permission for the + * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose + * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. + * + * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a + * project context but may not have the permission for any or all issues. For example, if Reporters have the + * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a + * project, because any user can be a reporter. However, if they are not the user who reported the issue queried they + * would not have EDIT_ISSUES permission for that issue. + * + * Global permissions are unaffected by context. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getMyPermissions( + parameters?: Parameters.GetMyPermissions, + callback?: never, + ): Promise; + async getMyPermissions( + parameters?: Parameters.GetMyPermissions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/mypermissions', + method: 'GET', + params: { + projectKey: parameters?.projectKey, + projectId: parameters?.projectId, + issueKey: parameters?.issueKey, + issueId: parameters?.issueId, + permissions: parameters?.permissions, + projectUuid: parameters?.projectUuid, + projectConfigurationUuid: parameters?.projectConfigurationUuid, + commentId: parameters?.commentId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all permissions, including: + * + * - Global permissions. + * - Project permissions. + * - Global permissions added by plugins. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllPermissions(callback: Callback): Promise; + /** + * Returns all permissions, including: + * + * - Global permissions. + * - Project permissions. + * - Global permissions added by plugins. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllPermissions(callback?: never): Promise; + async getAllPermissions(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/permissions', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns: + * + * - For a list of global permissions, the global permissions granted to a user. + * - For a list of project permissions and lists of projects and issues, for each project permission a list of the + * projects and issues a user can access or manipulate. + * + * If no account ID is provided, the operation returns details for the logged in user. + * + * Note that: + * + * - Invalid project and issue IDs are ignored. + * - A maximum of 1000 projects and 1000 issues can be checked. + * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and + * `projectPermissions.issues` are ignored. + * - Empty strings in `projectPermissions.permissions` are ignored. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other + * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain + * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made + * using AP.request() in a browser. + */ + async getBulkPermissions( + parameters: Parameters.GetBulkPermissions | undefined, + callback: Callback, + ): Promise; + /** + * Returns: + * + * - For a list of global permissions, the global permissions granted to a user. + * - For a list of project permissions and lists of projects and issues, for each project permission a list of the + * projects and issues a user can access or manipulate. + * + * If no account ID is provided, the operation returns details for the logged in user. + * + * Note that: + * + * - Invalid project and issue IDs are ignored. + * - A maximum of 1000 projects and 1000 issues can be checked. + * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and + * `projectPermissions.issues` are ignored. + * - Empty strings in `projectPermissions.permissions` are ignored. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other + * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain + * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made + * using AP.request() in a browser. + */ + async getBulkPermissions( + parameters?: Parameters.GetBulkPermissions, + callback?: never, + ): Promise; + async getBulkPermissions( + parameters?: Parameters.GetBulkPermissions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/permissions/check', + method: 'POST', + data: { + projectPermissions: parameters?.projectPermissions, + globalPermissions: parameters?.globalPermissions, + accountId: parameters?.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all the projects where the user is granted a list of project permissions. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getPermittedProjects( + parameters: Parameters.GetPermittedProjects | undefined, + callback: Callback, + ): Promise; + /** + * Returns all the projects where the user is granted a list of project permissions. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getPermittedProjects( + parameters?: Parameters.GetPermittedProjects, + callback?: never, + ): Promise; + async getPermittedProjects( + parameters?: Parameters.GetPermittedProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/permissions/project', + method: 'POST', + data: { + permissions: parameters?.permissions, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/permissions.ts b/src/version2/permissions.ts deleted file mode 100644 index e5739a257..000000000 --- a/src/version2/permissions.ts +++ /dev/null @@ -1,236 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Permissions { - constructor(private client: Client) {} - - /** - * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be - * obtained in a global, project, issue or comment context. - * - * The user is reported as having a project permission: - * - * - In the global context, if the user has the project permission in any project. - * - For a project, where the project permission is determined using issue data, if the user meets the permission's - * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. - * - For an issue, where a project permission is determined using issue data, if the user has the permission in the - * issue. Otherwise, if the user has the project permission in the project containing the issue. - * - For a comment, where the user has both the permission to browse the comment and the project permission for the - * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose - * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. - * - * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a - * project context but may not have the permission for any or all issues. For example, if Reporters have the - * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a - * project, because any user can be a reporter. However, if they are not the user who reported the issue queried they - * would not have EDIT_ISSUES permission for that issue. - * - * Global permissions are unaffected by context. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getMyPermissions( - parameters: Parameters.GetMyPermissions | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be - * obtained in a global, project, issue or comment context. - * - * The user is reported as having a project permission: - * - * - In the global context, if the user has the project permission in any project. - * - For a project, where the project permission is determined using issue data, if the user meets the permission's - * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. - * - For an issue, where a project permission is determined using issue data, if the user has the permission in the - * issue. Otherwise, if the user has the project permission in the project containing the issue. - * - For a comment, where the user has both the permission to browse the comment and the project permission for the - * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose - * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. - * - * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a - * project context but may not have the permission for any or all issues. For example, if Reporters have the - * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a - * project, because any user can be a reporter. However, if they are not the user who reported the issue queried they - * would not have EDIT_ISSUES permission for that issue. - * - * Global permissions are unaffected by context. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getMyPermissions( - parameters?: Parameters.GetMyPermissions, - callback?: never, - ): Promise; - async getMyPermissions( - parameters?: Parameters.GetMyPermissions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/mypermissions', - method: 'GET', - params: { - projectKey: parameters?.projectKey, - projectId: parameters?.projectId, - issueKey: parameters?.issueKey, - issueId: parameters?.issueId, - permissions: parameters?.permissions, - projectUuid: parameters?.projectUuid, - projectConfigurationUuid: parameters?.projectConfigurationUuid, - commentId: parameters?.commentId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all permissions, including: - * - * - Global permissions. - * - Project permissions. - * - Global permissions added by plugins. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllPermissions(callback: Callback): Promise; - /** - * Returns all permissions, including: - * - * - Global permissions. - * - Project permissions. - * - Global permissions added by plugins. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllPermissions(callback?: never): Promise; - async getAllPermissions(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/permissions', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns: - * - * - For a list of global permissions, the global permissions granted to a user. - * - For a list of project permissions and lists of projects and issues, for each project permission a list of the - * projects and issues a user can access or manipulate. - * - * If no account ID is provided, the operation returns details for the logged in user. - * - * Note that: - * - * - Invalid project and issue IDs are ignored. - * - A maximum of 1000 projects and 1000 issues can be checked. - * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and - * `projectPermissions.issues` are ignored. - * - Empty strings in `projectPermissions.permissions` are ignored. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other - * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain - * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made - * using AP.request() in a browser. - */ - async getBulkPermissions( - parameters: Parameters.GetBulkPermissions | undefined, - callback: Callback, - ): Promise; - /** - * Returns: - * - * - For a list of global permissions, the global permissions granted to a user. - * - For a list of project permissions and lists of projects and issues, for each project permission a list of the - * projects and issues a user can access or manipulate. - * - * If no account ID is provided, the operation returns details for the logged in user. - * - * Note that: - * - * - Invalid project and issue IDs are ignored. - * - A maximum of 1000 projects and 1000 issues can be checked. - * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and - * `projectPermissions.issues` are ignored. - * - Empty strings in `projectPermissions.permissions` are ignored. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other - * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain - * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made - * using AP.request() in a browser. - */ - async getBulkPermissions( - parameters?: Parameters.GetBulkPermissions, - callback?: never, - ): Promise; - async getBulkPermissions( - parameters?: Parameters.GetBulkPermissions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/permissions/check', - method: 'POST', - data: { - projectPermissions: parameters?.projectPermissions, - globalPermissions: parameters?.globalPermissions, - accountId: parameters?.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all the projects where the user is granted a list of project permissions. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getPermittedProjects( - parameters: Parameters.GetPermittedProjects | undefined, - callback: Callback, - ): Promise; - /** - * Returns all the projects where the user is granted a list of project permissions. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getPermittedProjects( - parameters?: Parameters.GetPermittedProjects, - callback?: never, - ): Promise; - async getPermittedProjects( - parameters?: Parameters.GetPermittedProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/permissions/project', - method: 'POST', - data: { - permissions: parameters?.permissions, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectAvatars.mts b/src/version2/projectAvatars.mts new file mode 100644 index 000000000..2f853f10b --- /dev/null +++ b/src/version2/projectAvatars.mts @@ -0,0 +1,180 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectAvatars { + constructor(private client: Client) {} + + /** + * Sets the avatar displayed for a project. + * + * Use [Load project avatar](#api-rest-api-2-project-projectIdOrKey-avatar2-post) to store avatars against the + * project, before using this operation to set the displayed avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback: Callback): Promise; + /** + * Sets the avatar displayed for a project. + * + * Use [Load project avatar](#api-rest-api-2-project-projectIdOrKey-avatar2-post) to store avatars against the + * project, before using this operation to set the displayed avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback?: never): Promise; + async updateProjectAvatar( + parameters: Parameters.UpdateProjectAvatar, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatar`, + method: 'PUT', + data: { + fileName: parameters.fileName, + id: parameters.id, + isDeletable: parameters.isDeletable, + isSelected: parameters.isSelected, + isSystemAvatar: parameters.isSystemAvatar, + owner: parameters.owner, + urls: parameters.urls, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback: Callback): Promise; + /** + * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback?: never): Promise; + async deleteProjectAvatar( + parameters: Parameters.DeleteProjectAvatar, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatar/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Loads an avatar for a project. + * + * Specify the avatar's local file location in the body of the request. Also, include the following headers: + * + * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special + * Headers](#special-request-headers). + * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * + * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of + * the image. The length of the square's sides is set to the smaller of the height or width of the image. + * + * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. + * + * After creating the avatar use [Set project avatar](#api-rest-api-2-project-projectIdOrKey-avatar-put) to set it as + * the project's displayed avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async createProjectAvatar( + parameters: Parameters.CreateProjectAvatar, + callback: Callback, + ): Promise; + /** + * Loads an avatar for a project. + * + * Specify the avatar's local file location in the body of the request. Also, include the following headers: + * + * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special + * Headers](#special-request-headers). + * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * + * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of + * the image. The length of the square's sides is set to the smaller of the height or width of the image. + * + * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. + * + * After creating the avatar use [Set project avatar](#api-rest-api-2-project-projectIdOrKey-avatar-put) to set it as + * the project's displayed avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async createProjectAvatar( + parameters: Parameters.CreateProjectAvatar, + callback?: never, + ): Promise; + async createProjectAvatar( + parameters: Parameters.CreateProjectAvatar, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatar2`, + method: 'POST', + params: { + x: parameters.x, + y: parameters.y, + size: parameters.size, + }, + data: parameters.avatar, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all project avatars, grouped by system and custom avatars. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getAllProjectAvatars( + parameters: Parameters.GetAllProjectAvatars | string, + callback: Callback, + ): Promise; + /** + * Returns all project avatars, grouped by system and custom avatars. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getAllProjectAvatars( + parameters: Parameters.GetAllProjectAvatars | string, + callback?: never, + ): Promise; + async getAllProjectAvatars( + parameters: Parameters.GetAllProjectAvatars | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/avatars`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectAvatars.ts b/src/version2/projectAvatars.ts deleted file mode 100644 index 34503a6cf..000000000 --- a/src/version2/projectAvatars.ts +++ /dev/null @@ -1,180 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectAvatars { - constructor(private client: Client) {} - - /** - * Sets the avatar displayed for a project. - * - * Use [Load project avatar](#api-rest-api-2-project-projectIdOrKey-avatar2-post) to store avatars against the - * project, before using this operation to set the displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback: Callback): Promise; - /** - * Sets the avatar displayed for a project. - * - * Use [Load project avatar](#api-rest-api-2-project-projectIdOrKey-avatar2-post) to store avatars against the - * project, before using this operation to set the displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback?: never): Promise; - async updateProjectAvatar( - parameters: Parameters.UpdateProjectAvatar, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatar`, - method: 'PUT', - data: { - fileName: parameters.fileName, - id: parameters.id, - isDeletable: parameters.isDeletable, - isSelected: parameters.isSelected, - isSystemAvatar: parameters.isSystemAvatar, - owner: parameters.owner, - urls: parameters.urls, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback: Callback): Promise; - /** - * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback?: never): Promise; - async deleteProjectAvatar( - parameters: Parameters.DeleteProjectAvatar, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatar/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Loads an avatar for a project. - * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar use [Set project avatar](#api-rest-api-2-project-projectIdOrKey-avatar-put) to set it as - * the project's displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async createProjectAvatar( - parameters: Parameters.CreateProjectAvatar, - callback: Callback, - ): Promise; - /** - * Loads an avatar for a project. - * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar use [Set project avatar](#api-rest-api-2-project-projectIdOrKey-avatar-put) to set it as - * the project's displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async createProjectAvatar( - parameters: Parameters.CreateProjectAvatar, - callback?: never, - ): Promise; - async createProjectAvatar( - parameters: Parameters.CreateProjectAvatar, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatar2`, - method: 'POST', - params: { - x: parameters.x, - y: parameters.y, - size: parameters.size, - }, - data: parameters.avatar, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all project avatars, grouped by system and custom avatars. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getAllProjectAvatars( - parameters: Parameters.GetAllProjectAvatars | string, - callback: Callback, - ): Promise; - /** - * Returns all project avatars, grouped by system and custom avatars. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getAllProjectAvatars( - parameters: Parameters.GetAllProjectAvatars | string, - callback?: never, - ): Promise; - async getAllProjectAvatars( - parameters: Parameters.GetAllProjectAvatars | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/avatars`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectCategories.mts b/src/version2/projectCategories.mts new file mode 100644 index 000000000..67bec15db --- /dev/null +++ b/src/version2/projectCategories.mts @@ -0,0 +1,174 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectCategories { + constructor(private client: Client) {} + + /** + * Returns all project categories. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAllProjectCategories(callback: Callback): Promise; + /** + * Returns all project categories. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAllProjectCategories(callback?: never): Promise; + async getAllProjectCategories(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/projectCategory', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProjectCategory( + parameters: Parameters.CreateProjectCategory, + callback: Callback, + ): Promise; + /** + * Creates a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProjectCategory( + parameters: Parameters.CreateProjectCategory, + callback?: never, + ): Promise; + async createProjectCategory( + parameters: Parameters.CreateProjectCategory, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/projectCategory', + method: 'POST', + data: { + description: parameters.description, + id: parameters.id, + name: parameters.name, + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getProjectCategoryById( + parameters: Parameters.GetProjectCategoryById | string, + callback: Callback, + ): Promise; + /** + * Returns a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getProjectCategoryById( + parameters: Parameters.GetProjectCategoryById | string, + callback?: never, + ): Promise; + async getProjectCategoryById( + parameters: Parameters.GetProjectCategoryById | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/projectCategory/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateProjectCategory( + parameters: Parameters.UpdateProjectCategory, + callback: Callback, + ): Promise; + /** + * Updates a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateProjectCategory( + parameters: Parameters.UpdateProjectCategory, + callback?: never, + ): Promise; + async updateProjectCategory( + parameters: Parameters.UpdateProjectCategory, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/projectCategory/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeProjectCategory( + parameters: Parameters.RemoveProjectCategory | string, + callback: Callback, + ): Promise; + /** + * Deletes a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeProjectCategory( + parameters: Parameters.RemoveProjectCategory | string, + callback?: never, + ): Promise; + async removeProjectCategory( + parameters: Parameters.RemoveProjectCategory | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/projectCategory/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectCategories.ts b/src/version2/projectCategories.ts deleted file mode 100644 index dd61323a1..000000000 --- a/src/version2/projectCategories.ts +++ /dev/null @@ -1,174 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectCategories { - constructor(private client: Client) {} - - /** - * Returns all project categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllProjectCategories(callback: Callback): Promise; - /** - * Returns all project categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllProjectCategories(callback?: never): Promise; - async getAllProjectCategories(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/projectCategory', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectCategory( - parameters: Parameters.CreateProjectCategory, - callback: Callback, - ): Promise; - /** - * Creates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectCategory( - parameters: Parameters.CreateProjectCategory, - callback?: never, - ): Promise; - async createProjectCategory( - parameters: Parameters.CreateProjectCategory, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/projectCategory', - method: 'POST', - data: { - description: parameters.description, - id: parameters.id, - name: parameters.name, - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getProjectCategoryById( - parameters: Parameters.GetProjectCategoryById | string, - callback: Callback, - ): Promise; - /** - * Returns a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getProjectCategoryById( - parameters: Parameters.GetProjectCategoryById | string, - callback?: never, - ): Promise; - async getProjectCategoryById( - parameters: Parameters.GetProjectCategoryById | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/projectCategory/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateProjectCategory( - parameters: Parameters.UpdateProjectCategory, - callback: Callback, - ): Promise; - /** - * Updates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateProjectCategory( - parameters: Parameters.UpdateProjectCategory, - callback?: never, - ): Promise; - async updateProjectCategory( - parameters: Parameters.UpdateProjectCategory, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/projectCategory/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeProjectCategory( - parameters: Parameters.RemoveProjectCategory | string, - callback: Callback, - ): Promise; - /** - * Deletes a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeProjectCategory( - parameters: Parameters.RemoveProjectCategory | string, - callback?: never, - ): Promise; - async removeProjectCategory( - parameters: Parameters.RemoveProjectCategory | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/projectCategory/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectComponents.mts b/src/version2/projectComponents.mts new file mode 100644 index 000000000..9291c2637 --- /dev/null +++ b/src/version2/projectComponents.mts @@ -0,0 +1,313 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectComponents { + constructor(private client: Client) {} + + /** + * Creates a component. Use components to provide containers for issues within a project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the + * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createComponent( + parameters: Parameters.CreateComponent, + callback: Callback, + ): Promise; + /** + * Creates a component. Use components to provide containers for issues within a project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the + * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createComponent( + parameters: Parameters.CreateComponent, + callback?: never, + ): Promise; + async createComponent( + parameters: Parameters.CreateComponent, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/component', + method: 'POST', + data: { + assignee: parameters.assignee, + assigneeType: parameters.assigneeType, + description: parameters.description, + id: parameters.id, + isAssigneeTypeValid: parameters.isAssigneeTypeValid, + lead: parameters.lead, + leadAccountId: parameters.leadAccountId, + leadUserName: parameters.leadUserName, + name: parameters.name, + project: parameters.project, + projectId: parameters.projectId, + realAssignee: parameters.realAssignee, + realAssigneeType: parameters.realAssigneeType, + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a component. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for project containing the component. + */ + async getComponent( + parameters: Parameters.GetComponent | string, + callback: Callback, + ): Promise; + /** + * Returns a component. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for project containing the component. + */ + async getComponent( + parameters: Parameters.GetComponent | string, + callback?: never, + ): Promise; + async getComponent( + parameters: Parameters.GetComponent | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/component/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") + * the component lead is removed. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateComponent( + parameters: Parameters.UpdateComponent, + callback: Callback, + ): Promise; + /** + * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") + * the component lead is removed. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateComponent( + parameters: Parameters.UpdateComponent, + callback?: never, + ): Promise; + async updateComponent( + parameters: Parameters.UpdateComponent, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/component/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + leadUserName: parameters.leadUserName, + leadAccountId: parameters.leadAccountId, + assigneeType: parameters.assigneeType, + project: parameters.project, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a component. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteComponent( + parameters: Parameters.DeleteComponent | string, + callback: Callback, + ): Promise; + /** + * Deletes a component. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteComponent(parameters: Parameters.DeleteComponent | string, callback?: never): Promise; + async deleteComponent( + parameters: Parameters.DeleteComponent | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/component/${id}`, + method: 'DELETE', + params: { + moveIssuesTo: typeof parameters !== 'string' && parameters.moveIssuesTo, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the counts of issues assigned to the component. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getComponentRelatedIssues( + parameters: Parameters.GetComponentRelatedIssues | string, + callback: Callback, + ): Promise; + /** + * Returns the counts of issues assigned to the component. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getComponentRelatedIssues( + parameters: Parameters.GetComponentRelatedIssues | string, + callback?: never, + ): Promise; + async getComponentRelatedIssues( + parameters: Parameters.GetComponentRelatedIssues | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/component/${id}/relatedIssueCounts`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * components in a project. See the [Get project components](#api-rest-api-2-project-projectIdOrKey-components-get) + * resource if you want to get a full list of versions without pagination. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectComponentsPaginated( + parameters: Parameters.GetProjectComponentsPaginated, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * components in a project. See the [Get project components](#api-rest-api-2-project-projectIdOrKey-components-get) + * resource if you want to get a full list of versions without pagination. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectComponentsPaginated( + parameters: Parameters.GetProjectComponentsPaginated, + callback?: never, + ): Promise; + async getProjectComponentsPaginated( + parameters: Parameters.GetProjectComponentsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/component`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + orderBy: parameters.orderBy, + query: parameters.query, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all components in a project. See the [Get project components + * paginated](#api-rest-api-2-project-projectIdOrKey-component-get) resource if you want to get a full list of + * components with pagination. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectComponents( + parameters: Parameters.GetProjectComponents | string, + callback: Callback, + ): Promise; + /** + * Returns all components in a project. See the [Get project components + * paginated](#api-rest-api-2-project-projectIdOrKey-component-get) resource if you want to get a full list of + * components with pagination. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectComponents( + parameters: Parameters.GetProjectComponents | string, + callback?: never, + ): Promise; + async getProjectComponents( + parameters: Parameters.GetProjectComponents | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/components`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectComponents.ts b/src/version2/projectComponents.ts deleted file mode 100644 index 0e195574c..000000000 --- a/src/version2/projectComponents.ts +++ /dev/null @@ -1,313 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectComponents { - constructor(private client: Client) {} - - /** - * Creates a component. Use components to provide containers for issues within a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the - * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createComponent( - parameters: Parameters.CreateComponent, - callback: Callback, - ): Promise; - /** - * Creates a component. Use components to provide containers for issues within a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the - * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createComponent( - parameters: Parameters.CreateComponent, - callback?: never, - ): Promise; - async createComponent( - parameters: Parameters.CreateComponent, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/component', - method: 'POST', - data: { - assignee: parameters.assignee, - assigneeType: parameters.assigneeType, - description: parameters.description, - id: parameters.id, - isAssigneeTypeValid: parameters.isAssigneeTypeValid, - lead: parameters.lead, - leadAccountId: parameters.leadAccountId, - leadUserName: parameters.leadUserName, - name: parameters.name, - project: parameters.project, - projectId: parameters.projectId, - realAssignee: parameters.realAssignee, - realAssigneeType: parameters.realAssigneeType, - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for project containing the component. - */ - async getComponent( - parameters: Parameters.GetComponent | string, - callback: Callback, - ): Promise; - /** - * Returns a component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for project containing the component. - */ - async getComponent( - parameters: Parameters.GetComponent | string, - callback?: never, - ): Promise; - async getComponent( - parameters: Parameters.GetComponent | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/component/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") - * the component lead is removed. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateComponent( - parameters: Parameters.UpdateComponent, - callback: Callback, - ): Promise; - /** - * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") - * the component lead is removed. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateComponent( - parameters: Parameters.UpdateComponent, - callback?: never, - ): Promise; - async updateComponent( - parameters: Parameters.UpdateComponent, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/component/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - leadUserName: parameters.leadUserName, - leadAccountId: parameters.leadAccountId, - assigneeType: parameters.assigneeType, - project: parameters.project, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteComponent( - parameters: Parameters.DeleteComponent | string, - callback: Callback, - ): Promise; - /** - * Deletes a component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteComponent(parameters: Parameters.DeleteComponent | string, callback?: never): Promise; - async deleteComponent( - parameters: Parameters.DeleteComponent | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/component/${id}`, - method: 'DELETE', - params: { - moveIssuesTo: typeof parameters !== 'string' && parameters.moveIssuesTo, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the counts of issues assigned to the component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues | string, - callback: Callback, - ): Promise; - /** - * Returns the counts of issues assigned to the component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues | string, - callback?: never, - ): Promise; - async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/component/${id}/relatedIssueCounts`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * components in a project. See the [Get project components](#api-rest-api-2-project-projectIdOrKey-components-get) - * resource if you want to get a full list of versions without pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectComponentsPaginated( - parameters: Parameters.GetProjectComponentsPaginated, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * components in a project. See the [Get project components](#api-rest-api-2-project-projectIdOrKey-components-get) - * resource if you want to get a full list of versions without pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectComponentsPaginated( - parameters: Parameters.GetProjectComponentsPaginated, - callback?: never, - ): Promise; - async getProjectComponentsPaginated( - parameters: Parameters.GetProjectComponentsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/component`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - orderBy: parameters.orderBy, - query: parameters.query, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all components in a project. See the [Get project components - * paginated](#api-rest-api-2-project-projectIdOrKey-component-get) resource if you want to get a full list of - * components with pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectComponents( - parameters: Parameters.GetProjectComponents | string, - callback: Callback, - ): Promise; - /** - * Returns all components in a project. See the [Get project components - * paginated](#api-rest-api-2-project-projectIdOrKey-component-get) resource if you want to get a full list of - * components with pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectComponents( - parameters: Parameters.GetProjectComponents | string, - callback?: never, - ): Promise; - async getProjectComponents( - parameters: Parameters.GetProjectComponents | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/components`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectEmail.mts b/src/version2/projectEmail.mts new file mode 100644 index 000000000..a021dda2b --- /dev/null +++ b/src/version2/projectEmail.mts @@ -0,0 +1,77 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectEmail { + constructor(private client: Client) {} + + /** + * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectEmail( + parameters: Parameters.GetProjectEmail | string, + callback: Callback, + ): Promise; + /** + * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectEmail( + parameters: Parameters.GetProjectEmail | string, + callback?: never, + ): Promise; + async getProjectEmail( + parameters: Parameters.GetProjectEmail | string, + callback?: Callback, + ): Promise { + const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectId}/email`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * + * If `emailAddress` is an empty string, the default email address is restored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback: Callback): Promise; + /** + * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * + * If `emailAddress` is an empty string, the default email address is restored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback?: never): Promise; + async updateProjectEmail( + parameters: Parameters.UpdateProjectEmail, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectId}/email`, + method: 'PUT', + data: { + emailAddress: parameters.emailAddress, + emailAddressStatus: parameters.emailAddressStatus, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectEmail.ts b/src/version2/projectEmail.ts deleted file mode 100644 index f804ad5f6..000000000 --- a/src/version2/projectEmail.ts +++ /dev/null @@ -1,77 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectEmail { - constructor(private client: Client) {} - - /** - * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectEmail( - parameters: Parameters.GetProjectEmail | string, - callback: Callback, - ): Promise; - /** - * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectEmail( - parameters: Parameters.GetProjectEmail | string, - callback?: never, - ): Promise; - async getProjectEmail( - parameters: Parameters.GetProjectEmail | string, - callback?: Callback, - ): Promise { - const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectId}/email`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * If `emailAddress` is an empty string, the default email address is restored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback: Callback): Promise; - /** - * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * If `emailAddress` is an empty string, the default email address is restored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback?: never): Promise; - async updateProjectEmail( - parameters: Parameters.UpdateProjectEmail, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectId}/email`, - method: 'PUT', - data: { - emailAddress: parameters.emailAddress, - emailAddressStatus: parameters.emailAddressStatus, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectFeatures.mts b/src/version2/projectFeatures.mts new file mode 100644 index 000000000..6f09dd9a8 --- /dev/null +++ b/src/version2/projectFeatures.mts @@ -0,0 +1,58 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectFeatures { + constructor(private client: Client) {} + + /** Returns the list of features for a project. */ + async getFeaturesForProject( + parameters: Parameters.GetFeaturesForProject | string, + callback: Callback, + ): Promise; + /** Returns the list of features for a project. */ + async getFeaturesForProject( + parameters: Parameters.GetFeaturesForProject | string, + callback?: never, + ): Promise; + async getFeaturesForProject( + parameters: Parameters.GetFeaturesForProject | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/features`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** Sets the state of a project feature. */ + async toggleFeatureForProject( + parameters: Parameters.ToggleFeatureForProject, + callback: Callback, + ): Promise; + /** Sets the state of a project feature. */ + async toggleFeatureForProject( + parameters: Parameters.ToggleFeatureForProject, + callback?: never, + ): Promise; + async toggleFeatureForProject( + parameters: Parameters.ToggleFeatureForProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/features/${parameters.featureKey}`, + method: 'PUT', + data: { + state: parameters.state, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectFeatures.ts b/src/version2/projectFeatures.ts deleted file mode 100644 index 7fe726829..000000000 --- a/src/version2/projectFeatures.ts +++ /dev/null @@ -1,58 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectFeatures { - constructor(private client: Client) {} - - /** Returns the list of features for a project. */ - async getFeaturesForProject( - parameters: Parameters.GetFeaturesForProject | string, - callback: Callback, - ): Promise; - /** Returns the list of features for a project. */ - async getFeaturesForProject( - parameters: Parameters.GetFeaturesForProject | string, - callback?: never, - ): Promise; - async getFeaturesForProject( - parameters: Parameters.GetFeaturesForProject | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/features`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** Sets the state of a project feature. */ - async toggleFeatureForProject( - parameters: Parameters.ToggleFeatureForProject, - callback: Callback, - ): Promise; - /** Sets the state of a project feature. */ - async toggleFeatureForProject( - parameters: Parameters.ToggleFeatureForProject, - callback?: never, - ): Promise; - async toggleFeatureForProject( - parameters: Parameters.ToggleFeatureForProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/features/${parameters.featureKey}`, - method: 'PUT', - data: { - state: parameters.state, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectKeyAndNameValidation.mts b/src/version2/projectKeyAndNameValidation.mts new file mode 100644 index 000000000..b1a834888 --- /dev/null +++ b/src/version2/projectKeyAndNameValidation.mts @@ -0,0 +1,118 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectKeyAndNameValidation { + constructor(private client: Client) {} + + /** + * Validates a project key by confirming the key is a valid string and not in use. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async validateProjectKey( + parameters: Parameters.ValidateProjectKey | string | undefined, + callback: Callback, + ): Promise; + /** + * Validates a project key by confirming the key is a valid string and not in use. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async validateProjectKey( + parameters?: Parameters.ValidateProjectKey | string, + callback?: never, + ): Promise; + async validateProjectKey( + parameters?: Parameters.ValidateProjectKey | string, + callback?: Callback, + ): Promise { + const key = typeof parameters === 'string' ? parameters : parameters?.key; + + const config: RequestConfig = { + url: '/rest/api/2/projectvalidate/key', + method: 'GET', + params: { + key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getValidProjectKey( + parameters: Parameters.GetValidProjectKey | string | undefined, + callback: Callback, + ): Promise; + /** + * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getValidProjectKey( + parameters?: Parameters.GetValidProjectKey | string, + callback?: never, + ): Promise; + async getValidProjectKey( + parameters?: Parameters.GetValidProjectKey | string, + callback?: Callback, + ): Promise { + const key = typeof parameters === 'string' ? parameters : parameters?.key; + + const config: RequestConfig = { + url: '/rest/api/2/projectvalidate/validProjectKey', + method: 'GET', + params: { + key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in + * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a + * sequence number. If a valid project name cannot be generated, a 404 response is returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getValidProjectName( + parameters: Parameters.GetValidProjectName | string, + callback: Callback, + ): Promise; + /** + * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in + * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a + * sequence number. If a valid project name cannot be generated, a 404 response is returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getValidProjectName( + parameters: Parameters.GetValidProjectName | string, + callback?: never, + ): Promise; + async getValidProjectName( + parameters: Parameters.GetValidProjectName | string, + callback?: Callback, + ): Promise { + const name = typeof parameters === 'string' ? parameters : parameters.name; + + const config: RequestConfig = { + url: '/rest/api/2/projectvalidate/validProjectName', + method: 'GET', + params: { + name, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectKeyAndNameValidation.ts b/src/version2/projectKeyAndNameValidation.ts deleted file mode 100644 index 48800ab69..000000000 --- a/src/version2/projectKeyAndNameValidation.ts +++ /dev/null @@ -1,118 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectKeyAndNameValidation { - constructor(private client: Client) {} - - /** - * Validates a project key by confirming the key is a valid string and not in use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async validateProjectKey( - parameters: Parameters.ValidateProjectKey | string | undefined, - callback: Callback, - ): Promise; - /** - * Validates a project key by confirming the key is a valid string and not in use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async validateProjectKey( - parameters?: Parameters.ValidateProjectKey | string, - callback?: never, - ): Promise; - async validateProjectKey( - parameters?: Parameters.ValidateProjectKey | string, - callback?: Callback, - ): Promise { - const key = typeof parameters === 'string' ? parameters : parameters?.key; - - const config: RequestConfig = { - url: '/rest/api/2/projectvalidate/key', - method: 'GET', - params: { - key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getValidProjectKey( - parameters: Parameters.GetValidProjectKey | string | undefined, - callback: Callback, - ): Promise; - /** - * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getValidProjectKey( - parameters?: Parameters.GetValidProjectKey | string, - callback?: never, - ): Promise; - async getValidProjectKey( - parameters?: Parameters.GetValidProjectKey | string, - callback?: Callback, - ): Promise { - const key = typeof parameters === 'string' ? parameters : parameters?.key; - - const config: RequestConfig = { - url: '/rest/api/2/projectvalidate/validProjectKey', - method: 'GET', - params: { - key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in - * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a - * sequence number. If a valid project name cannot be generated, a 404 response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getValidProjectName( - parameters: Parameters.GetValidProjectName | string, - callback: Callback, - ): Promise; - /** - * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in - * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a - * sequence number. If a valid project name cannot be generated, a 404 response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getValidProjectName( - parameters: Parameters.GetValidProjectName | string, - callback?: never, - ): Promise; - async getValidProjectName( - parameters: Parameters.GetValidProjectName | string, - callback?: Callback, - ): Promise { - const name = typeof parameters === 'string' ? parameters : parameters.name; - - const config: RequestConfig = { - url: '/rest/api/2/projectvalidate/validProjectName', - method: 'GET', - params: { - name, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectPermissionSchemes.mts b/src/version2/projectPermissionSchemes.mts new file mode 100644 index 000000000..c7301e6da --- /dev/null +++ b/src/version2/projectPermissionSchemes.mts @@ -0,0 +1,168 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectPermissionSchemes { + constructor(private client: Client) {} + + /** + * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) associated with the project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or the _Administer Projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async getProjectIssueSecurityScheme( + parameters: Parameters.GetProjectIssueSecurityScheme | string, + callback: Callback, + ): Promise; + /** + * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) associated with the project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or the _Administer Projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async getProjectIssueSecurityScheme( + parameters: Parameters.GetProjectIssueSecurityScheme | string, + callback?: never, + ): Promise; + async getProjectIssueSecurityScheme( + parameters: Parameters.GetProjectIssueSecurityScheme | string, + callback?: Callback, + ): Promise { + const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectKeyOrId}/issuesecuritylevelscheme`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) associated with the project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg). + */ + async getAssignedPermissionScheme( + parameters: Parameters.GetAssignedPermissionScheme | string, + callback: Callback, + ): Promise; + /** + * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) associated with the project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg). + */ + async getAssignedPermissionScheme( + parameters: Parameters.GetAssignedPermissionScheme | string, + callback?: never, + ): Promise; + async getAssignedPermissionScheme( + parameters: Parameters.GetAssignedPermissionScheme | string, + callback?: Callback, + ): Promise { + const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectKeyOrId}/permissionscheme`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns a permission scheme with a project. See [Managing project + * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + */ + async assignPermissionScheme( + parameters: Parameters.AssignPermissionScheme, + callback: Callback, + ): Promise; + /** + * Assigns a permission scheme with a project. See [Managing project + * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + */ + async assignPermissionScheme( + parameters: Parameters.AssignPermissionScheme, + callback?: never, + ): Promise; + async assignPermissionScheme( + parameters: Parameters.AssignPermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectKeyOrId}/permissionscheme`, + method: 'PUT', + params: { + expand: parameters.expand, + }, + data: { + id: parameters.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has + * access to. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security + * levels are only returned for authenticated user with _Set Issue Security_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. + */ + async getSecurityLevelsForProject( + parameters: Parameters.GetSecurityLevelsForProject | string, + callback: Callback, + ): Promise; + /** + * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has + * access to. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security + * levels are only returned for authenticated user with _Set Issue Security_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. + */ + async getSecurityLevelsForProject( + parameters: Parameters.GetSecurityLevelsForProject | string, + callback?: never, + ): Promise; + async getSecurityLevelsForProject( + parameters: Parameters.GetSecurityLevelsForProject | string, + callback?: Callback, + ): Promise { + const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectKeyOrId}/securitylevel`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectPermissionSchemes.ts b/src/version2/projectPermissionSchemes.ts deleted file mode 100644 index f0bafaec6..000000000 --- a/src/version2/projectPermissionSchemes.ts +++ /dev/null @@ -1,168 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectPermissionSchemes { - constructor(private client: Client) {} - - /** - * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) associated with the project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or the _Administer Projects_ - * [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getProjectIssueSecurityScheme( - parameters: Parameters.GetProjectIssueSecurityScheme | string, - callback: Callback, - ): Promise; - /** - * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) associated with the project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or the _Administer Projects_ - * [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getProjectIssueSecurityScheme( - parameters: Parameters.GetProjectIssueSecurityScheme | string, - callback?: never, - ): Promise; - async getProjectIssueSecurityScheme( - parameters: Parameters.GetProjectIssueSecurityScheme | string, - callback?: Callback, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectKeyOrId}/issuesecuritylevelscheme`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) associated with the project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getAssignedPermissionScheme( - parameters: Parameters.GetAssignedPermissionScheme | string, - callback: Callback, - ): Promise; - /** - * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) associated with the project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getAssignedPermissionScheme( - parameters: Parameters.GetAssignedPermissionScheme | string, - callback?: never, - ): Promise; - async getAssignedPermissionScheme( - parameters: Parameters.GetAssignedPermissionScheme | string, - callback?: Callback, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectKeyOrId}/permissionscheme`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns a permission scheme with a project. See [Managing project - * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - */ - async assignPermissionScheme( - parameters: Parameters.AssignPermissionScheme, - callback: Callback, - ): Promise; - /** - * Assigns a permission scheme with a project. See [Managing project - * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - */ - async assignPermissionScheme( - parameters: Parameters.AssignPermissionScheme, - callback?: never, - ): Promise; - async assignPermissionScheme( - parameters: Parameters.AssignPermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectKeyOrId}/permissionscheme`, - method: 'PUT', - params: { - expand: parameters.expand, - }, - data: { - id: parameters.id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has - * access to. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security - * levels are only returned for authenticated user with _Set Issue Security_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. - */ - async getSecurityLevelsForProject( - parameters: Parameters.GetSecurityLevelsForProject | string, - callback: Callback, - ): Promise; - /** - * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has - * access to. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security - * levels are only returned for authenticated user with _Set Issue Security_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. - */ - async getSecurityLevelsForProject( - parameters: Parameters.GetSecurityLevelsForProject | string, - callback?: never, - ): Promise; - async getSecurityLevelsForProject( - parameters: Parameters.GetSecurityLevelsForProject | string, - callback?: Callback, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectKeyOrId}/securitylevel`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectProperties.mts b/src/version2/projectProperties.mts new file mode 100644 index 000000000..798e726c5 --- /dev/null +++ b/src/version2/projectProperties.mts @@ -0,0 +1,174 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectProperties { + constructor(private client: Client) {} + + /** + * Returns all [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * keys for the project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectPropertyKeys( + parameters: Parameters.GetProjectPropertyKeys | string, + callback: Callback, + ): Promise; + /** + * Returns all [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * keys for the project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectPropertyKeys( + parameters: Parameters.GetProjectPropertyKeys | string, + callback?: never, + ): Promise; + async getProjectPropertyKeys( + parameters: Parameters.GetProjectPropertyKeys | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. + */ + async getProjectProperty( + parameters: Parameters.GetProjectProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. + */ + async getProjectProperty( + parameters: Parameters.GetProjectProperty, + callback?: never, + ): Promise; + async getProjectProperty( + parameters: Parameters.GetProjectProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of the [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * You can use project properties to store custom data against the project. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the property is created. + */ + async setProjectProperty( + parameters: Parameters.SetProjectProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of the [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * You can use project properties to store custom data against the project. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the property is created. + */ + async setProjectProperty(parameters: Parameters.SetProjectProperty, callback?: never): Promise; + async setProjectProperty( + parameters: Parameters.SetProjectProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the + * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * from a project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. + */ + async deleteProjectProperty( + parameters: Parameters.DeleteProjectProperty, + callback: Callback, + ): Promise; + /** + * Deletes the + * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * from a project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. + */ + async deleteProjectProperty(parameters: Parameters.DeleteProjectProperty, callback?: never): Promise; + async deleteProjectProperty( + parameters: Parameters.DeleteProjectProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectProperties.ts b/src/version2/projectProperties.ts deleted file mode 100644 index 5bbcb290d..000000000 --- a/src/version2/projectProperties.ts +++ /dev/null @@ -1,174 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectProperties { - constructor(private client: Client) {} - - /** - * Returns all [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys for the project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectPropertyKeys( - parameters: Parameters.GetProjectPropertyKeys | string, - callback: Callback, - ): Promise; - /** - * Returns all [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys for the project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectPropertyKeys( - parameters: Parameters.GetProjectPropertyKeys | string, - callback?: never, - ): Promise; - async getProjectPropertyKeys( - parameters: Parameters.GetProjectPropertyKeys | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. - */ - async getProjectProperty( - parameters: Parameters.GetProjectProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. - */ - async getProjectProperty( - parameters: Parameters.GetProjectProperty, - callback?: never, - ): Promise; - async getProjectProperty( - parameters: Parameters.GetProjectProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of the [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * You can use project properties to store custom data against the project. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the property is created. - */ - async setProjectProperty( - parameters: Parameters.SetProjectProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of the [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * You can use project properties to store custom data against the project. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the property is created. - */ - async setProjectProperty(parameters: Parameters.SetProjectProperty, callback?: never): Promise; - async setProjectProperty( - parameters: Parameters.SetProjectProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the - * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * from a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. - */ - async deleteProjectProperty( - parameters: Parameters.DeleteProjectProperty, - callback: Callback, - ): Promise; - /** - * Deletes the - * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * from a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. - */ - async deleteProjectProperty(parameters: Parameters.DeleteProjectProperty, callback?: never): Promise; - async deleteProjectProperty( - parameters: Parameters.DeleteProjectProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectRoleActors.mts b/src/version2/projectRoleActors.mts new file mode 100644 index 000000000..4f4fc9ee7 --- /dev/null +++ b/src/version2/projectRoleActors.mts @@ -0,0 +1,249 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectRoleActors { + constructor(private client: Client) {} + + /** + * Adds actors to a project role for the project. + * + * To replace all actors for the project, use [Set actors for project + * role](#api-rest-api-2-project-projectIdOrKey-role-id-put). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addActorUsers( + parameters: Parameters.AddActorUsers, + callback: Callback, + ): Promise; + /** + * Adds actors to a project role for the project. + * + * To replace all actors for the project, use [Set actors for project + * role](#api-rest-api-2-project-projectIdOrKey-role-id-put). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addActorUsers(parameters: Parameters.AddActorUsers, callback?: never): Promise; + async addActorUsers( + parameters: Parameters.AddActorUsers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'POST', + data: { + user: parameters.user, + group: parameters.group, + groupId: parameters.groupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the actors for a project role for a project, replacing all existing actors. + * + * To add actors to the project without overwriting the existing list, use [Add actors to project + * role](#api-rest-api-2-project-projectIdOrKey-role-id-post). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setActors(parameters: Parameters.SetActors, callback: Callback): Promise; + /** + * Sets the actors for a project role for a project, replacing all existing actors. + * + * To add actors to the project without overwriting the existing list, use [Add actors to project + * role](#api-rest-api-2-project-projectIdOrKey-role-id-post). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setActors(parameters: Parameters.SetActors, callback?: never): Promise; + async setActors(parameters: Parameters.SetActors, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'PUT', + data: { + categorisedActors: parameters.categorisedActors, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes actors from a project role for the project. + * + * To remove default actors from the project role, use [Delete default actors from project + * role](#api-rest-api-2-role-id-actors-delete). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteActor(parameters: Parameters.DeleteActor, callback: Callback): Promise; + /** + * Deletes actors from a project role for the project. + * + * To remove default actors from the project role, use [Delete default actors from project + * role](#api-rest-api-2-role-id-actors-delete). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteActor(parameters: Parameters.DeleteActor, callback?: never): Promise; + async deleteActor(parameters: Parameters.DeleteActor, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'DELETE', + params: { + user: parameters.user, + group: parameters.group, + groupId: parameters.groupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the [default actors](#api-rest-api-2-resolution-get) for the project role. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoleActorsForRole( + parameters: Parameters.GetProjectRoleActorsForRole | string, + callback: Callback, + ): Promise; + /** + * Returns the [default actors](#api-rest-api-2-resolution-get) for the project role. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoleActorsForRole( + parameters: Parameters.GetProjectRoleActorsForRole | string, + callback?: never, + ): Promise; + async getProjectRoleActorsForRole( + parameters: Parameters.GetProjectRoleActorsForRole | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/role/${id}/actors`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds [default actors](#api-rest-api-2-resolution-get) to a role. You may add groups or users, but you cannot add + * groups and users in the same request. + * + * Changing a project role's default actors does not affect project role members for projects already created. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addProjectRoleActorsToRole( + parameters: Parameters.AddProjectRoleActorsToRole, + callback: Callback, + ): Promise; + /** + * Adds [default actors](#api-rest-api-2-resolution-get) to a role. You may add groups or users, but you cannot add + * groups and users in the same request. + * + * Changing a project role's default actors does not affect project role members for projects already created. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addProjectRoleActorsToRole( + parameters: Parameters.AddProjectRoleActorsToRole, + callback?: never, + ): Promise; + async addProjectRoleActorsToRole( + parameters: Parameters.AddProjectRoleActorsToRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/role/${parameters.id}/actors`, + method: 'POST', + data: { + user: parameters.user, + groupId: parameters.groupId, + group: parameters.group, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the [default actors](#api-rest-api-2-resolution-get) from a project role. You may delete a group or user, + * but you cannot delete a group and a user in the same request. + * + * Changing a project role's default actors does not affect project role members for projects already created. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectRoleActorsFromRole( + parameters: Parameters.DeleteProjectRoleActorsFromRole, + callback: Callback, + ): Promise; + /** + * Deletes the [default actors](#api-rest-api-2-resolution-get) from a project role. You may delete a group or user, + * but you cannot delete a group and a user in the same request. + * + * Changing a project role's default actors does not affect project role members for projects already created. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectRoleActorsFromRole( + parameters: Parameters.DeleteProjectRoleActorsFromRole, + callback?: never, + ): Promise; + async deleteProjectRoleActorsFromRole( + parameters: Parameters.DeleteProjectRoleActorsFromRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/role/${parameters.id}/actors`, + method: 'DELETE', + params: { + user: parameters.user, + groupId: parameters.groupId, + group: parameters.group, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectRoleActors.ts b/src/version2/projectRoleActors.ts deleted file mode 100644 index 4f45e75b4..000000000 --- a/src/version2/projectRoleActors.ts +++ /dev/null @@ -1,249 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectRoleActors { - constructor(private client: Client) {} - - /** - * Adds actors to a project role for the project. - * - * To replace all actors for the project, use [Set actors for project - * role](#api-rest-api-2-project-projectIdOrKey-role-id-put). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addActorUsers( - parameters: Parameters.AddActorUsers, - callback: Callback, - ): Promise; - /** - * Adds actors to a project role for the project. - * - * To replace all actors for the project, use [Set actors for project - * role](#api-rest-api-2-project-projectIdOrKey-role-id-put). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addActorUsers(parameters: Parameters.AddActorUsers, callback?: never): Promise; - async addActorUsers( - parameters: Parameters.AddActorUsers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, - method: 'POST', - data: { - user: parameters.user, - group: parameters.group, - groupId: parameters.groupId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the actors for a project role for a project, replacing all existing actors. - * - * To add actors to the project without overwriting the existing list, use [Add actors to project - * role](#api-rest-api-2-project-projectIdOrKey-role-id-post). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setActors(parameters: Parameters.SetActors, callback: Callback): Promise; - /** - * Sets the actors for a project role for a project, replacing all existing actors. - * - * To add actors to the project without overwriting the existing list, use [Add actors to project - * role](#api-rest-api-2-project-projectIdOrKey-role-id-post). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setActors(parameters: Parameters.SetActors, callback?: never): Promise; - async setActors(parameters: Parameters.SetActors, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, - method: 'PUT', - data: { - categorisedActors: parameters.categorisedActors, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes actors from a project role for the project. - * - * To remove default actors from the project role, use [Delete default actors from project - * role](#api-rest-api-2-role-id-actors-delete). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteActor(parameters: Parameters.DeleteActor, callback: Callback): Promise; - /** - * Deletes actors from a project role for the project. - * - * To remove default actors from the project role, use [Delete default actors from project - * role](#api-rest-api-2-role-id-actors-delete). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteActor(parameters: Parameters.DeleteActor, callback?: never): Promise; - async deleteActor(parameters: Parameters.DeleteActor, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, - method: 'DELETE', - params: { - user: parameters.user, - group: parameters.group, - groupId: parameters.groupId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the [default actors](#api-rest-api-2-resolution-get) for the project role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleActorsForRole( - parameters: Parameters.GetProjectRoleActorsForRole | string, - callback: Callback, - ): Promise; - /** - * Returns the [default actors](#api-rest-api-2-resolution-get) for the project role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleActorsForRole( - parameters: Parameters.GetProjectRoleActorsForRole | string, - callback?: never, - ): Promise; - async getProjectRoleActorsForRole( - parameters: Parameters.GetProjectRoleActorsForRole | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/role/${id}/actors`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds [default actors](#api-rest-api-2-resolution-get) to a role. You may add groups or users, but you cannot add - * groups and users in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addProjectRoleActorsToRole( - parameters: Parameters.AddProjectRoleActorsToRole, - callback: Callback, - ): Promise; - /** - * Adds [default actors](#api-rest-api-2-resolution-get) to a role. You may add groups or users, but you cannot add - * groups and users in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addProjectRoleActorsToRole( - parameters: Parameters.AddProjectRoleActorsToRole, - callback?: never, - ): Promise; - async addProjectRoleActorsToRole( - parameters: Parameters.AddProjectRoleActorsToRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/role/${parameters.id}/actors`, - method: 'POST', - data: { - user: parameters.user, - groupId: parameters.groupId, - group: parameters.group, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the [default actors](#api-rest-api-2-resolution-get) from a project role. You may delete a group or user, - * but you cannot delete a group and a user in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRoleActorsFromRole( - parameters: Parameters.DeleteProjectRoleActorsFromRole, - callback: Callback, - ): Promise; - /** - * Deletes the [default actors](#api-rest-api-2-resolution-get) from a project role. You may delete a group or user, - * but you cannot delete a group and a user in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRoleActorsFromRole( - parameters: Parameters.DeleteProjectRoleActorsFromRole, - callback?: never, - ): Promise; - async deleteProjectRoleActorsFromRole( - parameters: Parameters.DeleteProjectRoleActorsFromRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/role/${parameters.id}/actors`, - method: 'DELETE', - params: { - user: parameters.user, - groupId: parameters.groupId, - group: parameters.group, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectRoles.mts b/src/version2/projectRoles.mts new file mode 100644 index 000000000..364800cd5 --- /dev/null +++ b/src/version2/projectRoles.mts @@ -0,0 +1,422 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectRoles { + constructor(private client: Client) {} + + /** + * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and + * self URL for each role. + * + * Note that all project roles are shared with all projects in Jira Cloud. See [Get all project + * roles](#api-rest-api-2-role-get) for more information. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site + * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoles>( + parameters: Parameters.GetProjectRoles | string, + callback: Callback, + ): Promise; + /** + * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and + * self URL for each role. + * + * Note that all project roles are shared with all projects in Jira Cloud. See [Get all project + * roles](#api-rest-api-2-role-get) for more information. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site + * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoles>( + parameters: Parameters.GetProjectRoles | string, + callback?: never, + ): Promise; + async getProjectRoles>( + parameters: Parameters.GetProjectRoles | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/role`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a project role's details and actors associated with the project. The list of actors is sorted by display + * name. + * + * To check whether a user belongs to a role based on their group memberships, use [Get + * user](#api-rest-api-2-user-get) with the `groups` expand parameter selected. Then check whether the user keys and + * groups match with the actors returned for the project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRole( + parameters: Parameters.GetProjectRole, + callback: Callback, + ): Promise; + /** + * Returns a project role's details and actors associated with the project. The list of actors is sorted by display + * name. + * + * To check whether a user belongs to a role based on their group memberships, use [Get + * user](#api-rest-api-2-user-get) with the `groups` expand parameter selected. Then check whether the user keys and + * groups match with the actors returned for the project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRole(parameters: Parameters.GetProjectRole, callback?: never): Promise; + async getProjectRole( + parameters: Parameters.GetProjectRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'GET', + params: { + excludeInactiveUsers: parameters.excludeInactiveUsers, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the + * list of project roles is common to all projects. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectRoleDetails( + parameters: Parameters.GetProjectRoleDetails | string, + callback: Callback, + ): Promise; + /** + * Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the + * list of project roles is common to all projects. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectRoleDetails( + parameters: Parameters.GetProjectRoleDetails | string, + callback?: never, + ): Promise; + async getProjectRoleDetails( + parameters: Parameters.GetProjectRoleDetails | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/roledetails`, + method: 'GET', + params: { + currentMember: typeof parameters !== 'string' && parameters.currentMember, + excludeConnectAddons: typeof parameters !== 'string' && parameters.excludeConnectAddons, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets a list of all project roles, complete with project role details and default actors. + * + * ### About project roles + * + * [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with + * projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have + * a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira + * applications). + * + * Project roles are used in [permission schemes](#api-rest-api-2-permissionscheme-get), [email notification + * schemes](#api-rest-api-2-notificationscheme-get), [issue security + * levels](#api-rest-api-2-issuesecurityschemes-get), [comment visibility](#api-rest-api-2-comment-list-post), and + * workflow conditions. + * + * #### Members and actors + * + * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated + * with a project role. + * + * Actors may be set as [default + * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) + * of the project role or set at the project level: + * + * - Default actors: Users and groups that are assigned to the project role for all newly created projects. The default + * actors can be removed at the project level later if desired. + * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default + * actors. This enables you to assign a user to different roles in different projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllProjectRoles(callback: Callback): Promise; + /** + * Gets a list of all project roles, complete with project role details and default actors. + * + * ### About project roles + * + * [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with + * projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have + * a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira + * applications). + * + * Project roles are used in [permission schemes](#api-rest-api-2-permissionscheme-get), [email notification + * schemes](#api-rest-api-2-notificationscheme-get), [issue security + * levels](#api-rest-api-2-issuesecurityschemes-get), [comment visibility](#api-rest-api-2-comment-list-post), and + * workflow conditions. + * + * #### Members and actors + * + * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated + * with a project role. + * + * Actors may be set as [default + * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) + * of the project role or set at the project level: + * + * - Default actors: Users and groups that are assigned to the project role for all newly created projects. The default + * actors can be removed at the project level later if desired. + * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default + * actors. This enables you to assign a user to different roles in different projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllProjectRoles(callback?: never): Promise; + async getAllProjectRoles(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/role', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a new project role with no [default actors](#api-rest-api-2-resolution-get). You can use the [Add default + * actors to project role](#api-rest-api-2-role-id-actors-post) operation to add default actors to the project role + * after creating it. + * + * _Note that although a new project role is available to all projects upon creation, any default actors that are + * associated with the project role are not added to projects that existed prior to the role being created._< + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProjectRole( + parameters: Parameters.CreateProjectRole, + callback: Callback, + ): Promise; + /** + * Creates a new project role with no [default actors](#api-rest-api-2-resolution-get). You can use the [Add default + * actors to project role](#api-rest-api-2-role-id-actors-post) operation to add default actors to the project role + * after creating it. + * + * _Note that although a new project role is available to all projects upon creation, any default actors that are + * associated with the project role are not added to projects that existed prior to the role being created._< + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProjectRole( + parameters: Parameters.CreateProjectRole, + callback?: never, + ): Promise; + async createProjectRole( + parameters: Parameters.CreateProjectRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/role', + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets the project role details and the default actors associated with the role. The list of default actors is sorted + * by display name. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoleById( + parameters: Parameters.GetProjectRoleById | string, + callback: Callback, + ): Promise; + /** + * Gets the project role details and the default actors associated with the role. The list of default actors is sorted + * by display name. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoleById( + parameters: Parameters.GetProjectRoleById | string, + callback?: never, + ): Promise; + async getProjectRoleById( + parameters: Parameters.GetProjectRoleById | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/role/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates either the project role's name or its description. + * + * You cannot update both the name and description at the same time using this operation. If you send a request with a + * name and a description only the name is updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async partialUpdateProjectRole( + parameters: Parameters.PartialUpdateProjectRole, + callback: Callback, + ): Promise; + /** + * Updates either the project role's name or its description. + * + * You cannot update both the name and description at the same time using this operation. If you send a request with a + * name and a description only the name is updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async partialUpdateProjectRole( + parameters: Parameters.PartialUpdateProjectRole, + callback?: never, + ): Promise; + async partialUpdateProjectRole( + parameters: Parameters.PartialUpdateProjectRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/role/${parameters.id}`, + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the project role's name and description. You must include both a name and a description in the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async fullyUpdateProjectRole( + parameters: Parameters.FullyUpdateProjectRole, + callback: Callback, + ): Promise; + /** + * Updates the project role's name and description. You must include both a name and a description in the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async fullyUpdateProjectRole( + parameters: Parameters.FullyUpdateProjectRole, + callback?: never, + ): Promise; + async fullyUpdateProjectRole( + parameters: Parameters.FullyUpdateProjectRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/role/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in + * use. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectRole( + parameters: Parameters.DeleteProjectRole | string, + callback: Callback, + ): Promise; + /** + * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in + * use. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectRole(parameters: Parameters.DeleteProjectRole | string, callback?: never): Promise; + async deleteProjectRole( + parameters: Parameters.DeleteProjectRole | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/role/${id}`, + method: 'DELETE', + params: { + swap: typeof parameters !== 'string' && parameters.swap, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectRoles.ts b/src/version2/projectRoles.ts deleted file mode 100644 index 91efea554..000000000 --- a/src/version2/projectRoles.ts +++ /dev/null @@ -1,422 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectRoles { - constructor(private client: Client) {} - - /** - * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and - * self URL for each role. - * - * Note that all project roles are shared with all projects in Jira Cloud. See [Get all project - * roles](#api-rest-api-2-role-get) for more information. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site - * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoles>( - parameters: Parameters.GetProjectRoles | string, - callback: Callback, - ): Promise; - /** - * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and - * self URL for each role. - * - * Note that all project roles are shared with all projects in Jira Cloud. See [Get all project - * roles](#api-rest-api-2-role-get) for more information. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site - * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoles>( - parameters: Parameters.GetProjectRoles | string, - callback?: never, - ): Promise; - async getProjectRoles>( - parameters: Parameters.GetProjectRoles | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/role`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a project role's details and actors associated with the project. The list of actors is sorted by display - * name. - * - * To check whether a user belongs to a role based on their group memberships, use [Get - * user](#api-rest-api-2-user-get) with the `groups` expand parameter selected. Then check whether the user keys and - * groups match with the actors returned for the project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRole( - parameters: Parameters.GetProjectRole, - callback: Callback, - ): Promise; - /** - * Returns a project role's details and actors associated with the project. The list of actors is sorted by display - * name. - * - * To check whether a user belongs to a role based on their group memberships, use [Get - * user](#api-rest-api-2-user-get) with the `groups` expand parameter selected. Then check whether the user keys and - * groups match with the actors returned for the project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRole(parameters: Parameters.GetProjectRole, callback?: never): Promise; - async getProjectRole( - parameters: Parameters.GetProjectRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, - method: 'GET', - params: { - excludeInactiveUsers: parameters.excludeInactiveUsers, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the - * list of project roles is common to all projects. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, - callback: Callback, - ): Promise; - /** - * Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the - * list of project roles is common to all projects. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, - callback?: never, - ): Promise; - async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/roledetails`, - method: 'GET', - params: { - currentMember: typeof parameters !== 'string' && parameters.currentMember, - excludeConnectAddons: typeof parameters !== 'string' && parameters.excludeConnectAddons, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets a list of all project roles, complete with project role details and default actors. - * - * ### About project roles - * - * [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with - * projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have - * a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira - * applications). - * - * Project roles are used in [permission schemes](#api-rest-api-2-permissionscheme-get), [email notification - * schemes](#api-rest-api-2-notificationscheme-get), [issue security - * levels](#api-rest-api-2-issuesecurityschemes-get), [comment visibility](#api-rest-api-2-comment-list-post), and - * workflow conditions. - * - * #### Members and actors - * - * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated - * with a project role. - * - * Actors may be set as [default - * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) - * of the project role or set at the project level: - * - * - Default actors: Users and groups that are assigned to the project role for all newly created projects. The default - * actors can be removed at the project level later if desired. - * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default - * actors. This enables you to assign a user to different roles in different projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllProjectRoles(callback: Callback): Promise; - /** - * Gets a list of all project roles, complete with project role details and default actors. - * - * ### About project roles - * - * [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with - * projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have - * a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira - * applications). - * - * Project roles are used in [permission schemes](#api-rest-api-2-permissionscheme-get), [email notification - * schemes](#api-rest-api-2-notificationscheme-get), [issue security - * levels](#api-rest-api-2-issuesecurityschemes-get), [comment visibility](#api-rest-api-2-comment-list-post), and - * workflow conditions. - * - * #### Members and actors - * - * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated - * with a project role. - * - * Actors may be set as [default - * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) - * of the project role or set at the project level: - * - * - Default actors: Users and groups that are assigned to the project role for all newly created projects. The default - * actors can be removed at the project level later if desired. - * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default - * actors. This enables you to assign a user to different roles in different projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllProjectRoles(callback?: never): Promise; - async getAllProjectRoles(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/role', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a new project role with no [default actors](#api-rest-api-2-resolution-get). You can use the [Add default - * actors to project role](#api-rest-api-2-role-id-actors-post) operation to add default actors to the project role - * after creating it. - * - * _Note that although a new project role is available to all projects upon creation, any default actors that are - * associated with the project role are not added to projects that existed prior to the role being created._< - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectRole( - parameters: Parameters.CreateProjectRole, - callback: Callback, - ): Promise; - /** - * Creates a new project role with no [default actors](#api-rest-api-2-resolution-get). You can use the [Add default - * actors to project role](#api-rest-api-2-role-id-actors-post) operation to add default actors to the project role - * after creating it. - * - * _Note that although a new project role is available to all projects upon creation, any default actors that are - * associated with the project role are not added to projects that existed prior to the role being created._< - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectRole( - parameters: Parameters.CreateProjectRole, - callback?: never, - ): Promise; - async createProjectRole( - parameters: Parameters.CreateProjectRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/role', - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets the project role details and the default actors associated with the role. The list of default actors is sorted - * by display name. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, - callback: Callback, - ): Promise; - /** - * Gets the project role details and the default actors associated with the role. The list of default actors is sorted - * by display name. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, - callback?: never, - ): Promise; - async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/role/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates either the project role's name or its description. - * - * You cannot update both the name and description at the same time using this operation. If you send a request with a - * name and a description only the name is updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async partialUpdateProjectRole( - parameters: Parameters.PartialUpdateProjectRole, - callback: Callback, - ): Promise; - /** - * Updates either the project role's name or its description. - * - * You cannot update both the name and description at the same time using this operation. If you send a request with a - * name and a description only the name is updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async partialUpdateProjectRole( - parameters: Parameters.PartialUpdateProjectRole, - callback?: never, - ): Promise; - async partialUpdateProjectRole( - parameters: Parameters.PartialUpdateProjectRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/role/${parameters.id}`, - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the project role's name and description. You must include both a name and a description in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async fullyUpdateProjectRole( - parameters: Parameters.FullyUpdateProjectRole, - callback: Callback, - ): Promise; - /** - * Updates the project role's name and description. You must include both a name and a description in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async fullyUpdateProjectRole( - parameters: Parameters.FullyUpdateProjectRole, - callback?: never, - ): Promise; - async fullyUpdateProjectRole( - parameters: Parameters.FullyUpdateProjectRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/role/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in - * use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRole( - parameters: Parameters.DeleteProjectRole | string, - callback: Callback, - ): Promise; - /** - * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in - * use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRole(parameters: Parameters.DeleteProjectRole | string, callback?: never): Promise; - async deleteProjectRole( - parameters: Parameters.DeleteProjectRole | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/role/${id}`, - method: 'DELETE', - params: { - swap: typeof parameters !== 'string' && parameters.swap, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectTypes.mts b/src/version2/projectTypes.mts new file mode 100644 index 000000000..bd44ec697 --- /dev/null +++ b/src/version2/projectTypes.mts @@ -0,0 +1,119 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectTypes { + constructor(private client: Client) {} + + /** + * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid + * license for each type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllProjectTypes(callback: Callback): Promise; + /** + * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid + * license for each type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllProjectTypes(callback?: never): Promise; + async getAllProjectTypes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/project/type', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ + async getAllAccessibleProjectTypes(callback: Callback): Promise; + /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ + async getAllAccessibleProjectTypes(callback?: never): Promise; + async getAllAccessibleProjectTypes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/project/type/accessible', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getProjectTypeByKey( + parameters: Parameters.GetProjectTypeByKey | string, + callback: Callback, + ): Promise; + /** + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getProjectTypeByKey( + parameters: Parameters.GetProjectTypeByKey | string, + callback?: never, + ): Promise; + async getProjectTypeByKey( + parameters: Parameters.GetProjectTypeByKey | string, + callback?: Callback, + ): Promise { + const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/type/${projectTypeKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAccessibleProjectTypeByKey( + parameters: Parameters.GetAccessibleProjectTypeByKey | string, + callback: Callback, + ): Promise; + /** + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAccessibleProjectTypeByKey( + parameters: Parameters.GetAccessibleProjectTypeByKey | string, + callback?: never, + ): Promise; + async getAccessibleProjectTypeByKey( + parameters: Parameters.GetAccessibleProjectTypeByKey | string, + callback?: Callback, + ): Promise { + const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/type/${projectTypeKey}/accessible`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectTypes.ts b/src/version2/projectTypes.ts deleted file mode 100644 index 02b07670f..000000000 --- a/src/version2/projectTypes.ts +++ /dev/null @@ -1,119 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectTypes { - constructor(private client: Client) {} - - /** - * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid - * license for each type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllProjectTypes(callback: Callback): Promise; - /** - * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid - * license for each type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllProjectTypes(callback?: never): Promise; - async getAllProjectTypes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/project/type', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ - async getAllAccessibleProjectTypes(callback: Callback): Promise; - /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ - async getAllAccessibleProjectTypes(callback?: never): Promise; - async getAllAccessibleProjectTypes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/project/type/accessible', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getProjectTypeByKey( - parameters: Parameters.GetProjectTypeByKey | string, - callback: Callback, - ): Promise; - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getProjectTypeByKey( - parameters: Parameters.GetProjectTypeByKey | string, - callback?: never, - ): Promise; - async getProjectTypeByKey( - parameters: Parameters.GetProjectTypeByKey | string, - callback?: Callback, - ): Promise { - const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/type/${projectTypeKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAccessibleProjectTypeByKey( - parameters: Parameters.GetAccessibleProjectTypeByKey | string, - callback: Callback, - ): Promise; - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAccessibleProjectTypeByKey( - parameters: Parameters.GetAccessibleProjectTypeByKey | string, - callback?: never, - ): Promise; - async getAccessibleProjectTypeByKey( - parameters: Parameters.GetAccessibleProjectTypeByKey | string, - callback?: Callback, - ): Promise { - const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/type/${projectTypeKey}/accessible`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectVersions.mts b/src/version2/projectVersions.mts new file mode 100644 index 000000000..2abd8c916 --- /dev/null +++ b/src/version2/projectVersions.mts @@ -0,0 +1,439 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectVersions { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * versions in a project. See the [Get project versions](#api-rest-api-2-project-projectIdOrKey-versions-get) resource + * if you want to get a full list of versions without pagination. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectVersionsPaginated( + parameters: Parameters.GetProjectVersionsPaginated | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * versions in a project. See the [Get project versions](#api-rest-api-2-project-projectIdOrKey-versions-get) resource + * if you want to get a full list of versions without pagination. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectVersionsPaginated( + parameters: Parameters.GetProjectVersionsPaginated | string, + callback?: never, + ): Promise; + async getProjectVersionsPaginated( + parameters: Parameters.GetProjectVersionsPaginated | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/version`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + orderBy: typeof parameters !== 'string' && parameters.orderBy, + query: typeof parameters !== 'string' && parameters.query, + status: typeof parameters !== 'string' && parameters.status, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all versions in a project. The response is not paginated. Use [Get project versions + * paginated](#api-rest-api-2-project-projectIdOrKey-version-get) if you want to get the versions in a project with + * pagination. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectVersions( + parameters: Parameters.GetProjectVersions | string, + callback: Callback, + ): Promise; + /** + * Returns all versions in a project. The response is not paginated. Use [Get project versions + * paginated](#api-rest-api-2-project-projectIdOrKey-version-get) if you want to get the versions in a project with + * pagination. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectVersions( + parameters: Parameters.GetProjectVersions | string, + callback?: never, + ): Promise; + async getProjectVersions( + parameters: Parameters.GetProjectVersions | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/versions`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project the version is added to. + */ + async createVersion(parameters: Parameters.CreateVersion, callback: Callback): Promise; + /** + * Creates a project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project the version is added to. + */ + async createVersion(parameters: Parameters.CreateVersion, callback?: never): Promise; + async createVersion( + parameters: Parameters.CreateVersion, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/version', + method: 'POST', + data: { + expand: parameters.expand, + self: parameters.self, + id: parameters.id, + description: parameters.description, + name: parameters.name, + archived: parameters.archived, + released: parameters.released, + startDate: parameters.startDate, + releaseDate: parameters.releaseDate, + overdue: parameters.overdue, + userStartDate: parameters.userStartDate, + userReleaseDate: parameters.userReleaseDate, + projectId: parameters.projectId, + moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, + operations: parameters.operations, + issuesStatusForFixVersion: parameters.issuesStatusForFixVersion, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the version. + */ + async getVersion( + parameters: Parameters.GetVersion | string, + callback: Callback, + ): Promise; + /** + * Returns a project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the version. + */ + async getVersion(parameters: Parameters.GetVersion | string, callback?: never): Promise; + async getVersion( + parameters: Parameters.GetVersion | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/version/${id}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + */ + async updateVersion(parameters: Parameters.UpdateVersion, callback: Callback): Promise; + /** + * Updates a project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + */ + async updateVersion(parameters: Parameters.UpdateVersion, callback?: never): Promise; + async updateVersion( + parameters: Parameters.UpdateVersion, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.id}`, + method: 'PUT', + data: { + expand: parameters.expand, + description: parameters.description, + name: parameters.name, + archived: parameters.archived, + released: parameters.released, + startDate: parameters.startDate, + releaseDate: parameters.releaseDate, + projectId: parameters.projectId, + moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any + * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. + * + * Consider using [ Delete and replace version](#api-rest-api-2-version-id-removeAndSwap-post) instead. This resource + * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + */ + async mergeVersions(parameters: Parameters.MergeVersions, callback: Callback): Promise; + /** + * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any + * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. + * + * Consider using [ Delete and replace version](#api-rest-api-2-version-id-removeAndSwap-post) instead. This resource + * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + */ + async mergeVersions(parameters: Parameters.MergeVersions, callback?: never): Promise; + async mergeVersions(parameters: Parameters.MergeVersions, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.id}/mergeto/${parameters.moveIssuesTo}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async moveVersion(parameters: Parameters.MoveVersion, callback: Callback): Promise; + /** + * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async moveVersion(parameters: Parameters.MoveVersion, callback?: never): Promise; + async moveVersion(parameters: Parameters.MoveVersion, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.id}/move`, + method: 'POST', + data: { + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the following counts for a version: + * + * - Number of issues where the `fixVersion` is set to the version. + * - Number of issues where the `affectedVersion` is set to the version. + * - Number of issues where a version custom field is set to the version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async getVersionRelatedIssues( + parameters: Parameters.GetVersionRelatedIssues | string, + callback: Callback, + ): Promise; + /** + * Returns the following counts for a version: + * + * - Number of issues where the `fixVersion` is set to the version. + * - Number of issues where the `affectedVersion` is set to the version. + * - Number of issues where a version custom field is set to the version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async getVersionRelatedIssues( + parameters: Parameters.GetVersionRelatedIssues | string, + callback?: never, + ): Promise; + async getVersionRelatedIssues( + parameters: Parameters.GetVersionRelatedIssues | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/version/${id}/relatedIssueCounts`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project version. + * + * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, + * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of + * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are + * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version + * being deleted. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + */ + async deleteAndReplaceVersion( + parameters: Parameters.DeleteAndReplaceVersion, + callback: Callback, + ): Promise; + /** + * Deletes a project version. + * + * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, + * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of + * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are + * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version + * being deleted. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + */ + async deleteAndReplaceVersion(parameters: Parameters.DeleteAndReplaceVersion, callback?: never): Promise; + async deleteAndReplaceVersion( + parameters: Parameters.DeleteAndReplaceVersion, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.id}/removeAndSwap`, + method: 'POST', + data: { + moveFixIssuesTo: parameters.moveFixIssuesTo, + moveAffectedIssuesTo: parameters.moveAffectedIssuesTo, + customFieldReplacementList: parameters.customFieldReplacementList, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns counts of the issues and unresolved issues for the project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async getVersionUnresolvedIssues( + parameters: Parameters.GetVersionUnresolvedIssues | string, + callback: Callback, + ): Promise; + /** + * Returns counts of the issues and unresolved issues for the project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async getVersionUnresolvedIssues( + parameters: Parameters.GetVersionUnresolvedIssues | string, + callback?: never, + ): Promise; + async getVersionUnresolvedIssues( + parameters: Parameters.GetVersionUnresolvedIssues | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/version/${id}/unresolvedIssueCount`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectVersions.ts b/src/version2/projectVersions.ts deleted file mode 100644 index c27850359..000000000 --- a/src/version2/projectVersions.ts +++ /dev/null @@ -1,439 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectVersions { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * versions in a project. See the [Get project versions](#api-rest-api-2-project-projectIdOrKey-versions-get) resource - * if you want to get a full list of versions without pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * versions in a project. See the [Get project versions](#api-rest-api-2-project-projectIdOrKey-versions-get) resource - * if you want to get a full list of versions without pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, - callback?: never, - ): Promise; - async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/version`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - orderBy: typeof parameters !== 'string' && parameters.orderBy, - query: typeof parameters !== 'string' && parameters.query, - status: typeof parameters !== 'string' && parameters.status, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all versions in a project. The response is not paginated. Use [Get project versions - * paginated](#api-rest-api-2-project-projectIdOrKey-version-get) if you want to get the versions in a project with - * pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectVersions( - parameters: Parameters.GetProjectVersions | string, - callback: Callback, - ): Promise; - /** - * Returns all versions in a project. The response is not paginated. Use [Get project versions - * paginated](#api-rest-api-2-project-projectIdOrKey-version-get) if you want to get the versions in a project with - * pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectVersions( - parameters: Parameters.GetProjectVersions | string, - callback?: never, - ): Promise; - async getProjectVersions( - parameters: Parameters.GetProjectVersions | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/versions`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project the version is added to. - */ - async createVersion(parameters: Parameters.CreateVersion, callback: Callback): Promise; - /** - * Creates a project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project the version is added to. - */ - async createVersion(parameters: Parameters.CreateVersion, callback?: never): Promise; - async createVersion( - parameters: Parameters.CreateVersion, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/version', - method: 'POST', - data: { - expand: parameters.expand, - self: parameters.self, - id: parameters.id, - description: parameters.description, - name: parameters.name, - archived: parameters.archived, - released: parameters.released, - startDate: parameters.startDate, - releaseDate: parameters.releaseDate, - overdue: parameters.overdue, - userStartDate: parameters.userStartDate, - userReleaseDate: parameters.userReleaseDate, - projectId: parameters.projectId, - moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, - operations: parameters.operations, - issuesStatusForFixVersion: parameters.issuesStatusForFixVersion, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the version. - */ - async getVersion( - parameters: Parameters.GetVersion | string, - callback: Callback, - ): Promise; - /** - * Returns a project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the version. - */ - async getVersion(parameters: Parameters.GetVersion | string, callback?: never): Promise; - async getVersion( - parameters: Parameters.GetVersion | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/version/${id}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. - */ - async updateVersion(parameters: Parameters.UpdateVersion, callback: Callback): Promise; - /** - * Updates a project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. - */ - async updateVersion(parameters: Parameters.UpdateVersion, callback?: never): Promise; - async updateVersion( - parameters: Parameters.UpdateVersion, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/version/${parameters.id}`, - method: 'PUT', - data: { - expand: parameters.expand, - description: parameters.description, - name: parameters.name, - archived: parameters.archived, - released: parameters.released, - startDate: parameters.startDate, - releaseDate: parameters.releaseDate, - projectId: parameters.projectId, - moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any - * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. - * - * Consider using [ Delete and replace version](#api-rest-api-2-version-id-removeAndSwap-post) instead. This resource - * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. - */ - async mergeVersions(parameters: Parameters.MergeVersions, callback: Callback): Promise; - /** - * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any - * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. - * - * Consider using [ Delete and replace version](#api-rest-api-2-version-id-removeAndSwap-post) instead. This resource - * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. - */ - async mergeVersions(parameters: Parameters.MergeVersions, callback?: never): Promise; - async mergeVersions(parameters: Parameters.MergeVersions, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/version/${parameters.id}/mergeto/${parameters.moveIssuesTo}`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async moveVersion(parameters: Parameters.MoveVersion, callback: Callback): Promise; - /** - * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async moveVersion(parameters: Parameters.MoveVersion, callback?: never): Promise; - async moveVersion(parameters: Parameters.MoveVersion, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/version/${parameters.id}/move`, - method: 'POST', - data: { - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the following counts for a version: - * - * - Number of issues where the `fixVersion` is set to the version. - * - Number of issues where the `affectedVersion` is set to the version. - * - Number of issues where a version custom field is set to the version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, - callback: Callback, - ): Promise; - /** - * Returns the following counts for a version: - * - * - Number of issues where the `fixVersion` is set to the version. - * - Number of issues where the `affectedVersion` is set to the version. - * - Number of issues where a version custom field is set to the version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, - callback?: never, - ): Promise; - async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/version/${id}/relatedIssueCounts`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project version. - * - * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, - * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of - * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are - * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version - * being deleted. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. - */ - async deleteAndReplaceVersion( - parameters: Parameters.DeleteAndReplaceVersion, - callback: Callback, - ): Promise; - /** - * Deletes a project version. - * - * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, - * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of - * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are - * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version - * being deleted. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. - */ - async deleteAndReplaceVersion(parameters: Parameters.DeleteAndReplaceVersion, callback?: never): Promise; - async deleteAndReplaceVersion( - parameters: Parameters.DeleteAndReplaceVersion, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/version/${parameters.id}/removeAndSwap`, - method: 'POST', - data: { - moveFixIssuesTo: parameters.moveFixIssuesTo, - moveAffectedIssuesTo: parameters.moveAffectedIssuesTo, - customFieldReplacementList: parameters.customFieldReplacementList, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns counts of the issues and unresolved issues for the project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, - callback: Callback, - ): Promise; - /** - * Returns counts of the issues and unresolved issues for the project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, - callback?: never, - ): Promise; - async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/version/${id}/unresolvedIssueCount`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projects.mts b/src/version2/projects.mts new file mode 100644 index 000000000..543e49554 --- /dev/null +++ b/src/version2/projects.mts @@ -0,0 +1,565 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Projects { + constructor(private client: Client) {} + + /** + * Creates a project based on a project type template, as shown in the following table: + * + * | Project Type Key | Project Template Key | + * | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | + * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-finance-service-desk`, `com.atlassian.servicedesk:next-gen-it-service-desk`, `com.atlassian.servicedesk:next-gen-hr-service-desk`, `com.atlassian.servicedesk:next-gen-legal-service-desk`, `com.atlassian.servicedesk:next-gen-marketing-service-desk`, `com.atlassian.servicedesk:next-gen-facilities-service-desk`, `com.atlassian.servicedesk:next-gen-general-service-desk`, `com.atlassian.servicedesk:next-gen-general-it-service-desk`, `com.atlassian.servicedesk:next-gen-general-business-service-desk`, `com.atlassian.servicedesk:next-gen-analytics-service-desk`, `com.atlassian.servicedesk:next-gen-finance-service-desk`, `com.atlassian.servicedesk:next-gen-design-service-desk`, `com.atlassian.servicedesk:next-gen-sales-service-desk` | + * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | + * + * The project types are available according to the installed Jira features as follows: + * + * - Jira Core, the default, enables `business` projects. + * - Jira Service Management enables `service_desk` projects. + * - Jira Software enables `software` projects. + * + * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the + * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > + * **Apps** > **Finding new apps**. For more information, see [ Managing + * add-ons](https://confluence.atlassian.com/x/S31NLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProject( + parameters: Parameters.CreateProject, + callback: Callback, + ): Promise; + /** + * Creates a project based on a project type template, as shown in the following table: + * + * | Project Type Key | Project Template Key | + * | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | + * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-finance-service-desk`, `com.atlassian.servicedesk:next-gen-it-service-desk`, `com.atlassian.servicedesk:next-gen-hr-service-desk`, `com.atlassian.servicedesk:next-gen-legal-service-desk`, `com.atlassian.servicedesk:next-gen-marketing-service-desk`, `com.atlassian.servicedesk:next-gen-facilities-service-desk`, `com.atlassian.servicedesk:next-gen-general-service-desk`, `com.atlassian.servicedesk:next-gen-general-it-service-desk`, `com.atlassian.servicedesk:next-gen-general-business-service-desk`, `com.atlassian.servicedesk:next-gen-analytics-service-desk`, `com.atlassian.servicedesk:next-gen-finance-service-desk`, `com.atlassian.servicedesk:next-gen-design-service-desk`, `com.atlassian.servicedesk:next-gen-sales-service-desk` | + * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | + * + * The project types are available according to the installed Jira features as follows: + * + * - Jira Core, the default, enables `business` projects. + * - Jira Service Management enables `service_desk` projects. + * - Jira Software enables `software` projects. + * + * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the + * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > + * **Apps** > **Finding new apps**. For more information, see [ Managing + * add-ons](https://confluence.atlassian.com/x/S31NLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProject( + parameters: Parameters.CreateProject, + callback?: never, + ): Promise; + async createProject( + parameters: Parameters.CreateProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/project', + method: 'POST', + data: { + assigneeType: parameters.assigneeType, + avatarId: parameters.avatarId, + categoryId: parameters.categoryId, + description: parameters.description, + fieldConfigurationScheme: parameters.fieldConfigurationScheme, + issueSecurityScheme: parameters.issueSecurityScheme, + issueTypeScheme: parameters.issueTypeScheme, + issueTypeScreenScheme: parameters.issueTypeScreenScheme, + key: parameters.key, + leadAccountId: parameters.leadAccountId, + name: parameters.name, + notificationScheme: parameters.notificationScheme, + permissionScheme: parameters.permissionScheme, + projectTemplateKey: parameters.projectTemplateKey, + projectTypeKey: parameters.projectTypeKey, + url: parameters.url, + workflowScheme: parameters.workflowScheme, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getRecent( + parameters: Parameters.GetRecent | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getRecent(parameters?: Parameters.GetRecent, callback?: never): Promise; + async getRecent(parameters?: Parameters.GetRecent, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/project/recent', + method: 'GET', + params: { + expand: parameters?.expand, + properties: parameters?.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * projects visible to the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchProjects( + parameters: Parameters.SearchProjects | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * projects visible to the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchProjects(parameters?: Parameters.SearchProjects, callback?: never): Promise; + async searchProjects( + parameters?: Parameters.SearchProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/project/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + orderBy: parameters?.orderBy, + id: parameters?.id, + keys: parameters?.keys, + query: parameters?.query, + typeKey: parameters?.typeKey, + categoryId: parameters?.categoryId, + action: parameters?.action, + expand: parameters?.expand, + status: parameters?.status, + properties: parameters?.properties, + propertyQuery: parameters?.propertyQuery, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProject( + parameters: Parameters.GetProject | string, + callback: Callback, + ): Promise; + /** + * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProject(parameters: Parameters.GetProject | string, callback?: never): Promise; + async getProject( + parameters: Parameters.GetProject | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + properties: typeof parameters !== 'string' && parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. + * + * All parameters are optional in the body of the request. Schemes will only be updated if they are included in the + * request, any omitted schemes will be left unchanged. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). is only needed when changing the + * schemes or project key. Otherwise you will only need _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) + */ + async updateProject(parameters: Parameters.UpdateProject, callback: Callback): Promise; + /** + * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. + * + * All parameters are optional in the body of the request. Schemes will only be updated if they are included in the + * request, any omitted schemes will be left unchanged. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). is only needed when changing the + * schemes or project key. Otherwise you will only need _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) + */ + async updateProject(parameters: Parameters.UpdateProject, callback?: never): Promise; + async updateProject( + parameters: Parameters.UpdateProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}`, + method: 'PUT', + params: { + expand: parameters.expand, + }, + data: { + assigneeType: parameters.assigneeType, + avatarId: parameters.avatarId, + categoryId: parameters.categoryId, + description: parameters.description, + issueSecurityScheme: parameters.issueSecurityScheme, + key: parameters.key, + leadAccountId: parameters.leadAccountId, + name: parameters.name, + notificationScheme: parameters.notificationScheme, + permissionScheme: parameters.permissionScheme, + projectTemplateKey: parameters.projectTemplateKey, + projectTypeKey: parameters.projectTypeKey, + url: parameters.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project. + * + * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. + * To restore a project, use the Jira UI. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProject(parameters: Parameters.DeleteProject | string, callback: Callback): Promise; + /** + * Deletes a project. + * + * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. + * To restore a project, use the Jira UI. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProject(parameters: Parameters.DeleteProject | string, callback?: never): Promise; + async deleteProject( + parameters: Parameters.DeleteProject | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}`, + method: 'DELETE', + params: { + enableUndo: typeof parameters !== 'string' && parameters.enableUndo, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project + * and then delete it. To restore a project, use the Jira UI. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async archiveProject(parameters: Parameters.ArchiveProject | string, callback: Callback): Promise; + /** + * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project + * and then delete it. To restore a project, use the Jira UI. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async archiveProject(parameters: Parameters.ArchiveProject | string, callback?: never): Promise; + async archiveProject( + parameters: Parameters.ArchiveProject | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/archive`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project asynchronously. + * + * This operation is: + * + * - Transactional, that is, if part of the delete fails the project is not deleted. + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectAsynchronously( + parameters: Parameters.DeleteProjectAsynchronously | string, + callback: Callback, + ): Promise; + /** + * Deletes a project asynchronously. + * + * This operation is: + * + * - Transactional, that is, if part of the delete fails the project is not deleted. + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectAsynchronously( + parameters: Parameters.DeleteProjectAsynchronously | string, + callback?: never, + ): Promise; + async deleteProjectAsynchronously( + parameters: Parameters.DeleteProjectAsynchronously | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/delete`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Restores a project that has been archived or placed in the Jira recycle bin. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg)for Company managed projects. + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project for Team managed projects. + */ + async restore(parameters: Parameters.Restore | string, callback: Callback): Promise; + /** + * Restores a project that has been archived or placed in the Jira recycle bin. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg)for Company managed projects. + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project for Team managed projects. + */ + async restore(parameters: Parameters.Restore | string, callback?: never): Promise; + async restore( + parameters: Parameters.Restore | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/restore`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of + * valid issue types and each issue type has a set of valid statuses. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getAllStatuses( + parameters: Parameters.GetAllStatuses | string, + callback: Callback, + ): Promise; + /** + * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of + * valid issue types and each issue type has a set of valid statuses. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getAllStatuses( + parameters: Parameters.GetAllStatuses | string, + callback?: never, + ): Promise; + async getAllStatuses( + parameters: Parameters.GetAllStatuses | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/statuses`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Get the issue type hierarchy for a next-gen project. + * + * The issue type hierarchy for a project consists of: + * + * - _Epic_ at level 1 (optional). + * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these + * issue types are used to break down the content of an epic. + * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. + * Issues based on a level -1 issue type must have a parent issue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getHierarchy( + parameters: Parameters.GetHierarchy | string, + callback: Callback, + ): Promise; + /** + * Get the issue type hierarchy for a next-gen project. + * + * The issue type hierarchy for a project consists of: + * + * - _Epic_ at level 1 (optional). + * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these + * issue types are used to break down the content of an epic. + * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. + * Issues based on a level -1 issue type must have a parent issue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getHierarchy( + parameters: Parameters.GetHierarchy | string, + callback?: never, + ): Promise; + async getHierarchy( + parameters: Parameters.GetHierarchy | string, + callback?: Callback, + ): Promise { + const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectId}/hierarchy`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets a [notification scheme](https://confluence.atlassian.com/x/8YdKLg) associated with the project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg). + */ + async getNotificationSchemeForProject( + parameters: Parameters.GetNotificationSchemeForProject | string, + callback: Callback, + ): Promise; + /** + * Gets a [notification scheme](https://confluence.atlassian.com/x/8YdKLg) associated with the project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg). + */ + async getNotificationSchemeForProject( + parameters: Parameters.GetNotificationSchemeForProject | string, + callback?: never, + ): Promise; + async getNotificationSchemeForProject( + parameters: Parameters.GetNotificationSchemeForProject | string, + callback?: Callback, + ): Promise { + const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectKeyOrId}/notificationscheme`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projects.ts b/src/version2/projects.ts deleted file mode 100644 index 8b53810f8..000000000 --- a/src/version2/projects.ts +++ /dev/null @@ -1,565 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Projects { - constructor(private client: Client) {} - - /** - * Creates a project based on a project type template, as shown in the following table: - * - * | Project Type Key | Project Template Key | - * | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | - * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-finance-service-desk`, `com.atlassian.servicedesk:next-gen-it-service-desk`, `com.atlassian.servicedesk:next-gen-hr-service-desk`, `com.atlassian.servicedesk:next-gen-legal-service-desk`, `com.atlassian.servicedesk:next-gen-marketing-service-desk`, `com.atlassian.servicedesk:next-gen-facilities-service-desk`, `com.atlassian.servicedesk:next-gen-general-service-desk`, `com.atlassian.servicedesk:next-gen-general-it-service-desk`, `com.atlassian.servicedesk:next-gen-general-business-service-desk`, `com.atlassian.servicedesk:next-gen-analytics-service-desk`, `com.atlassian.servicedesk:next-gen-finance-service-desk`, `com.atlassian.servicedesk:next-gen-design-service-desk`, `com.atlassian.servicedesk:next-gen-sales-service-desk` | - * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | - * - * The project types are available according to the installed Jira features as follows: - * - * - Jira Core, the default, enables `business` projects. - * - Jira Service Management enables `service_desk` projects. - * - Jira Software enables `software` projects. - * - * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the - * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > - * **Apps** > **Finding new apps**. For more information, see [ Managing - * add-ons](https://confluence.atlassian.com/x/S31NLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProject( - parameters: Parameters.CreateProject, - callback: Callback, - ): Promise; - /** - * Creates a project based on a project type template, as shown in the following table: - * - * | Project Type Key | Project Template Key | - * | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | - * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-finance-service-desk`, `com.atlassian.servicedesk:next-gen-it-service-desk`, `com.atlassian.servicedesk:next-gen-hr-service-desk`, `com.atlassian.servicedesk:next-gen-legal-service-desk`, `com.atlassian.servicedesk:next-gen-marketing-service-desk`, `com.atlassian.servicedesk:next-gen-facilities-service-desk`, `com.atlassian.servicedesk:next-gen-general-service-desk`, `com.atlassian.servicedesk:next-gen-general-it-service-desk`, `com.atlassian.servicedesk:next-gen-general-business-service-desk`, `com.atlassian.servicedesk:next-gen-analytics-service-desk`, `com.atlassian.servicedesk:next-gen-finance-service-desk`, `com.atlassian.servicedesk:next-gen-design-service-desk`, `com.atlassian.servicedesk:next-gen-sales-service-desk` | - * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | - * - * The project types are available according to the installed Jira features as follows: - * - * - Jira Core, the default, enables `business` projects. - * - Jira Service Management enables `service_desk` projects. - * - Jira Software enables `software` projects. - * - * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the - * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > - * **Apps** > **Finding new apps**. For more information, see [ Managing - * add-ons](https://confluence.atlassian.com/x/S31NLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProject( - parameters: Parameters.CreateProject, - callback?: never, - ): Promise; - async createProject( - parameters: Parameters.CreateProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/project', - method: 'POST', - data: { - assigneeType: parameters.assigneeType, - avatarId: parameters.avatarId, - categoryId: parameters.categoryId, - description: parameters.description, - fieldConfigurationScheme: parameters.fieldConfigurationScheme, - issueSecurityScheme: parameters.issueSecurityScheme, - issueTypeScheme: parameters.issueTypeScheme, - issueTypeScreenScheme: parameters.issueTypeScreenScheme, - key: parameters.key, - leadAccountId: parameters.leadAccountId, - name: parameters.name, - notificationScheme: parameters.notificationScheme, - permissionScheme: parameters.permissionScheme, - projectTemplateKey: parameters.projectTemplateKey, - projectTypeKey: parameters.projectTypeKey, - url: parameters.url, - workflowScheme: parameters.workflowScheme, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getRecent( - parameters: Parameters.GetRecent | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getRecent(parameters?: Parameters.GetRecent, callback?: never): Promise; - async getRecent(parameters?: Parameters.GetRecent, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/project/recent', - method: 'GET', - params: { - expand: parameters?.expand, - properties: parameters?.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * projects visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchProjects( - parameters: Parameters.SearchProjects | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * projects visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchProjects(parameters?: Parameters.SearchProjects, callback?: never): Promise; - async searchProjects( - parameters?: Parameters.SearchProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/project/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - orderBy: parameters?.orderBy, - id: parameters?.id, - keys: parameters?.keys, - query: parameters?.query, - typeKey: parameters?.typeKey, - categoryId: parameters?.categoryId, - action: parameters?.action, - expand: parameters?.expand, - status: parameters?.status, - properties: parameters?.properties, - propertyQuery: parameters?.propertyQuery, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProject( - parameters: Parameters.GetProject | string, - callback: Callback, - ): Promise; - /** - * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProject(parameters: Parameters.GetProject | string, callback?: never): Promise; - async getProject( - parameters: Parameters.GetProject | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - properties: typeof parameters !== 'string' && parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. - * - * All parameters are optional in the body of the request. Schemes will only be updated if they are included in the - * request, any omitted schemes will be left unchanged. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). is only needed when changing the - * schemes or project key. Otherwise you will only need _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) - */ - async updateProject(parameters: Parameters.UpdateProject, callback: Callback): Promise; - /** - * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. - * - * All parameters are optional in the body of the request. Schemes will only be updated if they are included in the - * request, any omitted schemes will be left unchanged. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). is only needed when changing the - * schemes or project key. Otherwise you will only need _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) - */ - async updateProject(parameters: Parameters.UpdateProject, callback?: never): Promise; - async updateProject( - parameters: Parameters.UpdateProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}`, - method: 'PUT', - params: { - expand: parameters.expand, - }, - data: { - assigneeType: parameters.assigneeType, - avatarId: parameters.avatarId, - categoryId: parameters.categoryId, - description: parameters.description, - issueSecurityScheme: parameters.issueSecurityScheme, - key: parameters.key, - leadAccountId: parameters.leadAccountId, - name: parameters.name, - notificationScheme: parameters.notificationScheme, - permissionScheme: parameters.permissionScheme, - projectTemplateKey: parameters.projectTemplateKey, - projectTypeKey: parameters.projectTypeKey, - url: parameters.url, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project. - * - * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. - * To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProject(parameters: Parameters.DeleteProject | string, callback: Callback): Promise; - /** - * Deletes a project. - * - * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. - * To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProject(parameters: Parameters.DeleteProject | string, callback?: never): Promise; - async deleteProject( - parameters: Parameters.DeleteProject | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}`, - method: 'DELETE', - params: { - enableUndo: typeof parameters !== 'string' && parameters.enableUndo, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project - * and then delete it. To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async archiveProject(parameters: Parameters.ArchiveProject | string, callback: Callback): Promise; - /** - * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project - * and then delete it. To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async archiveProject(parameters: Parameters.ArchiveProject | string, callback?: never): Promise; - async archiveProject( - parameters: Parameters.ArchiveProject | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/archive`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project asynchronously. - * - * This operation is: - * - * - Transactional, that is, if part of the delete fails the project is not deleted. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, - callback: Callback, - ): Promise; - /** - * Deletes a project asynchronously. - * - * This operation is: - * - * - Transactional, that is, if part of the delete fails the project is not deleted. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, - callback?: never, - ): Promise; - async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/delete`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Restores a project that has been archived or placed in the Jira recycle bin. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg)for Company managed projects. - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project for Team managed projects. - */ - async restore(parameters: Parameters.Restore | string, callback: Callback): Promise; - /** - * Restores a project that has been archived or placed in the Jira recycle bin. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg)for Company managed projects. - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project for Team managed projects. - */ - async restore(parameters: Parameters.Restore | string, callback?: never): Promise; - async restore( - parameters: Parameters.Restore | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/restore`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of - * valid issue types and each issue type has a set of valid statuses. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getAllStatuses( - parameters: Parameters.GetAllStatuses | string, - callback: Callback, - ): Promise; - /** - * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of - * valid issue types and each issue type has a set of valid statuses. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getAllStatuses( - parameters: Parameters.GetAllStatuses | string, - callback?: never, - ): Promise; - async getAllStatuses( - parameters: Parameters.GetAllStatuses | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/statuses`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Get the issue type hierarchy for a next-gen project. - * - * The issue type hierarchy for a project consists of: - * - * - _Epic_ at level 1 (optional). - * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these - * issue types are used to break down the content of an epic. - * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. - * Issues based on a level -1 issue type must have a parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getHierarchy( - parameters: Parameters.GetHierarchy | string, - callback: Callback, - ): Promise; - /** - * Get the issue type hierarchy for a next-gen project. - * - * The issue type hierarchy for a project consists of: - * - * - _Epic_ at level 1 (optional). - * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these - * issue types are used to break down the content of an epic. - * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. - * Issues based on a level -1 issue type must have a parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getHierarchy( - parameters: Parameters.GetHierarchy | string, - callback?: never, - ): Promise; - async getHierarchy( - parameters: Parameters.GetHierarchy | string, - callback?: Callback, - ): Promise { - const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectId}/hierarchy`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets a [notification scheme](https://confluence.atlassian.com/x/8YdKLg) associated with the project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getNotificationSchemeForProject( - parameters: Parameters.GetNotificationSchemeForProject | string, - callback: Callback, - ): Promise; - /** - * Gets a [notification scheme](https://confluence.atlassian.com/x/8YdKLg) associated with the project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getNotificationSchemeForProject( - parameters: Parameters.GetNotificationSchemeForProject | string, - callback?: never, - ): Promise; - async getNotificationSchemeForProject( - parameters: Parameters.GetNotificationSchemeForProject | string, - callback?: Callback, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectKeyOrId}/notificationscheme`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/screenSchemes.mts b/src/version2/screenSchemes.mts new file mode 100644 index 000000000..e61390e4f --- /dev/null +++ b/src/version2/screenSchemes.mts @@ -0,0 +1,160 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ScreenSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of screen + * schemes. + * + * Only screen schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreenSchemes( + parameters: Parameters.GetScreenSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of screen + * schemes. + * + * Only screen schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreenSchemes( + parameters?: Parameters.GetScreenSchemes, + callback?: never, + ): Promise; + async getScreenSchemes( + parameters?: Parameters.GetScreenSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/screenscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + expand: parameters?.expand, + queryString: parameters?.queryString, + orderBy: parameters?.orderBy, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createScreenScheme( + parameters: Parameters.CreateScreenScheme | string, + callback: Callback, + ): Promise; + /** + * Creates a screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createScreenScheme( + parameters: Parameters.CreateScreenScheme | string, + callback?: never, + ): Promise; + async createScreenScheme( + parameters: Parameters.CreateScreenScheme | string, + callback?: Callback, + ): Promise { + const name = typeof parameters === 'string' ? parameters : parameters.name; + + const config: RequestConfig = { + url: '/rest/api/2/screenscheme', + method: 'POST', + data: { + name, + description: typeof parameters !== 'string' && parameters.description, + screens: typeof parameters !== 'string' && parameters.screens, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a screen scheme. Only screen schemes used in classic projects can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback: Callback): Promise; + /** + * Updates a screen scheme. Only screen schemes used in classic projects can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback?: never): Promise; + async updateScreenScheme( + parameters: Parameters.UpdateScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screenscheme/${parameters.screenSchemeId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + screens: parameters.screens, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. + * + * Only screens schemes used in classic projects can be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteScreenScheme( + parameters: Parameters.DeleteScreenScheme | string, + callback: Callback, + ): Promise; + /** + * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. + * + * Only screens schemes used in classic projects can be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteScreenScheme(parameters: Parameters.DeleteScreenScheme | string, callback?: never): Promise; + async deleteScreenScheme( + parameters: Parameters.DeleteScreenScheme | string, + callback?: Callback, + ): Promise { + const screenSchemeId = typeof parameters === 'string' ? parameters : parameters.screenSchemeId; + + const config: RequestConfig = { + url: `/rest/api/2/screenscheme/${screenSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/screenSchemes.ts b/src/version2/screenSchemes.ts deleted file mode 100644 index cc914220e..000000000 --- a/src/version2/screenSchemes.ts +++ /dev/null @@ -1,160 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ScreenSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of screen - * schemes. - * - * Only screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreenSchemes( - parameters: Parameters.GetScreenSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of screen - * schemes. - * - * Only screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreenSchemes( - parameters?: Parameters.GetScreenSchemes, - callback?: never, - ): Promise; - async getScreenSchemes( - parameters?: Parameters.GetScreenSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/screenscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - expand: parameters?.expand, - queryString: parameters?.queryString, - orderBy: parameters?.orderBy, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createScreenScheme( - parameters: Parameters.CreateScreenScheme | string, - callback: Callback, - ): Promise; - /** - * Creates a screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createScreenScheme( - parameters: Parameters.CreateScreenScheme | string, - callback?: never, - ): Promise; - async createScreenScheme( - parameters: Parameters.CreateScreenScheme | string, - callback?: Callback, - ): Promise { - const name = typeof parameters === 'string' ? parameters : parameters.name; - - const config: RequestConfig = { - url: '/rest/api/2/screenscheme', - method: 'POST', - data: { - name, - description: typeof parameters !== 'string' && parameters.description, - screens: typeof parameters !== 'string' && parameters.screens, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a screen scheme. Only screen schemes used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback: Callback): Promise; - /** - * Updates a screen scheme. Only screen schemes used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback?: never): Promise; - async updateScreenScheme( - parameters: Parameters.UpdateScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screenscheme/${parameters.screenSchemeId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - screens: parameters.screens, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. - * - * Only screens schemes used in classic projects can be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenScheme( - parameters: Parameters.DeleteScreenScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. - * - * Only screens schemes used in classic projects can be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenScheme(parameters: Parameters.DeleteScreenScheme | string, callback?: never): Promise; - async deleteScreenScheme( - parameters: Parameters.DeleteScreenScheme | string, - callback?: Callback, - ): Promise { - const screenSchemeId = typeof parameters === 'string' ? parameters : parameters.screenSchemeId; - - const config: RequestConfig = { - url: `/rest/api/2/screenscheme/${screenSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/screenTabFields.mts b/src/version2/screenTabFields.mts new file mode 100644 index 000000000..bb0c9b24d --- /dev/null +++ b/src/version2/screenTabFields.mts @@ -0,0 +1,150 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ScreenTabFields { + constructor(private client: Client) {} + + /** + * Returns all fields for a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen + * Scheme. + */ + async getAllScreenTabFields( + parameters: Parameters.GetAllScreenTabFields, + callback: Callback, + ): Promise; + /** + * Returns all fields for a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen + * Scheme. + */ + async getAllScreenTabFields( + parameters: Parameters.GetAllScreenTabFields, + callback?: never, + ): Promise; + async getAllScreenTabFields( + parameters: Parameters.GetAllScreenTabFields, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, + method: 'GET', + params: { + projectKey: parameters.projectKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a field to a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addScreenTabField( + parameters: Parameters.AddScreenTabField, + callback: Callback, + ): Promise; + /** + * Adds a field to a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addScreenTabField( + parameters: Parameters.AddScreenTabField, + callback?: never, + ): Promise; + async addScreenTabField( + parameters: Parameters.AddScreenTabField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, + method: 'POST', + data: { + fieldId: parameters.fieldId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a field from a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeScreenTabField( + parameters: Parameters.RemoveScreenTabField, + callback: Callback, + ): Promise; + /** + * Removes a field from a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeScreenTabField(parameters: Parameters.RemoveScreenTabField, callback?: never): Promise; + async removeScreenTabField( + parameters: Parameters.RemoveScreenTabField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a screen tab field. + * + * If `after` and `position` are provided in the request, `position` is ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback: Callback): Promise; + /** + * Moves a screen tab field. + * + * If `after` and `position` are provided in the request, `position` is ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback?: never): Promise; + async moveScreenTabField( + parameters: Parameters.MoveScreenTabField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}/move`, + method: 'POST', + data: { + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/screenTabFields.ts b/src/version2/screenTabFields.ts deleted file mode 100644 index 71cd6c354..000000000 --- a/src/version2/screenTabFields.ts +++ /dev/null @@ -1,150 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ScreenTabFields { - constructor(private client: Client) {} - - /** - * Returns all fields for a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabFields( - parameters: Parameters.GetAllScreenTabFields, - callback: Callback, - ): Promise; - /** - * Returns all fields for a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabFields( - parameters: Parameters.GetAllScreenTabFields, - callback?: never, - ): Promise; - async getAllScreenTabFields( - parameters: Parameters.GetAllScreenTabFields, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, - method: 'GET', - params: { - projectKey: parameters.projectKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a field to a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTabField( - parameters: Parameters.AddScreenTabField, - callback: Callback, - ): Promise; - /** - * Adds a field to a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTabField( - parameters: Parameters.AddScreenTabField, - callback?: never, - ): Promise; - async addScreenTabField( - parameters: Parameters.AddScreenTabField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, - method: 'POST', - data: { - fieldId: parameters.fieldId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a field from a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeScreenTabField( - parameters: Parameters.RemoveScreenTabField, - callback: Callback, - ): Promise; - /** - * Removes a field from a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeScreenTabField(parameters: Parameters.RemoveScreenTabField, callback?: never): Promise; - async removeScreenTabField( - parameters: Parameters.RemoveScreenTabField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves a screen tab field. - * - * If `after` and `position` are provided in the request, `position` is ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback: Callback): Promise; - /** - * Moves a screen tab field. - * - * If `after` and `position` are provided in the request, `position` is ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback?: never): Promise; - async moveScreenTabField( - parameters: Parameters.MoveScreenTabField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}/move`, - method: 'POST', - data: { - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/screenTabs.mts b/src/version2/screenTabs.mts new file mode 100644 index 000000000..11e052fed --- /dev/null +++ b/src/version2/screenTabs.mts @@ -0,0 +1,166 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ScreenTabs { + constructor(private client: Client) {} + + /** + * Returns the list of tabs for a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen + * Scheme. + */ + async getAllScreenTabs( + parameters: Parameters.GetAllScreenTabs | string, + callback: Callback, + ): Promise; + /** + * Returns the list of tabs for a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen + * Scheme. + */ + async getAllScreenTabs( + parameters: Parameters.GetAllScreenTabs | string, + callback?: never, + ): Promise; + async getAllScreenTabs( + parameters: Parameters.GetAllScreenTabs | string, + callback?: Callback, + ): Promise { + const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; + + const config: RequestConfig = { + url: `/rest/api/2/screens/${screenId}/tabs`, + method: 'GET', + params: { + projectKey: typeof parameters !== 'string' && parameters.projectKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a tab for a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addScreenTab( + parameters: Parameters.AddScreenTab, + callback: Callback, + ): Promise; + /** + * Creates a tab for a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addScreenTab(parameters: Parameters.AddScreenTab, callback?: never): Promise; + async addScreenTab( + parameters: Parameters.AddScreenTab, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs`, + method: 'POST', + data: { + id: parameters.id, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the name of a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async renameScreenTab( + parameters: Parameters.RenameScreenTab, + callback: Callback, + ): Promise; + /** + * Updates the name of a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async renameScreenTab(parameters: Parameters.RenameScreenTab, callback?: never): Promise; + async renameScreenTab( + parameters: Parameters.RenameScreenTab, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}`, + method: 'PUT', + data: { + id: parameters.id, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback: Callback): Promise; + /** + * Deletes a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: never): Promise; + async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveScreenTab(parameters: Parameters.MoveScreenTab, callback: Callback): Promise; + /** + * Moves a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: never): Promise; + async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/move/${parameters.pos}`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/screenTabs.ts b/src/version2/screenTabs.ts deleted file mode 100644 index 4b6f84213..000000000 --- a/src/version2/screenTabs.ts +++ /dev/null @@ -1,166 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ScreenTabs { - constructor(private client: Client) {} - - /** - * Returns the list of tabs for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabs( - parameters: Parameters.GetAllScreenTabs | string, - callback: Callback, - ): Promise; - /** - * Returns the list of tabs for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabs( - parameters: Parameters.GetAllScreenTabs | string, - callback?: never, - ): Promise; - async getAllScreenTabs( - parameters: Parameters.GetAllScreenTabs | string, - callback?: Callback, - ): Promise { - const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; - - const config: RequestConfig = { - url: `/rest/api/2/screens/${screenId}/tabs`, - method: 'GET', - params: { - projectKey: typeof parameters !== 'string' && parameters.projectKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a tab for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTab( - parameters: Parameters.AddScreenTab, - callback: Callback, - ): Promise; - /** - * Creates a tab for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTab(parameters: Parameters.AddScreenTab, callback?: never): Promise; - async addScreenTab( - parameters: Parameters.AddScreenTab, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}/tabs`, - method: 'POST', - data: { - id: parameters.id, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the name of a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async renameScreenTab( - parameters: Parameters.RenameScreenTab, - callback: Callback, - ): Promise; - /** - * Updates the name of a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async renameScreenTab(parameters: Parameters.RenameScreenTab, callback?: never): Promise; - async renameScreenTab( - parameters: Parameters.RenameScreenTab, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}`, - method: 'PUT', - data: { - id: parameters.id, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback: Callback): Promise; - /** - * Deletes a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: never): Promise; - async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTab(parameters: Parameters.MoveScreenTab, callback: Callback): Promise; - /** - * Moves a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: never): Promise; - async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/move/${parameters.pos}`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/screens.mts b/src/version2/screens.mts new file mode 100644 index 000000000..c7f8b31bb --- /dev/null +++ b/src/version2/screens.mts @@ -0,0 +1,243 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Screens { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the + * screens a field is used in. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreensForField( + parameters: Parameters.GetScreensForField | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the + * screens a field is used in. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreensForField( + parameters: Parameters.GetScreensForField | string, + callback?: never, + ): Promise; + async getScreensForField( + parameters: Parameters.GetScreensForField | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/2/field/${fieldId}/screens`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * screens or those specified by one or more screen IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreens( + parameters: Parameters.GetScreens | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * screens or those specified by one or more screen IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreens(parameters?: Parameters.GetScreens, callback?: never): Promise; + async getScreens( + parameters?: Parameters.GetScreens, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/screens', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + queryString: parameters?.queryString, + scope: parameters?.scope, + orderBy: parameters?.orderBy, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a screen with a default field tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createScreen(parameters: Parameters.CreateScreen, callback: Callback): Promise; + /** + * Creates a screen with a default field tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createScreen(parameters: Parameters.CreateScreen, callback?: never): Promise; + async createScreen( + parameters: Parameters.CreateScreen, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/screens', + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a field to the default tab of the default screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addFieldToDefaultScreen( + parameters: Parameters.AddFieldToDefaultScreen | string, + callback: Callback, + ): Promise; + /** + * Adds a field to the default tab of the default screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addFieldToDefaultScreen( + parameters: Parameters.AddFieldToDefaultScreen | string, + callback?: never, + ): Promise; + async addFieldToDefaultScreen( + parameters: Parameters.AddFieldToDefaultScreen | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/2/screens/addToDefault/${fieldId}`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a screen. Only screens used in classic projects can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateScreen(parameters: Parameters.UpdateScreen, callback: Callback): Promise; + /** + * Updates a screen. Only screens used in classic projects can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateScreen(parameters: Parameters.UpdateScreen, callback?: never): Promise; + async updateScreen( + parameters: Parameters.UpdateScreen, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. + * + * Only screens used in classic projects can be deleted. + */ + async deleteScreen(parameters: Parameters.DeleteScreen | string, callback: Callback): Promise; + /** + * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. + * + * Only screens used in classic projects can be deleted. + */ + async deleteScreen(parameters: Parameters.DeleteScreen | string, callback?: never): Promise; + async deleteScreen( + parameters: Parameters.DeleteScreen | string, + callback?: Callback, + ): Promise { + const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; + + const config: RequestConfig = { + url: `/rest/api/2/screens/${screenId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the fields that can be added to a tab on a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAvailableScreenFields( + parameters: Parameters.GetAvailableScreenFields | string, + callback: Callback, + ): Promise; + /** + * Returns the fields that can be added to a tab on a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAvailableScreenFields( + parameters: Parameters.GetAvailableScreenFields | string, + callback?: never, + ): Promise; + async getAvailableScreenFields( + parameters: Parameters.GetAvailableScreenFields | string, + callback?: Callback, + ): Promise { + const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; + + const config: RequestConfig = { + url: `/rest/api/2/screens/${screenId}/availableFields`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/screens.ts b/src/version2/screens.ts deleted file mode 100644 index c19773725..000000000 --- a/src/version2/screens.ts +++ /dev/null @@ -1,243 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Screens { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * screens a field is used in. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreensForField( - parameters: Parameters.GetScreensForField | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * screens a field is used in. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreensForField( - parameters: Parameters.GetScreensForField | string, - callback?: never, - ): Promise; - async getScreensForField( - parameters: Parameters.GetScreensForField | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldId}/screens`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * screens or those specified by one or more screen IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreens( - parameters: Parameters.GetScreens | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * screens or those specified by one or more screen IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreens(parameters?: Parameters.GetScreens, callback?: never): Promise; - async getScreens( - parameters?: Parameters.GetScreens, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/screens', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - queryString: parameters?.queryString, - scope: parameters?.scope, - orderBy: parameters?.orderBy, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a screen with a default field tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createScreen(parameters: Parameters.CreateScreen, callback: Callback): Promise; - /** - * Creates a screen with a default field tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createScreen(parameters: Parameters.CreateScreen, callback?: never): Promise; - async createScreen( - parameters: Parameters.CreateScreen, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/screens', - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a field to the default tab of the default screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addFieldToDefaultScreen( - parameters: Parameters.AddFieldToDefaultScreen | string, - callback: Callback, - ): Promise; - /** - * Adds a field to the default tab of the default screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addFieldToDefaultScreen( - parameters: Parameters.AddFieldToDefaultScreen | string, - callback?: never, - ): Promise; - async addFieldToDefaultScreen( - parameters: Parameters.AddFieldToDefaultScreen | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/2/screens/addToDefault/${fieldId}`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a screen. Only screens used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreen(parameters: Parameters.UpdateScreen, callback: Callback): Promise; - /** - * Updates a screen. Only screens used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreen(parameters: Parameters.UpdateScreen, callback?: never): Promise; - async updateScreen( - parameters: Parameters.UpdateScreen, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. - * - * Only screens used in classic projects can be deleted. - */ - async deleteScreen(parameters: Parameters.DeleteScreen | string, callback: Callback): Promise; - /** - * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. - * - * Only screens used in classic projects can be deleted. - */ - async deleteScreen(parameters: Parameters.DeleteScreen | string, callback?: never): Promise; - async deleteScreen( - parameters: Parameters.DeleteScreen | string, - callback?: Callback, - ): Promise { - const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; - - const config: RequestConfig = { - url: `/rest/api/2/screens/${screenId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the fields that can be added to a tab on a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableScreenFields( - parameters: Parameters.GetAvailableScreenFields | string, - callback: Callback, - ): Promise; - /** - * Returns the fields that can be added to a tab on a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableScreenFields( - parameters: Parameters.GetAvailableScreenFields | string, - callback?: never, - ): Promise; - async getAvailableScreenFields( - parameters: Parameters.GetAvailableScreenFields | string, - callback?: Callback, - ): Promise { - const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; - - const config: RequestConfig = { - url: `/rest/api/2/screens/${screenId}/availableFields`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/serverInfo.mts b/src/version2/serverInfo.mts new file mode 100644 index 000000000..a6f939d4b --- /dev/null +++ b/src/version2/serverInfo.mts @@ -0,0 +1,33 @@ +import * as Models from './models/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ServerInfo { + constructor(private client: Client) {} + + /** + * Returns information about the Jira instance. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getServerInfo(callback: Callback): Promise; + /** + * Returns information about the Jira instance. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getServerInfo(callback?: never): Promise; + async getServerInfo(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/serverInfo', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/serverInfo.ts b/src/version2/serverInfo.ts deleted file mode 100644 index 4bb2663aa..000000000 --- a/src/version2/serverInfo.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as Models from './models/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ServerInfo { - constructor(private client: Client) {} - - /** - * Returns information about the Jira instance. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getServerInfo(callback: Callback): Promise; - /** - * Returns information about the Jira instance. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getServerInfo(callback?: never): Promise; - async getServerInfo(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/serverInfo', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/status.mts b/src/version2/status.mts new file mode 100644 index 000000000..e78dc80f4 --- /dev/null +++ b/src/version2/status.mts @@ -0,0 +1,196 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Status { + constructor(private client: Client) {} + + /** + * Returns a list of the statuses specified by one or more status IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async getStatusesById( + parameters: Parameters.GetStatusesById | string, + callback: Callback, + ): Promise; + /** + * Returns a list of the statuses specified by one or more status IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async getStatusesById( + parameters: Parameters.GetStatusesById | string, + callback?: never, + ): Promise; + async getStatusesById( + parameters: Parameters.GetStatusesById | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: '/rest/api/2/statuses', + method: 'GET', + params: { + id, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates statuses for a global or project scope. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async createStatuses( + parameters: Parameters.CreateStatuses, + callback: Callback, + ): Promise; + /** + * Creates statuses for a global or project scope. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async createStatuses(parameters: Parameters.CreateStatuses, callback?: never): Promise; + async createStatuses( + parameters: Parameters.CreateStatuses, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/statuses', + method: 'POST', + data: { + statuses: parameters.statuses, + scope: parameters.scope, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates statuses by ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async updateStatuses(parameters: Parameters.UpdateStatuses, callback: Callback): Promise; + /** + * Updates statuses by ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: never): Promise; + async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/statuses', + method: 'PUT', + data: { + statuses: parameters.statuses, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes statuses by ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async deleteStatusesById( + parameters: Parameters.DeleteStatusesById | string, + callback: Callback, + ): Promise; + /** + * Deletes statuses by ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async deleteStatusesById(parameters: Parameters.DeleteStatusesById | string, callback?: never): Promise; + async deleteStatusesById( + parameters: Parameters.DeleteStatusesById | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: '/rest/api/2/statuses', + method: 'DELETE', + params: { + id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * statuses that match a search on name or project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async search( + parameters: Parameters.Search | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * statuses that match a search on name or project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async search(parameters?: Parameters.Search, callback?: never): Promise; + async search(parameters?: Parameters.Search, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/statuses/search', + method: 'GET', + params: { + expand: parameters?.expand, + projectId: parameters?.projectId, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + searchString: parameters?.searchString, + statusCategory: parameters?.statusCategory, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/status.ts b/src/version2/status.ts deleted file mode 100644 index 440be2386..000000000 --- a/src/version2/status.ts +++ /dev/null @@ -1,196 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Status { - constructor(private client: Client) {} - - /** - * Returns a list of the statuses specified by one or more status IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async getStatusesById( - parameters: Parameters.GetStatusesById | string, - callback: Callback, - ): Promise; - /** - * Returns a list of the statuses specified by one or more status IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async getStatusesById( - parameters: Parameters.GetStatusesById | string, - callback?: never, - ): Promise; - async getStatusesById( - parameters: Parameters.GetStatusesById | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: '/rest/api/2/statuses', - method: 'GET', - params: { - id, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates statuses for a global or project scope. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async createStatuses( - parameters: Parameters.CreateStatuses, - callback: Callback, - ): Promise; - /** - * Creates statuses for a global or project scope. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async createStatuses(parameters: Parameters.CreateStatuses, callback?: never): Promise; - async createStatuses( - parameters: Parameters.CreateStatuses, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/statuses', - method: 'POST', - data: { - statuses: parameters.statuses, - scope: parameters.scope, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async updateStatuses(parameters: Parameters.UpdateStatuses, callback: Callback): Promise; - /** - * Updates statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: never): Promise; - async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/statuses', - method: 'PUT', - data: { - statuses: parameters.statuses, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async deleteStatusesById( - parameters: Parameters.DeleteStatusesById | string, - callback: Callback, - ): Promise; - /** - * Deletes statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async deleteStatusesById(parameters: Parameters.DeleteStatusesById | string, callback?: never): Promise; - async deleteStatusesById( - parameters: Parameters.DeleteStatusesById | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: '/rest/api/2/statuses', - method: 'DELETE', - params: { - id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * statuses that match a search on name or project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async search( - parameters: Parameters.Search | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * statuses that match a search on name or project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async search(parameters?: Parameters.Search, callback?: never): Promise; - async search(parameters?: Parameters.Search, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/statuses/search', - method: 'GET', - params: { - expand: parameters?.expand, - projectId: parameters?.projectId, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - searchString: parameters?.searchString, - statusCategory: parameters?.statusCategory, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/tasks.mts b/src/version2/tasks.mts new file mode 100644 index 000000000..8d7a1f85f --- /dev/null +++ b/src/version2/tasks.mts @@ -0,0 +1,87 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Tasks { + constructor(private client: Client) {} + + /** + * Returns the status of a [long-running asynchronous + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). + * + * When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the + * operation that created the task for details. Task details are not permanently retained. As of September 2019, + * details are retained for 14 days although this period may change without notice. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Creator of the task. + */ + async getTask( + parameters: Parameters.GetTask | string, + callback: Callback, + ): Promise; + /** + * Returns the status of a [long-running asynchronous + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). + * + * When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the + * operation that created the task for details. Task details are not permanently retained. As of September 2019, + * details are retained for 14 days although this period may change without notice. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Creator of the task. + */ + async getTask(parameters: Parameters.GetTask | string, callback?: never): Promise; + async getTask( + parameters: Parameters.GetTask | string, + callback?: Callback, + ): Promise { + const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; + + const config: RequestConfig = { + url: `/rest/api/2/task/${taskId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Cancels a task. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Creator of the task. + */ + async cancelTask(parameters: Parameters.CancelTask | string, callback: Callback): Promise; + /** + * Cancels a task. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Creator of the task. + */ + async cancelTask(parameters: Parameters.CancelTask | string, callback?: never): Promise; + async cancelTask(parameters: Parameters.CancelTask | string, callback?: Callback): Promise { + const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; + + const config: RequestConfig = { + url: `/rest/api/2/task/${taskId}/cancel`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/tasks.ts b/src/version2/tasks.ts deleted file mode 100644 index aaceaab6b..000000000 --- a/src/version2/tasks.ts +++ /dev/null @@ -1,87 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Tasks { - constructor(private client: Client) {} - - /** - * Returns the status of a [long-running asynchronous - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). - * - * When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the - * operation that created the task for details. Task details are not permanently retained. As of September 2019, - * details are retained for 14 days although this period may change without notice. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async getTask( - parameters: Parameters.GetTask | string, - callback: Callback, - ): Promise; - /** - * Returns the status of a [long-running asynchronous - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). - * - * When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the - * operation that created the task for details. Task details are not permanently retained. As of September 2019, - * details are retained for 14 days although this period may change without notice. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async getTask(parameters: Parameters.GetTask | string, callback?: never): Promise; - async getTask( - parameters: Parameters.GetTask | string, - callback?: Callback, - ): Promise { - const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; - - const config: RequestConfig = { - url: `/rest/api/2/task/${taskId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Cancels a task. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async cancelTask(parameters: Parameters.CancelTask | string, callback: Callback): Promise; - /** - * Cancels a task. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async cancelTask(parameters: Parameters.CancelTask | string, callback?: never): Promise; - async cancelTask(parameters: Parameters.CancelTask | string, callback?: Callback): Promise { - const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; - - const config: RequestConfig = { - url: `/rest/api/2/task/${taskId}/cancel`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/timeTracking.mts b/src/version2/timeTracking.mts new file mode 100644 index 000000000..96cbf662d --- /dev/null +++ b/src/version2/timeTracking.mts @@ -0,0 +1,169 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class TimeTracking { + constructor(private client: Client) {} + + /** + * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a + * successful but empty response is returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSelectedTimeTrackingImplementation(callback: Callback): Promise; + /** + * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a + * successful but empty response is returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSelectedTimeTrackingImplementation(callback?: never): Promise; + async getSelectedTimeTrackingImplementation(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/configuration/timetracking', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Selects a time tracking provider. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async selectTimeTrackingImplementation( + parameters: Parameters.SelectTimeTrackingImplementation | undefined, + callback: Callback, + ): Promise; + /** + * Selects a time tracking provider. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async selectTimeTrackingImplementation( + parameters?: Parameters.SelectTimeTrackingImplementation, + callback?: never, + ): Promise; + async selectTimeTrackingImplementation( + parameters?: Parameters.SelectTimeTrackingImplementation, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/configuration/timetracking', + method: 'PUT', + data: { + key: parameters?.key, + name: parameters?.name, + url: parameters?.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time + * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more + * information on time tracking providers, see the documentation for the [ Time Tracking + * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAvailableTimeTrackingImplementations( + callback: Callback, + ): Promise; + /** + * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time + * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more + * information on time tracking providers, see the documentation for the [ Time Tracking + * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAvailableTimeTrackingImplementations(callback?: never): Promise; + async getAvailableTimeTrackingImplementations( + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/configuration/timetracking/list', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. + * For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSharedTimeTrackingConfiguration(callback: Callback): Promise; + /** + * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. + * For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSharedTimeTrackingConfiguration(callback?: never): Promise; + async getSharedTimeTrackingConfiguration( + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/configuration/timetracking/options', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the time tracking settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setSharedTimeTrackingConfiguration( + parameters: Parameters.SetSharedTimeTrackingConfiguration | undefined, + callback: Callback, + ): Promise; + /** + * Sets the time tracking settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setSharedTimeTrackingConfiguration( + parameters?: Parameters.SetSharedTimeTrackingConfiguration, + callback?: never, + ): Promise; + async setSharedTimeTrackingConfiguration( + parameters?: Parameters.SetSharedTimeTrackingConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/configuration/timetracking/options', + method: 'PUT', + data: { + workingHoursPerDay: parameters?.workingHoursPerDay, + workingDaysPerWeek: parameters?.workingDaysPerWeek, + timeFormat: parameters?.timeFormat, + defaultUnit: parameters?.defaultUnit, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/timeTracking.ts b/src/version2/timeTracking.ts deleted file mode 100644 index 5158e54c8..000000000 --- a/src/version2/timeTracking.ts +++ /dev/null @@ -1,169 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class TimeTracking { - constructor(private client: Client) {} - - /** - * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a - * successful but empty response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSelectedTimeTrackingImplementation(callback: Callback): Promise; - /** - * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a - * successful but empty response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSelectedTimeTrackingImplementation(callback?: never): Promise; - async getSelectedTimeTrackingImplementation(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/configuration/timetracking', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Selects a time tracking provider. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async selectTimeTrackingImplementation( - parameters: Parameters.SelectTimeTrackingImplementation | undefined, - callback: Callback, - ): Promise; - /** - * Selects a time tracking provider. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async selectTimeTrackingImplementation( - parameters?: Parameters.SelectTimeTrackingImplementation, - callback?: never, - ): Promise; - async selectTimeTrackingImplementation( - parameters?: Parameters.SelectTimeTrackingImplementation, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/configuration/timetracking', - method: 'PUT', - data: { - key: parameters?.key, - name: parameters?.name, - url: parameters?.url, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time - * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more - * information on time tracking providers, see the documentation for the [ Time Tracking - * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableTimeTrackingImplementations( - callback: Callback, - ): Promise; - /** - * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time - * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more - * information on time tracking providers, see the documentation for the [ Time Tracking - * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableTimeTrackingImplementations(callback?: never): Promise; - async getAvailableTimeTrackingImplementations( - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/configuration/timetracking/list', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. - * For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSharedTimeTrackingConfiguration(callback: Callback): Promise; - /** - * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. - * For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSharedTimeTrackingConfiguration(callback?: never): Promise; - async getSharedTimeTrackingConfiguration( - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/configuration/timetracking/options', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the time tracking settings. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setSharedTimeTrackingConfiguration( - parameters: Parameters.SetSharedTimeTrackingConfiguration | undefined, - callback: Callback, - ): Promise; - /** - * Sets the time tracking settings. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setSharedTimeTrackingConfiguration( - parameters?: Parameters.SetSharedTimeTrackingConfiguration, - callback?: never, - ): Promise; - async setSharedTimeTrackingConfiguration( - parameters?: Parameters.SetSharedTimeTrackingConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/configuration/timetracking/options', - method: 'PUT', - data: { - workingHoursPerDay: parameters?.workingHoursPerDay, - workingDaysPerWeek: parameters?.workingDaysPerWeek, - timeFormat: parameters?.timeFormat, - defaultUnit: parameters?.defaultUnit, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/uIModificationsApps.ts b/src/version2/uIModificationsApps.ts deleted file mode 100644 index 36aa7122c..000000000 --- a/src/version2/uIModificationsApps.ts +++ /dev/null @@ -1,171 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class UIModificationsApps { - constructor(private client: Client) {} - - /** - * Gets UI modifications. UI modifications can only be retrieved by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getUiModifications( - parameters: Parameters.GetUiModifications | undefined, - callback: Callback, - ): Promise; - /** - * Gets UI modifications. UI modifications can only be retrieved by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getUiModifications( - parameters?: Parameters.GetUiModifications, - callback?: never, - ): Promise; - async getUiModifications( - parameters?: Parameters.GetUiModifications, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/uiModifications', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a UI modification. UI modification can only be created by Forge apps. - * - * Each app can define up to 100 UI modifications. Each UI modification can define up to 1000 contexts. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _None_ if the UI modification is created without contexts. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the - * UI modification is created with contexts. - */ - async createUiModification( - parameters: Parameters.CreateUiModification, - callback: Callback, - ): Promise; - /** - * Creates a UI modification. UI modification can only be created by Forge apps. - * - * Each app can define up to 100 UI modifications. Each UI modification can define up to 1000 contexts. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _None_ if the UI modification is created without contexts. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the - * UI modification is created with contexts. - */ - async createUiModification( - parameters: Parameters.CreateUiModification, - callback?: never, - ): Promise; - async createUiModification( - parameters: Parameters.CreateUiModification, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/uiModifications', - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - data: parameters.data, - contexts: parameters.contexts, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a UI modification. UI modification can only be updated by Forge apps. - * - * Each UI modification can define up to 1000 contexts. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _None_ if the UI modification is created without contexts. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the - * UI modification is created with contexts. - */ - async updateUiModification( - parameters: Parameters.UpdateUiModification, - callback: Callback, - ): Promise; - /** - * Updates a UI modification. UI modification can only be updated by Forge apps. - * - * Each UI modification can define up to 1000 contexts. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _None_ if the UI modification is created without contexts. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the - * UI modification is created with contexts. - */ - async updateUiModification(parameters: Parameters.UpdateUiModification, callback?: never): Promise; - async updateUiModification( - parameters: Parameters.UpdateUiModification, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/uiModifications/${parameters.uiModificationId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - data: parameters.data, - contexts: parameters.contexts, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can - * only be deleted by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async deleteUiModification( - parameters: Parameters.DeleteUiModification | string, - callback: Callback, - ): Promise; - /** - * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can - * only be deleted by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async deleteUiModification( - parameters: Parameters.DeleteUiModification | string, - callback?: never, - ): Promise; - async deleteUiModification( - parameters: Parameters.DeleteUiModification | string, - callback?: Callback, - ): Promise { - const uiModificationId = typeof parameters === 'string' ? parameters : parameters.uiModificationId; - - const config: RequestConfig = { - url: `/rest/api/2/uiModifications/${uiModificationId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/uiModificationsApps.mts b/src/version2/uiModificationsApps.mts new file mode 100644 index 000000000..06bb9bd3c --- /dev/null +++ b/src/version2/uiModificationsApps.mts @@ -0,0 +1,171 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class UiModificationsApps { + constructor(private client: Client) {} + + /** + * Gets UI modifications. UI modifications can only be retrieved by Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getUiModifications( + parameters: Parameters.GetUiModifications | undefined, + callback: Callback, + ): Promise; + /** + * Gets UI modifications. UI modifications can only be retrieved by Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getUiModifications( + parameters?: Parameters.GetUiModifications, + callback?: never, + ): Promise; + async getUiModifications( + parameters?: Parameters.GetUiModifications, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/uiModifications', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a UI modification. UI modification can only be created by Forge apps. + * + * Each app can define up to 100 UI modifications. Each UI modification can define up to 1000 contexts. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _None_ if the UI modification is created without contexts. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the + * UI modification is created with contexts. + */ + async createUiModification( + parameters: Parameters.CreateUiModification, + callback: Callback, + ): Promise; + /** + * Creates a UI modification. UI modification can only be created by Forge apps. + * + * Each app can define up to 100 UI modifications. Each UI modification can define up to 1000 contexts. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _None_ if the UI modification is created without contexts. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the + * UI modification is created with contexts. + */ + async createUiModification( + parameters: Parameters.CreateUiModification, + callback?: never, + ): Promise; + async createUiModification( + parameters: Parameters.CreateUiModification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/uiModifications', + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + data: parameters.data, + contexts: parameters.contexts, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a UI modification. UI modification can only be updated by Forge apps. + * + * Each UI modification can define up to 1000 contexts. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _None_ if the UI modification is created without contexts. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the + * UI modification is created with contexts. + */ + async updateUiModification( + parameters: Parameters.UpdateUiModification, + callback: Callback, + ): Promise; + /** + * Updates a UI modification. UI modification can only be updated by Forge apps. + * + * Each UI modification can define up to 1000 contexts. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _None_ if the UI modification is created without contexts. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the + * UI modification is created with contexts. + */ + async updateUiModification(parameters: Parameters.UpdateUiModification, callback?: never): Promise; + async updateUiModification( + parameters: Parameters.UpdateUiModification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/uiModifications/${parameters.uiModificationId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + data: parameters.data, + contexts: parameters.contexts, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can + * only be deleted by Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async deleteUiModification( + parameters: Parameters.DeleteUiModification | string, + callback: Callback, + ): Promise; + /** + * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can + * only be deleted by Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async deleteUiModification( + parameters: Parameters.DeleteUiModification | string, + callback?: never, + ): Promise; + async deleteUiModification( + parameters: Parameters.DeleteUiModification | string, + callback?: Callback, + ): Promise { + const uiModificationId = typeof parameters === 'string' ? parameters : parameters.uiModificationId; + + const config: RequestConfig = { + url: `/rest/api/2/uiModifications/${uiModificationId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/userProperties.mts b/src/version2/userProperties.mts new file mode 100644 index 000000000..eac9a71c7 --- /dev/null +++ b/src/version2/userProperties.mts @@ -0,0 +1,190 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class UserProperties { + constructor(private client: Client) {} + + /** + * Returns the keys of all properties for a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on + * any user. + * - Access to Jira, to access the calling user's property keys. + */ + async getUserPropertyKeys( + parameters: Parameters.GetUserPropertyKeys | undefined, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on + * any user. + * - Access to Jira, to access the calling user's property keys. + */ + async getUserPropertyKeys( + parameters?: Parameters.GetUserPropertyKeys, + callback?: never, + ): Promise; + async getUserPropertyKeys( + parameters?: Parameters.GetUserPropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/properties', + method: 'GET', + params: { + accountId: parameters?.accountId, + userKey: parameters?.userKey, + username: parameters?.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a user's property. If no property key is provided [Get user property + * keys](#api-rest-api-2-user-properties-get) is called. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. + * - Access to Jira, to get a property from the calling user's record. + */ + async getUserProperty( + parameters: Parameters.GetUserProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a user's property. If no property key is provided [Get user property + * keys](#api-rest-api-2-user-properties-get) is called. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. + * - Access to Jira, to get a property from the calling user's record. + */ + async getUserProperty( + parameters: Parameters.GetUserProperty, + callback?: never, + ): Promise; + async getUserProperty( + parameters: Parameters.GetUserProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/user/properties/${parameters.propertyKey}`, + method: 'GET', + params: { + accountId: parameters.accountId, + userKey: parameters.userKey, + username: parameters.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a user's property. Use this resource to store custom data against a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set a property on any user. + * - Access to Jira, to set a property on the calling user's record. + */ + async setUserProperty(parameters: Parameters.SetUserProperty, callback: Callback): Promise; + /** + * Sets the value of a user's property. Use this resource to store custom data against a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set a property on any user. + * - Access to Jira, to set a property on the calling user's record. + */ + async setUserProperty(parameters: Parameters.SetUserProperty, callback?: never): Promise; + async setUserProperty( + parameters: Parameters.SetUserProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/user/properties/${parameters.propertyKey}`, + method: 'PUT', + params: { + accountId: parameters.accountId, + }, + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a property from a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any + * user. + * - Access to Jira, to delete a property from the calling user's record. + */ + async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback: Callback): Promise; + /** + * Deletes a property from a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any + * user. + * - Access to Jira, to delete a property from the calling user's record. + */ + async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback?: never): Promise; + async deleteUserProperty( + parameters: Parameters.DeleteUserProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/user/properties/${parameters.propertyKey}`, + method: 'DELETE', + params: { + accountId: parameters.accountId, + userKey: parameters.userKey, + username: parameters.username, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/userProperties.ts b/src/version2/userProperties.ts deleted file mode 100644 index d150d2dc5..000000000 --- a/src/version2/userProperties.ts +++ /dev/null @@ -1,190 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class UserProperties { - constructor(private client: Client) {} - - /** - * Returns the keys of all properties for a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on - * any user. - * - Access to Jira, to access the calling user's property keys. - */ - async getUserPropertyKeys( - parameters: Parameters.GetUserPropertyKeys | undefined, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on - * any user. - * - Access to Jira, to access the calling user's property keys. - */ - async getUserPropertyKeys( - parameters?: Parameters.GetUserPropertyKeys, - callback?: never, - ): Promise; - async getUserPropertyKeys( - parameters?: Parameters.GetUserPropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/properties', - method: 'GET', - params: { - accountId: parameters?.accountId, - userKey: parameters?.userKey, - username: parameters?.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a user's property. If no property key is provided [Get user property - * keys](#api-rest-api-2-user-properties-get) is called. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. - * - Access to Jira, to get a property from the calling user's record. - */ - async getUserProperty( - parameters: Parameters.GetUserProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a user's property. If no property key is provided [Get user property - * keys](#api-rest-api-2-user-properties-get) is called. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. - * - Access to Jira, to get a property from the calling user's record. - */ - async getUserProperty( - parameters: Parameters.GetUserProperty, - callback?: never, - ): Promise; - async getUserProperty( - parameters: Parameters.GetUserProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/user/properties/${parameters.propertyKey}`, - method: 'GET', - params: { - accountId: parameters.accountId, - userKey: parameters.userKey, - username: parameters.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a user's property. Use this resource to store custom data against a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set a property on any user. - * - Access to Jira, to set a property on the calling user's record. - */ - async setUserProperty(parameters: Parameters.SetUserProperty, callback: Callback): Promise; - /** - * Sets the value of a user's property. Use this resource to store custom data against a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set a property on any user. - * - Access to Jira, to set a property on the calling user's record. - */ - async setUserProperty(parameters: Parameters.SetUserProperty, callback?: never): Promise; - async setUserProperty( - parameters: Parameters.SetUserProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/user/properties/${parameters.propertyKey}`, - method: 'PUT', - params: { - accountId: parameters.accountId, - }, - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a property from a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any - * user. - * - Access to Jira, to delete a property from the calling user's record. - */ - async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback: Callback): Promise; - /** - * Deletes a property from a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any - * user. - * - Access to Jira, to delete a property from the calling user's record. - */ - async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback?: never): Promise; - async deleteUserProperty( - parameters: Parameters.DeleteUserProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/user/properties/${parameters.propertyKey}`, - method: 'DELETE', - params: { - accountId: parameters.accountId, - userKey: parameters.userKey, - username: parameters.username, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/userSearch.mts b/src/version2/userSearch.mts new file mode 100644 index 000000000..b46ed99e5 --- /dev/null +++ b/src/version2/userSearch.mts @@ -0,0 +1,608 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { paramSerializer } from '../paramSerializer.mjs'; +import { RequestConfig } from '../requestConfig.mjs'; + +export class UserSearch { + constructor(private client: Client) {} + + /** + * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users + * whose attributes match a string. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned issues in the projects. This means the operation + * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the + * projects, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async findBulkAssignableUsers( + parameters: Parameters.FindBulkAssignableUsers, + callback: Callback, + ): Promise; + /** + * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users + * whose attributes match a string. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned issues in the projects. This means the operation + * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the + * projects, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async findBulkAssignableUsers( + parameters: Parameters.FindBulkAssignableUsers, + callback?: never, + ): Promise; + async findBulkAssignableUsers( + parameters: Parameters.FindBulkAssignableUsers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/assignable/multiProjectSearch', + method: 'GET', + params: { + query: parameters.query, + username: parameters.username, + accountId: parameters.accountId, + projectKeys: parameters.projectKeys, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be + * assigned to: + * + * - A new issue, by providing the `projectKeyOrId`. + * - An updated issue, by providing the `issueKey`. + * - To an issue during a transition (workflow action), by providing the `issueKey` and the transition id in + * `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in + * the `expand` parameter of [ Get issue](#api-rest-api-2-issue-issueIdOrKey-get). + * + * In all these cases, you can pass an account ID to determine if a user can be assigned to an issue. The user is + * returned in the response if they can be assigned to the issue or issue transition. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned the issue. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get + * all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async findAssignableUsers( + parameters: Parameters.FindAssignableUsers | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be + * assigned to: + * + * - A new issue, by providing the `projectKeyOrId`. + * - An updated issue, by providing the `issueKey`. + * - To an issue during a transition (workflow action), by providing the `issueKey` and the transition id in + * `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in + * the `expand` parameter of [ Get issue](#api-rest-api-2-issue-issueIdOrKey-get). + * + * In all these cases, you can pass an account ID to determine if a user can be assigned to an issue. The user is + * returned in the response if they can be assigned to the issue or issue transition. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned the issue. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get + * all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async findAssignableUsers( + parameters?: Parameters.FindAssignableUsers, + callback?: never, + ): Promise; + async findAssignableUsers( + parameters?: Parameters.FindAssignableUsers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/assignable/search', + method: 'GET', + params: { + query: parameters?.query, + sessionId: parameters?.sessionId, + username: parameters?.username, + accountId: parameters?.accountId, + project: parameters?.project, + issueKey: parameters?.issueKey, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + actionDescriptorId: parameters?.actionDescriptorId, + recommend: parameters?.recommend, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users who fulfill these criteria: + * + * - Their user attributes match a search string. + * - They have a set of permissions for a project or issue. + * + * If no search string is provided, a list of all users with the permissions is returned. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission for the project or + * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users + * who match the search string and have permission for the project or issue, use [Get all + * users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users + * for that project. + */ + async findUsersWithAllPermissions( + parameters: Parameters.FindUsersWithAllPermissions, + callback: Callback, + ): Promise; + /** + * Returns a list of users who fulfill these criteria: + * + * - Their user attributes match a search string. + * - They have a set of permissions for a project or issue. + * + * If no search string is provided, a list of all users with the permissions is returned. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission for the project or + * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users + * who match the search string and have permission for the project or issue, use [Get all + * users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users + * for that project. + */ + async findUsersWithAllPermissions( + parameters: Parameters.FindUsersWithAllPermissions, + callback?: never, + ): Promise; + async findUsersWithAllPermissions( + parameters: Parameters.FindUsersWithAllPermissions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/permission/search', + method: 'GET', + params: { + query: parameters.query, + username: parameters.username, + accountId: parameters.accountId, + permissions: parameters.permissions, + issueKey: parameters.issueKey, + projectKey: parameters.projectKey, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where + * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude + * users from the results. + * + * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns + * only the users from that range that match the query term. This means the operation usually returns fewer users than + * specified in `maxResults`. To get all the users who match the query term, use [Get all + * users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by + * users without the required permission return search results for an exact name match only. + */ + async findUsersForPicker( + parameters: Parameters.FindUsersForPicker, + callback: Callback, + ): Promise; + /** + * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where + * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude + * users from the results. + * + * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns + * only the users from that range that match the query term. This means the operation usually returns fewer users than + * specified in `maxResults`. To get all the users who match the query term, use [Get all + * users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by + * users without the required permission return search results for an exact name match only. + */ + async findUsersForPicker( + parameters: Parameters.FindUsersForPicker, + callback?: never, + ): Promise; + async findUsersForPicker( + parameters: Parameters.FindUsersForPicker, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/picker', + method: 'GET', + params: { + query: parameters.query, + maxResults: parameters.maxResults, + showAvatar: parameters.showAvatar, + excludeAccountIds: paramSerializer('excludeAccountIds', parameters.excludeAccountIds), + avatarSize: parameters.avatarSize, + excludeConnectUsers: parameters.excludeConnectUsers, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users that match the search string and property. + * + * This operation first applies a filter to match the search string and property, and then takes the filtered users in + * the range defined by `startAt` and `maxResults`, up to the thousandth user. To get all the users who match the + * search string and property, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your + * code. + * + * This operation can be accessed anonymously. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users + * without the required permission return empty search results. + */ + async findUsers( + parameters: Parameters.FindUsers | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of users that match the search string and property. + * + * This operation first applies a filter to match the search string and property, and then takes the filtered users in + * the range defined by `startAt` and `maxResults`, up to the thousandth user. To get all the users who match the + * search string and property, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your + * code. + * + * This operation can be accessed anonymously. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users + * without the required permission return empty search results. + */ + async findUsers(parameters?: Parameters.FindUsers, callback?: never): Promise; + async findUsers(parameters?: Parameters.FindUsers, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/search', + method: 'GET', + params: { + query: parameters?.query, + username: parameters?.username, + accountId: parameters?.accountId, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + property: parameters?.property, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Finds users with a structured query and returns a + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user details. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * The query statements are: + * + * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. + * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or + * _PROJ-2_. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * + * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined + * using the `AND` and `OR` operators to form more complex queries. For example: + * + * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + */ + async findUsersByQuery( + parameters: Parameters.FindUsersByQuery, + callback: Callback, + ): Promise; + /** + * Finds users with a structured query and returns a + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user details. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * The query statements are: + * + * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. + * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or + * _PROJ-2_. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * + * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined + * using the `AND` and `OR` operators to form more complex queries. For example: + * + * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + */ + async findUsersByQuery(parameters: Parameters.FindUsersByQuery, callback?: never): Promise; + async findUsersByQuery( + parameters: Parameters.FindUsersByQuery, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/search/query', + method: 'GET', + params: { + query: parameters.query, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Finds users with a structured query and returns a + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user keys. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * The query statements are: + * + * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. + * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or + * _PROJ-2_. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * + * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined + * using the `AND` and `OR` operators to form more complex queries. For example: + * + * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + */ + async findUserKeysByQuery( + parameters: Parameters.FindUserKeysByQuery, + callback: Callback, + ): Promise; + /** + * Finds users with a structured query and returns a + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user keys. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * The query statements are: + * + * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. + * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or + * _PROJ-2_. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * + * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined + * using the `AND` and `OR` operators to form more complex queries. For example: + * + * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + */ + async findUserKeysByQuery( + parameters: Parameters.FindUserKeysByQuery, + callback?: never, + ): Promise; + async findUserKeysByQuery( + parameters: Parameters.FindUserKeysByQuery, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/search/query/key', + method: 'GET', + params: { + query: parameters.query, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users who fulfill these criteria: + * + * - Their user attributes match a search string. + * - They have permission to browse issues. + * + * Use this resource to find users who can browse: + * + * - An issue, by providing the `issueKey`. + * - Any issue in a project, by providing the `projectKey`. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission to browse issues. This + * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the + * search string and have permission to browse issues, use [Get all users](#api-rest-api-2-users-search-get) and + * filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by + * users without the required permission return empty search results. + */ + async findUsersWithBrowsePermission( + parameters: Parameters.FindUsersWithBrowsePermission | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of users who fulfill these criteria: + * + * - Their user attributes match a search string. + * - They have permission to browse issues. + * + * Use this resource to find users who can browse: + * + * - An issue, by providing the `issueKey`. + * - Any issue in a project, by providing the `projectKey`. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission to browse issues. This + * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the + * search string and have permission to browse issues, use [Get all users](#api-rest-api-2-users-search-get) and + * filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by + * users without the required permission return empty search results. + */ + async findUsersWithBrowsePermission( + parameters?: Parameters.FindUsersWithBrowsePermission, + callback?: never, + ): Promise; + async findUsersWithBrowsePermission( + parameters?: Parameters.FindUsersWithBrowsePermission, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/viewissue/search', + method: 'GET', + params: { + query: parameters?.query, + username: parameters?.username, + accountId: parameters?.accountId, + issueKey: parameters?.issueKey, + projectKey: parameters?.projectKey, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/userSearch.ts b/src/version2/userSearch.ts deleted file mode 100644 index 48eeda07b..000000000 --- a/src/version2/userSearch.ts +++ /dev/null @@ -1,608 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import { paramSerializer } from '../paramSerializer.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class UserSearch { - constructor(private client: Client) {} - - /** - * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users - * whose attributes match a string. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned issues in the projects. This means the operation - * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the - * projects, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async findBulkAssignableUsers( - parameters: Parameters.FindBulkAssignableUsers, - callback: Callback, - ): Promise; - /** - * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users - * whose attributes match a string. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned issues in the projects. This means the operation - * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the - * projects, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async findBulkAssignableUsers( - parameters: Parameters.FindBulkAssignableUsers, - callback?: never, - ): Promise; - async findBulkAssignableUsers( - parameters: Parameters.FindBulkAssignableUsers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/assignable/multiProjectSearch', - method: 'GET', - params: { - query: parameters.query, - username: parameters.username, - accountId: parameters.accountId, - projectKeys: parameters.projectKeys, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be - * assigned to: - * - * - A new issue, by providing the `projectKeyOrId`. - * - An updated issue, by providing the `issueKey`. - * - To an issue during a transition (workflow action), by providing the `issueKey` and the transition id in - * `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in - * the `expand` parameter of [ Get issue](#api-rest-api-2-issue-issueIdOrKey-get). - * - * In all these cases, you can pass an account ID to determine if a user can be assigned to an issue. The user is - * returned in the response if they can be assigned to the issue or issue transition. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned the issue. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async findAssignableUsers( - parameters: Parameters.FindAssignableUsers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be - * assigned to: - * - * - A new issue, by providing the `projectKeyOrId`. - * - An updated issue, by providing the `issueKey`. - * - To an issue during a transition (workflow action), by providing the `issueKey` and the transition id in - * `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in - * the `expand` parameter of [ Get issue](#api-rest-api-2-issue-issueIdOrKey-get). - * - * In all these cases, you can pass an account ID to determine if a user can be assigned to an issue. The user is - * returned in the response if they can be assigned to the issue or issue transition. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned the issue. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async findAssignableUsers( - parameters?: Parameters.FindAssignableUsers, - callback?: never, - ): Promise; - async findAssignableUsers( - parameters?: Parameters.FindAssignableUsers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/assignable/search', - method: 'GET', - params: { - query: parameters?.query, - sessionId: parameters?.sessionId, - username: parameters?.username, - accountId: parameters?.accountId, - project: parameters?.project, - issueKey: parameters?.issueKey, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - actionDescriptorId: parameters?.actionDescriptorId, - recommend: parameters?.recommend, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have a set of permissions for a project or issue. - * - * If no search string is provided, a list of all users with the permissions is returned. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission for the project or - * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users - * who match the search string and have permission for the project or issue, use [Get all - * users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users - * for that project. - */ - async findUsersWithAllPermissions( - parameters: Parameters.FindUsersWithAllPermissions, - callback: Callback, - ): Promise; - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have a set of permissions for a project or issue. - * - * If no search string is provided, a list of all users with the permissions is returned. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission for the project or - * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users - * who match the search string and have permission for the project or issue, use [Get all - * users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users - * for that project. - */ - async findUsersWithAllPermissions( - parameters: Parameters.FindUsersWithAllPermissions, - callback?: never, - ): Promise; - async findUsersWithAllPermissions( - parameters: Parameters.FindUsersWithAllPermissions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/permission/search', - method: 'GET', - params: { - query: parameters.query, - username: parameters.username, - accountId: parameters.accountId, - permissions: parameters.permissions, - issueKey: parameters.issueKey, - projectKey: parameters.projectKey, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where - * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude - * users from the results. - * - * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns - * only the users from that range that match the query term. This means the operation usually returns fewer users than - * specified in `maxResults`. To get all the users who match the query term, use [Get all - * users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by - * users without the required permission return search results for an exact name match only. - */ - async findUsersForPicker( - parameters: Parameters.FindUsersForPicker, - callback: Callback, - ): Promise; - /** - * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where - * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude - * users from the results. - * - * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns - * only the users from that range that match the query term. This means the operation usually returns fewer users than - * specified in `maxResults`. To get all the users who match the query term, use [Get all - * users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by - * users without the required permission return search results for an exact name match only. - */ - async findUsersForPicker( - parameters: Parameters.FindUsersForPicker, - callback?: never, - ): Promise; - async findUsersForPicker( - parameters: Parameters.FindUsersForPicker, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/picker', - method: 'GET', - params: { - query: parameters.query, - maxResults: parameters.maxResults, - showAvatar: parameters.showAvatar, - excludeAccountIds: paramSerializer('excludeAccountIds', parameters.excludeAccountIds), - avatarSize: parameters.avatarSize, - excludeConnectUsers: parameters.excludeConnectUsers, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users that match the search string and property. - * - * This operation first applies a filter to match the search string and property, and then takes the filtered users in - * the range defined by `startAt` and `maxResults`, up to the thousandth user. To get all the users who match the - * search string and property, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your - * code. - * - * This operation can be accessed anonymously. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users - * without the required permission return empty search results. - */ - async findUsers( - parameters: Parameters.FindUsers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of users that match the search string and property. - * - * This operation first applies a filter to match the search string and property, and then takes the filtered users in - * the range defined by `startAt` and `maxResults`, up to the thousandth user. To get all the users who match the - * search string and property, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your - * code. - * - * This operation can be accessed anonymously. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users - * without the required permission return empty search results. - */ - async findUsers(parameters?: Parameters.FindUsers, callback?: never): Promise; - async findUsers(parameters?: Parameters.FindUsers, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/search', - method: 'GET', - params: { - query: parameters?.query, - username: parameters?.username, - accountId: parameters?.accountId, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - property: parameters?.property, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user details. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. - * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or - * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. - * - * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined - * using the `AND` and `OR` operators to form more complex queries. For example: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUsersByQuery( - parameters: Parameters.FindUsersByQuery, - callback: Callback, - ): Promise; - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user details. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. - * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or - * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. - * - * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined - * using the `AND` and `OR` operators to form more complex queries. For example: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUsersByQuery(parameters: Parameters.FindUsersByQuery, callback?: never): Promise; - async findUsersByQuery( - parameters: Parameters.FindUsersByQuery, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/search/query', - method: 'GET', - params: { - query: parameters.query, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user keys. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. - * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or - * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. - * - * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined - * using the `AND` and `OR` operators to form more complex queries. For example: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUserKeysByQuery( - parameters: Parameters.FindUserKeysByQuery, - callback: Callback, - ): Promise; - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user keys. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. - * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or - * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. - * - * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined - * using the `AND` and `OR` operators to form more complex queries. For example: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUserKeysByQuery( - parameters: Parameters.FindUserKeysByQuery, - callback?: never, - ): Promise; - async findUserKeysByQuery( - parameters: Parameters.FindUserKeysByQuery, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/search/query/key', - method: 'GET', - params: { - query: parameters.query, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have permission to browse issues. - * - * Use this resource to find users who can browse: - * - * - An issue, by providing the `issueKey`. - * - Any issue in a project, by providing the `projectKey`. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission to browse issues. This - * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the - * search string and have permission to browse issues, use [Get all users](#api-rest-api-2-users-search-get) and - * filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by - * users without the required permission return empty search results. - */ - async findUsersWithBrowsePermission( - parameters: Parameters.FindUsersWithBrowsePermission | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have permission to browse issues. - * - * Use this resource to find users who can browse: - * - * - An issue, by providing the `issueKey`. - * - Any issue in a project, by providing the `projectKey`. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission to browse issues. This - * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the - * search string and have permission to browse issues, use [Get all users](#api-rest-api-2-users-search-get) and - * filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by - * users without the required permission return empty search results. - */ - async findUsersWithBrowsePermission( - parameters?: Parameters.FindUsersWithBrowsePermission, - callback?: never, - ): Promise; - async findUsersWithBrowsePermission( - parameters?: Parameters.FindUsersWithBrowsePermission, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/viewissue/search', - method: 'GET', - params: { - query: parameters?.query, - username: parameters?.username, - accountId: parameters?.accountId, - issueKey: parameters?.issueKey, - projectKey: parameters?.projectKey, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/users.mts b/src/version2/users.mts new file mode 100644 index 000000000..949037901 --- /dev/null +++ b/src/version2/users.mts @@ -0,0 +1,495 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { paramSerializer } from '../paramSerializer.mjs'; +import { RequestConfig } from '../requestConfig.mjs'; + +export class Users { + constructor(private client: Client) {} + + /** + * Returns a user. + * + * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getUser(parameters: Parameters.GetUser | undefined, callback: Callback): Promise; + /** + * Returns a user. + * + * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getUser(parameters?: Parameters.GetUser, callback?: never): Promise; + async getUser(parameters?: Parameters.GetUser, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user', + method: 'GET', + params: { + accountId: parameters?.accountId, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is + * available this resource will be deprecated. + * + * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have + * access to Jira, the operation returns a 400 status. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createUser(parameters: Parameters.CreateUser, callback: Callback): Promise; + /** + * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is + * available this resource will be deprecated. + * + * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have + * access to Jira, the operation returns a 400 status. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createUser(parameters: Parameters.CreateUser, callback?: never): Promise; + async createUser(parameters: Parameters.CreateUser, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user', + method: 'POST', + data: { + emailAddress: parameters.emailAddress, + key: parameters.key, + name: parameters.name, + password: parameters.password, + products: parameters.products, + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This + * operation does not delete the user's Atlassian account. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeUser(parameters: Parameters.RemoveUser, callback: Callback): Promise; + /** + * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This + * operation does not delete the user's Atlassian account. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeUser(parameters: Parameters.RemoveUser, callback?: never): Promise; + async removeUser(parameters: Parameters.RemoveUser, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user', + method: 'DELETE', + params: { + accountId: parameters.accountId, + username: parameters.username, + key: parameters.key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the + * users specified by one or more account IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback: Callback): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the + * users specified by one or more account IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback?: never): Promise; + async bulkGetUsers( + parameters: Parameters.BulkGetUsers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/bulk', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + accountId: paramSerializer('accountId', parameters.accountId), + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or + * `username` parameters can be specified. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async bulkGetUsersMigration( + parameters: Parameters.BulkGetUsersMigration, + callback: Callback, + ): Promise; + /** + * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or + * `username` parameters can be specified. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async bulkGetUsersMigration( + parameters: Parameters.BulkGetUsersMigration, + callback?: never, + ): Promise; + async bulkGetUsersMigration( + parameters: Parameters.BulkGetUsersMigration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/bulk/migration', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + username: paramSerializer('username', parameters.username), + key: paramSerializer('key', parameters.key), + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` + * is not passed in the request, the calling user's details are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for + * any user. + * - Permission to access Jira, to get the calling user's column details. + */ + async getUserDefaultColumns( + parameters: Parameters.GetUserDefaultColumns | undefined, + callback: Callback, + ): Promise; + /** + * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` + * is not passed in the request, the calling user's details are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for + * any user. + * - Permission to access Jira, to get the calling user's column details. + */ + async getUserDefaultColumns( + parameters?: Parameters.GetUserDefaultColumns, + callback?: never, + ): Promise; + async getUserDefaultColumns( + parameters?: Parameters.GetUserDefaultColumns, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/columns', + method: 'GET', + params: { + accountId: parameters?.accountId, + username: parameters?.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If an account ID + * is not passed, the calling user's default columns are set. If no column details are sent, then all default columns + * are removed. + * + * The parameters for this resource are expressed as HTML form data. For example, in curl: + * + * `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/2/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. + * - Permission to access Jira, to set the calling user's columns. + */ + async setUserColumns( + parameters: Parameters.SetUserColumns | undefined, + callback: Callback, + ): Promise; + /** + * Sets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If an account ID + * is not passed, the calling user's default columns are set. If no column details are sent, then all default columns + * are removed. + * + * The parameters for this resource are expressed as HTML form data. For example, in curl: + * + * `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/2/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. + * - Permission to access Jira, to set the calling user's columns. + */ + async setUserColumns(parameters?: Parameters.SetUserColumns, callback?: never): Promise; + async setUserColumns(parameters?: Parameters.SetUserColumns, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/columns', + method: 'PUT', + params: { + accountId: parameters?.accountId, + }, + data: parameters?.columns, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system + * default. If `accountId` is not passed, the calling user's default columns are reset. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. + * - Permission to access Jira, to set the calling user's columns. + */ + async resetUserColumns(parameters: Parameters.ResetUserColumns, callback: Callback): Promise; + /** + * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system + * default. If `accountId` is not passed, the calling user's default columns are reset. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. + * - Permission to access Jira, to set the calling user's columns. + */ + async resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: never): Promise; + async resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/columns', + method: 'DELETE', + params: { + accountId: parameters.accountId, + username: parameters.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + */ + async getUserEmail( + parameters: Parameters.GetUserEmail | string, + callback: Callback, + ): Promise; + /** + * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + */ + async getUserEmail( + parameters: Parameters.GetUserEmail | string, + callback?: never, + ): Promise; + async getUserEmail( + parameters: Parameters.GetUserEmail | string, + callback?: Callback, + ): Promise { + const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; + + const config: RequestConfig = { + url: '/rest/api/2/user/email', + method: 'GET', + params: { + accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + */ + async getUserEmailBulk( + parameters: Parameters.GetUserEmailBulk | string, + callback: Callback, + ): Promise; + /** + * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + */ + async getUserEmailBulk( + parameters: Parameters.GetUserEmailBulk | string, + callback?: never, + ): Promise; + async getUserEmailBulk( + parameters: Parameters.GetUserEmailBulk | string, + callback?: Callback, + ): Promise { + const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; + + const config: RequestConfig = { + url: '/rest/api/2/user/email/bulk', + method: 'GET', + params: { + accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the groups to which a user belongs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getUserGroups( + parameters: Parameters.GetUserGroups, + callback: Callback, + ): Promise; + /** + * Returns the groups to which a user belongs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getUserGroups(parameters: Parameters.GetUserGroups, callback?: never): Promise; + async getUserGroups( + parameters: Parameters.GetUserGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/groups', + method: 'GET', + params: { + accountId: parameters.accountId, + username: parameters.username, + key: parameters.key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of all users, including active users, inactive users and previously deleted users that have an + * Atlassian account. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllUsersDefault( + parameters: Parameters.GetAllUsersDefault | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of all users, including active users, inactive users and previously deleted users that have an + * Atlassian account. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllUsersDefault(parameters?: Parameters.GetAllUsersDefault, callback?: never): Promise; + async getAllUsersDefault( + parameters?: Parameters.GetAllUsersDefault, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/users', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of all users, including active users, inactive users and previously deleted users that have an + * Atlassian account. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllUsers( + parameters: Parameters.GetAllUsers | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of all users, including active users, inactive users and previously deleted users that have an + * Atlassian account. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: never): Promise; + async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/users/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/users.ts b/src/version2/users.ts deleted file mode 100644 index 1be9e4bb5..000000000 --- a/src/version2/users.ts +++ /dev/null @@ -1,495 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import { paramSerializer } from '../paramSerializer.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Users { - constructor(private client: Client) {} - - /** - * Returns a user. - * - * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getUser(parameters: Parameters.GetUser | undefined, callback: Callback): Promise; - /** - * Returns a user. - * - * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getUser(parameters?: Parameters.GetUser, callback?: never): Promise; - async getUser(parameters?: Parameters.GetUser, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user', - method: 'GET', - params: { - accountId: parameters?.accountId, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is - * available this resource will be deprecated. - * - * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have - * access to Jira, the operation returns a 400 status. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createUser(parameters: Parameters.CreateUser, callback: Callback): Promise; - /** - * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is - * available this resource will be deprecated. - * - * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have - * access to Jira, the operation returns a 400 status. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createUser(parameters: Parameters.CreateUser, callback?: never): Promise; - async createUser(parameters: Parameters.CreateUser, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user', - method: 'POST', - data: { - emailAddress: parameters.emailAddress, - key: parameters.key, - name: parameters.name, - password: parameters.password, - products: parameters.products, - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This - * operation does not delete the user's Atlassian account. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUser(parameters: Parameters.RemoveUser, callback: Callback): Promise; - /** - * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This - * operation does not delete the user's Atlassian account. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUser(parameters: Parameters.RemoveUser, callback?: never): Promise; - async removeUser(parameters: Parameters.RemoveUser, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user', - method: 'DELETE', - params: { - accountId: parameters.accountId, - username: parameters.username, - key: parameters.key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * users specified by one or more account IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback: Callback): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * users specified by one or more account IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback?: never): Promise; - async bulkGetUsers( - parameters: Parameters.BulkGetUsers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/bulk', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - accountId: paramSerializer('accountId', parameters.accountId), - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or - * `username` parameters can be specified. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsersMigration( - parameters: Parameters.BulkGetUsersMigration, - callback: Callback, - ): Promise; - /** - * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or - * `username` parameters can be specified. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsersMigration( - parameters: Parameters.BulkGetUsersMigration, - callback?: never, - ): Promise; - async bulkGetUsersMigration( - parameters: Parameters.BulkGetUsersMigration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/bulk/migration', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - username: paramSerializer('username', parameters.username), - key: paramSerializer('key', parameters.key), - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` - * is not passed in the request, the calling user's details are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for - * any user. - * - Permission to access Jira, to get the calling user's column details. - */ - async getUserDefaultColumns( - parameters: Parameters.GetUserDefaultColumns | undefined, - callback: Callback, - ): Promise; - /** - * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` - * is not passed in the request, the calling user's details are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for - * any user. - * - Permission to access Jira, to get the calling user's column details. - */ - async getUserDefaultColumns( - parameters?: Parameters.GetUserDefaultColumns, - callback?: never, - ): Promise; - async getUserDefaultColumns( - parameters?: Parameters.GetUserDefaultColumns, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/columns', - method: 'GET', - params: { - accountId: parameters?.accountId, - username: parameters?.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If an account ID - * is not passed, the calling user's default columns are set. If no column details are sent, then all default columns - * are removed. - * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/2/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. - * - Permission to access Jira, to set the calling user's columns. - */ - async setUserColumns( - parameters: Parameters.SetUserColumns | undefined, - callback: Callback, - ): Promise; - /** - * Sets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If an account ID - * is not passed, the calling user's default columns are set. If no column details are sent, then all default columns - * are removed. - * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/2/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. - * - Permission to access Jira, to set the calling user's columns. - */ - async setUserColumns(parameters?: Parameters.SetUserColumns, callback?: never): Promise; - async setUserColumns(parameters?: Parameters.SetUserColumns, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/columns', - method: 'PUT', - params: { - accountId: parameters?.accountId, - }, - data: parameters?.columns, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system - * default. If `accountId` is not passed, the calling user's default columns are reset. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. - * - Permission to access Jira, to set the calling user's columns. - */ - async resetUserColumns(parameters: Parameters.ResetUserColumns, callback: Callback): Promise; - /** - * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system - * default. If `accountId` is not passed, the calling user's default columns are reset. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. - * - Permission to access Jira, to set the calling user's columns. - */ - async resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: never): Promise; - async resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/columns', - method: 'DELETE', - params: { - accountId: parameters.accountId, - username: parameters.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these - * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). - */ - async getUserEmail( - parameters: Parameters.GetUserEmail | string, - callback: Callback, - ): Promise; - /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these - * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). - */ - async getUserEmail( - parameters: Parameters.GetUserEmail | string, - callback?: never, - ): Promise; - async getUserEmail( - parameters: Parameters.GetUserEmail | string, - callback?: Callback, - ): Promise { - const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; - - const config: RequestConfig = { - url: '/rest/api/2/user/email', - method: 'GET', - params: { - accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these - * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). - */ - async getUserEmailBulk( - parameters: Parameters.GetUserEmailBulk | string, - callback: Callback, - ): Promise; - /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these - * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). - */ - async getUserEmailBulk( - parameters: Parameters.GetUserEmailBulk | string, - callback?: never, - ): Promise; - async getUserEmailBulk( - parameters: Parameters.GetUserEmailBulk | string, - callback?: Callback, - ): Promise { - const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; - - const config: RequestConfig = { - url: '/rest/api/2/user/email/bulk', - method: 'GET', - params: { - accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the groups to which a user belongs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getUserGroups( - parameters: Parameters.GetUserGroups, - callback: Callback, - ): Promise; - /** - * Returns the groups to which a user belongs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getUserGroups(parameters: Parameters.GetUserGroups, callback?: never): Promise; - async getUserGroups( - parameters: Parameters.GetUserGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/groups', - method: 'GET', - params: { - accountId: parameters.accountId, - username: parameters.username, - key: parameters.key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsersDefault( - parameters: Parameters.GetAllUsersDefault | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsersDefault(parameters?: Parameters.GetAllUsersDefault, callback?: never): Promise; - async getAllUsersDefault( - parameters?: Parameters.GetAllUsersDefault, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/users', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsers( - parameters: Parameters.GetAllUsers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: never): Promise; - async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/users/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/webhooks.mts b/src/version2/webhooks.mts new file mode 100644 index 000000000..c7ef3dbcf --- /dev/null +++ b/src/version2/webhooks.mts @@ -0,0 +1,221 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Webhooks { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the + * webhooks registered by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async getDynamicWebhooksForApp( + parameters: Parameters.GetDynamicWebhooksForApp | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the + * webhooks registered by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async getDynamicWebhooksForApp( + parameters?: Parameters.GetDynamicWebhooksForApp, + callback?: never, + ): Promise; + async getDynamicWebhooksForApp( + parameters?: Parameters.GetDynamicWebhooksForApp, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/webhook', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Registers webhooks. + * + * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the + * user who registered a dynamic webhook. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async registerDynamicWebhooks( + parameters: Parameters.RegisterDynamicWebhooks, + callback: Callback, + ): Promise; + /** + * Registers webhooks. + * + * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the + * user who registered a dynamic webhook. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async registerDynamicWebhooks( + parameters: Parameters.RegisterDynamicWebhooks, + callback?: never, + ): Promise; + async registerDynamicWebhooks( + parameters: Parameters.RegisterDynamicWebhooks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/webhook', + method: 'POST', + data: { + webhooks: parameters.webhooks, + url: parameters.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps + * are specified, they are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback: Callback): Promise; + /** + * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps + * are specified, they are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback?: never): Promise; + async deleteWebhookById( + parameters: Parameters.DeleteWebhookById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/webhook', + method: 'DELETE', + data: { + webhookIds: parameters.webhookIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of + * retries. + * + * After 72 hours the failure may no longer be returned by this operation. + * + * The oldest failure is returned first. + * + * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on + * the list as the `failedAfter` value or use the URL provided in `next`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. + */ + async getFailedWebhooks( + parameters: Parameters.GetFailedWebhooks | undefined, + callback: Callback, + ): Promise; + /** + * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of + * retries. + * + * After 72 hours the failure may no longer be returned by this operation. + * + * The oldest failure is returned first. + * + * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on + * the list as the `failedAfter` value or use the URL provided in `next`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. + */ + async getFailedWebhooks( + parameters?: Parameters.GetFailedWebhooks, + callback?: never, + ): Promise; + async getFailedWebhooks( + parameters?: Parameters.GetFailedWebhooks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/webhook/failed', + method: 'GET', + params: { + maxResults: parameters?.maxResults, + after: parameters?.after, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to + * keep them alive. + * + * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async refreshWebhooks( + parameters: Parameters.RefreshWebhooks, + callback: Callback, + ): Promise; + /** + * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to + * keep them alive. + * + * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async refreshWebhooks( + parameters: Parameters.RefreshWebhooks, + callback?: never, + ): Promise; + async refreshWebhooks( + parameters: Parameters.RefreshWebhooks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/webhook/refresh', + method: 'PUT', + data: { + webhookIds: parameters.webhookIds, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/webhooks.ts b/src/version2/webhooks.ts deleted file mode 100644 index f373e01a3..000000000 --- a/src/version2/webhooks.ts +++ /dev/null @@ -1,221 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Webhooks { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * webhooks registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async getDynamicWebhooksForApp( - parameters: Parameters.GetDynamicWebhooksForApp | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * webhooks registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async getDynamicWebhooksForApp( - parameters?: Parameters.GetDynamicWebhooksForApp, - callback?: never, - ): Promise; - async getDynamicWebhooksForApp( - parameters?: Parameters.GetDynamicWebhooksForApp, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/webhook', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Registers webhooks. - * - * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the - * user who registered a dynamic webhook. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async registerDynamicWebhooks( - parameters: Parameters.RegisterDynamicWebhooks, - callback: Callback, - ): Promise; - /** - * Registers webhooks. - * - * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the - * user who registered a dynamic webhook. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async registerDynamicWebhooks( - parameters: Parameters.RegisterDynamicWebhooks, - callback?: never, - ): Promise; - async registerDynamicWebhooks( - parameters: Parameters.RegisterDynamicWebhooks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/webhook', - method: 'POST', - data: { - webhooks: parameters.webhooks, - url: parameters.url, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps - * are specified, they are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback: Callback): Promise; - /** - * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps - * are specified, they are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback?: never): Promise; - async deleteWebhookById( - parameters: Parameters.DeleteWebhookById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/webhook', - method: 'DELETE', - data: { - webhookIds: parameters.webhookIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of - * retries. - * - * After 72 hours the failure may no longer be returned by this operation. - * - * The oldest failure is returned first. - * - * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on - * the list as the `failedAfter` value or use the URL provided in `next`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. - */ - async getFailedWebhooks( - parameters: Parameters.GetFailedWebhooks | undefined, - callback: Callback, - ): Promise; - /** - * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of - * retries. - * - * After 72 hours the failure may no longer be returned by this operation. - * - * The oldest failure is returned first. - * - * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on - * the list as the `failedAfter` value or use the URL provided in `next`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. - */ - async getFailedWebhooks( - parameters?: Parameters.GetFailedWebhooks, - callback?: never, - ): Promise; - async getFailedWebhooks( - parameters?: Parameters.GetFailedWebhooks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/webhook/failed', - method: 'GET', - params: { - maxResults: parameters?.maxResults, - after: parameters?.after, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to - * keep them alive. - * - * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async refreshWebhooks( - parameters: Parameters.RefreshWebhooks, - callback: Callback, - ): Promise; - /** - * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to - * keep them alive. - * - * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async refreshWebhooks( - parameters: Parameters.RefreshWebhooks, - callback?: never, - ): Promise; - async refreshWebhooks( - parameters: Parameters.RefreshWebhooks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/webhook/refresh', - method: 'PUT', - data: { - webhookIds: parameters.webhookIds, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/workflowSchemeDrafts.mts b/src/version2/workflowSchemeDrafts.mts new file mode 100644 index 000000000..0a22b1b68 --- /dev/null +++ b/src/version2/workflowSchemeDrafts.mts @@ -0,0 +1,542 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowSchemeDrafts { + constructor(private client: Client) {} + + /** + * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an + * active workflow scheme can only have one draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflowSchemeDraftFromParent( + parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, + callback: Callback, + ): Promise; + /** + * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an + * active workflow scheme can only have one draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflowSchemeDraftFromParent( + parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, + callback?: never, + ): Promise; + async createWorkflowSchemeDraftFromParent( + parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/createdraft`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the draft workflow scheme for an active workflow scheme. Draft workflow schemes allow changes to be made to + * the active workflow schemes: When an active workflow scheme is updated, a draft copy is created. The draft is + * modified, then the changes in the draft are copied back to the active workflow scheme. See [Configuring workflow + * schemes](https://confluence.atlassian.com/x/tohKLg) for more information. Note that: + * + * - Only active workflow schemes can have draft workflow schemes. + * - An active workflow scheme can only have one draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeDraft( + parameters: Parameters.GetWorkflowSchemeDraft | string, + callback: Callback, + ): Promise; + /** + * Returns the draft workflow scheme for an active workflow scheme. Draft workflow schemes allow changes to be made to + * the active workflow schemes: When an active workflow scheme is updated, a draft copy is created. The draft is + * modified, then the changes in the draft are copied back to the active workflow scheme. See [Configuring workflow + * schemes](https://confluence.atlassian.com/x/tohKLg) for more information. Note that: + * + * - Only active workflow schemes can have draft workflow schemes. + * - An active workflow scheme can only have one draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeDraft( + parameters: Parameters.GetWorkflowSchemeDraft | string, + callback?: never, + ): Promise; + async getWorkflowSchemeDraft( + parameters: Parameters.GetWorkflowSchemeDraft | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/draft`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a + * draft is created. Note that an active workflow scheme can only have one draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowSchemeDraft( + parameters: Parameters.UpdateWorkflowSchemeDraft, + callback: Callback, + ): Promise; + /** + * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a + * draft is created. Note that an active workflow scheme can only have one draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowSchemeDraft( + parameters: Parameters.UpdateWorkflowSchemeDraft, + callback?: never, + ): Promise; + async updateWorkflowSchemeDraft( + parameters: Parameters.UpdateWorkflowSchemeDraft, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + defaultWorkflow: parameters.defaultWorkflow, + issueTypeMappings: parameters.issueTypeMappings, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeDraft( + parameters: Parameters.DeleteWorkflowSchemeDraft | string, + callback: Callback, + ): Promise; + /** + * Deletes a draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeDraft( + parameters: Parameters.DeleteWorkflowSchemeDraft | string, + callback?: never, + ): Promise; + async deleteWorkflowSchemeDraft( + parameters: Parameters.DeleteWorkflowSchemeDraft | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/draft`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned + * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue + * Types_ listed in its issue types for the workflow scheme in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDraftDefaultWorkflow( + parameters: Parameters.GetDraftDefaultWorkflow | string, + callback: Callback, + ): Promise; + /** + * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned + * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue + * Types_ listed in its issue types for the workflow scheme in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDraftDefaultWorkflow( + parameters: Parameters.GetDraftDefaultWorkflow | string, + callback?: never, + ): Promise; + async getDraftDefaultWorkflow( + parameters: Parameters.GetDraftDefaultWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/draft/default`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default workflow for a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDraftDefaultWorkflow( + parameters: Parameters.UpdateDraftDefaultWorkflow, + callback: Callback, + ): Promise; + /** + * Sets the default workflow for a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDraftDefaultWorkflow( + parameters: Parameters.UpdateDraftDefaultWorkflow, + callback?: never, + ): Promise; + async updateDraftDefaultWorkflow( + parameters: Parameters.UpdateDraftDefaultWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/default`, + method: 'PUT', + data: { + workflow: parameters.workflow, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system + * workflow (the _jira_ workflow). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDraftDefaultWorkflow( + parameters: Parameters.DeleteDraftDefaultWorkflow | string, + callback: Callback, + ): Promise; + /** + * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system + * workflow (the _jira_ workflow). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDraftDefaultWorkflow( + parameters: Parameters.DeleteDraftDefaultWorkflow | string, + callback?: never, + ): Promise; + async deleteDraftDefaultWorkflow( + parameters: Parameters.DeleteDraftDefaultWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/draft/default`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeDraftIssueType( + parameters: Parameters.GetWorkflowSchemeDraftIssueType, + callback: Callback, + ): Promise; + /** + * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeDraftIssueType( + parameters: Parameters.GetWorkflowSchemeDraftIssueType, + callback?: never, + ): Promise; + async getWorkflowSchemeDraftIssueType( + parameters: Parameters.GetWorkflowSchemeDraftIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the workflow for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setWorkflowSchemeDraftIssueType( + parameters: Parameters.SetWorkflowSchemeDraftIssueType, + callback: Callback, + ): Promise; + /** + * Sets the workflow for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setWorkflowSchemeDraftIssueType( + parameters: Parameters.SetWorkflowSchemeDraftIssueType, + callback?: never, + ): Promise; + async setWorkflowSchemeDraftIssueType( + parameters: Parameters.SetWorkflowSchemeDraftIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, + method: 'PUT', + data: parameters.details, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeDraftIssueType( + parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, + callback: Callback, + ): Promise; + /** + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeDraftIssueType( + parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, + callback?: never, + ): Promise; + async deleteWorkflowSchemeDraftIssueType( + parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Publishes a draft workflow scheme. + * + * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues + * with the original workflow status to the new workflow status. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async publishDraftWorkflowScheme( + parameters: Parameters.PublishDraftWorkflowScheme | string, + callback: Callback, + ): Promise; + /** + * Publishes a draft workflow scheme. + * + * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues + * with the original workflow status to the new workflow status. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async publishDraftWorkflowScheme( + parameters: Parameters.PublishDraftWorkflowScheme | string, + callback?: never, + ): Promise; + async publishDraftWorkflowScheme( + parameters: Parameters.PublishDraftWorkflowScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/draft/publish`, + method: 'POST', + params: { + validateOnly: typeof parameters !== 'string' && parameters.validateOnly, + }, + data: { + statusMappings: typeof parameters !== 'string' && parameters.statusMappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the workflow-issue type mappings for a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDraftWorkflow( + parameters: Parameters.GetDraftWorkflow, + callback: Callback, + ): Promise; + /** + * Returns the workflow-issue type mappings for a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDraftWorkflow( + parameters: Parameters.GetDraftWorkflow, + callback?: never, + ): Promise; + async getDraftWorkflow( + parameters: Parameters.GetDraftWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/workflow`, + method: 'GET', + params: { + workflowName: parameters.workflowName, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default + * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDraftWorkflowMapping( + parameters: Parameters.UpdateDraftWorkflowMapping, + callback: Callback, + ): Promise; + /** + * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default + * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDraftWorkflowMapping( + parameters: Parameters.UpdateDraftWorkflowMapping, + callback?: never, + ): Promise; + async updateDraftWorkflowMapping( + parameters: Parameters.UpdateDraftWorkflowMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/workflow`, + method: 'PUT', + params: { + workflowName: parameters.workflowName, + }, + data: { + workflow: parameters.workflow, + issueTypes: parameters.issueTypes, + defaultMapping: parameters.defaultMapping, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDraftWorkflowMapping( + parameters: Parameters.DeleteDraftWorkflowMapping, + callback: Callback, + ): Promise; + /** + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDraftWorkflowMapping( + parameters: Parameters.DeleteDraftWorkflowMapping, + callback?: never, + ): Promise; + async deleteDraftWorkflowMapping( + parameters: Parameters.DeleteDraftWorkflowMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/workflow`, + method: 'DELETE', + params: { + workflowName: parameters.workflowName, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/workflowSchemeDrafts.ts b/src/version2/workflowSchemeDrafts.ts deleted file mode 100644 index b58a9e15a..000000000 --- a/src/version2/workflowSchemeDrafts.ts +++ /dev/null @@ -1,542 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class WorkflowSchemeDrafts { - constructor(private client: Client) {} - - /** - * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an - * active workflow scheme can only have one draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowSchemeDraftFromParent( - parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, - callback: Callback, - ): Promise; - /** - * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an - * active workflow scheme can only have one draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowSchemeDraftFromParent( - parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, - callback?: never, - ): Promise; - async createWorkflowSchemeDraftFromParent( - parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/createdraft`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the draft workflow scheme for an active workflow scheme. Draft workflow schemes allow changes to be made to - * the active workflow schemes: When an active workflow scheme is updated, a draft copy is created. The draft is - * modified, then the changes in the draft are copied back to the active workflow scheme. See [Configuring workflow - * schemes](https://confluence.atlassian.com/x/tohKLg) for more information. Note that: - * - * - Only active workflow schemes can have draft workflow schemes. - * - An active workflow scheme can only have one draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeDraft( - parameters: Parameters.GetWorkflowSchemeDraft | string, - callback: Callback, - ): Promise; - /** - * Returns the draft workflow scheme for an active workflow scheme. Draft workflow schemes allow changes to be made to - * the active workflow schemes: When an active workflow scheme is updated, a draft copy is created. The draft is - * modified, then the changes in the draft are copied back to the active workflow scheme. See [Configuring workflow - * schemes](https://confluence.atlassian.com/x/tohKLg) for more information. Note that: - * - * - Only active workflow schemes can have draft workflow schemes. - * - An active workflow scheme can only have one draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeDraft( - parameters: Parameters.GetWorkflowSchemeDraft | string, - callback?: never, - ): Promise; - async getWorkflowSchemeDraft( - parameters: Parameters.GetWorkflowSchemeDraft | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/draft`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a - * draft is created. Note that an active workflow scheme can only have one draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowSchemeDraft( - parameters: Parameters.UpdateWorkflowSchemeDraft, - callback: Callback, - ): Promise; - /** - * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a - * draft is created. Note that an active workflow scheme can only have one draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowSchemeDraft( - parameters: Parameters.UpdateWorkflowSchemeDraft, - callback?: never, - ): Promise; - async updateWorkflowSchemeDraft( - parameters: Parameters.UpdateWorkflowSchemeDraft, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - defaultWorkflow: parameters.defaultWorkflow, - issueTypeMappings: parameters.issueTypeMappings, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeDraft( - parameters: Parameters.DeleteWorkflowSchemeDraft | string, - callback: Callback, - ): Promise; - /** - * Deletes a draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeDraft( - parameters: Parameters.DeleteWorkflowSchemeDraft | string, - callback?: never, - ): Promise; - async deleteWorkflowSchemeDraft( - parameters: Parameters.DeleteWorkflowSchemeDraft | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/draft`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned - * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue - * Types_ listed in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftDefaultWorkflow( - parameters: Parameters.GetDraftDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned - * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue - * Types_ listed in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftDefaultWorkflow( - parameters: Parameters.GetDraftDefaultWorkflow | string, - callback?: never, - ): Promise; - async getDraftDefaultWorkflow( - parameters: Parameters.GetDraftDefaultWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/draft/default`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default workflow for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftDefaultWorkflow( - parameters: Parameters.UpdateDraftDefaultWorkflow, - callback: Callback, - ): Promise; - /** - * Sets the default workflow for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftDefaultWorkflow( - parameters: Parameters.UpdateDraftDefaultWorkflow, - callback?: never, - ): Promise; - async updateDraftDefaultWorkflow( - parameters: Parameters.UpdateDraftDefaultWorkflow, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft/default`, - method: 'PUT', - data: { - workflow: parameters.workflow, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system - * workflow (the _jira_ workflow). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftDefaultWorkflow( - parameters: Parameters.DeleteDraftDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system - * workflow (the _jira_ workflow). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftDefaultWorkflow( - parameters: Parameters.DeleteDraftDefaultWorkflow | string, - callback?: never, - ): Promise; - async deleteDraftDefaultWorkflow( - parameters: Parameters.DeleteDraftDefaultWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/draft/default`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeDraftIssueType( - parameters: Parameters.GetWorkflowSchemeDraftIssueType, - callback: Callback, - ): Promise; - /** - * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeDraftIssueType( - parameters: Parameters.GetWorkflowSchemeDraftIssueType, - callback?: never, - ): Promise; - async getWorkflowSchemeDraftIssueType( - parameters: Parameters.GetWorkflowSchemeDraftIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the workflow for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeDraftIssueType( - parameters: Parameters.SetWorkflowSchemeDraftIssueType, - callback: Callback, - ): Promise; - /** - * Sets the workflow for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeDraftIssueType( - parameters: Parameters.SetWorkflowSchemeDraftIssueType, - callback?: never, - ): Promise; - async setWorkflowSchemeDraftIssueType( - parameters: Parameters.SetWorkflowSchemeDraftIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, - method: 'PUT', - data: parameters.details, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeDraftIssueType( - parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, - callback: Callback, - ): Promise; - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeDraftIssueType( - parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, - callback?: never, - ): Promise; - async deleteWorkflowSchemeDraftIssueType( - parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Publishes a draft workflow scheme. - * - * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues - * with the original workflow status to the new workflow status. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async publishDraftWorkflowScheme( - parameters: Parameters.PublishDraftWorkflowScheme | string, - callback: Callback, - ): Promise; - /** - * Publishes a draft workflow scheme. - * - * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues - * with the original workflow status to the new workflow status. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-2-task-taskId-get) to obtain updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async publishDraftWorkflowScheme( - parameters: Parameters.PublishDraftWorkflowScheme | string, - callback?: never, - ): Promise; - async publishDraftWorkflowScheme( - parameters: Parameters.PublishDraftWorkflowScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/draft/publish`, - method: 'POST', - params: { - validateOnly: typeof parameters !== 'string' && parameters.validateOnly, - }, - data: { - statusMappings: typeof parameters !== 'string' && parameters.statusMappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the workflow-issue type mappings for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftWorkflow( - parameters: Parameters.GetDraftWorkflow, - callback: Callback, - ): Promise; - /** - * Returns the workflow-issue type mappings for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftWorkflow( - parameters: Parameters.GetDraftWorkflow, - callback?: never, - ): Promise; - async getDraftWorkflow( - parameters: Parameters.GetDraftWorkflow, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft/workflow`, - method: 'GET', - params: { - workflowName: parameters.workflowName, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default - * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftWorkflowMapping( - parameters: Parameters.UpdateDraftWorkflowMapping, - callback: Callback, - ): Promise; - /** - * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default - * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftWorkflowMapping( - parameters: Parameters.UpdateDraftWorkflowMapping, - callback?: never, - ): Promise; - async updateDraftWorkflowMapping( - parameters: Parameters.UpdateDraftWorkflowMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft/workflow`, - method: 'PUT', - params: { - workflowName: parameters.workflowName, - }, - data: { - workflow: parameters.workflow, - issueTypes: parameters.issueTypes, - defaultMapping: parameters.defaultMapping, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftWorkflowMapping( - parameters: Parameters.DeleteDraftWorkflowMapping, - callback: Callback, - ): Promise; - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftWorkflowMapping( - parameters: Parameters.DeleteDraftWorkflowMapping, - callback?: never, - ): Promise; - async deleteDraftWorkflowMapping( - parameters: Parameters.DeleteDraftWorkflowMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft/workflow`, - method: 'DELETE', - params: { - workflowName: parameters.workflowName, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/workflowSchemeProjectAssociations.mts b/src/version2/workflowSchemeProjectAssociations.mts new file mode 100644 index 000000000..a76793af5 --- /dev/null +++ b/src/version2/workflowSchemeProjectAssociations.mts @@ -0,0 +1,91 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowSchemeProjectAssociations { + constructor(private client: Client) {} + + /** + * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a + * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are + * ignored and no errors are returned. + * + * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the + * `Default Workflow Scheme` is stored means it has no ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeProjectAssociations( + parameters: Parameters.GetWorkflowSchemeProjectAssociations, + callback: Callback, + ): Promise; + /** + * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a + * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are + * ignored and no errors are returned. + * + * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the + * `Default Workflow Scheme` is stored means it has no ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeProjectAssociations( + parameters: Parameters.GetWorkflowSchemeProjectAssociations, + callback?: never, + ): Promise; + async getWorkflowSchemeProjectAssociations( + parameters: Parameters.GetWorkflowSchemeProjectAssociations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflowscheme/project', + method: 'GET', + params: { + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. + * + * Workflow schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignSchemeToProject( + parameters: Parameters.AssignSchemeToProject | undefined, + callback: Callback, + ): Promise; + /** + * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. + * + * Workflow schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignSchemeToProject(parameters?: Parameters.AssignSchemeToProject, callback?: never): Promise; + async assignSchemeToProject( + parameters?: Parameters.AssignSchemeToProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflowscheme/project', + method: 'PUT', + data: { + workflowSchemeId: parameters?.workflowSchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/workflowSchemeProjectAssociations.ts b/src/version2/workflowSchemeProjectAssociations.ts deleted file mode 100644 index 5632fc693..000000000 --- a/src/version2/workflowSchemeProjectAssociations.ts +++ /dev/null @@ -1,91 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class WorkflowSchemeProjectAssociations { - constructor(private client: Client) {} - - /** - * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a - * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are - * ignored and no errors are returned. - * - * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the - * `Default Workflow Scheme` is stored means it has no ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeProjectAssociations( - parameters: Parameters.GetWorkflowSchemeProjectAssociations, - callback: Callback, - ): Promise; - /** - * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a - * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are - * ignored and no errors are returned. - * - * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the - * `Default Workflow Scheme` is stored means it has no ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeProjectAssociations( - parameters: Parameters.GetWorkflowSchemeProjectAssociations, - callback?: never, - ): Promise; - async getWorkflowSchemeProjectAssociations( - parameters: Parameters.GetWorkflowSchemeProjectAssociations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflowscheme/project', - method: 'GET', - params: { - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. - * - * Workflow schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignSchemeToProject( - parameters: Parameters.AssignSchemeToProject | undefined, - callback: Callback, - ): Promise; - /** - * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. - * - * Workflow schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignSchemeToProject(parameters?: Parameters.AssignSchemeToProject, callback?: never): Promise; - async assignSchemeToProject( - parameters?: Parameters.AssignSchemeToProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflowscheme/project', - method: 'PUT', - data: { - workflowSchemeId: parameters?.workflowSchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/workflowSchemes.mts b/src/version2/workflowSchemes.mts new file mode 100644 index 000000000..0ab2d544f --- /dev/null +++ b/src/version2/workflowSchemes.mts @@ -0,0 +1,596 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * workflow schemes, not including draft workflow schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllWorkflowSchemes( + parameters: Parameters.GetAllWorkflowSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * workflow schemes, not including draft workflow schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllWorkflowSchemes( + parameters?: Parameters.GetAllWorkflowSchemes, + callback?: never, + ): Promise; + async getAllWorkflowSchemes( + parameters?: Parameters.GetAllWorkflowSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflowscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflowScheme( + parameters: Parameters.CreateWorkflowScheme, + callback: Callback, + ): Promise; + /** + * Creates a workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflowScheme( + parameters: Parameters.CreateWorkflowScheme, + callback?: never, + ): Promise; + async createWorkflowScheme( + parameters: Parameters.CreateWorkflowScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflowscheme', + method: 'POST', + data: { + defaultWorkflow: parameters.defaultWorkflow, + description: parameters.description, + draft: parameters.draft, + id: parameters.id, + issueTypeMappings: parameters.issueTypeMappings, + issueTypes: parameters.issueTypes, + lastModified: parameters.lastModified, + lastModifiedUser: parameters.lastModifiedUser, + name: parameters.name, + originalDefaultWorkflow: parameters.originalDefaultWorkflow, + originalIssueTypeMappings: parameters.originalIssueTypeMappings, + self: parameters.self, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowScheme( + parameters: Parameters.GetWorkflowScheme | string, + callback: Callback, + ): Promise; + /** + * Returns a workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowScheme( + parameters: Parameters.GetWorkflowScheme | string, + callback?: never, + ): Promise; + async getWorkflowScheme( + parameters: Parameters.GetWorkflowScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}`, + method: 'GET', + params: { + returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a company-manged project workflow scheme, including the name, default workflow, issue type to project + * mappings, and more. If the workflow scheme is active (that is, being used by at least one project), then a draft + * workflow scheme is created or updated instead, provided that `updateDraftIfNeeded` is set to `true`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowScheme( + parameters: Parameters.UpdateWorkflowScheme, + callback: Callback, + ): Promise; + /** + * Updates a company-manged project workflow scheme, including the name, default workflow, issue type to project + * mappings, and more. If the workflow scheme is active (that is, being used by at least one project), then a draft + * workflow scheme is created or updated instead, provided that `updateDraftIfNeeded` is set to `true`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowScheme( + parameters: Parameters.UpdateWorkflowScheme, + callback?: never, + ): Promise; + async updateWorkflowScheme( + parameters: Parameters.UpdateWorkflowScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + defaultWorkflow: parameters.defaultWorkflow, + issueTypeMappings: parameters.issueTypeMappings, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at + * least one project). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowScheme( + parameters: Parameters.DeleteWorkflowScheme | string, + callback: Callback, + ): Promise; + /** + * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at + * least one project). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowScheme( + parameters: Parameters.DeleteWorkflowScheme | string, + callback?: never, + ): Promise; + async deleteWorkflowScheme( + parameters: Parameters.DeleteWorkflowScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue + * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed + * in its issue types for the workflow scheme in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultWorkflow( + parameters: Parameters.GetDefaultWorkflow | string, + callback: Callback, + ): Promise; + /** + * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue + * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed + * in its issue types for the workflow scheme in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultWorkflow( + parameters: Parameters.GetDefaultWorkflow | string, + callback?: never, + ): Promise; + async getDefaultWorkflow( + parameters: Parameters.GetDefaultWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/default`, + method: 'GET', + params: { + returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default workflow for a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The + * draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultWorkflow( + parameters: Parameters.UpdateDefaultWorkflow, + callback: Callback, + ): Promise; + /** + * Sets the default workflow for a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The + * draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultWorkflow( + parameters: Parameters.UpdateDefaultWorkflow, + callback?: never, + ): Promise; + async updateDefaultWorkflow( + parameters: Parameters.UpdateDefaultWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/default`, + method: 'PUT', + data: { + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + workflow: parameters.workflow, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow + * (the _jira_ workflow). + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme + * can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDefaultWorkflow( + parameters: Parameters.DeleteDefaultWorkflow | string, + callback: Callback, + ): Promise; + /** + * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow + * (the _jira_ workflow). + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme + * can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDefaultWorkflow( + parameters: Parameters.DeleteDefaultWorkflow | string, + callback?: never, + ): Promise; + async deleteDefaultWorkflow( + parameters: Parameters.DeleteDefaultWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/default`, + method: 'DELETE', + params: { + updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the issue type-workflow mapping for an issue type in a workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeIssueType( + parameters: Parameters.GetWorkflowSchemeIssueType, + callback: Callback, + ): Promise; + /** + * Returns the issue type-workflow mapping for an issue type in a workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeIssueType( + parameters: Parameters.GetWorkflowSchemeIssueType, + callback?: never, + ): Promise; + async getWorkflowSchemeIssueType( + parameters: Parameters.GetWorkflowSchemeIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, + method: 'GET', + params: { + returnDraftIfExists: parameters.returnDraftIfExists, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the workflow for an issue type in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow + * mapping. The draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setWorkflowSchemeIssueType( + parameters: Parameters.SetWorkflowSchemeIssueType, + callback: Callback, + ): Promise; + /** + * Sets the workflow for an issue type in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow + * mapping. The draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setWorkflowSchemeIssueType( + parameters: Parameters.SetWorkflowSchemeIssueType, + callback?: never, + ): Promise; + async setWorkflowSchemeIssueType( + parameters: Parameters.SetWorkflowSchemeIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, + method: 'PUT', + data: parameters.details, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft + * workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeIssueType( + parameters: Parameters.DeleteWorkflowSchemeIssueType, + callback: Callback, + ): Promise; + /** + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft + * workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeIssueType( + parameters: Parameters.DeleteWorkflowSchemeIssueType, + callback?: never, + ): Promise; + async deleteWorkflowSchemeIssueType( + parameters: Parameters.DeleteWorkflowSchemeIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, + method: 'DELETE', + params: { + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the workflow-issue type mappings for a workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflow( + parameters: Parameters.GetWorkflow | string, + callback: Callback, + ): Promise; + /** + * Returns the workflow-issue type mappings for a workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflow( + parameters: Parameters.GetWorkflow | string, + callback?: never, + ): Promise; + async getWorkflow( + parameters: Parameters.GetWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/workflow`, + method: 'GET', + params: { + workflowName: typeof parameters !== 'string' && parameters.workflowName, + returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for + * the workflow scheme. Unmapped issues types are mapped to the default workflow. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types + * mappings. The draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowMapping( + parameters: Parameters.UpdateWorkflowMapping, + callback: Callback, + ): Promise; + /** + * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for + * the workflow scheme. Unmapped issues types are mapped to the default workflow. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types + * mappings. The draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowMapping( + parameters: Parameters.UpdateWorkflowMapping, + callback?: never, + ): Promise; + async updateWorkflowMapping( + parameters: Parameters.UpdateWorkflowMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/workflow`, + method: 'PUT', + params: { + workflowName: parameters.workflowName, + }, + data: { + defaultMapping: parameters.defaultMapping, + issueTypes: parameters.issueTypes, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + workflow: parameters.workflow, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft + * workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowMapping( + parameters: Parameters.DeleteWorkflowMapping | string, + callback: Callback, + ): Promise; + /** + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft + * workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowMapping( + parameters: Parameters.DeleteWorkflowMapping | string, + callback?: never, + ): Promise; + async deleteWorkflowMapping( + parameters: Parameters.DeleteWorkflowMapping | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/workflow`, + method: 'DELETE', + params: { + workflowName: typeof parameters !== 'string' && parameters.workflowName, + updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/workflowSchemes.ts b/src/version2/workflowSchemes.ts deleted file mode 100644 index 29c1d75fe..000000000 --- a/src/version2/workflowSchemes.ts +++ /dev/null @@ -1,596 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class WorkflowSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * workflow schemes, not including draft workflow schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllWorkflowSchemes( - parameters: Parameters.GetAllWorkflowSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * workflow schemes, not including draft workflow schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllWorkflowSchemes( - parameters?: Parameters.GetAllWorkflowSchemes, - callback?: never, - ): Promise; - async getAllWorkflowSchemes( - parameters?: Parameters.GetAllWorkflowSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflowscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowScheme( - parameters: Parameters.CreateWorkflowScheme, - callback: Callback, - ): Promise; - /** - * Creates a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowScheme( - parameters: Parameters.CreateWorkflowScheme, - callback?: never, - ): Promise; - async createWorkflowScheme( - parameters: Parameters.CreateWorkflowScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflowscheme', - method: 'POST', - data: { - defaultWorkflow: parameters.defaultWorkflow, - description: parameters.description, - draft: parameters.draft, - id: parameters.id, - issueTypeMappings: parameters.issueTypeMappings, - issueTypes: parameters.issueTypes, - lastModified: parameters.lastModified, - lastModifiedUser: parameters.lastModifiedUser, - name: parameters.name, - originalDefaultWorkflow: parameters.originalDefaultWorkflow, - originalIssueTypeMappings: parameters.originalIssueTypeMappings, - self: parameters.self, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowScheme( - parameters: Parameters.GetWorkflowScheme | string, - callback: Callback, - ): Promise; - /** - * Returns a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowScheme( - parameters: Parameters.GetWorkflowScheme | string, - callback?: never, - ): Promise; - async getWorkflowScheme( - parameters: Parameters.GetWorkflowScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}`, - method: 'GET', - params: { - returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a company-manged project workflow scheme, including the name, default workflow, issue type to project - * mappings, and more. If the workflow scheme is active (that is, being used by at least one project), then a draft - * workflow scheme is created or updated instead, provided that `updateDraftIfNeeded` is set to `true`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowScheme( - parameters: Parameters.UpdateWorkflowScheme, - callback: Callback, - ): Promise; - /** - * Updates a company-manged project workflow scheme, including the name, default workflow, issue type to project - * mappings, and more. If the workflow scheme is active (that is, being used by at least one project), then a draft - * workflow scheme is created or updated instead, provided that `updateDraftIfNeeded` is set to `true`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowScheme( - parameters: Parameters.UpdateWorkflowScheme, - callback?: never, - ): Promise; - async updateWorkflowScheme( - parameters: Parameters.UpdateWorkflowScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - defaultWorkflow: parameters.defaultWorkflow, - issueTypeMappings: parameters.issueTypeMappings, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at - * least one project). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowScheme( - parameters: Parameters.DeleteWorkflowScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at - * least one project). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowScheme( - parameters: Parameters.DeleteWorkflowScheme | string, - callback?: never, - ): Promise; - async deleteWorkflowScheme( - parameters: Parameters.DeleteWorkflowScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue - * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed - * in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultWorkflow( - parameters: Parameters.GetDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue - * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed - * in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultWorkflow( - parameters: Parameters.GetDefaultWorkflow | string, - callback?: never, - ): Promise; - async getDefaultWorkflow( - parameters: Parameters.GetDefaultWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/default`, - method: 'GET', - params: { - returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default workflow for a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The - * draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultWorkflow( - parameters: Parameters.UpdateDefaultWorkflow, - callback: Callback, - ): Promise; - /** - * Sets the default workflow for a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The - * draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultWorkflow( - parameters: Parameters.UpdateDefaultWorkflow, - callback?: never, - ): Promise; - async updateDefaultWorkflow( - parameters: Parameters.UpdateDefaultWorkflow, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/default`, - method: 'PUT', - data: { - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - workflow: parameters.workflow, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow - * (the _jira_ workflow). - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme - * can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDefaultWorkflow( - parameters: Parameters.DeleteDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow - * (the _jira_ workflow). - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme - * can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDefaultWorkflow( - parameters: Parameters.DeleteDefaultWorkflow | string, - callback?: never, - ): Promise; - async deleteDefaultWorkflow( - parameters: Parameters.DeleteDefaultWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/default`, - method: 'DELETE', - params: { - updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the issue type-workflow mapping for an issue type in a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeIssueType( - parameters: Parameters.GetWorkflowSchemeIssueType, - callback: Callback, - ): Promise; - /** - * Returns the issue type-workflow mapping for an issue type in a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeIssueType( - parameters: Parameters.GetWorkflowSchemeIssueType, - callback?: never, - ): Promise; - async getWorkflowSchemeIssueType( - parameters: Parameters.GetWorkflowSchemeIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, - method: 'GET', - params: { - returnDraftIfExists: parameters.returnDraftIfExists, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the workflow for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow - * mapping. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeIssueType( - parameters: Parameters.SetWorkflowSchemeIssueType, - callback: Callback, - ): Promise; - /** - * Sets the workflow for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow - * mapping. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeIssueType( - parameters: Parameters.SetWorkflowSchemeIssueType, - callback?: never, - ): Promise; - async setWorkflowSchemeIssueType( - parameters: Parameters.SetWorkflowSchemeIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, - method: 'PUT', - data: parameters.details, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeIssueType( - parameters: Parameters.DeleteWorkflowSchemeIssueType, - callback: Callback, - ): Promise; - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeIssueType( - parameters: Parameters.DeleteWorkflowSchemeIssueType, - callback?: never, - ): Promise; - async deleteWorkflowSchemeIssueType( - parameters: Parameters.DeleteWorkflowSchemeIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, - method: 'DELETE', - params: { - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the workflow-issue type mappings for a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflow( - parameters: Parameters.GetWorkflow | string, - callback: Callback, - ): Promise; - /** - * Returns the workflow-issue type mappings for a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflow( - parameters: Parameters.GetWorkflow | string, - callback?: never, - ): Promise; - async getWorkflow( - parameters: Parameters.GetWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/workflow`, - method: 'GET', - params: { - workflowName: typeof parameters !== 'string' && parameters.workflowName, - returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for - * the workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types - * mappings. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowMapping( - parameters: Parameters.UpdateWorkflowMapping, - callback: Callback, - ): Promise; - /** - * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for - * the workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types - * mappings. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowMapping( - parameters: Parameters.UpdateWorkflowMapping, - callback?: never, - ): Promise; - async updateWorkflowMapping( - parameters: Parameters.UpdateWorkflowMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/workflow`, - method: 'PUT', - params: { - workflowName: parameters.workflowName, - }, - data: { - defaultMapping: parameters.defaultMapping, - issueTypes: parameters.issueTypes, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - workflow: parameters.workflow, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowMapping( - parameters: Parameters.DeleteWorkflowMapping | string, - callback: Callback, - ): Promise; - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowMapping( - parameters: Parameters.DeleteWorkflowMapping | string, - callback?: never, - ): Promise; - async deleteWorkflowMapping( - parameters: Parameters.DeleteWorkflowMapping | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/workflow`, - method: 'DELETE', - params: { - workflowName: typeof parameters !== 'string' && parameters.workflowName, - updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/workflowStatusCategories.mts b/src/version2/workflowStatusCategories.mts new file mode 100644 index 000000000..86d748c40 --- /dev/null +++ b/src/version2/workflowStatusCategories.mts @@ -0,0 +1,68 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowStatusCategories { + constructor(private client: Client) {} + + /** + * Returns a list of all status categories. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getStatusCategories(callback: Callback): Promise; + /** + * Returns a list of all status categories. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getStatusCategories(callback?: never): Promise; + async getStatusCategories(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/statuscategory', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a status category. Status categories provided a mechanism for categorizing + * [statuses](#api-rest-api-2-status-idOrName-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getStatusCategory( + parameters: Parameters.GetStatusCategory | string, + callback: Callback, + ): Promise; + /** + * Returns a status category. Status categories provided a mechanism for categorizing + * [statuses](#api-rest-api-2-status-idOrName-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getStatusCategory( + parameters: Parameters.GetStatusCategory | string, + callback?: never, + ): Promise; + async getStatusCategory( + parameters: Parameters.GetStatusCategory | string, + callback?: Callback, + ): Promise { + const idOrKey = typeof parameters === 'string' ? parameters : parameters.idOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/statuscategory/${idOrKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/workflowStatusCategories.ts b/src/version2/workflowStatusCategories.ts deleted file mode 100644 index cae3267de..000000000 --- a/src/version2/workflowStatusCategories.ts +++ /dev/null @@ -1,68 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class WorkflowStatusCategories { - constructor(private client: Client) {} - - /** - * Returns a list of all status categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategories(callback: Callback): Promise; - /** - * Returns a list of all status categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategories(callback?: never): Promise; - async getStatusCategories(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/statuscategory', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a status category. Status categories provided a mechanism for categorizing - * [statuses](#api-rest-api-2-status-idOrName-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategory( - parameters: Parameters.GetStatusCategory | string, - callback: Callback, - ): Promise; - /** - * Returns a status category. Status categories provided a mechanism for categorizing - * [statuses](#api-rest-api-2-status-idOrName-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategory( - parameters: Parameters.GetStatusCategory | string, - callback?: never, - ): Promise; - async getStatusCategory( - parameters: Parameters.GetStatusCategory | string, - callback?: Callback, - ): Promise { - const idOrKey = typeof parameters === 'string' ? parameters : parameters.idOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/statuscategory/${idOrKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/workflowStatuses.mts b/src/version2/workflowStatuses.mts new file mode 100644 index 000000000..5dd07f34b --- /dev/null +++ b/src/version2/workflowStatuses.mts @@ -0,0 +1,73 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowStatuses { + constructor(private client: Client) {} + + /** + * Returns a list of all statuses associated with active workflows. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getStatuses(callback: Callback): Promise; + /** + * Returns a list of all statuses associated with active workflows. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getStatuses(callback?: never): Promise; + async getStatuses(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/status', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a status. The status must be associated with an active workflow to be returned. + * + * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the + * status by its ID may be preferable. + * + * This operation can be accessed anonymously. + * + * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: None. + */ + async getStatus( + parameters: Parameters.GetStatus | string, + callback: Callback, + ): Promise; + /** + * Returns a status. The status must be associated with an active workflow to be returned. + * + * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the + * status by its ID may be preferable. + * + * This operation can be accessed anonymously. + * + * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: None. + */ + async getStatus(parameters: Parameters.GetStatus | string, callback?: never): Promise; + async getStatus( + parameters: Parameters.GetStatus | string, + callback?: Callback, + ): Promise { + const idOrName = typeof parameters === 'string' ? parameters : parameters.idOrName; + + const config: RequestConfig = { + url: `/rest/api/2/status/${idOrName}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/workflowStatuses.ts b/src/version2/workflowStatuses.ts deleted file mode 100644 index 0c9d4204f..000000000 --- a/src/version2/workflowStatuses.ts +++ /dev/null @@ -1,73 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class WorkflowStatuses { - constructor(private client: Client) {} - - /** - * Returns a list of all statuses associated with active workflows. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getStatuses(callback: Callback): Promise; - /** - * Returns a list of all statuses associated with active workflows. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getStatuses(callback?: never): Promise; - async getStatuses(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/status', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a status. The status must be associated with an active workflow to be returned. - * - * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the - * status by its ID may be preferable. - * - * This operation can be accessed anonymously. - * - * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: None. - */ - async getStatus( - parameters: Parameters.GetStatus | string, - callback: Callback, - ): Promise; - /** - * Returns a status. The status must be associated with an active workflow to be returned. - * - * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the - * status by its ID may be preferable. - * - * This operation can be accessed anonymously. - * - * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: None. - */ - async getStatus(parameters: Parameters.GetStatus | string, callback?: never): Promise; - async getStatus( - parameters: Parameters.GetStatus | string, - callback?: Callback, - ): Promise { - const idOrName = typeof parameters === 'string' ? parameters : parameters.idOrName; - - const config: RequestConfig = { - url: `/rest/api/2/status/${idOrName}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/workflowTransitionProperties.mts b/src/version2/workflowTransitionProperties.mts new file mode 100644 index 000000000..26a83c9cb --- /dev/null +++ b/src/version2/workflowTransitionProperties.mts @@ -0,0 +1,198 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowTransitionProperties { + constructor(private client: Client) {} + + /** + * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowTransitionProperties( + parameters: Parameters.GetWorkflowTransitionProperties, + callback: Callback, + ): Promise; + /** + * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowTransitionProperties( + parameters: Parameters.GetWorkflowTransitionProperties, + callback?: never, + ): Promise; + async getWorkflowTransitionProperties( + parameters: Parameters.GetWorkflowTransitionProperties, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, + method: 'GET', + params: { + includeReservedKeys: parameters.includeReservedKeys, + key: parameters.key, + workflowName: parameters.workflowName, + workflowMode: parameters.workflowMode, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. + * For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflowTransitionProperty( + parameters: Parameters.CreateWorkflowTransitionProperty, + callback: Callback, + ): Promise; + /** + * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. + * For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflowTransitionProperty( + parameters: Parameters.CreateWorkflowTransitionProperty, + callback?: never, + ): Promise; + async createWorkflowTransitionProperty( + parameters: Parameters.CreateWorkflowTransitionProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, + method: 'POST', + params: { + key: parameters.key, + workflowName: parameters.workflowName, + workflowMode: parameters.workflowMode, + }, + data: { + ...parameters, + transitionId: undefined, + key: undefined, + workflowName: undefined, + workflowMode: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a workflow transition by changing the property value. Trying to update a property that does not exist + * results in a new property being added to the transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowTransitionProperty( + parameters: Parameters.UpdateWorkflowTransitionProperty, + callback: Callback, + ): Promise; + /** + * Updates a workflow transition by changing the property value. Trying to update a property that does not exist + * results in a new property being added to the transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowTransitionProperty( + parameters: Parameters.UpdateWorkflowTransitionProperty, + callback?: never, + ): Promise; + async updateWorkflowTransitionProperty( + parameters: Parameters.UpdateWorkflowTransitionProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, + method: 'PUT', + params: { + key: parameters.key, + workflowName: parameters.workflowName, + workflowMode: parameters.workflowMode, + }, + data: { + ...parameters, + transitionId: undefined, + key: undefined, + workflowName: undefined, + workflowMode: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowTransitionProperty( + parameters: Parameters.DeleteWorkflowTransitionProperty, + callback: Callback, + ): Promise; + /** + * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowTransitionProperty( + parameters: Parameters.DeleteWorkflowTransitionProperty, + callback?: never, + ): Promise; + async deleteWorkflowTransitionProperty( + parameters: Parameters.DeleteWorkflowTransitionProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, + method: 'DELETE', + params: { + key: parameters.key, + workflowName: parameters.workflowName, + workflowMode: parameters.workflowMode, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/workflowTransitionProperties.ts b/src/version2/workflowTransitionProperties.ts deleted file mode 100644 index 3b079e04f..000000000 --- a/src/version2/workflowTransitionProperties.ts +++ /dev/null @@ -1,198 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class WorkflowTransitionProperties { - constructor(private client: Client) {} - - /** - * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowTransitionProperties( - parameters: Parameters.GetWorkflowTransitionProperties, - callback: Callback, - ): Promise; - /** - * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowTransitionProperties( - parameters: Parameters.GetWorkflowTransitionProperties, - callback?: never, - ): Promise; - async getWorkflowTransitionProperties( - parameters: Parameters.GetWorkflowTransitionProperties, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, - method: 'GET', - params: { - includeReservedKeys: parameters.includeReservedKeys, - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. - * For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowTransitionProperty( - parameters: Parameters.CreateWorkflowTransitionProperty, - callback: Callback, - ): Promise; - /** - * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. - * For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowTransitionProperty( - parameters: Parameters.CreateWorkflowTransitionProperty, - callback?: never, - ): Promise; - async createWorkflowTransitionProperty( - parameters: Parameters.CreateWorkflowTransitionProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, - method: 'POST', - params: { - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - data: { - ...parameters, - transitionId: undefined, - key: undefined, - workflowName: undefined, - workflowMode: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a workflow transition by changing the property value. Trying to update a property that does not exist - * results in a new property being added to the transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowTransitionProperty( - parameters: Parameters.UpdateWorkflowTransitionProperty, - callback: Callback, - ): Promise; - /** - * Updates a workflow transition by changing the property value. Trying to update a property that does not exist - * results in a new property being added to the transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowTransitionProperty( - parameters: Parameters.UpdateWorkflowTransitionProperty, - callback?: never, - ): Promise; - async updateWorkflowTransitionProperty( - parameters: Parameters.UpdateWorkflowTransitionProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, - method: 'PUT', - params: { - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - data: { - ...parameters, - transitionId: undefined, - key: undefined, - workflowName: undefined, - workflowMode: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowTransitionProperty( - parameters: Parameters.DeleteWorkflowTransitionProperty, - callback: Callback, - ): Promise; - /** - * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowTransitionProperty( - parameters: Parameters.DeleteWorkflowTransitionProperty, - callback?: never, - ): Promise; - async deleteWorkflowTransitionProperty( - parameters: Parameters.DeleteWorkflowTransitionProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, - method: 'DELETE', - params: { - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/workflowTransitionRules.mts b/src/version2/workflowTransitionRules.mts new file mode 100644 index 000000000..b2d7d95a3 --- /dev/null +++ b/src/version2/workflowTransitionRules.mts @@ -0,0 +1,195 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '@/clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowTransitionRules { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition + * rules: + * + * - Of one or more transition rule types, such as [workflow post + * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). + * - Matching one or more transition rule keys. + * + * Only workflows containing transition rules created by the calling + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app are returned. + * + * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be + * ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. + */ + async getWorkflowTransitionRuleConfigurations( + parameters: Parameters.GetWorkflowTransitionRuleConfigurations, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition + * rules: + * + * - Of one or more transition rule types, such as [workflow post + * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). + * - Matching one or more transition rule keys. + * + * Only workflows containing transition rules created by the calling + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app are returned. + * + * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be + * ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. + */ + async getWorkflowTransitionRuleConfigurations( + parameters: Parameters.GetWorkflowTransitionRuleConfigurations, + callback?: never, + ): Promise; + async getWorkflowTransitionRuleConfigurations( + parameters: Parameters.GetWorkflowTransitionRuleConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflow/rule/config', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + types: parameters.types, + keys: parameters.keys, + workflowNames: parameters.workflowNames, + withTags: parameters.withTags, + draft: parameters.draft, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates configuration of workflow transition rules. The following rule types are supported: + * + * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) + * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) + * + * Only rules created by the calling + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app can be updated. + * + * To assist with app migration, this operation can be used to: + * + * - Disable a rule. + * - Add a `tag`. Use this to filter rules in the [Get workflow transition rule + * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). + * + * Rules are enabled if the `disabled` parameter is not provided. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. + */ + async updateWorkflowTransitionRuleConfigurations( + parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, + callback: Callback, + ): Promise; + /** + * Updates configuration of workflow transition rules. The following rule types are supported: + * + * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) + * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) + * + * Only rules created by the calling + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app can be updated. + * + * To assist with app migration, this operation can be used to: + * + * - Disable a rule. + * - Add a `tag`. Use this to filter rules in the [Get workflow transition rule + * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). + * + * Rules are enabled if the `disabled` parameter is not provided. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. + */ + async updateWorkflowTransitionRuleConfigurations( + parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, + callback?: never, + ): Promise; + async updateWorkflowTransitionRuleConfigurations( + parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflow/rule/config', + method: 'PUT', + data: { + workflows: parameters.workflows, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes workflow transition rules from one or more workflows. These rule types are supported: + * + * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) + * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) + * + * Only rules created by the calling Connect app can be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can use this operation. + */ + async deleteWorkflowTransitionRuleConfigurations( + parameters: Parameters.DeleteWorkflowTransitionRuleConfigurations | undefined, + callback: Callback, + ): Promise; + /** + * Deletes workflow transition rules from one or more workflows. These rule types are supported: + * + * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) + * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) + * + * Only rules created by the calling Connect app can be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can use this operation. + */ + async deleteWorkflowTransitionRuleConfigurations( + parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, + callback?: never, + ): Promise; + async deleteWorkflowTransitionRuleConfigurations( + parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflow/rule/config/delete', + method: 'PUT', + data: { + workflows: parameters?.workflows, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/workflowTransitionRules.ts b/src/version2/workflowTransitionRules.ts deleted file mode 100644 index b37016cde..000000000 --- a/src/version2/workflowTransitionRules.ts +++ /dev/null @@ -1,195 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class WorkflowTransitionRules { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition - * rules: - * - * - Of one or more transition rule types, such as [workflow post - * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). - * - Matching one or more transition rule keys. - * - * Only workflows containing transition rules created by the calling - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app are returned. - * - * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be - * ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. - */ - async getWorkflowTransitionRuleConfigurations( - parameters: Parameters.GetWorkflowTransitionRuleConfigurations, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition - * rules: - * - * - Of one or more transition rule types, such as [workflow post - * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). - * - Matching one or more transition rule keys. - * - * Only workflows containing transition rules created by the calling - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app are returned. - * - * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be - * ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. - */ - async getWorkflowTransitionRuleConfigurations( - parameters: Parameters.GetWorkflowTransitionRuleConfigurations, - callback?: never, - ): Promise; - async getWorkflowTransitionRuleConfigurations( - parameters: Parameters.GetWorkflowTransitionRuleConfigurations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflow/rule/config', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - types: parameters.types, - keys: parameters.keys, - workflowNames: parameters.workflowNames, - withTags: parameters.withTags, - draft: parameters.draft, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates configuration of workflow transition rules. The following rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) - * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) - * - * Only rules created by the calling - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app can be updated. - * - * To assist with app migration, this operation can be used to: - * - * - Disable a rule. - * - Add a `tag`. Use this to filter rules in the [Get workflow transition rule - * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). - * - * Rules are enabled if the `disabled` parameter is not provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. - */ - async updateWorkflowTransitionRuleConfigurations( - parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, - callback: Callback, - ): Promise; - /** - * Updates configuration of workflow transition rules. The following rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) - * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) - * - * Only rules created by the calling - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app can be updated. - * - * To assist with app migration, this operation can be used to: - * - * - Disable a rule. - * - Add a `tag`. Use this to filter rules in the [Get workflow transition rule - * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). - * - * Rules are enabled if the `disabled` parameter is not provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. - */ - async updateWorkflowTransitionRuleConfigurations( - parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, - callback?: never, - ): Promise; - async updateWorkflowTransitionRuleConfigurations( - parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflow/rule/config', - method: 'PUT', - data: { - workflows: parameters.workflows, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes workflow transition rules from one or more workflows. These rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) - * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) - * - * Only rules created by the calling Connect app can be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can use this operation. - */ - async deleteWorkflowTransitionRuleConfigurations( - parameters: Parameters.DeleteWorkflowTransitionRuleConfigurations | undefined, - callback: Callback, - ): Promise; - /** - * Deletes workflow transition rules from one or more workflows. These rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) - * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) - * - * Only rules created by the calling Connect app can be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can use this operation. - */ - async deleteWorkflowTransitionRuleConfigurations( - parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, - callback?: never, - ): Promise; - async deleteWorkflowTransitionRuleConfigurations( - parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflow/rule/config/delete', - method: 'PUT', - data: { - workflows: parameters?.workflows, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/workflows.mts b/src/version2/workflows.mts new file mode 100644 index 000000000..81ec8b8ac --- /dev/null +++ b/src/version2/workflows.mts @@ -0,0 +1,400 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { paramSerializer } from '../paramSerializer.mjs'; +import { RequestConfig } from '../requestConfig.mjs'; + +export class Workflows { + constructor(private client: Client) {} + + /** + * Creates a workflow. Workflow transitions are created with the default system transition rules. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflow( + parameters: Parameters.CreateWorkflow, + callback: Callback, + ): Promise; + /** + * Creates a workflow. Workflow transitions are created with the default system transition rules. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflow(parameters: Parameters.CreateWorkflow, callback?: never): Promise; + async createWorkflow( + parameters: Parameters.CreateWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflow', + method: 'POST', + data: { + description: parameters.description, + name: parameters.name, + statuses: parameters.statuses, + transitions: parameters.transitions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, + * all published classic workflows are returned. + * + * This operation does not return next-gen workflows. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowsPaginated( + parameters: Parameters.GetWorkflowsPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, + * all published classic workflows are returned. + * + * This operation does not return next-gen workflows. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowsPaginated( + parameters?: Parameters.GetWorkflowsPaginated, + callback?: never, + ): Promise; + async getWorkflowsPaginated( + parameters?: Parameters.GetWorkflowsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflow/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + workflowName: paramSerializer('workflowName', parameters?.workflowName), + expand: parameters?.expand, + queryString: parameters?.queryString, + orderBy: parameters?.orderBy, + isActive: parameters?.isActive, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a workflow. + * + * The workflow cannot be deleted if it is: + * + * - An active workflow. + * - A system workflow. + * - Associated with any workflow scheme. + * - Associated with any draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteInactiveWorkflow( + parameters: Parameters.DeleteInactiveWorkflow | string, + callback: Callback, + ): Promise; + /** + * Deletes a workflow. + * + * The workflow cannot be deleted if it is: + * + * - An active workflow. + * - A system workflow. + * - Associated with any workflow scheme. + * - Associated with any draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteInactiveWorkflow( + parameters: Parameters.DeleteInactiveWorkflow | string, + callback?: never, + ): Promise; + async deleteInactiveWorkflow( + parameters: Parameters.DeleteInactiveWorkflow | string, + callback?: Callback, + ): Promise { + const entityId = typeof parameters === 'string' ? parameters : parameters.entityId; + + const config: RequestConfig = { + url: `/rest/api/2/workflow/${entityId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of workflows and related statuses by providing workflow names, workflow IDs, or project and issue + * types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflows + * - At least one of the _Administer projects_ and _View (read-only) workflow_ project permissions to access + * project-scoped workflows + */ + async readWorkflows( + parameters: Parameters.ReadWorkflows, + callback: Callback, + ): Promise; + /** + * Returns a list of workflows and related statuses by providing workflow names, workflow IDs, or project and issue + * types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflows + * - At least one of the _Administer projects_ and _View (read-only) workflow_ project permissions to access + * project-scoped workflows + */ + async readWorkflows(parameters: Parameters.ReadWorkflows, callback?: never): Promise; + async readWorkflows( + parameters: Parameters.ReadWorkflows, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflows', + method: 'POST', + params: { + expand: parameters.expand, + }, + data: { + projectAndIssueTypes: parameters.projectAndIssueTypes, + workflowIds: parameters.workflowIds, + workflowNames: parameters.workflowNames, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Get the list of workflow capabilities for a specific workflow using either the workflow ID, or the project and + * issue type ID pair. The response includes the scope of the workflow, defined as global/project-based, and a list of + * project types that the workflow is scoped to. It also includes all rules organized into their broad categories + * (conditions, validators, actions, triggers, screens) as well as the source location (Atlassian-provided, Connect, + * Forge). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to access all, including global-scoped, workflows + * - _Administer projects_ project permissions to access project-scoped workflows + */ + async workflowCapabilities( + parameters: Parameters.WorkflowCapabilities, + callback: Callback, + ): Promise; + /** + * Get the list of workflow capabilities for a specific workflow using either the workflow ID, or the project and + * issue type ID pair. The response includes the scope of the workflow, defined as global/project-based, and a list of + * project types that the workflow is scoped to. It also includes all rules organized into their broad categories + * (conditions, validators, actions, triggers, screens) as well as the source location (Atlassian-provided, Connect, + * Forge). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to access all, including global-scoped, workflows + * - _Administer projects_ project permissions to access project-scoped workflows + */ + async workflowCapabilities( + parameters: Parameters.WorkflowCapabilities, + callback?: never, + ): Promise; + async workflowCapabilities( + parameters: Parameters.WorkflowCapabilities, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflows/capabilities', + method: 'GET', + params: { + workflowId: parameters.workflowId, + projectId: parameters.projectId, + issueTypeId: parameters.issueTypeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Create workflows and related statuses. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - _Administer projects_ project permissions to create project-scoped workflows + */ + async createWorkflows( + parameters: Parameters.CreateWorkflows, + callback: Callback, + ): Promise; + /** + * Create workflows and related statuses. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - _Administer projects_ project permissions to create project-scoped workflows + */ + async createWorkflows( + parameters: Parameters.CreateWorkflows, + callback?: never, + ): Promise; + async createWorkflows( + parameters: Parameters.CreateWorkflows, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflows/create', + method: 'POST', + data: { + scope: parameters.scope, + statuses: parameters.statuses, + workflows: parameters.workflows, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Validate the payload for bulk create workflows. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - _Administer projects_ project permissions to create project-scoped workflows + */ + async validateCreateWorkflows( + parameters: Parameters.ValidateCreateWorkflows, + callback: Callback, + ): Promise; + /** + * Validate the payload for bulk create workflows. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - _Administer projects_ project permissions to create project-scoped workflows + */ + async validateCreateWorkflows( + parameters: Parameters.ValidateCreateWorkflows, + callback?: never, + ): Promise; + async validateCreateWorkflows( + parameters: Parameters.ValidateCreateWorkflows, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflows/create/validation', + method: 'POST', + data: { + payload: parameters.payload, + validationOptions: parameters.validationOptions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update workflows and related statuses. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - _Administer projects_ project permissions to create project-scoped workflows + */ + async updateWorkflows( + parameters: Parameters.UpdateWorkflows, + callback: Callback, + ): Promise; + /** + * Update workflows and related statuses. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - _Administer projects_ project permissions to create project-scoped workflows + */ + async updateWorkflows( + parameters: Parameters.UpdateWorkflows, + callback?: never, + ): Promise; + async updateWorkflows( + parameters: Parameters.UpdateWorkflows, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflows/update', + method: 'POST', + params: { + expand: parameters.expand, + }, + data: { + statuses: parameters.statuses, + workflows: parameters.workflows, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Validate the payload for bulk update workflows. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - _Administer projects_ project permissions to create project-scoped workflows + */ + async validateUpdateWorkflows( + parameters: Parameters.ValidateUpdateWorkflows, + callback: Callback, + ): Promise; + /** + * Validate the payload for bulk update workflows. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - _Administer projects_ project permissions to create project-scoped workflows + */ + async validateUpdateWorkflows( + parameters: Parameters.ValidateUpdateWorkflows, + callback?: never, + ): Promise; + async validateUpdateWorkflows( + parameters: Parameters.ValidateUpdateWorkflows, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflows/update/validation', + method: 'POST', + data: { + payload: parameters.payload, + validationOptions: parameters.validationOptions, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/workflows.ts b/src/version2/workflows.ts deleted file mode 100644 index be3d702d1..000000000 --- a/src/version2/workflows.ts +++ /dev/null @@ -1,400 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import { paramSerializer } from '../paramSerializer.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Workflows { - constructor(private client: Client) {} - - /** - * Creates a workflow. Workflow transitions are created with the default system transition rules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflow( - parameters: Parameters.CreateWorkflow, - callback: Callback, - ): Promise; - /** - * Creates a workflow. Workflow transitions are created with the default system transition rules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflow(parameters: Parameters.CreateWorkflow, callback?: never): Promise; - async createWorkflow( - parameters: Parameters.CreateWorkflow, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflow', - method: 'POST', - data: { - description: parameters.description, - name: parameters.name, - statuses: parameters.statuses, - transitions: parameters.transitions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, - * all published classic workflows are returned. - * - * This operation does not return next-gen workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowsPaginated( - parameters: Parameters.GetWorkflowsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, - * all published classic workflows are returned. - * - * This operation does not return next-gen workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowsPaginated( - parameters?: Parameters.GetWorkflowsPaginated, - callback?: never, - ): Promise; - async getWorkflowsPaginated( - parameters?: Parameters.GetWorkflowsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflow/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - workflowName: paramSerializer('workflowName', parameters?.workflowName), - expand: parameters?.expand, - queryString: parameters?.queryString, - orderBy: parameters?.orderBy, - isActive: parameters?.isActive, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a workflow. - * - * The workflow cannot be deleted if it is: - * - * - An active workflow. - * - A system workflow. - * - Associated with any workflow scheme. - * - Associated with any draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteInactiveWorkflow( - parameters: Parameters.DeleteInactiveWorkflow | string, - callback: Callback, - ): Promise; - /** - * Deletes a workflow. - * - * The workflow cannot be deleted if it is: - * - * - An active workflow. - * - A system workflow. - * - Associated with any workflow scheme. - * - Associated with any draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteInactiveWorkflow( - parameters: Parameters.DeleteInactiveWorkflow | string, - callback?: never, - ): Promise; - async deleteInactiveWorkflow( - parameters: Parameters.DeleteInactiveWorkflow | string, - callback?: Callback, - ): Promise { - const entityId = typeof parameters === 'string' ? parameters : parameters.entityId; - - const config: RequestConfig = { - url: `/rest/api/2/workflow/${entityId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of workflows and related statuses by providing workflow names, workflow IDs, or project and issue - * types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ global permission to access all, including project-scoped, workflows - * - At least one of the _Administer projects_ and _View (read-only) workflow_ project permissions to access - * project-scoped workflows - */ - async readWorkflows( - parameters: Parameters.ReadWorkflows, - callback: Callback, - ): Promise; - /** - * Returns a list of workflows and related statuses by providing workflow names, workflow IDs, or project and issue - * types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ global permission to access all, including project-scoped, workflows - * - At least one of the _Administer projects_ and _View (read-only) workflow_ project permissions to access - * project-scoped workflows - */ - async readWorkflows(parameters: Parameters.ReadWorkflows, callback?: never): Promise; - async readWorkflows( - parameters: Parameters.ReadWorkflows, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflows', - method: 'POST', - params: { - expand: parameters.expand, - }, - data: { - projectAndIssueTypes: parameters.projectAndIssueTypes, - workflowIds: parameters.workflowIds, - workflowNames: parameters.workflowNames, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Get the list of workflow capabilities for a specific workflow using either the workflow ID, or the project and - * issue type ID pair. The response includes the scope of the workflow, defined as global/project-based, and a list of - * project types that the workflow is scoped to. It also includes all rules organized into their broad categories - * (conditions, validators, actions, triggers, screens) as well as the source location (Atlassian-provided, Connect, - * Forge). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to access all, including global-scoped, workflows - * - _Administer projects_ project permissions to access project-scoped workflows - */ - async workflowCapabilities( - parameters: Parameters.WorkflowCapabilities, - callback: Callback, - ): Promise; - /** - * Get the list of workflow capabilities for a specific workflow using either the workflow ID, or the project and - * issue type ID pair. The response includes the scope of the workflow, defined as global/project-based, and a list of - * project types that the workflow is scoped to. It also includes all rules organized into their broad categories - * (conditions, validators, actions, triggers, screens) as well as the source location (Atlassian-provided, Connect, - * Forge). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to access all, including global-scoped, workflows - * - _Administer projects_ project permissions to access project-scoped workflows - */ - async workflowCapabilities( - parameters: Parameters.WorkflowCapabilities, - callback?: never, - ): Promise; - async workflowCapabilities( - parameters: Parameters.WorkflowCapabilities, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflows/capabilities', - method: 'GET', - params: { - workflowId: parameters.workflowId, - projectId: parameters.projectId, - issueTypeId: parameters.issueTypeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Create workflows and related statuses. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to create all, including global-scoped, workflows - * - _Administer projects_ project permissions to create project-scoped workflows - */ - async createWorkflows( - parameters: Parameters.CreateWorkflows, - callback: Callback, - ): Promise; - /** - * Create workflows and related statuses. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to create all, including global-scoped, workflows - * - _Administer projects_ project permissions to create project-scoped workflows - */ - async createWorkflows( - parameters: Parameters.CreateWorkflows, - callback?: never, - ): Promise; - async createWorkflows( - parameters: Parameters.CreateWorkflows, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflows/create', - method: 'POST', - data: { - scope: parameters.scope, - statuses: parameters.statuses, - workflows: parameters.workflows, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Validate the payload for bulk create workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to create all, including global-scoped, workflows - * - _Administer projects_ project permissions to create project-scoped workflows - */ - async validateCreateWorkflows( - parameters: Parameters.ValidateCreateWorkflows, - callback: Callback, - ): Promise; - /** - * Validate the payload for bulk create workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to create all, including global-scoped, workflows - * - _Administer projects_ project permissions to create project-scoped workflows - */ - async validateCreateWorkflows( - parameters: Parameters.ValidateCreateWorkflows, - callback?: never, - ): Promise; - async validateCreateWorkflows( - parameters: Parameters.ValidateCreateWorkflows, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflows/create/validation', - method: 'POST', - data: { - payload: parameters.payload, - validationOptions: parameters.validationOptions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Update workflows and related statuses. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to create all, including global-scoped, workflows - * - _Administer projects_ project permissions to create project-scoped workflows - */ - async updateWorkflows( - parameters: Parameters.UpdateWorkflows, - callback: Callback, - ): Promise; - /** - * Update workflows and related statuses. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to create all, including global-scoped, workflows - * - _Administer projects_ project permissions to create project-scoped workflows - */ - async updateWorkflows( - parameters: Parameters.UpdateWorkflows, - callback?: never, - ): Promise; - async updateWorkflows( - parameters: Parameters.UpdateWorkflows, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflows/update', - method: 'POST', - params: { - expand: parameters.expand, - }, - data: { - statuses: parameters.statuses, - workflows: parameters.workflows, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Validate the payload for bulk update workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to create all, including global-scoped, workflows - * - _Administer projects_ project permissions to create project-scoped workflows - */ - async validateUpdateWorkflows( - parameters: Parameters.ValidateUpdateWorkflows, - callback: Callback, - ): Promise; - /** - * Validate the payload for bulk update workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ project permission to create all, including global-scoped, workflows - * - _Administer projects_ project permissions to create project-scoped workflows - */ - async validateUpdateWorkflows( - parameters: Parameters.ValidateUpdateWorkflows, - callback?: never, - ): Promise; - async validateUpdateWorkflows( - parameters: Parameters.ValidateUpdateWorkflows, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflows/update/validation', - method: 'POST', - data: { - payload: parameters.payload, - validationOptions: parameters.validationOptions, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/announcementBanner.mts b/src/version3/announcementBanner.mts new file mode 100644 index 000000000..9d3e96d13 --- /dev/null +++ b/src/version3/announcementBanner.mts @@ -0,0 +1,61 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class AnnouncementBanner { + constructor(private client: Client) {} + + /** + * Returns the current announcement banner configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getBanner(callback: Callback): Promise; + /** + * Returns the current announcement banner configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getBanner(callback?: never): Promise; + async getBanner(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/announcementBanner', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the announcement banner configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setBanner(parameters: Parameters.SetBanner | undefined, callback: Callback): Promise; + /** + * Updates the announcement banner configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setBanner(parameters?: Parameters.SetBanner, callback?: never): Promise; + async setBanner(parameters?: Parameters.SetBanner, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/announcementBanner', + method: 'PUT', + data: { + isDismissible: parameters?.isDismissible, + isEnabled: parameters?.isEnabled, + message: parameters?.message, + visibility: parameters?.visibility, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/announcementBanner.ts b/src/version3/announcementBanner.ts deleted file mode 100644 index 7c844baa9..000000000 --- a/src/version3/announcementBanner.ts +++ /dev/null @@ -1,61 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class AnnouncementBanner { - constructor(private client: Client) {} - - /** - * Returns the current announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getBanner(callback: Callback): Promise; - /** - * Returns the current announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getBanner(callback?: never): Promise; - async getBanner(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/announcementBanner', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setBanner(parameters: Parameters.SetBanner | undefined, callback: Callback): Promise; - /** - * Updates the announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setBanner(parameters?: Parameters.SetBanner, callback?: never): Promise; - async setBanner(parameters?: Parameters.SetBanner, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/announcementBanner', - method: 'PUT', - data: { - isDismissible: parameters?.isDismissible, - isEnabled: parameters?.isEnabled, - message: parameters?.message, - visibility: parameters?.visibility, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/appMigration.mts b/src/version3/appMigration.mts new file mode 100644 index 000000000..4ec07537f --- /dev/null +++ b/src/version3/appMigration.mts @@ -0,0 +1,114 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class AppMigration { + constructor(private client: Client) {} + + /** + * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom + * fields can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback: Callback): Promise; + /** + * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom + * fields can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback?: never): Promise; + async updateIssueFields( + parameters: Parameters.UpdateIssueFields, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/migration/field', + method: 'PUT', + headers: { + 'Atlassian-Account-Id': parameters.accountId, + 'Atlassian-Transfer-Id': parameters.transferId, + }, + data: { + updateValueList: parameters.updateValueList, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for + * use by Connect apps during app migration. + */ + async updateEntityPropertiesValue( + parameters: Parameters.UpdateEntityPropertiesValue, + callback: Callback, + ): Promise; + /** + * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for + * use by Connect apps during app migration. + */ + async updateEntityPropertiesValue( + parameters: Parameters.UpdateEntityPropertiesValue, + callback?: never, + ): Promise; + async updateEntityPropertiesValue( + parameters: Parameters.UpdateEntityPropertiesValue, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/migration/properties/${parameters.entityType}`, + method: 'PUT', + headers: { + 'Atlassian-Account-Id': parameters.accountId, + 'Atlassian-Transfer-Id': parameters.transferId, + 'Content-Type': 'application/json', + }, + data: parameters.entities, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect + * app. + */ + async workflowRuleSearch( + parameters: Parameters.WorkflowRuleSearch, + callback: Callback, + ): Promise; + /** + * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect + * app. + */ + async workflowRuleSearch( + parameters: Parameters.WorkflowRuleSearch, + callback?: never, + ): Promise; + async workflowRuleSearch( + parameters: Parameters.WorkflowRuleSearch, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/migration/workflow/rule/search', + method: 'POST', + headers: { + 'Atlassian-Transfer-Id': parameters.transferId, + }, + data: { + expand: parameters.expand, + ruleIds: parameters.ruleIds, + workflowEntityId: parameters.workflowEntityId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/appMigration.ts b/src/version3/appMigration.ts deleted file mode 100644 index d69e66c75..000000000 --- a/src/version3/appMigration.ts +++ /dev/null @@ -1,114 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class AppMigration { - constructor(private client: Client) {} - - /** - * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom - * fields can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback: Callback): Promise; - /** - * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom - * fields can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback?: never): Promise; - async updateIssueFields( - parameters: Parameters.UpdateIssueFields, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/migration/field', - method: 'PUT', - headers: { - 'Atlassian-Account-Id': parameters.accountId, - 'Atlassian-Transfer-Id': parameters.transferId, - }, - data: { - updateValueList: parameters.updateValueList, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for - * use by Connect apps during app migration. - */ - async updateEntityPropertiesValue( - parameters: Parameters.UpdateEntityPropertiesValue, - callback: Callback, - ): Promise; - /** - * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for - * use by Connect apps during app migration. - */ - async updateEntityPropertiesValue( - parameters: Parameters.UpdateEntityPropertiesValue, - callback?: never, - ): Promise; - async updateEntityPropertiesValue( - parameters: Parameters.UpdateEntityPropertiesValue, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/migration/properties/${parameters.entityType}`, - method: 'PUT', - headers: { - 'Atlassian-Account-Id': parameters.accountId, - 'Atlassian-Transfer-Id': parameters.transferId, - 'Content-Type': 'application/json', - }, - data: parameters.entities, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect - * app. - */ - async workflowRuleSearch( - parameters: Parameters.WorkflowRuleSearch, - callback: Callback, - ): Promise; - /** - * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect - * app. - */ - async workflowRuleSearch( - parameters: Parameters.WorkflowRuleSearch, - callback?: never, - ): Promise; - async workflowRuleSearch( - parameters: Parameters.WorkflowRuleSearch, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/migration/workflow/rule/search', - method: 'POST', - headers: { - 'Atlassian-Transfer-Id': parameters.transferId, - }, - data: { - expand: parameters.expand, - ruleIds: parameters.ruleIds, - workflowEntityId: parameters.workflowEntityId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/appProperties.mts b/src/version3/appProperties.mts new file mode 100644 index 000000000..5fa02e937 --- /dev/null +++ b/src/version3/appProperties.mts @@ -0,0 +1,223 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class AppProperties { + constructor(private client: Client) {} + + /** + * Gets all the properties of an app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the + * Marketplace can access properties of Connect apps they were [migrated + * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + */ + async getAddonProperties( + parameters: Parameters.GetAddonProperties | string, + callback: Callback, + ): Promise; + /** + * Gets all the properties of an app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the + * Marketplace can access properties of Connect apps they were [migrated + * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + */ + async getAddonProperties( + parameters: Parameters.GetAddonProperties | string, + callback?: never, + ): Promise; + async getAddonProperties( + parameters: Parameters.GetAddonProperties | string, + callback?: Callback, + ): Promise { + const addonKey = typeof parameters === 'string' ? parameters : parameters.addonKey; + + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/addons/${addonKey}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the key and value of an app's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the + * Marketplace can access properties of Connect apps they were [migrated + * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + */ + async getAddonProperty( + parameters: Parameters.GetAddonProperty, + callback: Callback, + ): Promise; + /** + * Returns the key and value of an app's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the + * Marketplace can access properties of Connect apps they were [migrated + * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + */ + async getAddonProperty( + parameters: Parameters.GetAddonProperty, + callback?: never, + ): Promise; + async getAddonProperty( + parameters: Parameters.GetAddonProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of an app's property. Use this resource to store custom data for your app. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. + */ + async putAddonProperty( + parameters: Parameters.PutAddonProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of an app's property. Use this resource to store custom data for your app. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. + */ + async putAddonProperty( + parameters: Parameters.PutAddonProperty, + callback?: never, + ): Promise; + async putAddonProperty( + parameters: Parameters.PutAddonProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an app's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. + */ + async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback: Callback): Promise; + /** + * Deletes an app's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a + * Connect app whose key matches `addonKey` can make this request. + */ + async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback?: never): Promise; + async deleteAddonProperty( + parameters: Parameters.DeleteAddonProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a Forge app's property. These values can be retrieved in [Jira + * expressions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) through the `app` [context + * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). + * + * For other use cases, use the [Storage + * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Forge apps can make this request. + */ + async putAppProperty( + parameters: Parameters.PutAppProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of a Forge app's property. These values can be retrieved in [Jira + * expressions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) through the `app` [context + * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). + * + * For other use cases, use the [Storage + * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Forge apps can make this request. + */ + async putAppProperty( + parameters: Parameters.PutAppProperty, + callback?: never, + ): Promise; + async putAppProperty( + parameters: Parameters.PutAppProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a Forge app's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Forge apps can make this request. + */ + async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback: Callback): Promise; + /** + * Deletes a Forge app's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Forge apps can make this request. + */ + async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback?: never): Promise; + async deleteAppProperty( + parameters: Parameters.DeleteAppProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/appProperties.ts b/src/version3/appProperties.ts deleted file mode 100644 index 7dab487de..000000000 --- a/src/version3/appProperties.ts +++ /dev/null @@ -1,223 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class AppProperties { - constructor(private client: Client) {} - - /** - * Gets all the properties of an app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). - */ - async getAddonProperties( - parameters: Parameters.GetAddonProperties | string, - callback: Callback, - ): Promise; - /** - * Gets all the properties of an app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). - */ - async getAddonProperties( - parameters: Parameters.GetAddonProperties | string, - callback?: never, - ): Promise; - async getAddonProperties( - parameters: Parameters.GetAddonProperties | string, - callback?: Callback, - ): Promise { - const addonKey = typeof parameters === 'string' ? parameters : parameters.addonKey; - - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/addons/${addonKey}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the key and value of an app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). - */ - async getAddonProperty( - parameters: Parameters.GetAddonProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of an app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). - */ - async getAddonProperty( - parameters: Parameters.GetAddonProperty, - callback?: never, - ): Promise; - async getAddonProperty( - parameters: Parameters.GetAddonProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of an app's property. Use this resource to store custom data for your app. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. - */ - async putAddonProperty( - parameters: Parameters.PutAddonProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of an app's property. Use this resource to store custom data for your app. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. - */ - async putAddonProperty( - parameters: Parameters.PutAddonProperty, - callback?: never, - ): Promise; - async putAddonProperty( - parameters: Parameters.PutAddonProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. - */ - async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback: Callback): Promise; - /** - * Deletes an app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. - */ - async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback?: never): Promise; - async deleteAddonProperty( - parameters: Parameters.DeleteAddonProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a Forge app's property. These values can be retrieved in [Jira - * expressions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) through the `app` [context - * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). - * - * For other use cases, use the [Storage - * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Forge apps can make this request. - */ - async putAppProperty( - parameters: Parameters.PutAppProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of a Forge app's property. These values can be retrieved in [Jira - * expressions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) through the `app` [context - * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). - * - * For other use cases, use the [Storage - * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Forge apps can make this request. - */ - async putAppProperty( - parameters: Parameters.PutAppProperty, - callback?: never, - ): Promise; - async putAppProperty( - parameters: Parameters.PutAppProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a Forge app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Forge apps can make this request. - */ - async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback: Callback): Promise; - /** - * Deletes a Forge app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Forge apps can make this request. - */ - async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback?: never): Promise; - async deleteAppProperty( - parameters: Parameters.DeleteAppProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/applicationRoles.mts b/src/version3/applicationRoles.mts new file mode 100644 index 000000000..ec469d2a9 --- /dev/null +++ b/src/version3/applicationRoles.mts @@ -0,0 +1,68 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ApplicationRoles { + constructor(private client: Client) {} + + /** + * Returns all application roles. In Jira, application roles are managed using the [Application access + * configuration](https://confluence.atlassian.com/x/3YxjL) page. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllApplicationRoles(callback: Callback): Promise; + /** + * Returns all application roles. In Jira, application roles are managed using the [Application access + * configuration](https://confluence.atlassian.com/x/3YxjL) page. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllApplicationRoles(callback?: never): Promise; + async getAllApplicationRoles(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/applicationrole', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an application role. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApplicationRole( + parameters: Parameters.GetApplicationRole | string, + callback: Callback, + ): Promise; + /** + * Returns an application role. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApplicationRole( + parameters: Parameters.GetApplicationRole | string, + callback?: never, + ): Promise; + async getApplicationRole( + parameters: Parameters.GetApplicationRole | string, + callback?: Callback, + ): Promise { + const key = typeof parameters === 'string' ? parameters : parameters.key; + + const config: RequestConfig = { + url: `/rest/api/3/applicationrole/${key}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/applicationRoles.ts b/src/version3/applicationRoles.ts deleted file mode 100644 index f8ade4386..000000000 --- a/src/version3/applicationRoles.ts +++ /dev/null @@ -1,68 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ApplicationRoles { - constructor(private client: Client) {} - - /** - * Returns all application roles. In Jira, application roles are managed using the [Application access - * configuration](https://confluence.atlassian.com/x/3YxjL) page. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllApplicationRoles(callback: Callback): Promise; - /** - * Returns all application roles. In Jira, application roles are managed using the [Application access - * configuration](https://confluence.atlassian.com/x/3YxjL) page. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllApplicationRoles(callback?: never): Promise; - async getAllApplicationRoles(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/applicationrole', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an application role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationRole( - parameters: Parameters.GetApplicationRole | string, - callback: Callback, - ): Promise; - /** - * Returns an application role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationRole( - parameters: Parameters.GetApplicationRole | string, - callback?: never, - ): Promise; - async getApplicationRole( - parameters: Parameters.GetApplicationRole | string, - callback?: Callback, - ): Promise { - const key = typeof parameters === 'string' ? parameters : parameters.key; - - const config: RequestConfig = { - url: `/rest/api/3/applicationrole/${key}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/auditRecords.mts b/src/version3/auditRecords.mts new file mode 100644 index 000000000..664b4a3e5 --- /dev/null +++ b/src/version3/auditRecords.mts @@ -0,0 +1,79 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class AuditRecords { + constructor(private client: Client) {} + + /** + * Returns a list of audit records. The list can be filtered to include items: + * + * - Where each item in `filter` has at least one match in any of these fields: + * + * - `summary` + * - `category` + * - `eventSource` + * - `objectItem.name` If the object is a user, account ID is available to filter. + * - `objectItem.parentName` + * - `objectItem.typeName` + * - `changedValues.changedFrom` + * - `changedValues.changedTo` + * - `remoteAddress` + * + * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and + * `"category": "group management"` is returned. + * - Created on or after a date and time. + * - Created on or before a date and time. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAuditRecords( + parameters: Parameters.GetAuditRecords | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of audit records. The list can be filtered to include items: + * + * - Where each item in `filter` has at least one match in any of these fields: + * + * - `summary` + * - `category` + * - `eventSource` + * - `objectItem.name` If the object is a user, account ID is available to filter. + * - `objectItem.parentName` + * - `objectItem.typeName` + * - `changedValues.changedFrom` + * - `changedValues.changedTo` + * - `remoteAddress` + * + * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and + * `"category": "group management"` is returned. + * - Created on or after a date and time. + * - Created on or before a date and time. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAuditRecords(parameters?: Parameters.GetAuditRecords, callback?: never): Promise; + async getAuditRecords( + parameters?: Parameters.GetAuditRecords, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/auditing/record', + method: 'GET', + params: { + offset: parameters?.offset, + limit: parameters?.limit, + filter: parameters?.filter, + from: parameters?.from, + to: parameters?.to, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/auditRecords.ts b/src/version3/auditRecords.ts deleted file mode 100644 index 21be24e60..000000000 --- a/src/version3/auditRecords.ts +++ /dev/null @@ -1,79 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class AuditRecords { - constructor(private client: Client) {} - - /** - * Returns a list of audit records. The list can be filtered to include items: - * - * - Where each item in `filter` has at least one match in any of these fields: - * - * - `summary` - * - `category` - * - `eventSource` - * - `objectItem.name` If the object is a user, account ID is available to filter. - * - `objectItem.parentName` - * - `objectItem.typeName` - * - `changedValues.changedFrom` - * - `changedValues.changedTo` - * - `remoteAddress` - * - * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and - * `"category": "group management"` is returned. - * - Created on or after a date and time. - * - Created on or before a date and time. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAuditRecords( - parameters: Parameters.GetAuditRecords | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of audit records. The list can be filtered to include items: - * - * - Where each item in `filter` has at least one match in any of these fields: - * - * - `summary` - * - `category` - * - `eventSource` - * - `objectItem.name` If the object is a user, account ID is available to filter. - * - `objectItem.parentName` - * - `objectItem.typeName` - * - `changedValues.changedFrom` - * - `changedValues.changedTo` - * - `remoteAddress` - * - * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and - * `"category": "group management"` is returned. - * - Created on or after a date and time. - * - Created on or before a date and time. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAuditRecords(parameters?: Parameters.GetAuditRecords, callback?: never): Promise; - async getAuditRecords( - parameters?: Parameters.GetAuditRecords, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/auditing/record', - method: 'GET', - params: { - offset: parameters?.offset, - limit: parameters?.limit, - filter: parameters?.filter, - from: parameters?.from, - to: parameters?.to, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/avatars.mts b/src/version3/avatars.mts new file mode 100644 index 000000000..d4f626d4c --- /dev/null +++ b/src/version3/avatars.mts @@ -0,0 +1,332 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Avatars { + constructor(private client: Client) {} + + /** + * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllSystemAvatars( + parameters: Parameters.GetAllSystemAvatars | string, + callback: Callback, + ): Promise; + /** + * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllSystemAvatars( + parameters: Parameters.GetAllSystemAvatars | string, + callback?: never, + ): Promise; + async getAllSystemAvatars( + parameters: Parameters.GetAllSystemAvatars | string, + callback?: Callback, + ): Promise { + const type = typeof parameters === 'string' ? parameters : parameters.type; + + const config: RequestConfig = { + url: `/rest/api/3/avatar/${type}/system`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the system and custom avatars for a project or issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * the project the avatar belongs to. + * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for at least one project the issue type is used in. + * - For system avatars, none. + */ + async getAvatars(parameters: Parameters.GetAvatars, callback: Callback): Promise; + /** + * Returns the system and custom avatars for a project or issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * the project the avatar belongs to. + * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for at least one project the issue type is used in. + * - For system avatars, none. + */ + async getAvatars(parameters: Parameters.GetAvatars, callback?: never): Promise; + async getAvatars(parameters: Parameters.GetAvatars, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Loads a custom avatar for a project or issue type. + * + * Specify the avatar's local file location in the body of the request. Also, include the following headers: + * + * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special + * Headers](#special-request-headers). + * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * + * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of + * the image. The length of the square's sides is set to the smaller of the height or width of the image. + * + * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. + * + * After creating the avatar use: + * + * - [Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's displayed avatar. + * - [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as the project's displayed + * avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async storeAvatar(parameters: Parameters.StoreAvatar, callback: Callback): Promise; + /** + * Loads a custom avatar for a project or issue type. + * + * Specify the avatar's local file location in the body of the request. Also, include the following headers: + * + * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special + * Headers](#special-request-headers). + * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * + * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of + * the image. The length of the square's sides is set to the smaller of the height or width of the image. + * + * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. + * + * After creating the avatar use: + * + * - [Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's displayed avatar. + * - [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as the project's displayed + * avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async storeAvatar(parameters: Parameters.StoreAvatar, callback?: never): Promise; + async storeAvatar(parameters: Parameters.StoreAvatar, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, + method: 'POST', + params: { + x: parameters.x, + y: parameters.y, + size: parameters.size, + }, + data: parameters.avatar, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an avatar from a project or issue type. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteAvatar(parameters: Parameters.DeleteAvatar, callback: Callback): Promise; + /** + * Deletes an avatar from a project or issue type. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteAvatar(parameters: Parameters.DeleteAvatar, callback?: never): Promise; + async deleteAvatar(parameters: Parameters.DeleteAvatar, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/universal_avatar/type/${parameters.type}/owner/${parameters.owningObjectId}/avatar/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the default project or issue type avatar image. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType | string, + callback: Callback, + ): Promise; + /** + * Returns the default project or issue type avatar image. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType | string, + callback?: never, + ): Promise; + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType | string, + callback?: Callback, + ): Promise { + const type = typeof parameters === 'string' ? parameters : parameters.type; + + const config: RequestConfig = { + url: `/rest/api/3/universal_avatar/view/type/${type}`, + method: 'GET', + responseType: 'arraybuffer', + params: { + size: typeof parameters !== 'string' && parameters.size, + format: typeof parameters !== 'string' && parameters.format, + }, + }; + + const { + data: avatar, + headers: { 'content-type': contentTypeWithEncoding }, + } = await this.client.sendRequestFullResponse(config); + + const contentType = contentTypeWithEncoding.split(';')[0].trim(); + + return this.client.handleSuccessResponse({ contentType, avatar }, callback); + } + + /** + * Returns a project or issue type avatar image by ID. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - For system avatars, none. + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * the project the avatar belongs to. + * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for at least one project the issue type is used in. + */ + async getAvatarImageByID( + parameters: Parameters.GetAvatarImageByID, + callback: Callback, + ): Promise; + /** + * Returns a project or issue type avatar image by ID. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - For system avatars, none. + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * the project the avatar belongs to. + * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for at least one project the issue type is used in. + */ + async getAvatarImageByID( + parameters: Parameters.GetAvatarImageByID, + callback?: never, + ): Promise; + async getAvatarImageByID( + parameters: Parameters.GetAvatarImageByID, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/universal_avatar/view/type/${parameters.type}/avatar/${parameters.id}`, + method: 'GET', + responseType: 'arraybuffer', + params: { + size: parameters.size, + format: parameters.format, + }, + }; + + const { + data: avatar, + headers: { 'content-type': contentTypeWithEncoding }, + } = await this.client.sendRequestFullResponse(config); + + const contentType = contentTypeWithEncoding.split(';')[0].trim(); + + return this.client.handleSuccessResponse({ contentType, avatar }, callback); + } + + /** + * Returns the avatar image for a project or issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - For system avatars, none. + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * the project the avatar belongs to. + * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for at least one project the issue type is used in. + */ + async getAvatarImageByOwner( + parameters: Parameters.GetAvatarImageByOwner, + callback: Callback, + ): Promise; + /** + * Returns the avatar image for a project or issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - For system avatars, none. + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * the project the avatar belongs to. + * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for at least one project the issue type is used in. + */ + async getAvatarImageByOwner( + parameters: Parameters.GetAvatarImageByOwner, + callback?: never, + ): Promise; + async getAvatarImageByOwner( + parameters: Parameters.GetAvatarImageByOwner, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/universal_avatar/view/type/${parameters.type}/owner/${parameters.entityId}`, + method: 'GET', + responseType: 'arraybuffer', + params: { + size: parameters.size, + format: parameters.format, + }, + }; + + const { + data: avatar, + headers: { 'content-type': contentTypeWithEncoding }, + } = await this.client.sendRequestFullResponse(config); + + const contentType = contentTypeWithEncoding.split(';')[0].trim(); + + return this.client.handleSuccessResponse({ contentType, avatar }, callback); + } +} diff --git a/src/version3/avatars.ts b/src/version3/avatars.ts deleted file mode 100644 index 1f0006b5e..000000000 --- a/src/version3/avatars.ts +++ /dev/null @@ -1,332 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Avatars { - constructor(private client: Client) {} - - /** - * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, - callback: Callback, - ): Promise; - /** - * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, - callback?: never, - ): Promise; - async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, - callback?: Callback, - ): Promise { - const type = typeof parameters === 'string' ? parameters : parameters.type; - - const config: RequestConfig = { - url: `/rest/api/3/avatar/${type}/system`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the system and custom avatars for a project or issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - * - For system avatars, none. - */ - async getAvatars(parameters: Parameters.GetAvatars, callback: Callback): Promise; - /** - * Returns the system and custom avatars for a project or issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - * - For system avatars, none. - */ - async getAvatars(parameters: Parameters.GetAvatars, callback?: never): Promise; - async getAvatars(parameters: Parameters.GetAvatars, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Loads a custom avatar for a project or issue type. - * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar use: - * - * - [Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's displayed avatar. - * - [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as the project's displayed - * avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async storeAvatar(parameters: Parameters.StoreAvatar, callback: Callback): Promise; - /** - * Loads a custom avatar for a project or issue type. - * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar use: - * - * - [Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's displayed avatar. - * - [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as the project's displayed - * avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async storeAvatar(parameters: Parameters.StoreAvatar, callback?: never): Promise; - async storeAvatar(parameters: Parameters.StoreAvatar, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, - method: 'POST', - params: { - x: parameters.x, - y: parameters.y, - size: parameters.size, - }, - data: parameters.avatar, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an avatar from a project or issue type. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteAvatar(parameters: Parameters.DeleteAvatar, callback: Callback): Promise; - /** - * Deletes an avatar from a project or issue type. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteAvatar(parameters: Parameters.DeleteAvatar, callback?: never): Promise; - async deleteAvatar(parameters: Parameters.DeleteAvatar, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/universal_avatar/type/${parameters.type}/owner/${parameters.owningObjectId}/avatar/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the default project or issue type avatar image. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType | string, - callback: Callback, - ): Promise; - /** - * Returns the default project or issue type avatar image. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType | string, - callback?: never, - ): Promise; - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType | string, - callback?: Callback, - ): Promise { - const type = typeof parameters === 'string' ? parameters : parameters.type; - - const config: RequestConfig = { - url: `/rest/api/3/universal_avatar/view/type/${type}`, - method: 'GET', - responseType: 'arraybuffer', - params: { - size: typeof parameters !== 'string' && parameters.size, - format: typeof parameters !== 'string' && parameters.format, - }, - }; - - const { - data: avatar, - headers: { 'content-type': contentTypeWithEncoding }, - } = await this.client.sendRequestFullResponse(config); - - const contentType = contentTypeWithEncoding.split(';')[0].trim(); - - return this.client.handleSuccessResponse({ contentType, avatar }, callback); - } - - /** - * Returns a project or issue type avatar image by ID. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - */ - async getAvatarImageByID( - parameters: Parameters.GetAvatarImageByID, - callback: Callback, - ): Promise; - /** - * Returns a project or issue type avatar image by ID. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - */ - async getAvatarImageByID( - parameters: Parameters.GetAvatarImageByID, - callback?: never, - ): Promise; - async getAvatarImageByID( - parameters: Parameters.GetAvatarImageByID, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/universal_avatar/view/type/${parameters.type}/avatar/${parameters.id}`, - method: 'GET', - responseType: 'arraybuffer', - params: { - size: parameters.size, - format: parameters.format, - }, - }; - - const { - data: avatar, - headers: { 'content-type': contentTypeWithEncoding }, - } = await this.client.sendRequestFullResponse(config); - - const contentType = contentTypeWithEncoding.split(';')[0].trim(); - - return this.client.handleSuccessResponse({ contentType, avatar }, callback); - } - - /** - * Returns the avatar image for a project or issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - */ - async getAvatarImageByOwner( - parameters: Parameters.GetAvatarImageByOwner, - callback: Callback, - ): Promise; - /** - * Returns the avatar image for a project or issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * the project the avatar belongs to. - * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for at least one project the issue type is used in. - */ - async getAvatarImageByOwner( - parameters: Parameters.GetAvatarImageByOwner, - callback?: never, - ): Promise; - async getAvatarImageByOwner( - parameters: Parameters.GetAvatarImageByOwner, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/universal_avatar/view/type/${parameters.type}/owner/${parameters.entityId}`, - method: 'GET', - responseType: 'arraybuffer', - params: { - size: parameters.size, - format: parameters.format, - }, - }; - - const { - data: avatar, - headers: { 'content-type': contentTypeWithEncoding }, - } = await this.client.sendRequestFullResponse(config); - - const contentType = contentTypeWithEncoding.split(';')[0].trim(); - - return this.client.handleSuccessResponse({ contentType, avatar }, callback); - } -} diff --git a/src/version3/client/index.ts b/src/version3/client/index.ts deleted file mode 100644 index f545fc896..000000000 --- a/src/version3/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './version3Client.js'; diff --git a/src/version3/client/version3Client.mts b/src/version3/client/version3Client.mts new file mode 100644 index 000000000..81c35543b --- /dev/null +++ b/src/version3/client/version3Client.mts @@ -0,0 +1,176 @@ +import { BaseClient } from '@/clients/baseClient.mjs'; +import { AnnouncementBanner } from '@/version3/announcementBanner.mjs'; +import { AppMigration } from '@/version3/appMigration.mjs'; +import { AppProperties } from '@/version3/appProperties.mjs'; +import { ApplicationRoles } from '@/version3/applicationRoles.mjs'; +import { AuditRecords } from '@/version3/auditRecords.mjs'; +import { Avatars } from '@/version3/avatars.mjs'; +import { Dashboards } from '@/version3/dashboards.mjs'; +import { DynamicModules } from '@/version3/dynamicModules.mjs'; +import { FilterSharing } from '@/version3/filterSharing.mjs'; +import { Filters } from '@/version3/filters.mjs'; +import { GroupAndUserPicker } from '@/version3/groupAndUserPicker.mjs'; +import { Groups } from '@/version3/groups.mjs'; +import { InstanceInformation } from '@/version3/instanceInformation.mjs'; +import { IssueAttachments } from '@/version3/issueAttachments.mjs'; +import { IssueCommentProperties } from '@/version3/issueCommentProperties.mjs'; +import { IssueComments } from '@/version3/issueComments.mjs'; +import { IssueCustomFieldConfigurationApps } from '@/version3/issueCustomFieldConfigurationApps.mjs'; +import { IssueCustomFieldContexts } from '@/version3/issueCustomFieldContexts.mjs'; +import { IssueCustomFieldOptions } from '@/version3/issueCustomFieldOptions.mjs'; +import { IssueCustomFieldOptionsApps } from '@/version3/issueCustomFieldOptionsApps.mjs'; +import { IssueCustomFieldValuesApps } from '@/version3/issueCustomFieldValuesApps.mjs'; +import { IssueFieldConfigurations } from '@/version3/issueFieldConfigurations.mjs'; +import { IssueFields } from '@/version3/issueFields.mjs'; +import { IssueLinkTypes } from '@/version3/issueLinkTypes.mjs'; +import { IssueLinks } from '@/version3/issueLinks.mjs'; +import { IssueNavigatorSettings } from '@/version3/issueNavigatorSettings.mjs'; +import { IssueNotificationSchemes } from '@/version3/issueNotificationSchemes.mjs'; +import { IssuePriorities } from '@/version3/issuePriorities.mjs'; +import { IssueProperties } from '@/version3/issueProperties.mjs'; +import { IssueRemoteLinks } from '@/version3/issueRemoteLinks.mjs'; +import { IssueResolutions } from '@/version3/issueResolutions.mjs'; +import { IssueSearch } from '@/version3/issueSearch.mjs'; +import { IssueSecurityLevel } from '@/version3/issueSecurityLevel.mjs'; +import { IssueSecuritySchemes } from '@/version3/issueSecuritySchemes.mjs'; +import { IssueTypeProperties } from '@/version3/issueTypeProperties.mjs'; +import { IssueTypeSchemes } from '@/version3/issueTypeSchemes.mjs'; +import { IssueTypeScreenSchemes } from '@/version3/issueTypeScreenSchemes.mjs'; +import { IssueTypes } from '@/version3/issueTypes.mjs'; +import { IssueVotes } from '@/version3/issueVotes.mjs'; +import { IssueWatchers } from '@/version3/issueWatchers.mjs'; +import { IssueWorklogProperties } from '@/version3/issueWorklogProperties.mjs'; +import { IssueWorklogs } from '@/version3/issueWorklogs.mjs'; +import { Issues } from '@/version3/issues.mjs'; +import { JiraExpressions } from '@/version3/jiraExpressions.mjs'; +import { JiraSettings } from '@/version3/jiraSettings.mjs'; +import { JQL } from '@/version3/jql.mjs'; +import { JqlFunctionsApps } from '@/version3/jqlFunctionsApps.mjs'; +import { Labels } from '@/version3/labels.mjs'; +import { LicenseMetrics } from '@/version3/licenseMetrics.mjs'; +import { Myself } from '@/version3/myself.mjs'; +import { PermissionSchemes } from '@/version3/permissionSchemes.mjs'; +import { Permissions } from '@/version3/permissions.mjs'; +import { ProjectAvatars } from '@/version3/projectAvatars.mjs'; +import { ProjectCategories } from '@/version3/projectCategories.mjs'; +import { ProjectComponents } from '@/version3/projectComponents.mjs'; +import { ProjectEmail } from '@/version3/projectEmail.mjs'; +import { ProjectFeatures } from '@/version3/projectFeatures.mjs'; +import { ProjectKeyAndNameValidation } from '@/version3/projectKeyAndNameValidation.mjs'; +import { ProjectPermissionSchemes } from '@/version3/projectPermissionSchemes.mjs'; +import { ProjectProperties } from '@/version3/projectProperties.mjs'; +import { ProjectRoleActors } from '@/version3/projectRoleActors.mjs'; +import { ProjectRoles } from '@/version3/projectRoles.mjs'; +import { ProjectTypes } from '@/version3/projectTypes.mjs'; +import { ProjectVersions } from '@/version3/projectVersions.mjs'; +import { Projects } from '@/version3/projects.mjs'; +import { ScreenSchemes } from '@/version3/screenSchemes.mjs'; +import { ScreenTabFields } from '@/version3/screenTabFields.mjs'; +import { ScreenTabs } from '@/version3/screenTabs.mjs'; +import { Screens } from '@/version3/screens.mjs'; +import { ServerInfo } from '@/version3/serverInfo.mjs'; +import { Status } from '@/version3/status.mjs'; +import { Tasks } from '@/version3/tasks.mjs'; +import { TimeTracking } from '@/version3/timeTracking.mjs'; +import { UiModificationsApps } from '@/version3/uiModificationsApps.mjs'; +import { UserProperties } from '@/version3/userProperties.mjs'; +import { UserSearch } from '@/version3/userSearch.mjs'; +import { Users } from '@/version3/users.mjs'; +import { Webhooks } from '@/version3/webhooks.mjs'; +import { Workflows } from '@/version3/workflows.mjs'; +import { WorkflowSchemeDrafts } from '@/version3/workflowSchemeDrafts.mjs'; +import { WorkflowSchemeProjectAssociations } from '@/version3/workflowSchemeProjectAssociations.mjs'; +import { WorkflowSchemes } from '@/version3/workflowSchemes.mjs'; +import { WorkflowStatusCategories } from '@/version3/workflowStatusCategories.mjs'; +import { WorkflowStatuses } from '@/version3/workflowStatuses.mjs'; +import { WorkflowTransitionProperties } from '@/version3/workflowTransitionProperties.mjs'; +import { WorkflowTransitionRules } from '@/version3/workflowTransitionRules.mjs'; + +export class Version3Client extends BaseClient { + announcementBanner = new AnnouncementBanner(this); + applicationRoles = new ApplicationRoles(this); + appMigration = new AppMigration(this); + appProperties = new AppProperties(this); + auditRecords = new AuditRecords(this); + avatars = new Avatars(this); + dashboards = new Dashboards(this); + dynamicModules = new DynamicModules(this); + filters = new Filters(this); + filterSharing = new FilterSharing(this); + groupAndUserPicker = new GroupAndUserPicker(this); + groups = new Groups(this); + instanceInformation = new InstanceInformation(this); + issueAttachments = new IssueAttachments(this); + issueCommentProperties = new IssueCommentProperties(this); + issueComments = new IssueComments(this); + issueCustomFieldConfigurationApps = new IssueCustomFieldConfigurationApps(this); + issueCustomFieldContexts = new IssueCustomFieldContexts(this); + issueCustomFieldOptions = new IssueCustomFieldOptions(this); + issueCustomFieldOptionsApps = new IssueCustomFieldOptionsApps(this); + issueCustomFieldValuesApps = new IssueCustomFieldValuesApps(this); + issueFieldConfigurations = new IssueFieldConfigurations(this); + issueFields = new IssueFields(this); + issueLinks = new IssueLinks(this); + issueLinkTypes = new IssueLinkTypes(this); + issueNavigatorSettings = new IssueNavigatorSettings(this); + issueNotificationSchemes = new IssueNotificationSchemes(this); + issuePriorities = new IssuePriorities(this); + issueProperties = new IssueProperties(this); + issueRemoteLinks = new IssueRemoteLinks(this); + issueResolutions = new IssueResolutions(this); + issues = new Issues(this); + issueSearch = new IssueSearch(this); + issueSecurityLevel = new IssueSecurityLevel(this); + issueSecuritySchemes = new IssueSecuritySchemes(this); + issueTypeProperties = new IssueTypeProperties(this); + issueTypes = new IssueTypes(this); + issueTypeSchemes = new IssueTypeSchemes(this); + issueTypeScreenSchemes = new IssueTypeScreenSchemes(this); + issueVotes = new IssueVotes(this); + issueWatchers = new IssueWatchers(this); + issueWorklogProperties = new IssueWorklogProperties(this); + issueWorklogs = new IssueWorklogs(this); + jiraExpressions = new JiraExpressions(this); + jiraSettings = new JiraSettings(this); + jql = new JQL(this); + jqlFunctionsApps = new JqlFunctionsApps(this); + labels = new Labels(this); + licenseMetrics = new LicenseMetrics(this); + myself = new Myself(this); + permissions = new Permissions(this); + permissionSchemes = new PermissionSchemes(this); + projectAvatars = new ProjectAvatars(this); + projectCategories = new ProjectCategories(this); + projectComponents = new ProjectComponents(this); + projectEmail = new ProjectEmail(this); + projectFeatures = new ProjectFeatures(this); + projectKeyAndNameValidation = new ProjectKeyAndNameValidation(this); + projectPermissionSchemes = new ProjectPermissionSchemes(this); + projectProperties = new ProjectProperties(this); + projectRoleActors = new ProjectRoleActors(this); + projectRoles = new ProjectRoles(this); + projects = new Projects(this); + projectTypes = new ProjectTypes(this); + projectVersions = new ProjectVersions(this); + screens = new Screens(this); + screenSchemes = new ScreenSchemes(this); + screenTabFields = new ScreenTabFields(this); + screenTabs = new ScreenTabs(this); + serverInfo = new ServerInfo(this); + status = new Status(this); + tasks = new Tasks(this); + timeTracking = new TimeTracking(this); + uiModificationsApps = new UiModificationsApps(this); + userProperties = new UserProperties(this); + users = new Users(this); + userSearch = new UserSearch(this); + webhooks = new Webhooks(this); + workflows = new Workflows(this); + workflowSchemeDrafts = new WorkflowSchemeDrafts(this); + workflowSchemeProjectAssociations = new WorkflowSchemeProjectAssociations(this); + workflowSchemes = new WorkflowSchemes(this); + workflowStatusCategories = new WorkflowStatusCategories(this); + workflowStatuses = new WorkflowStatuses(this); + workflowTransitionProperties = new WorkflowTransitionProperties(this); + workflowTransitionRules = new WorkflowTransitionRules(this); +} diff --git a/src/version3/client/version3Client.ts b/src/version3/client/version3Client.ts deleted file mode 100644 index 4d8b9c470..000000000 --- a/src/version3/client/version3Client.ts +++ /dev/null @@ -1,178 +0,0 @@ -import { BaseClient } from '../../clients/index.js'; -import { - AnnouncementBanner, - ApplicationRoles, - AppMigration, - AppProperties, - AuditRecords, - Avatars, - Dashboards, - DynamicModules, - Filters, - FilterSharing, - GroupAndUserPicker, - Groups, - InstanceInformation, - IssueAttachments, - IssueCommentProperties, - IssueComments, - IssueCustomFieldConfigurationApps, - IssueCustomFieldContexts, - IssueCustomFieldOptions, - IssueCustomFieldOptionsApps, - IssueCustomFieldValuesApps, - IssueFieldConfigurations, - IssueFields, - IssueLinks, - IssueLinkTypes, - IssueNavigatorSettings, - IssueNotificationSchemes, - IssuePriorities, - IssueProperties, - IssueRemoteLinks, - IssueResolutions, - Issues, - IssueSearch, - IssueSecurityLevel, - IssueSecuritySchemes, - IssueTypeProperties, - IssueTypes, - IssueTypeSchemes, - IssueTypeScreenSchemes, - IssueVotes, - IssueWatchers, - IssueWorklogProperties, - IssueWorklogs, - JiraExpressions, - JiraSettings, - JQL, - JqlFunctionsApps, - Labels, - LicenseMetrics, - Myself, - Permissions, - PermissionSchemes, - ProjectAvatars, - ProjectCategories, - ProjectComponents, - ProjectEmail, - ProjectFeatures, - ProjectKeyAndNameValidation, - ProjectPermissionSchemes, - ProjectProperties, - ProjectRoleActors, - ProjectRoles, - Projects, - ProjectTypes, - ProjectVersions, - Screens, - ScreenSchemes, - ScreenTabFields, - ScreenTabs, - ServerInfo, - Status, - Tasks, - TimeTracking, - UIModificationsApps, - UserProperties, - Users, - UserSearch, - Webhooks, - Workflows, - WorkflowSchemeDrafts, - WorkflowSchemeProjectAssociations, - WorkflowSchemes, - WorkflowStatusCategories, - WorkflowStatuses, - WorkflowTransitionProperties, - WorkflowTransitionRules, -} from '../index.js'; - -export class Version3Client extends BaseClient { - announcementBanner = new AnnouncementBanner(this); - applicationRoles = new ApplicationRoles(this); - appMigration = new AppMigration(this); - appProperties = new AppProperties(this); - auditRecords = new AuditRecords(this); - avatars = new Avatars(this); - dashboards = new Dashboards(this); - dynamicModules = new DynamicModules(this); - filters = new Filters(this); - filterSharing = new FilterSharing(this); - groupAndUserPicker = new GroupAndUserPicker(this); - groups = new Groups(this); - instanceInformation = new InstanceInformation(this); - issueAttachments = new IssueAttachments(this); - issueCommentProperties = new IssueCommentProperties(this); - issueComments = new IssueComments(this); - issueCustomFieldConfigurationApps = new IssueCustomFieldConfigurationApps(this); - issueCustomFieldContexts = new IssueCustomFieldContexts(this); - issueCustomFieldOptions = new IssueCustomFieldOptions(this); - issueCustomFieldOptionsApps = new IssueCustomFieldOptionsApps(this); - issueCustomFieldValuesApps = new IssueCustomFieldValuesApps(this); - issueFieldConfigurations = new IssueFieldConfigurations(this); - issueFields = new IssueFields(this); - issueLinks = new IssueLinks(this); - issueLinkTypes = new IssueLinkTypes(this); - issueNavigatorSettings = new IssueNavigatorSettings(this); - issueNotificationSchemes = new IssueNotificationSchemes(this); - issuePriorities = new IssuePriorities(this); - issueProperties = new IssueProperties(this); - issueRemoteLinks = new IssueRemoteLinks(this); - issueResolutions = new IssueResolutions(this); - issues = new Issues(this); - issueSearch = new IssueSearch(this); - issueSecurityLevel = new IssueSecurityLevel(this); - issueSecuritySchemes = new IssueSecuritySchemes(this); - issueTypeProperties = new IssueTypeProperties(this); - issueTypes = new IssueTypes(this); - issueTypeSchemes = new IssueTypeSchemes(this); - issueTypeScreenSchemes = new IssueTypeScreenSchemes(this); - issueVotes = new IssueVotes(this); - issueWatchers = new IssueWatchers(this); - issueWorklogProperties = new IssueWorklogProperties(this); - issueWorklogs = new IssueWorklogs(this); - jiraExpressions = new JiraExpressions(this); - jiraSettings = new JiraSettings(this); - jql = new JQL(this); - jqlFunctionsApps = new JqlFunctionsApps(this); - labels = new Labels(this); - licenseMetrics = new LicenseMetrics(this); - myself = new Myself(this); - permissions = new Permissions(this); - permissionSchemes = new PermissionSchemes(this); - projectAvatars = new ProjectAvatars(this); - projectCategories = new ProjectCategories(this); - projectComponents = new ProjectComponents(this); - projectEmail = new ProjectEmail(this); - projectFeatures = new ProjectFeatures(this); - projectKeyAndNameValidation = new ProjectKeyAndNameValidation(this); - projectPermissionSchemes = new ProjectPermissionSchemes(this); - projectProperties = new ProjectProperties(this); - projectRoleActors = new ProjectRoleActors(this); - projectRoles = new ProjectRoles(this); - projects = new Projects(this); - projectTypes = new ProjectTypes(this); - projectVersions = new ProjectVersions(this); - screens = new Screens(this); - screenSchemes = new ScreenSchemes(this); - screenTabFields = new ScreenTabFields(this); - screenTabs = new ScreenTabs(this); - serverInfo = new ServerInfo(this); - status = new Status(this); - tasks = new Tasks(this); - timeTracking = new TimeTracking(this); - uiModificationsApps = new UIModificationsApps(this); - userProperties = new UserProperties(this); - users = new Users(this); - userSearch = new UserSearch(this); - webhooks = new Webhooks(this); - workflows = new Workflows(this); - workflowSchemeDrafts = new WorkflowSchemeDrafts(this); - workflowSchemeProjectAssociations = new WorkflowSchemeProjectAssociations(this); - workflowSchemes = new WorkflowSchemes(this); - workflowStatusCategories = new WorkflowStatusCategories(this); - workflowStatuses = new WorkflowStatuses(this); - workflowTransitionProperties = new WorkflowTransitionProperties(this); - workflowTransitionRules = new WorkflowTransitionRules(this); -} diff --git a/src/version3/dashboards.mts b/src/version3/dashboards.mts new file mode 100644 index 000000000..d07e79ecd --- /dev/null +++ b/src/version3/dashboards.mts @@ -0,0 +1,729 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Dashboards { + constructor(private client: Client) {} + + /** + * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or + * owned dashboards. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllDashboards( + parameters: Parameters.GetAllDashboards | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or + * owned dashboards. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllDashboards( + parameters?: Parameters.GetAllDashboards, + callback?: never, + ): Promise; + async getAllDashboards( + parameters?: Parameters.GetAllDashboards, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/dashboard', + method: 'GET', + params: { + filter: parameters?.filter, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async createDashboard( + parameters: Parameters.CreateDashboard, + callback: Callback, + ): Promise; + /** + * Creates a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async createDashboard(parameters: Parameters.CreateDashboard, callback?: never): Promise; + async createDashboard( + parameters: Parameters.CreateDashboard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/dashboard', + method: 'POST', + data: { + description: parameters.description, + editPermissions: parameters.editPermissions, + name: parameters.name, + sharePermissions: parameters.sharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None + * + * The dashboards to be updated must be owned by the user, or the user must be an administrator. + */ + async bulkEditDashboards( + parameters: Parameters.BulkEditDashboards, + callback: Callback, + ): Promise; + /** + * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None + * + * The dashboards to be updated must be owned by the user, or the user must be an administrator. + */ + async bulkEditDashboards( + parameters: Parameters.BulkEditDashboards, + callback?: never, + ): Promise; + async bulkEditDashboards( + parameters: Parameters.BulkEditDashboards, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/dashboard/bulk/edit', + method: 'PUT', + data: { + action: parameters.action, + changeOwnerDetails: parameters.changeOwnerDetails, + entityIds: parameters.entityIds, + extendAdminPermissions: parameters.extendAdminPermissions, + permissionDetails: parameters.permissionDetails, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets a list of all available gadgets that can be added to all dashboards. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllAvailableDashboardGadgets( + callback: Callback, + ): Promise; + /** + * Gets a list of all available gadgets that can be added to all dashboards. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllAvailableDashboardGadgets(callback?: never): Promise; + async getAllAvailableDashboardGadgets( + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/dashboard/gadgets', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * dashboards. This operation is similar to [Get dashboards](#api-rest-api-3-dashboard-get) except that the results + * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. + * When multiple attributes are specified only filters matching all attributes are returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * following dashboards that match the query parameters are returned: + * + * - Dashboards owned by the user. Not returned for anonymous users. + * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. + * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. + * - Dashboards shared with a public project. + * - Dashboards shared with the public. + */ + async getDashboardsPaginated( + parameters: Parameters.GetDashboardsPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * dashboards. This operation is similar to [Get dashboards](#api-rest-api-3-dashboard-get) except that the results + * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. + * When multiple attributes are specified only filters matching all attributes are returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * following dashboards that match the query parameters are returned: + * + * - Dashboards owned by the user. Not returned for anonymous users. + * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. + * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. + * - Dashboards shared with a public project. + * - Dashboards shared with the public. + */ + async getDashboardsPaginated( + parameters?: Parameters.GetDashboardsPaginated, + callback?: never, + ): Promise; + async getDashboardsPaginated( + parameters?: Parameters.GetDashboardsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/dashboard/search', + method: 'GET', + params: { + dashboardName: parameters?.dashboardName, + accountId: parameters?.accountId, + groupname: parameters?.groupname, + groupId: parameters?.groupId, + projectId: parameters?.projectId, + orderBy: parameters?.orderBy, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + status: parameters?.status, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of dashboard gadgets on a dashboard. + * + * This operation returns: + * + * - Gadgets from a list of IDs, when `id` is set. + * - Gadgets with a module key, when `moduleKey` is set. + * - Gadgets from a list of URIs, when `uri` is set. + * - All gadgets, when no other parameters are set. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllGadgets( + parameters: Parameters.GetAllGadgets | string, + callback: Callback, + ): Promise; + /** + * Returns a list of dashboard gadgets on a dashboard. + * + * This operation returns: + * + * - Gadgets from a list of IDs, when `id` is set. + * - Gadgets with a module key, when `moduleKey` is set. + * - Gadgets from a list of URIs, when `uri` is set. + * - All gadgets, when no other parameters are set. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllGadgets( + parameters: Parameters.GetAllGadgets | string, + callback?: never, + ): Promise; + async getAllGadgets( + parameters: Parameters.GetAllGadgets | string, + callback?: Callback, + ): Promise { + const dashboardId = typeof parameters === 'string' ? parameters : parameters.dashboardId; + + // todo paramSerializer needed? + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${dashboardId}/gadget`, + method: 'GET', + params: { + moduleKey: typeof parameters !== 'string' && parameters.moduleKey, + uri: typeof parameters !== 'string' && parameters.uri, + gadgetId: typeof parameters !== 'string' && parameters.gadgetId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a gadget to a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async addGadget(parameters: Parameters.AddGadget, callback: Callback): Promise; + /** + * Adds a gadget to a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async addGadget(parameters: Parameters.AddGadget, callback?: never): Promise; + async addGadget( + parameters: Parameters.AddGadget, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.dashboardId}/gadget`, + method: 'POST', + data: { + color: parameters.color, + ignoreUriAndModuleKeyValidation: parameters.ignoreUriAndModuleKeyValidation, + moduleKey: parameters.moduleKey, + position: parameters.position, + title: parameters.title, + uri: parameters.uri, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the title, position, and color of the gadget on a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async updateGadget(parameters: Parameters.UpdateGadget, callback: Callback): Promise; + /** + * Changes the title, position, and color of the gadget on a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async updateGadget(parameters: Parameters.UpdateGadget, callback?: never): Promise; + async updateGadget(parameters: Parameters.UpdateGadget, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, + method: 'PUT', + data: { + color: parameters.color, + position: parameters.position, + title: parameters.title, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a dashboard gadget from a dashboard. + * + * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied + * position. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async removeGadget(parameters: Parameters.RemoveGadget, callback: Callback): Promise; + /** + * Removes a dashboard gadget from a dashboard. + * + * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied + * position. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async removeGadget(parameters: Parameters.RemoveGadget, callback?: never): Promise; + async removeGadget(parameters: Parameters.RemoveGadget, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the keys of all properties for a dashboard item. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when + * Jira’s anonymous access is permitted. + */ + async getDashboardItemPropertyKeys( + parameters: Parameters.GetDashboardItemPropertyKeys, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for a dashboard item. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when + * Jira’s anonymous access is permitted. + */ + async getDashboardItemPropertyKeys( + parameters: Parameters.GetDashboardItemPropertyKeys, + callback?: never, + ): Promise; + async getDashboardItemPropertyKeys( + parameters: Parameters.GetDashboardItemPropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the key and value of a dashboard item property. + * + * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding + * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * + * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * + * There is no resource to set or get dashboard items. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when + * Jira’s anonymous access is permitted. + */ + async getDashboardItemProperty( + parameters: Parameters.GetDashboardItemProperty, + callback: Callback, + ): Promise; + /** + * Returns the key and value of a dashboard item property. + * + * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding + * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * + * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * + * There is no resource to set or get dashboard items. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when + * Jira’s anonymous access is permitted. + */ + async getDashboardItemProperty( + parameters: Parameters.GetDashboardItemProperty, + callback?: never, + ): Promise; + async getDashboardItemProperty( + parameters: Parameters.GetDashboardItemProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard + * item. + * + * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding + * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * + * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * + * There is no resource to set or get dashboard items. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async setDashboardItemProperty( + parameters: Parameters.SetDashboardItemProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard + * item. + * + * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding + * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * + * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * + * There is no resource to set or get dashboard items. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async setDashboardItemProperty( + parameters: Parameters.SetDashboardItemProperty, + callback?: never, + ): Promise; + async setDashboardItemProperty( + parameters: Parameters.SetDashboardItemProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a dashboard item property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async deleteDashboardItemProperty( + parameters: Parameters.DeleteDashboardItemProperty, + callback: Callback, + ): Promise; + /** + * Deletes a dashboard item property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async deleteDashboardItemProperty( + parameters: Parameters.DeleteDashboardItemProperty, + callback?: never, + ): Promise; + async deleteDashboardItemProperty( + parameters: Parameters.DeleteDashboardItemProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a dashboard. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + * + * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with + * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the + * System dashboard. The System dashboard is considered to be shared with all other users. + */ + async getDashboard( + parameters: Parameters.GetDashboard | string, + callback: Callback, + ): Promise; + /** + * Returns a dashboard. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + * + * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with + * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the + * System dashboard. The System dashboard is considered to be shared with all other users. + */ + async getDashboard(parameters: Parameters.GetDashboard | string, callback?: never): Promise; + async getDashboard( + parameters: Parameters.GetDashboard | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a dashboard, replacing all the dashboard details with those provided. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None + * + * The dashboard to be updated must be owned by the user. + */ + async updateDashboard( + parameters: Parameters.UpdateDashboard, + callback: Callback, + ): Promise; + /** + * Updates a dashboard, replacing all the dashboard details with those provided. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None + * + * The dashboard to be updated must be owned by the user. + */ + async updateDashboard(parameters: Parameters.UpdateDashboard, callback?: never): Promise; + async updateDashboard( + parameters: Parameters.UpdateDashboard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.id}`, + method: 'PUT', + data: { + description: parameters.description, + editPermissions: parameters.editPermissions, + name: parameters.name, + sharePermissions: parameters.sharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None + * + * The dashboard to be deleted must be owned by the user. + */ + async deleteDashboard( + parameters: Parameters.DeleteDashboard | string, + callback: Callback, + ): Promise; + /** + * Deletes a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None + * + * The dashboard to be deleted must be owned by the user. + */ + async deleteDashboard(parameters: Parameters.DeleteDashboard | string, callback?: never): Promise; + async deleteDashboard( + parameters: Parameters.DeleteDashboard | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None + * + * The dashboard to be copied must be owned by or shared with the user. + */ + async copyDashboard(parameters: Parameters.CopyDashboard, callback: Callback): Promise; + /** + * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None + * + * The dashboard to be copied must be owned by or shared with the user. + */ + async copyDashboard(parameters: Parameters.CopyDashboard, callback?: never): Promise; + async copyDashboard( + parameters: Parameters.CopyDashboard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.id}/copy`, + method: 'POST', + data: { + description: parameters.description, + editPermissions: parameters.editPermissions, + name: parameters.name, + sharePermissions: parameters.sharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/dashboards.ts b/src/version3/dashboards.ts deleted file mode 100644 index bef0c27f5..000000000 --- a/src/version3/dashboards.ts +++ /dev/null @@ -1,728 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Dashboards { - constructor(private client: Client) {} - - /** - * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or - * owned dashboards. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllDashboards( - parameters: Parameters.GetAllDashboards | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or - * owned dashboards. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllDashboards( - parameters?: Parameters.GetAllDashboards, - callback?: never, - ): Promise; - async getAllDashboards( - parameters?: Parameters.GetAllDashboards, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/dashboard', - method: 'GET', - params: { - filter: parameters?.filter, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async createDashboard( - parameters: Parameters.CreateDashboard, - callback: Callback, - ): Promise; - /** - * Creates a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async createDashboard(parameters: Parameters.CreateDashboard, callback?: never): Promise; - async createDashboard( - parameters: Parameters.CreateDashboard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/dashboard', - method: 'POST', - data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - name: parameters.name, - sharePermissions: parameters.sharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None - * - * The dashboards to be updated must be owned by the user, or the user must be an administrator. - */ - async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, - callback: Callback, - ): Promise; - /** - * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None - * - * The dashboards to be updated must be owned by the user, or the user must be an administrator. - */ - async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, - callback?: never, - ): Promise; - async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/dashboard/bulk/edit', - method: 'PUT', - data: { - action: parameters.action, - changeOwnerDetails: parameters.changeOwnerDetails, - entityIds: parameters.entityIds, - extendAdminPermissions: parameters.extendAdminPermissions, - permissionDetails: parameters.permissionDetails, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets a list of all available gadgets that can be added to all dashboards. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllAvailableDashboardGadgets( - callback: Callback, - ): Promise; - /** - * Gets a list of all available gadgets that can be added to all dashboards. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllAvailableDashboardGadgets(callback?: never): Promise; - async getAllAvailableDashboardGadgets( - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/dashboard/gadgets', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * dashboards. This operation is similar to [Get dashboards](#api-rest-api-3-dashboard-get) except that the results - * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. - * When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * following dashboards that match the query parameters are returned: - * - * - Dashboards owned by the user. Not returned for anonymous users. - * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. - * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. - * - Dashboards shared with a public project. - * - Dashboards shared with the public. - */ - async getDashboardsPaginated( - parameters: Parameters.GetDashboardsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * dashboards. This operation is similar to [Get dashboards](#api-rest-api-3-dashboard-get) except that the results - * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. - * When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * following dashboards that match the query parameters are returned: - * - * - Dashboards owned by the user. Not returned for anonymous users. - * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. - * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. - * - Dashboards shared with a public project. - * - Dashboards shared with the public. - */ - async getDashboardsPaginated( - parameters?: Parameters.GetDashboardsPaginated, - callback?: never, - ): Promise; - async getDashboardsPaginated( - parameters?: Parameters.GetDashboardsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/dashboard/search', - method: 'GET', - params: { - dashboardName: parameters?.dashboardName, - accountId: parameters?.accountId, - groupname: parameters?.groupname, - groupId: parameters?.groupId, - projectId: parameters?.projectId, - orderBy: parameters?.orderBy, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - status: parameters?.status, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of dashboard gadgets on a dashboard. - * - * This operation returns: - * - * - Gadgets from a list of IDs, when `id` is set. - * - Gadgets with a module key, when `moduleKey` is set. - * - Gadgets from a list of URIs, when `uri` is set. - * - All gadgets, when no other parameters are set. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllGadgets( - parameters: Parameters.GetAllGadgets | string, - callback: Callback, - ): Promise; - /** - * Returns a list of dashboard gadgets on a dashboard. - * - * This operation returns: - * - * - Gadgets from a list of IDs, when `id` is set. - * - Gadgets with a module key, when `moduleKey` is set. - * - Gadgets from a list of URIs, when `uri` is set. - * - All gadgets, when no other parameters are set. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllGadgets( - parameters: Parameters.GetAllGadgets | string, - callback?: never, - ): Promise; - async getAllGadgets( - parameters: Parameters.GetAllGadgets | string, - callback?: Callback, - ): Promise { - const dashboardId = typeof parameters === 'string' ? parameters : parameters.dashboardId; - - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${dashboardId}/gadget`, - method: 'GET', - params: { - moduleKey: typeof parameters !== 'string' && parameters.moduleKey, - uri: typeof parameters !== 'string' && parameters.uri, - gadgetId: typeof parameters !== 'string' && parameters.gadgetId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a gadget to a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async addGadget(parameters: Parameters.AddGadget, callback: Callback): Promise; - /** - * Adds a gadget to a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async addGadget(parameters: Parameters.AddGadget, callback?: never): Promise; - async addGadget( - parameters: Parameters.AddGadget, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.dashboardId}/gadget`, - method: 'POST', - data: { - color: parameters.color, - ignoreUriAndModuleKeyValidation: parameters.ignoreUriAndModuleKeyValidation, - moduleKey: parameters.moduleKey, - position: parameters.position, - title: parameters.title, - uri: parameters.uri, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the title, position, and color of the gadget on a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async updateGadget(parameters: Parameters.UpdateGadget, callback: Callback): Promise; - /** - * Changes the title, position, and color of the gadget on a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async updateGadget(parameters: Parameters.UpdateGadget, callback?: never): Promise; - async updateGadget(parameters: Parameters.UpdateGadget, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, - method: 'PUT', - data: { - color: parameters.color, - position: parameters.position, - title: parameters.title, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a dashboard gadget from a dashboard. - * - * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied - * position. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async removeGadget(parameters: Parameters.RemoveGadget, callback: Callback): Promise; - /** - * Removes a dashboard gadget from a dashboard. - * - * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied - * position. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async removeGadget(parameters: Parameters.RemoveGadget, callback?: never): Promise; - async removeGadget(parameters: Parameters.RemoveGadget, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the keys of all properties for a dashboard item. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemPropertyKeys( - parameters: Parameters.GetDashboardItemPropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for a dashboard item. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemPropertyKeys( - parameters: Parameters.GetDashboardItemPropertyKeys, - callback?: never, - ): Promise; - async getDashboardItemPropertyKeys( - parameters: Parameters.GetDashboardItemPropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the key and value of a dashboard item property. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemProperty( - parameters: Parameters.GetDashboardItemProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of a dashboard item property. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemProperty( - parameters: Parameters.GetDashboardItemProperty, - callback?: never, - ): Promise; - async getDashboardItemProperty( - parameters: Parameters.GetDashboardItemProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard - * item. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async setDashboardItemProperty( - parameters: Parameters.SetDashboardItemProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard - * item. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async setDashboardItemProperty( - parameters: Parameters.SetDashboardItemProperty, - callback?: never, - ): Promise; - async setDashboardItemProperty( - parameters: Parameters.SetDashboardItemProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, - method: 'PUT', - headers: { - 'Content-Type': 'application/json', - }, - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a dashboard item property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async deleteDashboardItemProperty( - parameters: Parameters.DeleteDashboardItemProperty, - callback: Callback, - ): Promise; - /** - * Deletes a dashboard item property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async deleteDashboardItemProperty( - parameters: Parameters.DeleteDashboardItemProperty, - callback?: never, - ): Promise; - async deleteDashboardItemProperty( - parameters: Parameters.DeleteDashboardItemProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a dashboard. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - * - * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with - * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the - * System dashboard. The System dashboard is considered to be shared with all other users. - */ - async getDashboard( - parameters: Parameters.GetDashboard | string, - callback: Callback, - ): Promise; - /** - * Returns a dashboard. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - * - * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with - * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the - * System dashboard. The System dashboard is considered to be shared with all other users. - */ - async getDashboard(parameters: Parameters.GetDashboard | string, callback?: never): Promise; - async getDashboard( - parameters: Parameters.GetDashboard | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a dashboard, replacing all the dashboard details with those provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None - * - * The dashboard to be updated must be owned by the user. - */ - async updateDashboard( - parameters: Parameters.UpdateDashboard, - callback: Callback, - ): Promise; - /** - * Updates a dashboard, replacing all the dashboard details with those provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None - * - * The dashboard to be updated must be owned by the user. - */ - async updateDashboard(parameters: Parameters.UpdateDashboard, callback?: never): Promise; - async updateDashboard( - parameters: Parameters.UpdateDashboard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.id}`, - method: 'PUT', - data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - name: parameters.name, - sharePermissions: parameters.sharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None - * - * The dashboard to be deleted must be owned by the user. - */ - async deleteDashboard( - parameters: Parameters.DeleteDashboard | string, - callback: Callback, - ): Promise; - /** - * Deletes a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None - * - * The dashboard to be deleted must be owned by the user. - */ - async deleteDashboard(parameters: Parameters.DeleteDashboard | string, callback?: never): Promise; - async deleteDashboard( - parameters: Parameters.DeleteDashboard | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None - * - * The dashboard to be copied must be owned by or shared with the user. - */ - async copyDashboard(parameters: Parameters.CopyDashboard, callback: Callback): Promise; - /** - * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None - * - * The dashboard to be copied must be owned by or shared with the user. - */ - async copyDashboard(parameters: Parameters.CopyDashboard, callback?: never): Promise; - async copyDashboard( - parameters: Parameters.CopyDashboard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.id}/copy`, - method: 'POST', - data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - name: parameters.name, - sharePermissions: parameters.sharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/dynamicModules.mts b/src/version3/dynamicModules.mts new file mode 100644 index 000000000..c83f55ebc --- /dev/null +++ b/src/version3/dynamicModules.mts @@ -0,0 +1,90 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class DynamicModules { + constructor(private client: Client) {} + + /** + * Returns all modules registered dynamically by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async getModules(callback: Callback): Promise; + /** + * Returns all modules registered dynamically by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async getModules(callback?: never): Promise; + async getModules(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/app/module/dynamic', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Registers a list of modules. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async registerModules( + parameters: Parameters.RegisterModules | undefined, + callback: Callback, + ): Promise; + /** + * Registers a list of modules. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async registerModules(parameters?: Parameters.RegisterModules, callback?: never): Promise; + async registerModules( + parameters?: Parameters.RegisterModules, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/app/module/dynamic', + method: 'POST', + data: { + modules: parameters?.modules, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Remove all or a list of modules registered by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async removeModules(parameters: Parameters.RemoveModules | undefined, callback: Callback): Promise; + /** + * Remove all or a list of modules registered by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async removeModules(parameters?: Parameters.RemoveModules, callback?: never): Promise; + async removeModules(parameters?: Parameters.RemoveModules, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/app/module/dynamic', + method: 'DELETE', + params: { + moduleKey: parameters?.moduleKey, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/dynamicModules.ts b/src/version3/dynamicModules.ts deleted file mode 100644 index f72bf8bdd..000000000 --- a/src/version3/dynamicModules.ts +++ /dev/null @@ -1,90 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class DynamicModules { - constructor(private client: Client) {} - - /** - * Returns all modules registered dynamically by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async getModules(callback: Callback): Promise; - /** - * Returns all modules registered dynamically by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async getModules(callback?: never): Promise; - async getModules(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/app/module/dynamic', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Registers a list of modules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async registerModules( - parameters: Parameters.RegisterModules | undefined, - callback: Callback, - ): Promise; - /** - * Registers a list of modules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async registerModules(parameters?: Parameters.RegisterModules, callback?: never): Promise; - async registerModules( - parameters?: Parameters.RegisterModules, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/app/module/dynamic', - method: 'POST', - data: { - modules: parameters?.modules, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Remove all or a list of modules registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async removeModules(parameters: Parameters.RemoveModules | undefined, callback: Callback): Promise; - /** - * Remove all or a list of modules registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async removeModules(parameters?: Parameters.RemoveModules, callback?: never): Promise; - async removeModules(parameters?: Parameters.RemoveModules, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/app/module/dynamic', - method: 'DELETE', - params: { - moduleKey: parameters?.moduleKey, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/filterSharing.mts b/src/version3/filterSharing.mts new file mode 100644 index 000000000..2e005d186 --- /dev/null +++ b/src/version3/filterSharing.mts @@ -0,0 +1,255 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class FilterSharing { + constructor(private client: Client) {} + + /** + * Returns the default sharing settings for new filters and dashboards for a user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getDefaultShareScope(callback: Callback): Promise; + /** + * Returns the default sharing settings for new filters and dashboards for a user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getDefaultShareScope(callback?: never): Promise; + async getDefaultShareScope(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/filter/defaultShareScope', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default sharing for new filters and dashboards for a user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async setDefaultShareScope( + parameters: Parameters.SetDefaultShareScope | string, + callback: Callback, + ): Promise; + /** + * Sets the default sharing for new filters and dashboards for a user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async setDefaultShareScope( + parameters: Parameters.SetDefaultShareScope | string, + callback?: never, + ): Promise; + async setDefaultShareScope( + parameters: Parameters.SetDefaultShareScope | string, + callback?: Callback, + ): Promise { + const scope = typeof parameters === 'string' ? parameters : parameters.scope; + + const config: RequestConfig = { + url: '/rest/api/3/filter/defaultShareScope', + method: 'PUT', + data: { + scope, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or + * the public. Sharing with all logged-in users or the public is known as a global share permission. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, share permissions are only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getSharePermissions( + parameters: Parameters.GetSharePermissions | string, + callback: Callback, + ): Promise; + /** + * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or + * the public. Sharing with all logged-in users or the public is known as a global share permission. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, share permissions are only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getSharePermissions( + parameters: Parameters.GetSharePermissions | string, + callback?: never, + ): Promise; + async getSharePermissions( + parameters: Parameters.GetSharePermissions | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/filter/${id}/permission`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the + * public) it will overwrite all share permissions for the filter. + * + * Be aware that this operation uses different objects for updating share permissions compared to [Update + * filter](#api-rest-api-3-filter-id-put). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Share + * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the + * filter. + */ + async addSharePermission( + parameters: Parameters.AddSharePermission, + callback: Callback, + ): Promise; + /** + * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the + * public) it will overwrite all share permissions for the filter. + * + * Be aware that this operation uses different objects for updating share permissions compared to [Update + * filter](#api-rest-api-3-filter-id-put). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Share + * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the + * filter. + */ + async addSharePermission( + parameters: Parameters.AddSharePermission, + callback?: never, + ): Promise; + async addSharePermission( + parameters: Parameters.AddSharePermission, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/filter/${parameters.id}/permission`, + method: 'POST', + data: { + type: parameters.type, + projectId: parameters.projectId, + groupname: parameters.groupname, + projectRoleId: parameters.projectRoleId, + accountId: parameters.accountId, + rights: parameters.rights, + groupId: parameters.groupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the + * public. Sharing with all logged-in users or the public is known as a global share permission. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, a share permission is only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getSharePermission( + parameters: Parameters.GetSharePermission, + callback: Callback, + ): Promise; + /** + * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the + * public. Sharing with all logged-in users or the public is known as a global share permission. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, a share permission is only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getSharePermission( + parameters: Parameters.GetSharePermission, + callback?: never, + ): Promise; + async getSharePermission( + parameters: Parameters.GetSharePermission, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/filter/${parameters.id}/permission/${parameters.permissionId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a share permission from a filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira and the user must own the filter. + */ + async deleteSharePermission( + parameters: Parameters.DeleteSharePermission, + callback: Callback, + ): Promise; + /** + * Deletes a share permission from a filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira and the user must own the filter. + */ + async deleteSharePermission(parameters: Parameters.DeleteSharePermission, callback?: never): Promise; + async deleteSharePermission( + parameters: Parameters.DeleteSharePermission, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/filter/${parameters.id}/permission/${parameters.permissionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/filterSharing.ts b/src/version3/filterSharing.ts deleted file mode 100644 index c9f7240ea..000000000 --- a/src/version3/filterSharing.ts +++ /dev/null @@ -1,255 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class FilterSharing { - constructor(private client: Client) {} - - /** - * Returns the default sharing settings for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getDefaultShareScope(callback: Callback): Promise; - /** - * Returns the default sharing settings for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getDefaultShareScope(callback?: never): Promise; - async getDefaultShareScope(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/filter/defaultShareScope', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default sharing for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async setDefaultShareScope( - parameters: Parameters.SetDefaultShareScope | string, - callback: Callback, - ): Promise; - /** - * Sets the default sharing for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async setDefaultShareScope( - parameters: Parameters.SetDefaultShareScope | string, - callback?: never, - ): Promise; - async setDefaultShareScope( - parameters: Parameters.SetDefaultShareScope | string, - callback?: Callback, - ): Promise { - const scope = typeof parameters === 'string' ? parameters : parameters.scope; - - const config: RequestConfig = { - url: '/rest/api/3/filter/defaultShareScope', - method: 'PUT', - data: { - scope, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or - * the public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, share permissions are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermissions( - parameters: Parameters.GetSharePermissions | string, - callback: Callback, - ): Promise; - /** - * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or - * the public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, share permissions are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermissions( - parameters: Parameters.GetSharePermissions | string, - callback?: never, - ): Promise; - async getSharePermissions( - parameters: Parameters.GetSharePermissions | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/filter/${id}/permission`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the - * public) it will overwrite all share permissions for the filter. - * - * Be aware that this operation uses different objects for updating share permissions compared to [Update - * filter](#api-rest-api-3-filter-id-put). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Share - * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the - * filter. - */ - async addSharePermission( - parameters: Parameters.AddSharePermission, - callback: Callback, - ): Promise; - /** - * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the - * public) it will overwrite all share permissions for the filter. - * - * Be aware that this operation uses different objects for updating share permissions compared to [Update - * filter](#api-rest-api-3-filter-id-put). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Share - * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the - * filter. - */ - async addSharePermission( - parameters: Parameters.AddSharePermission, - callback?: never, - ): Promise; - async addSharePermission( - parameters: Parameters.AddSharePermission, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/filter/${parameters.id}/permission`, - method: 'POST', - data: { - type: parameters.type, - projectId: parameters.projectId, - groupname: parameters.groupname, - projectRoleId: parameters.projectRoleId, - accountId: parameters.accountId, - rights: parameters.rights, - groupId: parameters.groupId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the - * public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, a share permission is only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermission( - parameters: Parameters.GetSharePermission, - callback: Callback, - ): Promise; - /** - * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the - * public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, a share permission is only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermission( - parameters: Parameters.GetSharePermission, - callback?: never, - ): Promise; - async getSharePermission( - parameters: Parameters.GetSharePermission, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/filter/${parameters.id}/permission/${parameters.permissionId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a share permission from a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira and the user must own the filter. - */ - async deleteSharePermission( - parameters: Parameters.DeleteSharePermission, - callback: Callback, - ): Promise; - /** - * Deletes a share permission from a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira and the user must own the filter. - */ - async deleteSharePermission(parameters: Parameters.DeleteSharePermission, callback?: never): Promise; - async deleteSharePermission( - parameters: Parameters.DeleteSharePermission, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/filter/${parameters.id}/permission/${parameters.permissionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/filters.mts b/src/version3/filters.mts new file mode 100644 index 000000000..cdf2bc786 --- /dev/null +++ b/src/version3/filters.mts @@ -0,0 +1,629 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Filters { + constructor(private client: Client) {} + + /** + * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-3-filter-post). The + * filter is not selected as a favorite. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async createFilter(parameters: Parameters.CreateFilter, callback: Callback): Promise; + /** + * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-3-filter-post). The + * filter is not selected as a favorite. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async createFilter(parameters: Parameters.CreateFilter, callback?: never): Promise; + async createFilter( + parameters: Parameters.CreateFilter, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/filter', + method: 'POST', + params: { + expand: parameters?.expand, + overrideSharePermissions: parameters?.overrideSharePermissions, + }, + data: { + description: parameters.description, + editPermissions: parameters.editPermissions, + favourite: parameters.favourite, + favouritedCount: parameters.favouritedCount, + id: parameters.id, + jql: parameters.jql, + name: parameters.name, + owner: parameters.owner, + searchUrl: parameters.searchUrl, + self: parameters.self, + sharePermissions: parameters.sharePermissions, + sharedUsers: parameters.sharedUsers, + subscriptions: parameters.subscriptions, + viewUrl: parameters.viewUrl, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the visible favorite filters of the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** A + * favorite filter is only visible to the user where the filter is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + * + * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. + */ + async getFavouriteFilters( + parameters: Parameters.GetFavouriteFilters | undefined, + callback: Callback, + ): Promise; + /** + * Returns the visible favorite filters of the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** A + * favorite filter is only visible to the user where the filter is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + * + * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. + */ + async getFavouriteFilters( + parameters?: Parameters.GetFavouriteFilters, + callback?: never, + ): Promise; + async getFavouriteFilters( + parameters?: Parameters.GetFavouriteFilters, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/filter/favourite', + method: 'GET', + params: { + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are + * also returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + * + * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. + */ + async getMyFilters( + parameters: Parameters.GetMyFilters | undefined, + callback: Callback, + ): Promise; + /** + * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are + * also returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + * + * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. + */ + async getMyFilters(parameters?: Parameters.GetMyFilters, callback?: never): Promise; + async getMyFilters( + parameters?: Parameters.GetMyFilters, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/filter/my', + method: 'GET', + params: { + expand: parameters?.expand, + includeFavourites: parameters?.includeFavourites, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * filters. Use this operation to get: + * + * - Specific filters, by defining `id` only. + * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in + * their name. When multiple attributes are specified only filters matching all attributes are returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, only the following filters that match the query parameters are returned: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getFiltersPaginated( + parameters: Parameters.GetFiltersPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * filters. Use this operation to get: + * + * - Specific filters, by defining `id` only. + * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in + * their name. When multiple attributes are specified only filters matching all attributes are returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, only the following filters that match the query parameters are returned: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getFiltersPaginated( + parameters?: Parameters.GetFiltersPaginated, + callback?: never, + ): Promise; + async getFiltersPaginated( + parameters?: Parameters.GetFiltersPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/filter/search', + method: 'GET', + params: { + filterName: parameters?.filterName, + accountId: parameters?.accountId, + groupname: parameters?.groupname, + groupId: parameters?.groupId, + projectId: parameters?.projectId, + id: parameters?.id, + orderBy: parameters?.orderBy, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + expand: parameters?.expand, + overrideSharePermissions: parameters?.overrideSharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a filter. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, the filter is only returned where it is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + */ + async getFilter(parameters: Parameters.GetFilter | string, callback: Callback): Promise; + /** + * Returns a filter. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, the filter is only returned where it is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + */ + async getFilter(parameters: Parameters.GetFilter | string, callback?: never): Promise; + async getFilter( + parameters: Parameters.GetFilter | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/filter/${id}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + overrideSharePermissions: typeof parameters !== 'string' && parameters.overrideSharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a filter. Use this operation to update a filter's name, description, Jql, or sharing. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however the user must own the filter. + */ + async updateFilter(parameters: Parameters.UpdateFilter, callback: Callback): Promise; + /** + * Updates a filter. Use this operation to update a filter's name, description, Jql, or sharing. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however the user must own the filter. + */ + async updateFilter(parameters: Parameters.UpdateFilter, callback?: never): Promise; + async updateFilter( + parameters: Parameters.UpdateFilter, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/filter/${parameters.id}`, + method: 'PUT', + params: { + expand: parameters.expand, + overrideSharePermissions: parameters.overrideSharePermissions, + }, + data: { + name: parameters.name, + description: parameters.description, + jql: parameters.jql, + favourite: parameters.favourite, + sharePermissions: parameters.sharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete a filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFilter(parameters: Parameters.DeleteFilter | string, callback: Callback): Promise; + /** + * Delete a filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFilter(parameters: Parameters.DeleteFilter | string, callback?: never): Promise; + async deleteFilter( + parameters: Parameters.DeleteFilter | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/filter/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed + * in _List View_ with the _Columns_ set to _Filter_. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, column details are only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getColumns( + parameters: Parameters.GetColumns | string, + callback: Callback, + ): Promise; + /** + * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed + * in _List View_ with the _Columns_ set to _Filter_. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, column details are only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getColumns(parameters: Parameters.GetColumns | string, callback?: never): Promise; + async getColumns( + parameters: Parameters.GetColumns | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/filter/${id}/columns`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get + * fields](#api-rest-api-3-field-get) to get the list fields in Jira. A navigable field has `navigable` set to + * `true`. + * + * The parameters for this resource are expressed as HTML form data. For example, in curl: + * + * `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/3/filter/10000/columns` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, columns are only set for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async setColumns(parameters: Parameters.SetColumns, callback: Callback): Promise; + /** + * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get + * fields](#api-rest-api-3-field-get) to get the list fields in Jira. A navigable field has `navigable` set to + * `true`. + * + * The parameters for this resource are expressed as HTML form data. For example, in curl: + * + * `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/3/filter/10000/columns` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, columns are only set for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async setColumns(parameters: Parameters.SetColumns, callback?: never): Promise; + async setColumns(parameters: Parameters.SetColumns, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/filter/${parameters.id}/columns`, + method: 'PUT', + data: parameters.columns, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Reset the user's column configuration for the filter to the default. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, columns are only reset for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async resetColumns(parameters: Parameters.ResetColumns | string, callback: Callback): Promise; + /** + * Reset the user's column configuration for the filter to the default. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, columns are only reset for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async resetColumns(parameters: Parameters.ResetColumns | string, callback?: never): Promise; + async resetColumns( + parameters: Parameters.ResetColumns | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/filter/${id}/columns`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Add a filter as a favorite for the user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, the user can only favorite: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async setFavouriteForFilter( + parameters: Parameters.SetFavouriteForFilter | string, + callback: Callback, + ): Promise; + /** + * Add a filter as a favorite for the user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, the user can only favorite: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async setFavouriteForFilter( + parameters: Parameters.SetFavouriteForFilter | string, + callback?: never, + ): Promise; + async setFavouriteForFilter( + parameters: Parameters.SetFavouriteForFilter | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/filter/${id}/favourite`, + method: 'PUT', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from + * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private + * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async deleteFavouriteForFilter( + parameters: Parameters.DeleteFavouriteForFilter | string, + callback: Callback, + ): Promise; + /** + * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from + * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private + * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async deleteFavouriteForFilter( + parameters: Parameters.DeleteFavouriteForFilter | string, + callback?: never, + ): Promise; + async deleteFavouriteForFilter( + parameters: Parameters.DeleteFavouriteForFilter | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/filter/${id}/favourite`, + method: 'DELETE', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the owner of the filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback: Callback): Promise; + /** + * Changes the owner of the filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback?: never): Promise; + async changeFilterOwner( + parameters: Parameters.ChangeFilterOwner, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/filter/${parameters.id}/owner`, + method: 'PUT', + data: { + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/filters.ts b/src/version3/filters.ts deleted file mode 100644 index e07fdd87b..000000000 --- a/src/version3/filters.ts +++ /dev/null @@ -1,629 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Filters { - constructor(private client: Client) {} - - /** - * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-3-filter-post). The - * filter is not selected as a favorite. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async createFilter(parameters: Parameters.CreateFilter, callback: Callback): Promise; - /** - * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-3-filter-post). The - * filter is not selected as a favorite. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async createFilter(parameters: Parameters.CreateFilter, callback?: never): Promise; - async createFilter( - parameters: Parameters.CreateFilter, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/filter', - method: 'POST', - params: { - expand: parameters?.expand, - overrideSharePermissions: parameters?.overrideSharePermissions, - }, - data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - favourite: parameters.favourite, - favouritedCount: parameters.favouritedCount, - id: parameters.id, - jql: parameters.jql, - name: parameters.name, - owner: parameters.owner, - searchUrl: parameters.searchUrl, - self: parameters.self, - sharePermissions: parameters.sharePermissions, - sharedUsers: parameters.sharedUsers, - subscriptions: parameters.subscriptions, - viewUrl: parameters.viewUrl, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the visible favorite filters of the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** A - * favorite filter is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getFavouriteFilters( - parameters: Parameters.GetFavouriteFilters | undefined, - callback: Callback, - ): Promise; - /** - * Returns the visible favorite filters of the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** A - * favorite filter is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getFavouriteFilters( - parameters?: Parameters.GetFavouriteFilters, - callback?: never, - ): Promise; - async getFavouriteFilters( - parameters?: Parameters.GetFavouriteFilters, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/filter/favourite', - method: 'GET', - params: { - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are - * also returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getMyFilters( - parameters: Parameters.GetMyFilters | undefined, - callback: Callback, - ): Promise; - /** - * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are - * also returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getMyFilters(parameters?: Parameters.GetMyFilters, callback?: never): Promise; - async getMyFilters( - parameters?: Parameters.GetMyFilters, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/filter/my', - method: 'GET', - params: { - expand: parameters?.expand, - includeFavourites: parameters?.includeFavourites, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * filters. Use this operation to get: - * - * - Specific filters, by defining `id` only. - * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in - * their name. When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, only the following filters that match the query parameters are returned: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getFiltersPaginated( - parameters: Parameters.GetFiltersPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * filters. Use this operation to get: - * - * - Specific filters, by defining `id` only. - * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in - * their name. When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, only the following filters that match the query parameters are returned: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getFiltersPaginated( - parameters?: Parameters.GetFiltersPaginated, - callback?: never, - ): Promise; - async getFiltersPaginated( - parameters?: Parameters.GetFiltersPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/filter/search', - method: 'GET', - params: { - filterName: parameters?.filterName, - accountId: parameters?.accountId, - groupname: parameters?.groupname, - groupId: parameters?.groupId, - projectId: parameters?.projectId, - id: parameters?.id, - orderBy: parameters?.orderBy, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - expand: parameters?.expand, - overrideSharePermissions: parameters?.overrideSharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a filter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, the filter is only returned where it is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - */ - async getFilter(parameters: Parameters.GetFilter | string, callback: Callback): Promise; - /** - * Returns a filter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, the filter is only returned where it is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - */ - async getFilter(parameters: Parameters.GetFilter | string, callback?: never): Promise; - async getFilter( - parameters: Parameters.GetFilter | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/filter/${id}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - overrideSharePermissions: typeof parameters !== 'string' && parameters.overrideSharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a filter. Use this operation to update a filter's name, description, JQL, or sharing. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however the user must own the filter. - */ - async updateFilter(parameters: Parameters.UpdateFilter, callback: Callback): Promise; - /** - * Updates a filter. Use this operation to update a filter's name, description, JQL, or sharing. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however the user must own the filter. - */ - async updateFilter(parameters: Parameters.UpdateFilter, callback?: never): Promise; - async updateFilter( - parameters: Parameters.UpdateFilter, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/filter/${parameters.id}`, - method: 'PUT', - params: { - expand: parameters.expand, - overrideSharePermissions: parameters.overrideSharePermissions, - }, - data: { - name: parameters.name, - description: parameters.description, - jql: parameters.jql, - favourite: parameters.favourite, - sharePermissions: parameters.sharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFilter(parameters: Parameters.DeleteFilter | string, callback: Callback): Promise; - /** - * Delete a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFilter(parameters: Parameters.DeleteFilter | string, callback?: never): Promise; - async deleteFilter( - parameters: Parameters.DeleteFilter | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/filter/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed - * in _List View_ with the _Columns_ set to _Filter_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, column details are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getColumns( - parameters: Parameters.GetColumns | string, - callback: Callback, - ): Promise; - /** - * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed - * in _List View_ with the _Columns_ set to _Filter_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, column details are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getColumns(parameters: Parameters.GetColumns | string, callback?: never): Promise; - async getColumns( - parameters: Parameters.GetColumns | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/filter/${id}/columns`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get - * fields](#api-rest-api-3-field-get) to get the list fields in Jira. A navigable field has `navigable` set to - * `true`. - * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/3/filter/10000/columns` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, columns are only set for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setColumns(parameters: Parameters.SetColumns, callback: Callback): Promise; - /** - * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get - * fields](#api-rest-api-3-field-get) to get the list fields in Jira. A navigable field has `navigable` set to - * `true`. - * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/3/filter/10000/columns` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, columns are only set for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setColumns(parameters: Parameters.SetColumns, callback?: never): Promise; - async setColumns(parameters: Parameters.SetColumns, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/filter/${parameters.id}/columns`, - method: 'PUT', - data: parameters.columns, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Reset the user's column configuration for the filter to the default. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, columns are only reset for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async resetColumns(parameters: Parameters.ResetColumns | string, callback: Callback): Promise; - /** - * Reset the user's column configuration for the filter to the default. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, columns are only reset for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async resetColumns(parameters: Parameters.ResetColumns | string, callback?: never): Promise; - async resetColumns( - parameters: Parameters.ResetColumns | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/filter/${id}/columns`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Add a filter as a favorite for the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, the user can only favorite: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, - callback: Callback, - ): Promise; - /** - * Add a filter as a favorite for the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, the user can only favorite: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, - callback?: never, - ): Promise; - async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/filter/${id}/favourite`, - method: 'PUT', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from - * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private - * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, - callback: Callback, - ): Promise; - /** - * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from - * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private - * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, - callback?: never, - ): Promise; - async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/filter/${id}/favourite`, - method: 'DELETE', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the owner of the filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback: Callback): Promise; - /** - * Changes the owner of the filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback?: never): Promise; - async changeFilterOwner( - parameters: Parameters.ChangeFilterOwner, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/filter/${parameters.id}/owner`, - method: 'PUT', - data: { - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/groupAndUserPicker.mts b/src/version3/groupAndUserPicker.mts new file mode 100644 index 000000000..53718648a --- /dev/null +++ b/src/version3/groupAndUserPicker.mts @@ -0,0 +1,110 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class GroupAndUserPicker { + constructor(private client: Client) {} + + /** + * Returns a list of users and groups matching a string. The string is used: + * + * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden + * their email address in their user profile, partial matches of the email address will not find the user. An exact + * match is required. + * - For groups, to find a case-sensitive match with group name. + * + * For example, if the string _tin_ is used, records with the display name _Tina_, email address + * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. + * + * Optionally, the search can be refined to: + * + * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further + * refined to return only users and groups that have permission to view specific: + * + * - Projects. + * - Issue types. + * + * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or + * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be + * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. + * - Not return Connect app users and groups. + * - Return groups that have a case-insensitive match with the query. + * + * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this + * end, the returned object includes an `html` field for each list. This field highlights the matched query term in + * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for + * use in a picker, specifically _Showing X of Y matching groups_. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). + */ + async findUsersAndGroups( + parameters: Parameters.FindUsersAndGroups, + callback: Callback, + ): Promise; + /** + * Returns a list of users and groups matching a string. The string is used: + * + * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden + * their email address in their user profile, partial matches of the email address will not find the user. An exact + * match is required. + * - For groups, to find a case-sensitive match with group name. + * + * For example, if the string _tin_ is used, records with the display name _Tina_, email address + * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. + * + * Optionally, the search can be refined to: + * + * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further + * refined to return only users and groups that have permission to view specific: + * + * - Projects. + * - Issue types. + * + * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or + * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be + * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. + * - Not return Connect app users and groups. + * - Return groups that have a case-insensitive match with the query. + * + * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this + * end, the returned object includes an `html` field for each list. This field highlights the matched query term in + * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for + * use in a picker, specifically _Showing X of Y matching groups_. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). + */ + async findUsersAndGroups( + parameters: Parameters.FindUsersAndGroups, + callback?: never, + ): Promise; + async findUsersAndGroups( + parameters: Parameters.FindUsersAndGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/groupuserpicker', + method: 'GET', + params: { + query: parameters.query, + maxResults: parameters.maxResults, + showAvatar: parameters.showAvatar, + fieldId: parameters.fieldId, + projectId: parameters.projectId, + issueTypeId: parameters.issueTypeId, + avatarSize: parameters.avatarSize, + caseInsensitive: parameters.caseInsensitive, + excludeConnectAddons: parameters.excludeConnectAddons, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/groupAndUserPicker.ts b/src/version3/groupAndUserPicker.ts deleted file mode 100644 index 038fb7b8b..000000000 --- a/src/version3/groupAndUserPicker.ts +++ /dev/null @@ -1,110 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class GroupAndUserPicker { - constructor(private client: Client) {} - - /** - * Returns a list of users and groups matching a string. The string is used: - * - * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden - * their email address in their user profile, partial matches of the email address will not find the user. An exact - * match is required. - * - For groups, to find a case-sensitive match with group name. - * - * For example, if the string _tin_ is used, records with the display name _Tina_, email address - * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. - * - * Optionally, the search can be refined to: - * - * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further - * refined to return only users and groups that have permission to view specific: - * - * - Projects. - * - Issue types. - * - * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or - * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be - * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. - * - Not return Connect app users and groups. - * - Return groups that have a case-insensitive match with the query. - * - * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this - * end, the returned object includes an `html` field for each list. This field highlights the matched query term in - * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for - * use in a picker, specifically _Showing X of Y matching groups_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). - */ - async findUsersAndGroups( - parameters: Parameters.FindUsersAndGroups, - callback: Callback, - ): Promise; - /** - * Returns a list of users and groups matching a string. The string is used: - * - * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden - * their email address in their user profile, partial matches of the email address will not find the user. An exact - * match is required. - * - For groups, to find a case-sensitive match with group name. - * - * For example, if the string _tin_ is used, records with the display name _Tina_, email address - * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. - * - * Optionally, the search can be refined to: - * - * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further - * refined to return only users and groups that have permission to view specific: - * - * - Projects. - * - Issue types. - * - * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or - * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be - * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. - * - Not return Connect app users and groups. - * - Return groups that have a case-insensitive match with the query. - * - * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this - * end, the returned object includes an `html` field for each list. This field highlights the matched query term in - * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for - * use in a picker, specifically _Showing X of Y matching groups_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). - */ - async findUsersAndGroups( - parameters: Parameters.FindUsersAndGroups, - callback?: never, - ): Promise; - async findUsersAndGroups( - parameters: Parameters.FindUsersAndGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/groupuserpicker', - method: 'GET', - params: { - query: parameters.query, - maxResults: parameters.maxResults, - showAvatar: parameters.showAvatar, - fieldId: parameters.fieldId, - projectId: parameters.projectId, - issueTypeId: parameters.issueTypeId, - avatarSize: parameters.avatarSize, - caseInsensitive: parameters.caseInsensitive, - excludeConnectAddons: parameters.excludeConnectAddons, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/groups.mts b/src/version3/groups.mts new file mode 100644 index 000000000..56bd2f117 --- /dev/null +++ b/src/version3/groups.mts @@ -0,0 +1,281 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Groups { + constructor(private client: Client) {} + + /** + * Creates a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async createGroup(parameters: Parameters.CreateGroup, callback: Callback): Promise; + /** + * Creates a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async createGroup(parameters: Parameters.CreateGroup, callback?: never): Promise; + async createGroup(parameters: Parameters.CreateGroup, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/group', + method: 'POST', + data: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeGroup(parameters: Parameters.RemoveGroup, callback: Callback): Promise; + /** + * Deletes a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeGroup(parameters: Parameters.RemoveGroup, callback?: never): Promise; + async removeGroup(parameters: Parameters.RemoveGroup, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/group', + method: 'DELETE', + params: { + groupname: parameters.groupname, + groupId: parameters.groupId, + swapGroup: parameters.swapGroup, + swapGroupId: parameters.swapGroupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * groups. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async bulkGetGroups( + parameters: Parameters.BulkGetGroups | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * groups. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async bulkGetGroups(parameters?: Parameters.BulkGetGroups, callback?: never): Promise; + async bulkGetGroups( + parameters?: Parameters.BulkGetGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/group/bulk', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + groupId: parameters?.groupId, + groupName: parameters?.groupName, + accessType: parameters?.accessType, + applicationKey: parameters?.applicationKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * users in a group. + * + * Note that users are ordered by username, however the username is not returned in the results due to privacy + * reasons. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getUsersFromGroup( + parameters: Parameters.GetUsersFromGroup, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * users in a group. + * + * Note that users are ordered by username, however the username is not returned in the results due to privacy + * reasons. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getUsersFromGroup( + parameters: Parameters.GetUsersFromGroup, + callback?: never, + ): Promise; + async getUsersFromGroup( + parameters: Parameters.GetUsersFromGroup, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/group/member', + method: 'GET', + params: { + groupname: parameters.groupname, + groupId: parameters.groupId, + includeInactiveUsers: parameters.includeInactiveUsers, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a user to a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async addUserToGroup(parameters: Parameters.AddUserToGroup, callback: Callback): Promise; + /** + * Adds a user to a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async addUserToGroup(parameters: Parameters.AddUserToGroup, callback?: never): Promise; + async addUserToGroup( + parameters: Parameters.AddUserToGroup, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/group/user', + method: 'POST', + params: { + groupname: parameters.groupname, + groupId: parameters.groupId, + }, + data: { + accountId: parameters.accountId, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a user from a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeUserFromGroup( + parameters: Parameters.RemoveUserFromGroup, + callback: Callback, + ): Promise; + /** + * Removes a user from a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeUserFromGroup(parameters: Parameters.RemoveUserFromGroup, callback?: never): Promise; + async removeUserFromGroup( + parameters: Parameters.RemoveUserFromGroup, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/group/user', + method: 'DELETE', + params: { + groupname: parameters.groupname, + groupId: parameters.groupId, + username: parameters.username, + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude + * groups from the results. + * + * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned + * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong + * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, + * specifically _Showing X of Y matching groups_. + * + * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). Anonymous calls and calls by users + * without the required permission return an empty list. + * + * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, + * calls where query is not an exact match to an existing group will return an empty list. + */ + async findGroups( + parameters: Parameters.FindGroups | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude + * groups from the results. + * + * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned + * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong + * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, + * specifically _Showing X of Y matching groups_. + * + * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). Anonymous calls and calls by users + * without the required permission return an empty list. + * + * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, + * calls where query is not an exact match to an existing group will return an empty list. + */ + async findGroups(parameters?: Parameters.FindGroups, callback?: never): Promise; + async findGroups( + parameters?: Parameters.FindGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/groups/picker', + method: 'GET', + params: { + query: parameters?.query, + exclude: parameters?.exclude, + excludeId: parameters?.excludeId, + maxResults: parameters?.maxResults, + caseInsensitive: parameters?.caseInsensitive, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/groups.ts b/src/version3/groups.ts deleted file mode 100644 index 107a62f6c..000000000 --- a/src/version3/groups.ts +++ /dev/null @@ -1,281 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Groups { - constructor(private client: Client) {} - - /** - * Creates a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async createGroup(parameters: Parameters.CreateGroup, callback: Callback): Promise; - /** - * Creates a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async createGroup(parameters: Parameters.CreateGroup, callback?: never): Promise; - async createGroup(parameters: Parameters.CreateGroup, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/group', - method: 'POST', - data: parameters, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeGroup(parameters: Parameters.RemoveGroup, callback: Callback): Promise; - /** - * Deletes a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeGroup(parameters: Parameters.RemoveGroup, callback?: never): Promise; - async removeGroup(parameters: Parameters.RemoveGroup, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/group', - method: 'DELETE', - params: { - groupname: parameters.groupname, - groupId: parameters.groupId, - swapGroup: parameters.swapGroup, - swapGroupId: parameters.swapGroupId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * groups. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async bulkGetGroups( - parameters: Parameters.BulkGetGroups | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * groups. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async bulkGetGroups(parameters?: Parameters.BulkGetGroups, callback?: never): Promise; - async bulkGetGroups( - parameters?: Parameters.BulkGetGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/group/bulk', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - groupId: parameters?.groupId, - groupName: parameters?.groupName, - accessType: parameters?.accessType, - applicationKey: parameters?.applicationKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * users in a group. - * - * Note that users are ordered by username, however the username is not returned in the results due to privacy - * reasons. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getUsersFromGroup( - parameters: Parameters.GetUsersFromGroup, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * users in a group. - * - * Note that users are ordered by username, however the username is not returned in the results due to privacy - * reasons. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getUsersFromGroup( - parameters: Parameters.GetUsersFromGroup, - callback?: never, - ): Promise; - async getUsersFromGroup( - parameters: Parameters.GetUsersFromGroup, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/group/member', - method: 'GET', - params: { - groupname: parameters.groupname, - groupId: parameters.groupId, - includeInactiveUsers: parameters.includeInactiveUsers, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a user to a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async addUserToGroup(parameters: Parameters.AddUserToGroup, callback: Callback): Promise; - /** - * Adds a user to a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async addUserToGroup(parameters: Parameters.AddUserToGroup, callback?: never): Promise; - async addUserToGroup( - parameters: Parameters.AddUserToGroup, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/group/user', - method: 'POST', - params: { - groupname: parameters.groupname, - groupId: parameters.groupId, - }, - data: { - accountId: parameters.accountId, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a user from a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUserFromGroup( - parameters: Parameters.RemoveUserFromGroup, - callback: Callback, - ): Promise; - /** - * Removes a user from a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUserFromGroup(parameters: Parameters.RemoveUserFromGroup, callback?: never): Promise; - async removeUserFromGroup( - parameters: Parameters.RemoveUserFromGroup, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/group/user', - method: 'DELETE', - params: { - groupname: parameters.groupname, - groupId: parameters.groupId, - username: parameters.username, - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude - * groups from the results. - * - * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned - * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong - * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, - * specifically _Showing X of Y matching groups_. - * - * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). Anonymous calls and calls by users - * without the required permission return an empty list. - * - * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, - * calls where query is not an exact match to an existing group will return an empty list. - */ - async findGroups( - parameters: Parameters.FindGroups | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude - * groups from the results. - * - * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned - * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong - * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, - * specifically _Showing X of Y matching groups_. - * - * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). Anonymous calls and calls by users - * without the required permission return an empty list. - * - * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, - * calls where query is not an exact match to an existing group will return an empty list. - */ - async findGroups(parameters?: Parameters.FindGroups, callback?: never): Promise; - async findGroups( - parameters?: Parameters.FindGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/groups/picker', - method: 'GET', - params: { - query: parameters?.query, - exclude: parameters?.exclude, - excludeId: parameters?.excludeId, - maxResults: parameters?.maxResults, - caseInsensitive: parameters?.caseInsensitive, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/index.mts b/src/version3/index.mts new file mode 100644 index 000000000..058fd4d5b --- /dev/null +++ b/src/version3/index.mts @@ -0,0 +1,90 @@ +export * from './announcementBanner.mjs'; +export * from './applicationRoles.mjs'; +export * from './appMigration.mjs'; +export * from './appProperties.mjs'; +export * from './auditRecords.mjs'; +export * from './avatars.mjs'; +export * from './dashboards.mjs'; +export * from './dynamicModules.mjs'; +export * from './filters.mjs'; +export * from './filterSharing.mjs'; +export * from './groupAndUserPicker.mjs'; +export * from './groups.mjs'; +export * from './instanceInformation.mjs'; +export * from './issueAttachments.mjs'; +export * from './issueCommentProperties.mjs'; +export * from './issueComments.mjs'; +export * from './issueCustomFieldConfigurationApps.mjs'; +export * from './issueCustomFieldContexts.mjs'; +export * from './issueCustomFieldOptions.mjs'; +export * from './issueCustomFieldOptionsApps.mjs'; +export * from './issueCustomFieldValuesApps.mjs'; +export * from './issueFieldConfigurations.mjs'; +export * from './issueFields.mjs'; +export * from './issueLinks.mjs'; +export * from './issueLinkTypes.mjs'; +export * from './issueNavigatorSettings.mjs'; +export * from './issueNotificationSchemes.mjs'; +export * from './issuePriorities.mjs'; +export * from './issueProperties.mjs'; +export * from './issueRemoteLinks.mjs'; +export * from './issueResolutions.mjs'; +export * from './issues.mjs'; +export * from './issueSearch.mjs'; +export * from './issueSecurityLevel.mjs'; +export * from './issueSecuritySchemes.mjs'; +export * from './issueTypeProperties.mjs'; +export * from './issueTypes.mjs'; +export * from './issueTypeSchemes.mjs'; +export * from './issueTypeScreenSchemes.mjs'; +export * from './issueVotes.mjs'; +export * from './issueWatchers.mjs'; +export * from './issueWorklogProperties.mjs'; +export * from './issueWorklogs.mjs'; +export * from './jiraExpressions.mjs'; +export * from './jiraSettings.mjs'; +export * from './jql.mjs'; +export * from './jqlFunctionsApps.mjs'; +export * from './labels.mjs'; +export * from './licenseMetrics.mjs'; +export * from './myself.mjs'; +export * from './permissions.mjs'; +export * from './permissionSchemes.mjs'; +export * from './projectAvatars.mjs'; +export * from './projectCategories.mjs'; +export * from './projectComponents.mjs'; +export * from './projectEmail.mjs'; +export * from './projectFeatures.mjs'; +export * from './projectKeyAndNameValidation.mjs'; +export * from './projectPermissionSchemes.mjs'; +export * from './projectProperties.mjs'; +export * from './projectRoleActors.mjs'; +export * from './projectRoles.mjs'; +export * from './projects.mjs'; +export * from './projectTypes.mjs'; +export * from './projectVersions.mjs'; +export * from './screens.mjs'; +export * from './screenSchemes.mjs'; +export * from './screenTabFields.mjs'; +export * from './screenTabs.mjs'; +export * from './serverInfo.mjs'; +export * from './status.mjs'; +export * from './tasks.mjs'; +export * from './timeTracking.mjs'; +export * from './uiModificationsApps.mjs'; +export * from './userProperties.mjs'; +export * from './users.mjs'; +export * from './userSearch.mjs'; +export * from './webhooks.mjs'; +export * from './workflows.mjs'; +export * from './workflowSchemeDrafts.mjs'; +export * from './workflowSchemeProjectAssociations.mjs'; +export * from './workflowSchemes.mjs'; +export * from './workflowStatusCategories.mjs'; +export * from './workflowStatuses.mjs'; +export * from './workflowTransitionProperties.mjs'; +export * from './workflowTransitionRules.mjs'; + +export * from './client/version3Client.mjs'; +export * as Version3Models from './models/index.mjs'; +export * as Version3Parameters from './parameters/index.mjs'; diff --git a/src/version3/index.ts b/src/version3/index.ts deleted file mode 100644 index 97edd095a..000000000 --- a/src/version3/index.ts +++ /dev/null @@ -1,90 +0,0 @@ -export * from './announcementBanner.js'; -export * from './applicationRoles.js'; -export * from './appMigration.js'; -export * from './appProperties.js'; -export * from './auditRecords.js'; -export * from './avatars.js'; -export * from './dashboards.js'; -export * from './dynamicModules.js'; -export * from './filters.js'; -export * from './filterSharing.js'; -export * from './groupAndUserPicker.js'; -export * from './groups.js'; -export * from './instanceInformation.js'; -export * from './issueAttachments.js'; -export * from './issueCommentProperties.js'; -export * from './issueComments.js'; -export * from './issueCustomFieldConfigurationApps.js'; -export * from './issueCustomFieldContexts.js'; -export * from './issueCustomFieldOptions.js'; -export * from './issueCustomFieldOptionsApps.js'; -export * from './issueCustomFieldValuesApps.js'; -export * from './issueFieldConfigurations.js'; -export * from './issueFields.js'; -export * from './issueLinks.js'; -export * from './issueLinkTypes.js'; -export * from './issueNavigatorSettings.js'; -export * from './issueNotificationSchemes.js'; -export * from './issuePriorities.js'; -export * from './issueProperties.js'; -export * from './issueRemoteLinks.js'; -export * from './issueResolutions.js'; -export * from './issues.js'; -export * from './issueSearch.js'; -export * from './issueSecurityLevel.js'; -export * from './issueSecuritySchemes.js'; -export * from './issueTypeProperties.js'; -export * from './issueTypes.js'; -export * from './issueTypeSchemes.js'; -export * from './issueTypeScreenSchemes.js'; -export * from './issueVotes.js'; -export * from './issueWatchers.js'; -export * from './issueWorklogProperties.js'; -export * from './issueWorklogs.js'; -export * from './jiraExpressions.js'; -export * from './jiraSettings.js'; -export * from './jQL.js'; -export * from './jqlFunctionsApps.js'; -export * from './labels.js'; -export * from './licenseMetrics.js'; -export * from './myself.js'; -export * from './permissions.js'; -export * from './permissionSchemes.js'; -export * from './projectAvatars.js'; -export * from './projectCategories.js'; -export * from './projectComponents.js'; -export * from './projectEmail.js'; -export * from './projectFeatures.js'; -export * from './projectKeyAndNameValidation.js'; -export * from './projectPermissionSchemes.js'; -export * from './projectProperties.js'; -export * from './projectRoleActors.js'; -export * from './projectRoles.js'; -export * from './projects.js'; -export * from './projectTypes.js'; -export * from './projectVersions.js'; -export * from './screens.js'; -export * from './screenSchemes.js'; -export * from './screenTabFields.js'; -export * from './screenTabs.js'; -export * from './serverInfo.js'; -export * from './status.js'; -export * from './tasks.js'; -export * from './timeTracking.js'; -export * from './uIModificationsApps.js'; -export * from './userProperties.js'; -export * from './users.js'; -export * from './userSearch.js'; -export * from './webhooks.js'; -export * from './workflows.js'; -export * from './workflowSchemeDrafts.js'; -export * from './workflowSchemeProjectAssociations.js'; -export * from './workflowSchemes.js'; -export * from './workflowStatusCategories.js'; -export * from './workflowStatuses.js'; -export * from './workflowTransitionProperties.js'; -export * from './workflowTransitionRules.js'; - -export * from './client/index.js'; -export * as Version3Models from './models/index.js'; -export * as Version3Parameters from './parameters/index.js'; diff --git a/src/version3/instanceInformation.mts b/src/version3/instanceInformation.mts new file mode 100644 index 000000000..0f8906c59 --- /dev/null +++ b/src/version3/instanceInformation.mts @@ -0,0 +1,29 @@ +import * as Models from './models/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class InstanceInformation { + constructor(private client: Client) {} + + /** + * Returns licensing information about the Jira instance. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getLicense(callback: Callback): Promise; + /** + * Returns licensing information about the Jira instance. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getLicense(callback?: never): Promise; + async getLicense(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/instance/license', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/instanceInformation.ts b/src/version3/instanceInformation.ts deleted file mode 100644 index c8057c8d8..000000000 --- a/src/version3/instanceInformation.ts +++ /dev/null @@ -1,29 +0,0 @@ -import * as Models from './models/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class InstanceInformation { - constructor(private client: Client) {} - - /** - * Returns licensing information about the Jira instance. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getLicense(callback: Callback): Promise; - /** - * Returns licensing information about the Jira instance. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getLicense(callback?: never): Promise; - async getLicense(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/instance/license', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueAttachments.mts b/src/version3/issueAttachments.mts new file mode 100644 index 000000000..78044f184 --- /dev/null +++ b/src/version3/issueAttachments.mts @@ -0,0 +1,444 @@ +import { FormData } from 'formdata-node'; +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueAttachments { + constructor(private client: Client) {} + + /** + * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment + * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) + * for details. + * + * To return a thumbnail of the attachment, use [Get attachment + * thumbnail](#api-rest-api-3-attachment-thumbnail-id-get). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAttachmentContent( + parameters: Parameters.GetAttachmentContent | string, + callback: Callback, + ): Promise; + /** + * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment + * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) + * for details. + * + * To return a thumbnail of the attachment, use [Get attachment + * thumbnail](#api-rest-api-3-attachment-thumbnail-id-get). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAttachmentContent( + parameters: Parameters.GetAttachmentContent | string, + callback?: never, + ): Promise; + async getAttachmentContent( + parameters: Parameters.GetAttachmentContent | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/attachment/content/${id}`, + method: 'GET', + params: { + redirect: typeof parameters !== 'string' && parameters.redirect, + }, + responseType: 'arraybuffer', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. + * + * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether + * users can create and delete attachments. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAttachmentMeta(callback: Callback): Promise; + /** + * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. + * + * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether + * users can create and delete attachments. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAttachmentMeta(callback?: never): Promise; + async getAttachmentMeta(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/attachment/meta', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the thumbnail of an attachment. + * + * To return the attachment contents, use [Get attachment content](#api-rest-api-3-attachment-content-id-get). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail | string, + callback: Callback, + ): Promise; + /** + * Returns the thumbnail of an attachment. + * + * To return the attachment contents, use [Get attachment content](#api-rest-api-3-attachment-content-id-get). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail | string, + callback?: never, + ): Promise; + async getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/attachment/thumbnail/${id}`, + method: 'GET', + params: { + redirect: typeof parameters !== 'string' && parameters.redirect, + fallbackToDefault: typeof parameters !== 'string' && parameters.fallbackToDefault, + width: typeof parameters !== 'string' && parameters.width, + height: typeof parameters !== 'string' && parameters.height, + }, + responseType: 'arraybuffer', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the metadata for an attachment. Note that the attachment itself is not returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAttachment( + parameters: Parameters.GetAttachment | string, + callback: Callback, + ): Promise; + /** + * Returns the metadata for an attachment. Note that the attachment itself is not returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAttachment( + parameters: Parameters.GetAttachment | string, + callback?: never, + ): Promise; + async getAttachment( + parameters: Parameters.GetAttachment | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/attachment/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an attachment from an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * project holding the issue containing the attachment: + * + * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by the calling user. + * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by any user. + */ + async removeAttachment( + parameters: Parameters.RemoveAttachment | string, + callback: Callback, + ): Promise; + /** + * Deletes an attachment from an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * project holding the issue containing the attachment: + * + * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by the calling user. + * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by any user. + */ + async removeAttachment(parameters: Parameters.RemoveAttachment | string, callback?: never): Promise; + async removeAttachment( + parameters: Parameters.RemoveAttachment | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/attachment/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment + * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is + * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. + * + * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the + * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded + * attachment](#api-rest-api-3-attachment-id-expand-raw-get), which only returns the metadata for the attachment's + * contents. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async expandAttachmentForHumans( + parameters: Parameters.ExpandAttachmentForHumans | string, + callback: Callback, + ): Promise; + /** + * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment + * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is + * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. + * + * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the + * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded + * attachment](#api-rest-api-3-attachment-id-expand-raw-get), which only returns the metadata for the attachment's + * contents. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async expandAttachmentForHumans( + parameters: Parameters.ExpandAttachmentForHumans | string, + callback?: never, + ): Promise; + async expandAttachmentForHumans( + parameters: Parameters.ExpandAttachmentForHumans | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/attachment/${id}/expand/human`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a + * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is + * supported. + * + * Use this operation if you are processing the data without presenting it to the user, as this operation only returns + * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all + * metadata for an expanded attachment](#api-rest-api-3-attachment-id-expand-human-get) which also returns the + * metadata for the attachment itself, such as the attachment's ID and name. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async expandAttachmentForMachines( + parameters: Parameters.ExpandAttachmentForMachines | string, + callback: Callback, + ): Promise; + /** + * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a + * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is + * supported. + * + * Use this operation if you are processing the data without presenting it to the user, as this operation only returns + * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all + * metadata for an expanded attachment](#api-rest-api-3-attachment-id-expand-human-get) which also returns the + * metadata for the attachment itself, such as the attachment's ID and name. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async expandAttachmentForMachines( + parameters: Parameters.ExpandAttachmentForMachines | string, + callback?: never, + ): Promise; + async expandAttachmentForMachines( + parameters: Parameters.ExpandAttachmentForMachines | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/attachment/${id}/expand/raw`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC + * 1867](https://www.ietf.org/rfc/rfc1867.txt)). + * + * Note that: + * + * - The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special + * headers](#special-request-headers) for more information. + * - The name of the multipart/form-data parameter that contains the attachments must be `file`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse Projects_ and _Create attachments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addAttachment( + parameters: Parameters.AddAttachment, + callback: Callback, + ): Promise; + /** + * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC + * 1867](https://www.ietf.org/rfc/rfc1867.txt)). + * + * Note that: + * + * - The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special + * headers](#special-request-headers) for more information. + * - The name of the multipart/form-data parameter that contains the attachments must be `file`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse Projects_ and _Create attachments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addAttachment(parameters: Parameters.AddAttachment, callback?: never): Promise; + async addAttachment( + parameters: Parameters.AddAttachment, + callback?: Callback, + ): Promise { + const formData = new FormData(); + const attachments = Array.isArray(parameters.attachment) ? parameters.attachment : [parameters.attachment]; + + attachments.forEach(attachment => formData.append('file', attachment.file, attachment.filename)); + + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/attachments`, + method: 'POST', + headers: { + 'X-Atlassian-Token': 'no-check', + 'Content-Type': 'multipart/form-data', + }, + data: formData, + maxBodyLength: Infinity, + maxContentLength: Infinity, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueAttachments.ts b/src/version3/issueAttachments.ts deleted file mode 100644 index b134f7a4f..000000000 --- a/src/version3/issueAttachments.ts +++ /dev/null @@ -1,444 +0,0 @@ -import { FormData } from 'formdata-node'; -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueAttachments { - constructor(private client: Client) {} - - /** - * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment - * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) - * for details. - * - * To return a thumbnail of the attachment, use [Get attachment - * thumbnail](#api-rest-api-3-attachment-thumbnail-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getAttachmentContent( - parameters: Parameters.GetAttachmentContent | string, - callback: Callback, - ): Promise; - /** - * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment - * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) - * for details. - * - * To return a thumbnail of the attachment, use [Get attachment - * thumbnail](#api-rest-api-3-attachment-thumbnail-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getAttachmentContent( - parameters: Parameters.GetAttachmentContent | string, - callback?: never, - ): Promise; - async getAttachmentContent( - parameters: Parameters.GetAttachmentContent | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/attachment/content/${id}`, - method: 'GET', - params: { - redirect: typeof parameters !== 'string' && parameters.redirect, - }, - responseType: 'arraybuffer', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. - * - * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether - * users can create and delete attachments. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAttachmentMeta(callback: Callback): Promise; - /** - * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. - * - * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether - * users can create and delete attachments. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAttachmentMeta(callback?: never): Promise; - async getAttachmentMeta(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/attachment/meta', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the thumbnail of an attachment. - * - * To return the attachment contents, use [Get attachment content](#api-rest-api-3-attachment-content-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, - callback: Callback, - ): Promise; - /** - * Returns the thumbnail of an attachment. - * - * To return the attachment contents, use [Get attachment content](#api-rest-api-3-attachment-content-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, - callback?: never, - ): Promise; - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/attachment/thumbnail/${id}`, - method: 'GET', - params: { - redirect: typeof parameters !== 'string' && parameters.redirect, - fallbackToDefault: typeof parameters !== 'string' && parameters.fallbackToDefault, - width: typeof parameters !== 'string' && parameters.width, - height: typeof parameters !== 'string' && parameters.height, - }, - responseType: 'arraybuffer', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the metadata for an attachment. Note that the attachment itself is not returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getAttachment( - parameters: Parameters.GetAttachment | string, - callback: Callback, - ): Promise; - /** - * Returns the metadata for an attachment. Note that the attachment itself is not returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getAttachment( - parameters: Parameters.GetAttachment | string, - callback?: never, - ): Promise; - async getAttachment( - parameters: Parameters.GetAttachment | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/attachment/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an attachment from an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * project holding the issue containing the attachment: - * - * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by the calling user. - * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by any user. - */ - async removeAttachment( - parameters: Parameters.RemoveAttachment | string, - callback: Callback, - ): Promise; - /** - * Deletes an attachment from an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * project holding the issue containing the attachment: - * - * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by the calling user. - * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by any user. - */ - async removeAttachment(parameters: Parameters.RemoveAttachment | string, callback?: never): Promise; - async removeAttachment( - parameters: Parameters.RemoveAttachment | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/attachment/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment - * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is - * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. - * - * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the - * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded - * attachment](#api-rest-api-3-attachment-id-expand-raw-get), which only returns the metadata for the attachment's - * contents. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, - callback: Callback, - ): Promise; - /** - * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment - * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is - * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. - * - * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the - * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded - * attachment](#api-rest-api-3-attachment-id-expand-raw-get), which only returns the metadata for the attachment's - * contents. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, - callback?: never, - ): Promise; - async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/attachment/${id}/expand/human`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a - * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is - * supported. - * - * Use this operation if you are processing the data without presenting it to the user, as this operation only returns - * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all - * metadata for an expanded attachment](#api-rest-api-3-attachment-id-expand-human-get) which also returns the - * metadata for the attachment itself, such as the attachment's ID and name. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, - callback: Callback, - ): Promise; - /** - * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a - * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is - * supported. - * - * Use this operation if you are processing the data without presenting it to the user, as this operation only returns - * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all - * metadata for an expanded attachment](#api-rest-api-3-attachment-id-expand-human-get) which also returns the - * metadata for the attachment itself, such as the attachment's ID and name. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, - callback?: never, - ): Promise; - async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/attachment/${id}/expand/raw`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC - * 1867](https://www.ietf.org/rfc/rfc1867.txt)). - * - * Note that: - * - * - The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special - * headers](#special-request-headers) for more information. - * - The name of the multipart/form-data parameter that contains the attachments must be `file`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse Projects_ and _Create attachments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addAttachment( - parameters: Parameters.AddAttachment, - callback: Callback, - ): Promise; - /** - * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC - * 1867](https://www.ietf.org/rfc/rfc1867.txt)). - * - * Note that: - * - * - The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special - * headers](#special-request-headers) for more information. - * - The name of the multipart/form-data parameter that contains the attachments must be `file`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse Projects_ and _Create attachments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addAttachment(parameters: Parameters.AddAttachment, callback?: never): Promise; - async addAttachment( - parameters: Parameters.AddAttachment, - callback?: Callback, - ): Promise { - const formData = new FormData(); - const attachments = Array.isArray(parameters.attachment) ? parameters.attachment : [parameters.attachment]; - - attachments.forEach(attachment => formData.append('file', attachment.file, attachment.filename)); - - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/attachments`, - method: 'POST', - headers: { - 'X-Atlassian-Token': 'no-check', - 'Content-Type': 'multipart/form-data', - }, - data: formData, - maxBodyLength: Infinity, - maxContentLength: Infinity, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueCommentProperties.mts b/src/version3/issueCommentProperties.mts new file mode 100644 index 000000000..8158aa37f --- /dev/null +++ b/src/version3/issueCommentProperties.mts @@ -0,0 +1,196 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCommentProperties { + constructor(private client: Client) {} + + /** + * Returns the keys of all the properties of a comment. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentPropertyKeys( + parameters: Parameters.GetCommentPropertyKeys | string, + callback: Callback, + ): Promise; + /** + * Returns the keys of all the properties of a comment. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentPropertyKeys( + parameters: Parameters.GetCommentPropertyKeys | string, + callback?: never, + ): Promise; + async getCommentPropertyKeys( + parameters: Parameters.GetCommentPropertyKeys | string, + callback?: Callback, + ): Promise { + const commentId = typeof parameters === 'string' ? parameters : parameters.commentId; + + const config: RequestConfig = { + url: `/rest/api/3/comment/${commentId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a comment property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentProperty( + parameters: Parameters.GetCommentProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a comment property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentProperty( + parameters: Parameters.GetCommentProperty, + callback?: never, + ): Promise; + async getCommentProperty( + parameters: Parameters.GetCommentProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on any comment. + * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on a comment created by the user. + * + * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. + */ + async setCommentProperty( + parameters: Parameters.SetCommentProperty, + callback: Callback, + ): Promise; + /** + * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on any comment. + * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on a comment created by the user. + * + * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. + */ + async setCommentProperty(parameters: Parameters.SetCommentProperty, callback?: never): Promise; + async setCommentProperty( + parameters: Parameters.SetCommentProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.property, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a comment property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any + * comment. + * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a + * comment created by the user. + * + * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. + */ + async deleteCommentProperty( + parameters: Parameters.DeleteCommentProperty, + callback: Callback, + ): Promise; + /** + * Deletes a comment property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any + * comment. + * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a + * comment created by the user. + * + * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. + */ + async deleteCommentProperty(parameters: Parameters.DeleteCommentProperty, callback?: never): Promise; + async deleteCommentProperty( + parameters: Parameters.DeleteCommentProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueCommentProperties.ts b/src/version3/issueCommentProperties.ts deleted file mode 100644 index ff2764ec6..000000000 --- a/src/version3/issueCommentProperties.ts +++ /dev/null @@ -1,196 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueCommentProperties { - constructor(private client: Client) {} - - /** - * Returns the keys of all the properties of a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentPropertyKeys( - parameters: Parameters.GetCommentPropertyKeys | string, - callback: Callback, - ): Promise; - /** - * Returns the keys of all the properties of a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentPropertyKeys( - parameters: Parameters.GetCommentPropertyKeys | string, - callback?: never, - ): Promise; - async getCommentPropertyKeys( - parameters: Parameters.GetCommentPropertyKeys | string, - callback?: Callback, - ): Promise { - const commentId = typeof parameters === 'string' ? parameters : parameters.commentId; - - const config: RequestConfig = { - url: `/rest/api/3/comment/${commentId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a comment property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentProperty( - parameters: Parameters.GetCommentProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a comment property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentProperty( - parameters: Parameters.GetCommentProperty, - callback?: never, - ): Promise; - async getCommentProperty( - parameters: Parameters.GetCommentProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on any comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on a comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async setCommentProperty( - parameters: Parameters.SetCommentProperty, - callback: Callback, - ): Promise; - /** - * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on any comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on a comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async setCommentProperty(parameters: Parameters.SetCommentProperty, callback?: never): Promise; - async setCommentProperty( - parameters: Parameters.SetCommentProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.property, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a comment property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any - * comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a - * comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async deleteCommentProperty( - parameters: Parameters.DeleteCommentProperty, - callback: Callback, - ): Promise; - /** - * Deletes a comment property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any - * comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a - * comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async deleteCommentProperty(parameters: Parameters.DeleteCommentProperty, callback?: never): Promise; - async deleteCommentProperty( - parameters: Parameters.DeleteCommentProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueComments.mts b/src/version3/issueComments.mts new file mode 100644 index 000000000..5f7c63636 --- /dev/null +++ b/src/version3/issueComments.mts @@ -0,0 +1,324 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueComments { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * comments specified by a list of comment IDs. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Comments are returned where the user: + * + * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentsByIds( + parameters: Parameters.GetCommentsByIds, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * comments specified by a list of comment IDs. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Comments are returned where the user: + * + * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentsByIds(parameters: Parameters.GetCommentsByIds, callback?: never): Promise; + async getCommentsByIds( + parameters: Parameters.GetCommentsByIds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/comment/list', + method: 'POST', + params: { + expand: parameters.expand, + }, + data: { + ids: parameters.ids, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all comments for an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Comments are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is + * restricted to. + */ + async getComments( + parameters: Parameters.GetComments | string, + callback: Callback, + ): Promise; + /** + * Returns all comments for an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Comments are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is + * restricted to. + */ + async getComments( + parameters: Parameters.GetComments | string, + callback?: never, + ): Promise; + async getComments( + parameters: Parameters.GetComments | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/issue/${issueIdOrKey}/comment`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + orderBy: typeof parameters !== 'string' && parameters.orderBy, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a comment to an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addComment(parameters: Parameters.AddComment, callback: Callback): Promise; + /** + * Adds a comment to an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addComment(parameters: Parameters.AddComment, callback?: never): Promise; + async addComment(parameters: Parameters.AddComment, callback?: Callback): Promise { + const body = typeof parameters.comment === 'string' + ? { + type: 'doc', + version: 1, + content: [ + { + type: 'paragraph', + content: [{ type: 'text', text: parameters.comment }], + }, + ], + } + : parameters.comment; + + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment`, + method: 'POST', + params: { + expand: parameters.expand, + }, + data: { + self: parameters.self, + id: parameters.id, + author: parameters.author, + body, + renderedBody: parameters.renderedBody, + updateAuthor: parameters.updateAuthor, + created: parameters.created, + updated: parameters.updated, + visibility: parameters.visibility, + jsdPublic: parameters.jsdPublic, + jsdAuthorCanSeeRequest: parameters.jsdAuthorCanSeeRequest, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a comment. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async getComment(parameters: Parameters.GetComment, callback: Callback): Promise; + /** + * Returns a comment. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async getComment(parameters: Parameters.GetComment, callback?: never): Promise; + async getComment(parameters: Parameters.GetComment, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a comment. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue + * containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit + * own comments_ to update comment created by the user. + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async updateComment(parameters: Parameters.UpdateComment, callback: Callback): Promise; + /** + * Updates a comment. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue + * containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit + * own comments_ to update comment created by the user. + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async updateComment(parameters: Parameters.UpdateComment, callback?: never): Promise; + async updateComment( + parameters: Parameters.UpdateComment, + callback?: Callback, + ): Promise { + // todo same above + + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, + method: 'PUT', + params: { + notifyUsers: parameters.notifyUsers, + overrideEditableFlag: parameters.overrideEditableFlag, + expand: parameters.expand, + }, + data: { + body: parameters.body, + visibility: parameters.visibility, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue + * containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or + * _Delete own comments_ to delete comment created by the user, + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async deleteComment(parameters: Parameters.DeleteComment, callback: Callback): Promise; + /** + * Deletes a comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue + * containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or + * _Delete own comments_ to delete comment created by the user, + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async deleteComment(parameters: Parameters.DeleteComment, callback?: never): Promise; + async deleteComment(parameters: Parameters.DeleteComment, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueComments.ts b/src/version3/issueComments.ts deleted file mode 100644 index f894c5c28..000000000 --- a/src/version3/issueComments.ts +++ /dev/null @@ -1,324 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueComments { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * comments specified by a list of comment IDs. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Comments are returned where the user: - * - * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentsByIds( - parameters: Parameters.GetCommentsByIds, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * comments specified by a list of comment IDs. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Comments are returned where the user: - * - * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentsByIds(parameters: Parameters.GetCommentsByIds, callback?: never): Promise; - async getCommentsByIds( - parameters: Parameters.GetCommentsByIds, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/comment/list', - method: 'POST', - params: { - expand: parameters.expand, - }, - data: { - ids: parameters.ids, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all comments for an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Comments are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is - * restricted to. - */ - async getComments( - parameters: Parameters.GetComments | string, - callback: Callback, - ): Promise; - /** - * Returns all comments for an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Comments are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is - * restricted to. - */ - async getComments( - parameters: Parameters.GetComments | string, - callback?: never, - ): Promise; - async getComments( - parameters: Parameters.GetComments | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/issue/${issueIdOrKey}/comment`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - orderBy: typeof parameters !== 'string' && parameters.orderBy, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a comment to an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addComment(parameters: Parameters.AddComment, callback: Callback): Promise; - /** - * Adds a comment to an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addComment(parameters: Parameters.AddComment, callback?: never): Promise; - async addComment(parameters: Parameters.AddComment, callback?: Callback): Promise { - const body = typeof parameters.comment === 'string' - ? { - type: 'doc', - version: 1, - content: [ - { - type: 'paragraph', - content: [{ type: 'text', text: parameters.comment }], - }, - ], - } - : parameters.comment; - - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment`, - method: 'POST', - params: { - expand: parameters.expand, - }, - data: { - self: parameters.self, - id: parameters.id, - author: parameters.author, - body, - renderedBody: parameters.renderedBody, - updateAuthor: parameters.updateAuthor, - created: parameters.created, - updated: parameters.updated, - visibility: parameters.visibility, - jsdPublic: parameters.jsdPublic, - jsdAuthorCanSeeRequest: parameters.jsdAuthorCanSeeRequest, - properties: parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async getComment(parameters: Parameters.GetComment, callback: Callback): Promise; - /** - * Returns a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async getComment(parameters: Parameters.GetComment, callback?: never): Promise; - async getComment(parameters: Parameters.GetComment, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit - * own comments_ to update comment created by the user. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async updateComment(parameters: Parameters.UpdateComment, callback: Callback): Promise; - /** - * Updates a comment. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit - * own comments_ to update comment created by the user. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async updateComment(parameters: Parameters.UpdateComment, callback?: never): Promise; - async updateComment( - parameters: Parameters.UpdateComment, - callback?: Callback, - ): Promise { - // todo same above - - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, - method: 'PUT', - params: { - notifyUsers: parameters.notifyUsers, - overrideEditableFlag: parameters.overrideEditableFlag, - expand: parameters.expand, - }, - data: { - body: parameters.body, - visibility: parameters.visibility, - properties: parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or - * _Delete own comments_ to delete comment created by the user, - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async deleteComment(parameters: Parameters.DeleteComment, callback: Callback): Promise; - /** - * Deletes a comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or - * _Delete own comments_ to delete comment created by the user, - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async deleteComment(parameters: Parameters.DeleteComment, callback?: never): Promise; - async deleteComment(parameters: Parameters.DeleteComment, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueCustomFieldConfigurationApps.mts b/src/version3/issueCustomFieldConfigurationApps.mts new file mode 100644 index 000000000..202785387 --- /dev/null +++ b/src/version3/issueCustomFieldConfigurationApps.mts @@ -0,0 +1,113 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldConfigurationApps { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * configurations for a custom field created by a [Forge app](https://developer.atlassian.com/platform/forge/). + * + * The result can be filtered by one of these criteria: + * + * - `id`. + * - `fieldContextId`. + * - `issueId`. + * - `projectKeyOrId` and `issueTypeId`. + * + * Otherwise, all configurations are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the Forge app that created the custom field. + */ + async getCustomFieldConfiguration( + parameters: Parameters.GetCustomFieldConfiguration | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * configurations for a custom field created by a [Forge app](https://developer.atlassian.com/platform/forge/). + * + * The result can be filtered by one of these criteria: + * + * - `id`. + * - `fieldContextId`. + * - `issueId`. + * - `projectKeyOrId` and `issueTypeId`. + * + * Otherwise, all configurations are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the Forge app that created the custom field. + */ + async getCustomFieldConfiguration( + parameters: Parameters.GetCustomFieldConfiguration | string, + callback?: never, + ): Promise; + async getCustomFieldConfiguration( + parameters: Parameters.GetCustomFieldConfiguration | string, + callback?: Callback, + ): Promise { + const fieldIdOrKey = typeof parameters === 'string' ? parameters : parameters.fieldIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/app/field/${fieldIdOrKey}/context/configuration`, + method: 'GET', + params: { + id: typeof parameters !== 'string' && parameters.id, + fieldContextId: typeof parameters !== 'string' && parameters.fieldContextId, + issueId: typeof parameters !== 'string' && parameters.issueId, + projectKeyOrId: typeof parameters !== 'string' && parameters.projectKeyOrId, + issueTypeId: typeof parameters !== 'string' && parameters.issueTypeId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update the configuration for contexts of a custom field created by a [Forge + * app](https://developer.atlassian.com/platform/forge/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the Forge app that created the custom field. + */ + async updateCustomFieldConfiguration( + parameters: Parameters.UpdateCustomFieldConfiguration, + callback: Callback, + ): Promise; + /** + * Update the configuration for contexts of a custom field created by a [Forge + * app](https://developer.atlassian.com/platform/forge/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the Forge app that created the custom field. + */ + async updateCustomFieldConfiguration( + parameters: Parameters.UpdateCustomFieldConfiguration, + callback?: never, + ): Promise; + async updateCustomFieldConfiguration( + parameters: Parameters.UpdateCustomFieldConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/app/field/${parameters.fieldIdOrKey}/context/configuration`, + method: 'PUT', + data: { + configurations: parameters.configurations, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueCustomFieldConfigurationApps.ts b/src/version3/issueCustomFieldConfigurationApps.ts deleted file mode 100644 index 6b67f77b1..000000000 --- a/src/version3/issueCustomFieldConfigurationApps.ts +++ /dev/null @@ -1,113 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueCustomFieldConfigurationApps { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * configurations for a custom field created by a [Forge app](https://developer.atlassian.com/platform/forge/). - * - * The result can be filtered by one of these criteria: - * - * - `id`. - * - `fieldContextId`. - * - `issueId`. - * - `projectKeyOrId` and `issueTypeId`. - * - * Otherwise, all configurations are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. - */ - async getCustomFieldConfiguration( - parameters: Parameters.GetCustomFieldConfiguration | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * configurations for a custom field created by a [Forge app](https://developer.atlassian.com/platform/forge/). - * - * The result can be filtered by one of these criteria: - * - * - `id`. - * - `fieldContextId`. - * - `issueId`. - * - `projectKeyOrId` and `issueTypeId`. - * - * Otherwise, all configurations are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. - */ - async getCustomFieldConfiguration( - parameters: Parameters.GetCustomFieldConfiguration | string, - callback?: never, - ): Promise; - async getCustomFieldConfiguration( - parameters: Parameters.GetCustomFieldConfiguration | string, - callback?: Callback, - ): Promise { - const fieldIdOrKey = typeof parameters === 'string' ? parameters : parameters.fieldIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/app/field/${fieldIdOrKey}/context/configuration`, - method: 'GET', - params: { - id: typeof parameters !== 'string' && parameters.id, - fieldContextId: typeof parameters !== 'string' && parameters.fieldContextId, - issueId: typeof parameters !== 'string' && parameters.issueId, - projectKeyOrId: typeof parameters !== 'string' && parameters.projectKeyOrId, - issueTypeId: typeof parameters !== 'string' && parameters.issueTypeId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Update the configuration for contexts of a custom field created by a [Forge - * app](https://developer.atlassian.com/platform/forge/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. - */ - async updateCustomFieldConfiguration( - parameters: Parameters.UpdateCustomFieldConfiguration, - callback: Callback, - ): Promise; - /** - * Update the configuration for contexts of a custom field created by a [Forge - * app](https://developer.atlassian.com/platform/forge/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. - */ - async updateCustomFieldConfiguration( - parameters: Parameters.UpdateCustomFieldConfiguration, - callback?: never, - ): Promise; - async updateCustomFieldConfiguration( - parameters: Parameters.UpdateCustomFieldConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/app/field/${parameters.fieldIdOrKey}/context/configuration`, - method: 'PUT', - data: { - configurations: parameters.configurations, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueCustomFieldContexts.mts b/src/version3/issueCustomFieldContexts.mts new file mode 100644 index 000000000..a99a55a3e --- /dev/null +++ b/src/version3/issueCustomFieldContexts.mts @@ -0,0 +1,724 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldContexts { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of [ + * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a + * custom field. Contexts can be returned as follows: + * + * - With no other parameters set, all contexts. + * - By defining `id` only, all contexts from the list of IDs. + * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types + * (true) or those that apply to only a subset of issue types (false) + * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global + * contexts) (true) or those that apply to only a subset of projects (false). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getContextsForField( + parameters: Parameters.GetContextsForField | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of [ + * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a + * custom field. Contexts can be returned as follows: + * + * - With no other parameters set, all contexts. + * - By defining `id` only, all contexts from the list of IDs. + * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types + * (true) or those that apply to only a subset of issue types (false) + * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global + * contexts) (true) or those that apply to only a subset of projects (false). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getContextsForField( + parameters: Parameters.GetContextsForField | string, + callback?: never, + ): Promise; + async getContextsForField( + parameters: Parameters.GetContextsForField | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/3/field/${fieldId}/context`, + method: 'GET', + params: { + isAnyIssueType: typeof parameters !== 'string' && parameters.isAnyIssueType, + isGlobalContext: typeof parameters !== 'string' && parameters.isGlobalContext, + contextId: typeof parameters !== 'string' && parameters.contextId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a custom field context. + * + * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If + * `issueTypeIds` is empty, the context applies to all issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomFieldContext( + parameters: Parameters.CreateCustomFieldContext, + callback: Callback, + ): Promise; + /** + * Creates a custom field context. + * + * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If + * `issueTypeIds` is empty, the context applies to all issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomFieldContext( + parameters: Parameters.CreateCustomFieldContext, + callback?: never, + ): Promise; + async createCustomFieldContext( + parameters: Parameters.CreateCustomFieldContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context`, + method: 'POST', + data: { + id: parameters.id, + name: parameters.name, + description: parameters.description, + projectIds: parameters.projectIds, + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * defaults for a custom field. The results can be filtered by `contextId`, otherwise all values are returned. If no + * defaults are set for a context, nothing is returned. The returned object depends on type of the custom field: + * + * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * + * Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * + * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultValues( + parameters: Parameters.GetDefaultValues | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * defaults for a custom field. The results can be filtered by `contextId`, otherwise all values are returned. If no + * defaults are set for a context, nothing is returned. The returned object depends on type of the custom field: + * + * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * + * Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * + * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultValues( + parameters: Parameters.GetDefaultValues | string, + callback?: never, + ): Promise; + async getDefaultValues( + parameters: Parameters.GetDefaultValues | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/3/field/${fieldId}/context/defaultValue`, + method: 'GET', + params: { + contextId: typeof parameters !== 'string' && parameters.contextId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets default for contexts of a custom field. Default are defined using these objects: + * + * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * + * Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * + * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * + * Only one type of default object can be included in a request. To remove a default for a context, set the default + * parameter to `null`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultValues(parameters: Parameters.SetDefaultValues, callback: Callback): Promise; + /** + * Sets default for contexts of a custom field. Default are defined using these objects: + * + * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * + * Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * + * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * + * Only one type of default object can be included in a request. To remove a default for a context, set the default + * parameter to `null`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: never): Promise; + async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/defaultValue`, + method: 'PUT', + data: { + defaultValues: parameters.defaultValues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. + * Mappings are ordered first by context ID and then by issue type ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeMappingsForContexts( + parameters: Parameters.GetIssueTypeMappingsForContexts | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. + * Mappings are ordered first by context ID and then by issue type ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeMappingsForContexts( + parameters: Parameters.GetIssueTypeMappingsForContexts | string, + callback?: never, + ): Promise; + async getIssueTypeMappingsForContexts( + parameters: Parameters.GetIssueTypeMappingsForContexts | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/3/field/${fieldId}/context/issuetypemapping`, + method: 'GET', + params: { + contextId: typeof parameters !== 'string' && parameters.contextId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * project and issue type mappings and, for each mapping, the ID of a [custom field + * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. + * + * If there is no custom field context assigned to the project then, if present, the custom field context that applies + * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is + * not found, the returned custom field context ID is `null`. + * + * Duplicate project and issue type mappings cannot be provided in the request. + * + * The order of the returned values is the same as provided in the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getCustomFieldContextsForProjectsAndIssueTypes( + parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * project and issue type mappings and, for each mapping, the ID of a [custom field + * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. + * + * If there is no custom field context assigned to the project then, if present, the custom field context that applies + * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is + * not found, the returned custom field context ID is `null`. + * + * Duplicate project and issue type mappings cannot be provided in the request. + * + * The order of the returned values is the same as provided in the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getCustomFieldContextsForProjectsAndIssueTypes( + parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, + callback?: never, + ): Promise; + async getCustomFieldContextsForProjectsAndIssueTypes( + parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/mapping`, + method: 'POST', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + data: { + mappings: parameters.mappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings + * are returned. Invalid IDs are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectContextMapping( + parameters: Parameters.GetProjectContextMapping | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings + * are returned. Invalid IDs are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectContextMapping( + parameters: Parameters.GetProjectContextMapping | string, + callback?: never, + ): Promise; + async getProjectContextMapping( + parameters: Parameters.GetProjectContextMapping | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/3/field/${fieldId}/context/projectmapping`, + method: 'GET', + params: { + contextId: typeof parameters !== 'string' && parameters.contextId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a [custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomFieldContext( + parameters: Parameters.UpdateCustomFieldContext, + callback: Callback, + ): Promise; + /** + * Updates a [custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomFieldContext( + parameters: Parameters.UpdateCustomFieldContext, + callback?: never, + ): Promise; + async updateCustomFieldContext( + parameters: Parameters.UpdateCustomFieldContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a [custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomFieldContext( + parameters: Parameters.DeleteCustomFieldContext, + callback: Callback, + ): Promise; + /** + * Deletes a [custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomFieldContext( + parameters: Parameters.DeleteCustomFieldContext, + callback?: never, + ): Promise; + async deleteCustomFieldContext( + parameters: Parameters.DeleteCustomFieldContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds issue types to a custom field context, appending the issue types to the issue types list. + * + * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom + * field context would result in it applying to only the listed issue types. + * + * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addIssueTypesToContext( + parameters: Parameters.AddIssueTypesToContext, + callback: Callback, + ): Promise; + /** + * Adds issue types to a custom field context, appending the issue types to the issue types list. + * + * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom + * field context would result in it applying to only the listed issue types. + * + * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addIssueTypesToContext(parameters: Parameters.AddIssueTypesToContext, callback?: never): Promise; + async addIssueTypesToContext( + parameters: Parameters.AddIssueTypesToContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype`, + method: 'PUT', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes issue types from a custom field context. + * + * A custom field context without any issue types applies to all issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypesFromContext( + parameters: Parameters.RemoveIssueTypesFromContext, + callback: Callback, + ): Promise; + /** + * Removes issue types from a custom field context. + * + * A custom field context without any issue types applies to all issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypesFromContext( + parameters: Parameters.RemoveIssueTypesFromContext, + callback?: never, + ): Promise; + async removeIssueTypesFromContext( + parameters: Parameters.RemoveIssueTypesFromContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype/remove`, + method: 'POST', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns a custom field context to projects. + * + * If any project in the request is assigned to any context of the custom field, the operation fails. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignProjectsToCustomFieldContext( + parameters: Parameters.AssignProjectsToCustomFieldContext, + callback: Callback, + ): Promise; + /** + * Assigns a custom field context to projects. + * + * If any project in the request is assigned to any context of the custom field, the operation fails. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignProjectsToCustomFieldContext( + parameters: Parameters.AssignProjectsToCustomFieldContext, + callback?: never, + ): Promise; + async assignProjectsToCustomFieldContext( + parameters: Parameters.AssignProjectsToCustomFieldContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/project`, + method: 'PUT', + data: { + projectIds: parameters.projectIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a custom field context from projects. + * + * A custom field context without any projects applies to all projects. Removing all projects from a custom field + * context would result in it applying to all projects. + * + * If any project in the request is not assigned to the context, or the operation would result in two global contexts + * for the field, the operation fails. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeCustomFieldContextFromProjects( + parameters: Parameters.RemoveCustomFieldContextFromProjects, + callback: Callback, + ): Promise; + /** + * Removes a custom field context from projects. + * + * A custom field context without any projects applies to all projects. Removing all projects from a custom field + * context would result in it applying to all projects. + * + * If any project in the request is not assigned to the context, or the operation would result in two global contexts + * for the field, the operation fails. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeCustomFieldContextFromProjects( + parameters: Parameters.RemoveCustomFieldContextFromProjects, + callback?: never, + ): Promise; + async removeCustomFieldContextFromProjects( + parameters: Parameters.RemoveCustomFieldContextFromProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/project/remove`, + method: 'POST', + data: { + projectIds: parameters.projectIds, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueCustomFieldContexts.ts b/src/version3/issueCustomFieldContexts.ts deleted file mode 100644 index d6f5ddee5..000000000 --- a/src/version3/issueCustomFieldContexts.ts +++ /dev/null @@ -1,724 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueCustomFieldContexts { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of [ - * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a - * custom field. Contexts can be returned as follows: - * - * - With no other parameters set, all contexts. - * - By defining `id` only, all contexts from the list of IDs. - * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types - * (true) or those that apply to only a subset of issue types (false) - * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global - * contexts) (true) or those that apply to only a subset of projects (false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getContextsForField( - parameters: Parameters.GetContextsForField | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of [ - * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a - * custom field. Contexts can be returned as follows: - * - * - With no other parameters set, all contexts. - * - By defining `id` only, all contexts from the list of IDs. - * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types - * (true) or those that apply to only a subset of issue types (false) - * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global - * contexts) (true) or those that apply to only a subset of projects (false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getContextsForField( - parameters: Parameters.GetContextsForField | string, - callback?: never, - ): Promise; - async getContextsForField( - parameters: Parameters.GetContextsForField | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/3/field/${fieldId}/context`, - method: 'GET', - params: { - isAnyIssueType: typeof parameters !== 'string' && parameters.isAnyIssueType, - isGlobalContext: typeof parameters !== 'string' && parameters.isGlobalContext, - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a custom field context. - * - * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If - * `issueTypeIds` is empty, the context applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldContext( - parameters: Parameters.CreateCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Creates a custom field context. - * - * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If - * `issueTypeIds` is empty, the context applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldContext( - parameters: Parameters.CreateCustomFieldContext, - callback?: never, - ): Promise; - async createCustomFieldContext( - parameters: Parameters.CreateCustomFieldContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context`, - method: 'POST', - data: { - id: parameters.id, - name: parameters.name, - description: parameters.description, - projectIds: parameters.projectIds, - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * defaults for a custom field. The results can be filtered by `contextId`, otherwise all values are returned. If no - * defaults are set for a context, nothing is returned. The returned object depends on type of the custom field: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultValues( - parameters: Parameters.GetDefaultValues | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * defaults for a custom field. The results can be filtered by `contextId`, otherwise all values are returned. If no - * defaults are set for a context, nothing is returned. The returned object depends on type of the custom field: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultValues( - parameters: Parameters.GetDefaultValues | string, - callback?: never, - ): Promise; - async getDefaultValues( - parameters: Parameters.GetDefaultValues | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/3/field/${fieldId}/context/defaultValue`, - method: 'GET', - params: { - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets default for contexts of a custom field. Default are defined using these objects: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * Only one type of default object can be included in a request. To remove a default for a context, set the default - * parameter to `null`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultValues(parameters: Parameters.SetDefaultValues, callback: Callback): Promise; - /** - * Sets default for contexts of a custom field. Default are defined using these objects: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * Only one type of default object can be included in a request. To remove a default for a context, set the default - * parameter to `null`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: never): Promise; - async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/defaultValue`, - method: 'PUT', - data: { - defaultValues: parameters.defaultValues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. - * Mappings are ordered first by context ID and then by issue type ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeMappingsForContexts( - parameters: Parameters.GetIssueTypeMappingsForContexts | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. - * Mappings are ordered first by context ID and then by issue type ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeMappingsForContexts( - parameters: Parameters.GetIssueTypeMappingsForContexts | string, - callback?: never, - ): Promise; - async getIssueTypeMappingsForContexts( - parameters: Parameters.GetIssueTypeMappingsForContexts | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/3/field/${fieldId}/context/issuetypemapping`, - method: 'GET', - params: { - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * project and issue type mappings and, for each mapping, the ID of a [custom field - * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. - * - * If there is no custom field context assigned to the project then, if present, the custom field context that applies - * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is - * not found, the returned custom field context ID is `null`. - * - * Duplicate project and issue type mappings cannot be provided in the request. - * - * The order of the returned values is the same as provided in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getCustomFieldContextsForProjectsAndIssueTypes( - parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * project and issue type mappings and, for each mapping, the ID of a [custom field - * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. - * - * If there is no custom field context assigned to the project then, if present, the custom field context that applies - * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is - * not found, the returned custom field context ID is `null`. - * - * Duplicate project and issue type mappings cannot be provided in the request. - * - * The order of the returned values is the same as provided in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getCustomFieldContextsForProjectsAndIssueTypes( - parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, - callback?: never, - ): Promise; - async getCustomFieldContextsForProjectsAndIssueTypes( - parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/mapping`, - method: 'POST', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - data: { - mappings: parameters.mappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings - * are returned. Invalid IDs are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectContextMapping( - parameters: Parameters.GetProjectContextMapping | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings - * are returned. Invalid IDs are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectContextMapping( - parameters: Parameters.GetProjectContextMapping | string, - callback?: never, - ): Promise; - async getProjectContextMapping( - parameters: Parameters.GetProjectContextMapping | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/3/field/${fieldId}/context/projectmapping`, - method: 'GET', - params: { - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a [custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomFieldContext( - parameters: Parameters.UpdateCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Updates a [custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomFieldContext( - parameters: Parameters.UpdateCustomFieldContext, - callback?: never, - ): Promise; - async updateCustomFieldContext( - parameters: Parameters.UpdateCustomFieldContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a [custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldContext( - parameters: Parameters.DeleteCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Deletes a [custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldContext( - parameters: Parameters.DeleteCustomFieldContext, - callback?: never, - ): Promise; - async deleteCustomFieldContext( - parameters: Parameters.DeleteCustomFieldContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds issue types to a custom field context, appending the issue types to the issue types list. - * - * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom - * field context would result in it applying to only the listed issue types. - * - * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToContext( - parameters: Parameters.AddIssueTypesToContext, - callback: Callback, - ): Promise; - /** - * Adds issue types to a custom field context, appending the issue types to the issue types list. - * - * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom - * field context would result in it applying to only the listed issue types. - * - * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToContext(parameters: Parameters.AddIssueTypesToContext, callback?: never): Promise; - async addIssueTypesToContext( - parameters: Parameters.AddIssueTypesToContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype`, - method: 'PUT', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes issue types from a custom field context. - * - * A custom field context without any issue types applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromContext( - parameters: Parameters.RemoveIssueTypesFromContext, - callback: Callback, - ): Promise; - /** - * Removes issue types from a custom field context. - * - * A custom field context without any issue types applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromContext( - parameters: Parameters.RemoveIssueTypesFromContext, - callback?: never, - ): Promise; - async removeIssueTypesFromContext( - parameters: Parameters.RemoveIssueTypesFromContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype/remove`, - method: 'POST', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns a custom field context to projects. - * - * If any project in the request is assigned to any context of the custom field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignProjectsToCustomFieldContext( - parameters: Parameters.AssignProjectsToCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Assigns a custom field context to projects. - * - * If any project in the request is assigned to any context of the custom field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignProjectsToCustomFieldContext( - parameters: Parameters.AssignProjectsToCustomFieldContext, - callback?: never, - ): Promise; - async assignProjectsToCustomFieldContext( - parameters: Parameters.AssignProjectsToCustomFieldContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/project`, - method: 'PUT', - data: { - projectIds: parameters.projectIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a custom field context from projects. - * - * A custom field context without any projects applies to all projects. Removing all projects from a custom field - * context would result in it applying to all projects. - * - * If any project in the request is not assigned to the context, or the operation would result in two global contexts - * for the field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeCustomFieldContextFromProjects( - parameters: Parameters.RemoveCustomFieldContextFromProjects, - callback: Callback, - ): Promise; - /** - * Removes a custom field context from projects. - * - * A custom field context without any projects applies to all projects. Removing all projects from a custom field - * context would result in it applying to all projects. - * - * If any project in the request is not assigned to the context, or the operation would result in two global contexts - * for the field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeCustomFieldContextFromProjects( - parameters: Parameters.RemoveCustomFieldContextFromProjects, - callback?: never, - ): Promise; - async removeCustomFieldContextFromProjects( - parameters: Parameters.RemoveCustomFieldContextFromProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/project/remove`, - method: 'POST', - data: { - projectIds: parameters.projectIds, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueCustomFieldOptions.mts b/src/version3/issueCustomFieldOptions.mts new file mode 100644 index 000000000..333991671 --- /dev/null +++ b/src/version3/issueCustomFieldOptions.mts @@ -0,0 +1,301 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldOptions { + constructor(private client: Client) {} + + /** + * Returns a custom field option. For example, an option in a select list. + * + * Note that this operation **only works for issue field select list options created in Jira or using operations from + * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue + * field select list options created by Connect apps. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * custom field option is returned as follows: + * + * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least + * one project the custom field is used in, and the field is visible in at least one layout the user has permission + * to view. + */ + async getCustomFieldOption( + parameters: Parameters.GetCustomFieldOption | string, + callback: Callback, + ): Promise; + /** + * Returns a custom field option. For example, an option in a select list. + * + * Note that this operation **only works for issue field select list options created in Jira or using operations from + * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue + * field select list options created by Connect apps. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * custom field option is returned as follows: + * + * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least + * one project the custom field is used in, and the field is visible in at least one layout the user has permission + * to view. + */ + async getCustomFieldOption( + parameters: Parameters.GetCustomFieldOption | string, + callback?: never, + ): Promise; + async getCustomFieldOption( + parameters: Parameters.GetCustomFieldOption | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/customFieldOption/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * custom field option for a context. Options are returned first then cascading options, in the order they display in + * Jira. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getOptionsForContext( + parameters: Parameters.GetOptionsForContext, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * custom field option for a context. Options are returned first then cascading options, in the order they display in + * Jira. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getOptionsForContext( + parameters: Parameters.GetOptionsForContext, + callback?: never, + ): Promise; + async getOptionsForContext( + parameters: Parameters.GetOptionsForContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option`, + method: 'GET', + params: { + optionId: parameters.optionId, + onlyOptions: parameters.onlyOptions, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a + * custom select field. The options are added to a context of the field. + * + * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 + * options. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomFieldOption( + parameters: Parameters.CreateCustomFieldOption, + callback: Callback, + ): Promise; + /** + * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a + * custom select field. The options are added to a context of the field. + * + * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 + * options. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomFieldOption( + parameters: Parameters.CreateCustomFieldOption, + callback?: never, + ): Promise; + async createCustomFieldOption( + parameters: Parameters.CreateCustomFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option`, + method: 'POST', + data: { + options: parameters.options, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the options of a custom field. + * + * If any of the options are not found, no options are updated. Options where the values in the request match the + * current values aren't updated and aren't reported in the response. + * + * Note that this operation **only works for issue field select list options created in Jira or using operations from + * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue + * field select list options created by Connect apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomFieldOption( + parameters: Parameters.UpdateCustomFieldOption, + callback: Callback, + ): Promise; + /** + * Updates the options of a custom field. + * + * If any of the options are not found, no options are updated. Options where the values in the request match the + * current values aren't updated and aren't reported in the response. + * + * Note that this operation **only works for issue field select list options created in Jira or using operations from + * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue + * field select list options created by Connect apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomFieldOption( + parameters: Parameters.UpdateCustomFieldOption, + callback?: never, + ): Promise; + async updateCustomFieldOption( + parameters: Parameters.UpdateCustomFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option`, + method: 'PUT', + data: { + options: parameters.options, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the order of custom field options or cascading options in a context. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async reorderCustomFieldOptions( + parameters: Parameters.ReorderCustomFieldOptions, + callback: Callback, + ): Promise; + /** + * Changes the order of custom field options or cascading options in a context. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async reorderCustomFieldOptions( + parameters: Parameters.ReorderCustomFieldOptions, + callback?: never, + ): Promise; + async reorderCustomFieldOptions( + parameters: Parameters.ReorderCustomFieldOptions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option/move`, + method: 'PUT', + data: { + after: parameters.after, + customFieldOptionIds: parameters.customFieldOptionIds, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a custom field option. + * + * Options with cascading options cannot be deleted without deleting the cascading options first. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomFieldOption( + parameters: Parameters.DeleteCustomFieldOption, + callback: Callback, + ): Promise; + /** + * Deletes a custom field option. + * + * Options with cascading options cannot be deleted without deleting the cascading options first. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomFieldOption(parameters: Parameters.DeleteCustomFieldOption, callback?: never): Promise; + async deleteCustomFieldOption( + parameters: Parameters.DeleteCustomFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option/${parameters.optionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueCustomFieldOptions.ts b/src/version3/issueCustomFieldOptions.ts deleted file mode 100644 index 3a880ef8d..000000000 --- a/src/version3/issueCustomFieldOptions.ts +++ /dev/null @@ -1,301 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueCustomFieldOptions { - constructor(private client: Client) {} - - /** - * Returns a custom field option. For example, an option in a select list. - * - * Note that this operation **only works for issue field select list options created in Jira or using operations from - * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue - * field select list options created by Connect apps. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * custom field option is returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least - * one project the custom field is used in, and the field is visible in at least one layout the user has permission - * to view. - */ - async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, - callback: Callback, - ): Promise; - /** - * Returns a custom field option. For example, an option in a select list. - * - * Note that this operation **only works for issue field select list options created in Jira or using operations from - * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue - * field select list options created by Connect apps. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * custom field option is returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least - * one project the custom field is used in, and the field is visible in at least one layout the user has permission - * to view. - */ - async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, - callback?: never, - ): Promise; - async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/customFieldOption/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * custom field option for a context. Options are returned first then cascading options, in the order they display in - * Jira. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getOptionsForContext( - parameters: Parameters.GetOptionsForContext, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * custom field option for a context. Options are returned first then cascading options, in the order they display in - * Jira. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getOptionsForContext( - parameters: Parameters.GetOptionsForContext, - callback?: never, - ): Promise; - async getOptionsForContext( - parameters: Parameters.GetOptionsForContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option`, - method: 'GET', - params: { - optionId: parameters.optionId, - onlyOptions: parameters.onlyOptions, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a - * custom select field. The options are added to a context of the field. - * - * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 - * options. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldOption( - parameters: Parameters.CreateCustomFieldOption, - callback: Callback, - ): Promise; - /** - * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a - * custom select field. The options are added to a context of the field. - * - * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 - * options. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldOption( - parameters: Parameters.CreateCustomFieldOption, - callback?: never, - ): Promise; - async createCustomFieldOption( - parameters: Parameters.CreateCustomFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option`, - method: 'POST', - data: { - options: parameters.options, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the options of a custom field. - * - * If any of the options are not found, no options are updated. Options where the values in the request match the - * current values aren't updated and aren't reported in the response. - * - * Note that this operation **only works for issue field select list options created in Jira or using operations from - * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue - * field select list options created by Connect apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomFieldOption( - parameters: Parameters.UpdateCustomFieldOption, - callback: Callback, - ): Promise; - /** - * Updates the options of a custom field. - * - * If any of the options are not found, no options are updated. Options where the values in the request match the - * current values aren't updated and aren't reported in the response. - * - * Note that this operation **only works for issue field select list options created in Jira or using operations from - * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue - * field select list options created by Connect apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomFieldOption( - parameters: Parameters.UpdateCustomFieldOption, - callback?: never, - ): Promise; - async updateCustomFieldOption( - parameters: Parameters.UpdateCustomFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option`, - method: 'PUT', - data: { - options: parameters.options, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the order of custom field options or cascading options in a context. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderCustomFieldOptions( - parameters: Parameters.ReorderCustomFieldOptions, - callback: Callback, - ): Promise; - /** - * Changes the order of custom field options or cascading options in a context. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderCustomFieldOptions( - parameters: Parameters.ReorderCustomFieldOptions, - callback?: never, - ): Promise; - async reorderCustomFieldOptions( - parameters: Parameters.ReorderCustomFieldOptions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option/move`, - method: 'PUT', - data: { - after: parameters.after, - customFieldOptionIds: parameters.customFieldOptionIds, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a custom field option. - * - * Options with cascading options cannot be deleted without deleting the cascading options first. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldOption( - parameters: Parameters.DeleteCustomFieldOption, - callback: Callback, - ): Promise; - /** - * Deletes a custom field option. - * - * Options with cascading options cannot be deleted without deleting the cascading options first. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldOption(parameters: Parameters.DeleteCustomFieldOption, callback?: never): Promise; - async deleteCustomFieldOption( - parameters: Parameters.DeleteCustomFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option/${parameters.optionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueCustomFieldOptionsApps.mts b/src/version3/issueCustomFieldOptionsApps.mts new file mode 100644 index 000000000..ffa53d051 --- /dev/null +++ b/src/version3/issueCustomFieldOptionsApps.mts @@ -0,0 +1,407 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldOptionsApps { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * the options of a select list issue field. A select list issue field is a type of [issue + * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a + * value from a list of options. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async getAllIssueFieldOptions( + parameters: Parameters.GetAllIssueFieldOptions | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * the options of a select list issue field. A select list issue field is a type of [issue + * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a + * value from a list of options. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async getAllIssueFieldOptions( + parameters: Parameters.GetAllIssueFieldOptions | string, + callback?: never, + ): Promise; + async getAllIssueFieldOptions( + parameters: Parameters.GetAllIssueFieldOptions | string, + callback?: Callback, + ): Promise { + const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; + + const config: RequestConfig = { + url: `/rest/api/3/field/${fieldKey}/option`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an option for a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async createIssueFieldOption( + parameters: Parameters.CreateIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Creates an option for a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async createIssueFieldOption( + parameters: Parameters.CreateIssueFieldOption, + callback?: never, + ): Promise; + async createIssueFieldOption( + parameters: Parameters.CreateIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldKey}/option`, + method: 'POST', + data: { + value: parameters.value, + properties: parameters.properties, + config: parameters.config, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * options for a select list issue field that can be viewed and selected by the user. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getSelectableIssueFieldOptions( + parameters: Parameters.GetSelectableIssueFieldOptions | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * options for a select list issue field that can be viewed and selected by the user. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getSelectableIssueFieldOptions( + parameters: Parameters.GetSelectableIssueFieldOptions | string, + callback?: never, + ): Promise; + async getSelectableIssueFieldOptions( + parameters: Parameters.GetSelectableIssueFieldOptions | string, + callback?: Callback, + ): Promise { + const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; + + const config: RequestConfig = { + url: `/rest/api/3/field/${fieldKey}/option/suggestions/edit`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + projectId: typeof parameters !== 'string' && parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * options for a select list issue field that can be viewed by the user. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getVisibleIssueFieldOptions( + parameters: Parameters.GetVisibleIssueFieldOptions | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * options for a select list issue field that can be viewed by the user. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getVisibleIssueFieldOptions( + parameters: Parameters.GetVisibleIssueFieldOptions | string, + callback?: never, + ): Promise; + async getVisibleIssueFieldOptions( + parameters: Parameters.GetVisibleIssueFieldOptions | string, + callback?: Callback, + ): Promise { + const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; + + const config: RequestConfig = { + url: `/rest/api/3/field/${fieldKey}/option/suggestions/search`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + projectId: typeof parameters !== 'string' && parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an option from a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async getIssueFieldOption( + parameters: Parameters.GetIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Returns an option from a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async getIssueFieldOption( + parameters: Parameters.GetIssueFieldOption, + callback?: never, + ): Promise; + async getIssueFieldOption( + parameters: Parameters.GetIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided + * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID + * provided in the path and body must be identical. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async updateIssueFieldOption( + parameters: Parameters.UpdateIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided + * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID + * provided in the path and body must be identical. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async updateIssueFieldOption( + parameters: Parameters.UpdateIssueFieldOption, + callback?: never, + ): Promise; + async updateIssueFieldOption( + parameters: Parameters.UpdateIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}`, + method: 'PUT', + data: { + id: parameters.id, + value: parameters.value, + properties: parameters.properties, + config: parameters.config, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an option from a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async deleteIssueFieldOption( + parameters: Parameters.DeleteIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Deletes an option from a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async deleteIssueFieldOption(parameters: Parameters.DeleteIssueFieldOption, callback?: never): Promise; + async deleteIssueFieldOption( + parameters: Parameters.DeleteIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deselects an issue-field select-list option from all issues where it is selected. A different option can be + * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a Jql + * query. + * + * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + * can override the screen security configuration using `overrideScreenSecurity` and `overrideEditableFlag`. + * + * This is an [asynchronous + * operation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). The response + * object contains a link to the long-running task. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async replaceIssueFieldOption( + parameters: Parameters.ReplaceIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Deselects an issue-field select-list option from all issues where it is selected. A different option can be + * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a Jql + * query. + * + * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + * can override the screen security configuration using `overrideScreenSecurity` and `overrideEditableFlag`. + * + * This is an [asynchronous + * operation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). The response + * object contains a link to the long-running task. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * used with issue field select list options created in Jira or using operations from the [Issue custom field + * options](#api-group-Issue-custom-field-options) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the app providing the field. + */ + async replaceIssueFieldOption( + parameters: Parameters.ReplaceIssueFieldOption, + callback?: never, + ): Promise; + async replaceIssueFieldOption( + parameters: Parameters.ReplaceIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}/issue`, + method: 'DELETE', + params: { + replaceWith: parameters.replaceWith, + jql: parameters.jql, + overrideScreenSecurity: parameters.overrideScreenSecurity, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueCustomFieldOptionsApps.ts b/src/version3/issueCustomFieldOptionsApps.ts deleted file mode 100644 index 32baefb7a..000000000 --- a/src/version3/issueCustomFieldOptionsApps.ts +++ /dev/null @@ -1,407 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueCustomFieldOptionsApps { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * the options of a select list issue field. A select list issue field is a type of [issue - * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a - * value from a list of options. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * the options of a select list issue field. A select list issue field is a type of [issue - * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a - * value from a list of options. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, - callback?: never, - ): Promise; - async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, - callback?: Callback, - ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - - const config: RequestConfig = { - url: `/rest/api/3/field/${fieldKey}/option`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an option for a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async createIssueFieldOption( - parameters: Parameters.CreateIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Creates an option for a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async createIssueFieldOption( - parameters: Parameters.CreateIssueFieldOption, - callback?: never, - ): Promise; - async createIssueFieldOption( - parameters: Parameters.CreateIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldKey}/option`, - method: 'POST', - data: { - value: parameters.value, - properties: parameters.properties, - config: parameters.config, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * options for a select list issue field that can be viewed and selected by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * options for a select list issue field that can be viewed and selected by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, - callback?: never, - ): Promise; - async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, - callback?: Callback, - ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - - const config: RequestConfig = { - url: `/rest/api/3/field/${fieldKey}/option/suggestions/edit`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - projectId: typeof parameters !== 'string' && parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * options for a select list issue field that can be viewed by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * options for a select list issue field that can be viewed by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, - callback?: never, - ): Promise; - async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, - callback?: Callback, - ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - - const config: RequestConfig = { - url: `/rest/api/3/field/${fieldKey}/option/suggestions/search`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - projectId: typeof parameters !== 'string' && parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async getIssueFieldOption( - parameters: Parameters.GetIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Returns an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async getIssueFieldOption( - parameters: Parameters.GetIssueFieldOption, - callback?: never, - ): Promise; - async getIssueFieldOption( - parameters: Parameters.GetIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided - * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID - * provided in the path and body must be identical. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async updateIssueFieldOption( - parameters: Parameters.UpdateIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided - * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID - * provided in the path and body must be identical. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async updateIssueFieldOption( - parameters: Parameters.UpdateIssueFieldOption, - callback?: never, - ): Promise; - async updateIssueFieldOption( - parameters: Parameters.UpdateIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}`, - method: 'PUT', - data: { - id: parameters.id, - value: parameters.value, - properties: parameters.properties, - config: parameters.config, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async deleteIssueFieldOption( - parameters: Parameters.DeleteIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Deletes an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async deleteIssueFieldOption(parameters: Parameters.DeleteIssueFieldOption, callback?: never): Promise; - async deleteIssueFieldOption( - parameters: Parameters.DeleteIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deselects an issue-field select-list option from all issues where it is selected. A different option can be - * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a JQL - * query. - * - * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - * can override the screen security configuration using `overrideScreenSecurity` and `overrideEditableFlag`. - * - * This is an [asynchronous - * operation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). The response - * object contains a link to the long-running task. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async replaceIssueFieldOption( - parameters: Parameters.ReplaceIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Deselects an issue-field select-list option from all issues where it is selected. A different option can be - * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a JQL - * query. - * - * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - * can override the screen security configuration using `overrideScreenSecurity` and `overrideEditableFlag`. - * - * This is an [asynchronous - * operation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). The response - * object contains a link to the long-running task. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * used with issue field select list options created in Jira or using operations from the [Issue custom field - * options](#api-group-Issue-custom-field-options) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the app providing the field. - */ - async replaceIssueFieldOption( - parameters: Parameters.ReplaceIssueFieldOption, - callback?: never, - ): Promise; - async replaceIssueFieldOption( - parameters: Parameters.ReplaceIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}/issue`, - method: 'DELETE', - params: { - replaceWith: parameters.replaceWith, - jql: parameters.jql, - overrideScreenSecurity: parameters.overrideScreenSecurity, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueCustomFieldValuesApps.mts b/src/version3/issueCustomFieldValuesApps.mts new file mode 100644 index 000000000..c83ad68ac --- /dev/null +++ b/src/version3/issueCustomFieldValuesApps.mts @@ -0,0 +1,85 @@ +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldValuesApps { + constructor(private client: Client) {} + + /** + * Updates the value of one or more custom fields on one or more issues. Combinations of custom field and issue should + * be unique within the request. Custom fields can only be updated by the Forge app that created them. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * the app that created the custom field can update its values with this operation. + */ + async updateMultipleCustomFieldValues( + parameters: Parameters.UpdateMultipleCustomFieldValues, + callback: Callback, + ): Promise; + /** + * Updates the value of one or more custom fields on one or more issues. Combinations of custom field and issue should + * be unique within the request. Custom fields can only be updated by the Forge app that created them. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * the app that created the custom field can update its values with this operation. + */ + async updateMultipleCustomFieldValues( + parameters: Parameters.UpdateMultipleCustomFieldValues, + callback?: never, + ): Promise; + async updateMultipleCustomFieldValues( + parameters: Parameters.UpdateMultipleCustomFieldValues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/app/field/value', + method: 'POST', + params: { + generateChangelog: parameters.generateChangelog, + }, + data: { + updates: parameters.updates, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the value of a custom field on one or more issues. Custom fields can only be updated by the Forge app that + * created them. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * the app that created the custom field can update its values with this operation. + */ + async updateCustomFieldValue( + parameters: Parameters.UpdateCustomFieldValue, + callback: Callback, + ): Promise; + /** + * Updates the value of a custom field on one or more issues. Custom fields can only be updated by the Forge app that + * created them. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * the app that created the custom field can update its values with this operation. + */ + async updateCustomFieldValue(parameters: Parameters.UpdateCustomFieldValue, callback?: never): Promise; + async updateCustomFieldValue( + parameters: Parameters.UpdateCustomFieldValue, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/app/field/${parameters.fieldIdOrKey}/value`, + method: 'PUT', + params: { + generateChangelog: parameters.generateChangelog, + }, + data: { + updates: parameters.updates, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueCustomFieldValuesApps.ts b/src/version3/issueCustomFieldValuesApps.ts deleted file mode 100644 index 4775ecf9b..000000000 --- a/src/version3/issueCustomFieldValuesApps.ts +++ /dev/null @@ -1,85 +0,0 @@ -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueCustomFieldValuesApps { - constructor(private client: Client) {} - - /** - * Updates the value of one or more custom fields on one or more issues. Combinations of custom field and issue should - * be unique within the request. Custom fields can only be updated by the Forge app that created them. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. - */ - async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues, - callback: Callback, - ): Promise; - /** - * Updates the value of one or more custom fields on one or more issues. Combinations of custom field and issue should - * be unique within the request. Custom fields can only be updated by the Forge app that created them. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. - */ - async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues, - callback?: never, - ): Promise; - async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/app/field/value', - method: 'POST', - params: { - generateChangelog: parameters.generateChangelog, - }, - data: { - updates: parameters.updates, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the value of a custom field on one or more issues. Custom fields can only be updated by the Forge app that - * created them. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. - */ - async updateCustomFieldValue( - parameters: Parameters.UpdateCustomFieldValue, - callback: Callback, - ): Promise; - /** - * Updates the value of a custom field on one or more issues. Custom fields can only be updated by the Forge app that - * created them. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. - */ - async updateCustomFieldValue(parameters: Parameters.UpdateCustomFieldValue, callback?: never): Promise; - async updateCustomFieldValue( - parameters: Parameters.UpdateCustomFieldValue, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/app/field/${parameters.fieldIdOrKey}/value`, - method: 'PUT', - params: { - generateChangelog: parameters.generateChangelog, - }, - data: { - updates: parameters.updates, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueFieldConfigurations.mts b/src/version3/issueFieldConfigurations.mts new file mode 100644 index 000000000..e263e50d2 --- /dev/null +++ b/src/version3/issueFieldConfigurations.mts @@ -0,0 +1,644 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueFieldConfigurations { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field + * configurations. The list can be for all field configurations or a subset determined by any combination of these + * criteria: + * + * - A list of field configuration item IDs. + * - Whether the field configuration is a default. + * - Whether the field configuration name or description contains a query string. + * + * Only field configurations used in company-managed (classic) projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllFieldConfigurations( + parameters: Parameters.GetAllFieldConfigurations | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field + * configurations. The list can be for all field configurations or a subset determined by any combination of these + * criteria: + * + * - A list of field configuration item IDs. + * - Whether the field configuration is a default. + * - Whether the field configuration name or description contains a query string. + * + * Only field configurations used in company-managed (classic) projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllFieldConfigurations( + parameters?: Parameters.GetAllFieldConfigurations, + callback?: never, + ): Promise; + async getAllFieldConfigurations( + parameters?: Parameters.GetAllFieldConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/fieldconfiguration', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + isDefault: parameters?.isDefault, + query: parameters?.query, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a field configuration. The field configuration is created with the same field properties as the default + * configuration, with all the fields being optional. + * + * This operation can only create configurations for use in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createFieldConfiguration( + parameters: Parameters.CreateFieldConfiguration | undefined, + callback: Callback, + ): Promise; + /** + * Creates a field configuration. The field configuration is created with the same field properties as the default + * configuration, with all the fields being optional. + * + * This operation can only create configurations for use in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createFieldConfiguration( + parameters?: Parameters.CreateFieldConfiguration, + callback?: never, + ): Promise; + async createFieldConfiguration( + parameters?: Parameters.CreateFieldConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/fieldconfiguration', + method: 'POST', + data: { + name: parameters?.name, + description: parameters?.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a field configuration. The name and the description provided in the request override the existing values. + * + * This operation can only update configurations used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfiguration( + parameters: Parameters.UpdateFieldConfiguration, + callback: Callback, + ): Promise; + /** + * Updates a field configuration. The name and the description provided in the request override the existing values. + * + * This operation can only update configurations used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfiguration( + parameters: Parameters.UpdateFieldConfiguration, + callback?: never, + ): Promise; + async updateFieldConfiguration( + parameters: Parameters.UpdateFieldConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/fieldconfiguration/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a field configuration. + * + * This operation can only delete configurations used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFieldConfiguration( + parameters: Parameters.DeleteFieldConfiguration, + callback: Callback, + ): Promise; + /** + * Deletes a field configuration. + * + * This operation can only delete configurations used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFieldConfiguration( + parameters: Parameters.DeleteFieldConfiguration, + callback?: never, + ): Promise; + async deleteFieldConfiguration( + parameters: Parameters.DeleteFieldConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/fieldconfiguration/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * fields for a configuration. + * + * Only the fields from configurations used in company-managed (classic) projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldConfigurationItems( + parameters: Parameters.GetFieldConfigurationItems, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * fields for a configuration. + * + * Only the fields from configurations used in company-managed (classic) projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldConfigurationItems( + parameters: Parameters.GetFieldConfigurationItems, + callback?: never, + ): Promise; + async getFieldConfigurationItems( + parameters: Parameters.GetFieldConfigurationItems, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/fieldconfiguration/${parameters.id}/fields`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates fields in a field configuration. The properties of the field configuration fields provided override the + * existing values. + * + * This operation can only update field configurations used in company-managed (classic) projects. + * + * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style + * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer + * (`autocomplete-renderer`). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfigurationItems( + parameters: Parameters.UpdateFieldConfigurationItems, + callback: Callback, + ): Promise; + /** + * Updates fields in a field configuration. The properties of the field configuration fields provided override the + * existing values. + * + * This operation can only update field configurations used in company-managed (classic) projects. + * + * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style + * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer + * (`autocomplete-renderer`). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfigurationItems( + parameters: Parameters.UpdateFieldConfigurationItems, + callback?: never, + ): Promise; + async updateFieldConfigurationItems( + parameters: Parameters.UpdateFieldConfigurationItems, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/fieldconfiguration/${parameters.id}/fields`, + method: 'PUT', + data: { + fieldConfigurationItems: parameters.fieldConfigurationItems, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field + * configuration schemes. + * + * Only field configuration schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllFieldConfigurationSchemes( + parameters: Parameters.GetAllFieldConfigurationSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field + * configuration schemes. + * + * Only field configuration schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllFieldConfigurationSchemes( + parameters?: Parameters.GetAllFieldConfigurationSchemes, + callback?: never, + ): Promise; + async getAllFieldConfigurationSchemes( + parameters?: Parameters.GetAllFieldConfigurationSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/fieldconfigurationscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a field configuration scheme. + * + * This operation can only create field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createFieldConfigurationScheme( + parameters: Parameters.CreateFieldConfigurationScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates a field configuration scheme. + * + * This operation can only create field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createFieldConfigurationScheme( + parameters?: Parameters.CreateFieldConfigurationScheme, + callback?: never, + ): Promise; + async createFieldConfigurationScheme( + parameters?: Parameters.CreateFieldConfigurationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/fieldconfigurationscheme', + method: 'POST', + data: { + name: parameters?.name, + description: parameters?.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field + * configuration issue type items. + * + * Only items used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldConfigurationSchemeMappings( + parameters: Parameters.GetFieldConfigurationSchemeMappings | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field + * configuration issue type items. + * + * Only items used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldConfigurationSchemeMappings( + parameters?: Parameters.GetFieldConfigurationSchemeMappings, + callback?: never, + ): Promise; + async getFieldConfigurationSchemeMappings( + parameters?: Parameters.GetFieldConfigurationSchemeMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/fieldconfigurationscheme/mapping', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + fieldConfigurationSchemeId: parameters?.fieldConfigurationSchemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field + * configuration schemes and, for each scheme, a list of the projects that use it. + * + * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to + * the default field configuration scheme. + * + * Only field configuration schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldConfigurationSchemeProjectMapping( + parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field + * configuration schemes and, for each scheme, a list of the projects that use it. + * + * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to + * the default field configuration scheme. + * + * Only field configuration schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldConfigurationSchemeProjectMapping( + parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, + callback?: never, + ): Promise; + async getFieldConfigurationSchemeProjectMapping( + parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/fieldconfigurationscheme/project', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation + * assigns the default field configuration scheme. + * + * Field configuration schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignFieldConfigurationSchemeToProject( + parameters: Parameters.AssignFieldConfigurationSchemeToProject | undefined, + callback: Callback, + ): Promise; + /** + * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation + * assigns the default field configuration scheme. + * + * Field configuration schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignFieldConfigurationSchemeToProject( + parameters?: Parameters.AssignFieldConfigurationSchemeToProject, + callback?: never, + ): Promise; + async assignFieldConfigurationSchemeToProject( + parameters?: Parameters.AssignFieldConfigurationSchemeToProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/fieldconfigurationscheme/project', + method: 'PUT', + data: { + fieldConfigurationSchemeId: parameters?.fieldConfigurationSchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a field configuration scheme. + * + * This operation can only update field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfigurationScheme( + parameters: Parameters.UpdateFieldConfigurationScheme, + callback: Callback, + ): Promise; + /** + * Updates a field configuration scheme. + * + * This operation can only update field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfigurationScheme( + parameters: Parameters.UpdateFieldConfigurationScheme, + callback?: never, + ): Promise; + async updateFieldConfigurationScheme( + parameters: Parameters.UpdateFieldConfigurationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a field configuration scheme. + * + * This operation can only delete field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFieldConfigurationScheme( + parameters: Parameters.DeleteFieldConfigurationScheme, + callback: Callback, + ): Promise; + /** + * Deletes a field configuration scheme. + * + * This operation can only delete field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFieldConfigurationScheme( + parameters: Parameters.DeleteFieldConfigurationScheme, + callback?: never, + ): Promise; + async deleteFieldConfigurationScheme( + parameters: Parameters.DeleteFieldConfigurationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns issue types to field configurations on field configuration scheme. + * + * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setFieldConfigurationSchemeMapping( + parameters: Parameters.SetFieldConfigurationSchemeMapping, + callback: Callback, + ): Promise; + /** + * Assigns issue types to field configurations on field configuration scheme. + * + * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setFieldConfigurationSchemeMapping( + parameters: Parameters.SetFieldConfigurationSchemeMapping, + callback?: never, + ): Promise; + async setFieldConfigurationSchemeMapping( + parameters: Parameters.SetFieldConfigurationSchemeMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}/mapping`, + method: 'PUT', + data: { + mappings: parameters.mappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes issue types from the field configuration scheme. + * + * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypesFromGlobalFieldConfigurationScheme( + parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, + callback: Callback, + ): Promise; + /** + * Removes issue types from the field configuration scheme. + * + * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypesFromGlobalFieldConfigurationScheme( + parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, + callback?: never, + ): Promise; + async removeIssueTypesFromGlobalFieldConfigurationScheme( + parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}/mapping/delete`, + method: 'POST', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueFieldConfigurations.ts b/src/version3/issueFieldConfigurations.ts deleted file mode 100644 index 185370328..000000000 --- a/src/version3/issueFieldConfigurations.ts +++ /dev/null @@ -1,644 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueFieldConfigurations { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field - * configurations. The list can be for all field configurations or a subset determined by any combination of these - * criteria: - * - * - A list of field configuration item IDs. - * - Whether the field configuration is a default. - * - Whether the field configuration name or description contains a query string. - * - * Only field configurations used in company-managed (classic) projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllFieldConfigurations( - parameters: Parameters.GetAllFieldConfigurations | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field - * configurations. The list can be for all field configurations or a subset determined by any combination of these - * criteria: - * - * - A list of field configuration item IDs. - * - Whether the field configuration is a default. - * - Whether the field configuration name or description contains a query string. - * - * Only field configurations used in company-managed (classic) projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllFieldConfigurations( - parameters?: Parameters.GetAllFieldConfigurations, - callback?: never, - ): Promise; - async getAllFieldConfigurations( - parameters?: Parameters.GetAllFieldConfigurations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/fieldconfiguration', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - isDefault: parameters?.isDefault, - query: parameters?.query, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a field configuration. The field configuration is created with the same field properties as the default - * configuration, with all the fields being optional. - * - * This operation can only create configurations for use in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfiguration( - parameters: Parameters.CreateFieldConfiguration | undefined, - callback: Callback, - ): Promise; - /** - * Creates a field configuration. The field configuration is created with the same field properties as the default - * configuration, with all the fields being optional. - * - * This operation can only create configurations for use in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfiguration( - parameters?: Parameters.CreateFieldConfiguration, - callback?: never, - ): Promise; - async createFieldConfiguration( - parameters?: Parameters.CreateFieldConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/fieldconfiguration', - method: 'POST', - data: { - name: parameters?.name, - description: parameters?.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a field configuration. The name and the description provided in the request override the existing values. - * - * This operation can only update configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfiguration( - parameters: Parameters.UpdateFieldConfiguration, - callback: Callback, - ): Promise; - /** - * Updates a field configuration. The name and the description provided in the request override the existing values. - * - * This operation can only update configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfiguration( - parameters: Parameters.UpdateFieldConfiguration, - callback?: never, - ): Promise; - async updateFieldConfiguration( - parameters: Parameters.UpdateFieldConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/fieldconfiguration/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a field configuration. - * - * This operation can only delete configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfiguration( - parameters: Parameters.DeleteFieldConfiguration, - callback: Callback, - ): Promise; - /** - * Deletes a field configuration. - * - * This operation can only delete configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfiguration( - parameters: Parameters.DeleteFieldConfiguration, - callback?: never, - ): Promise; - async deleteFieldConfiguration( - parameters: Parameters.DeleteFieldConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/fieldconfiguration/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * fields for a configuration. - * - * Only the fields from configurations used in company-managed (classic) projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldConfigurationItems( - parameters: Parameters.GetFieldConfigurationItems, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * fields for a configuration. - * - * Only the fields from configurations used in company-managed (classic) projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldConfigurationItems( - parameters: Parameters.GetFieldConfigurationItems, - callback?: never, - ): Promise; - async getFieldConfigurationItems( - parameters: Parameters.GetFieldConfigurationItems, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/fieldconfiguration/${parameters.id}/fields`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates fields in a field configuration. The properties of the field configuration fields provided override the - * existing values. - * - * This operation can only update field configurations used in company-managed (classic) projects. - * - * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style - * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer - * (`autocomplete-renderer`). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationItems( - parameters: Parameters.UpdateFieldConfigurationItems, - callback: Callback, - ): Promise; - /** - * Updates fields in a field configuration. The properties of the field configuration fields provided override the - * existing values. - * - * This operation can only update field configurations used in company-managed (classic) projects. - * - * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style - * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer - * (`autocomplete-renderer`). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationItems( - parameters: Parameters.UpdateFieldConfigurationItems, - callback?: never, - ): Promise; - async updateFieldConfigurationItems( - parameters: Parameters.UpdateFieldConfigurationItems, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/fieldconfiguration/${parameters.id}/fields`, - method: 'PUT', - data: { - fieldConfigurationItems: parameters.fieldConfigurationItems, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field - * configuration schemes. - * - * Only field configuration schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllFieldConfigurationSchemes( - parameters: Parameters.GetAllFieldConfigurationSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field - * configuration schemes. - * - * Only field configuration schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllFieldConfigurationSchemes( - parameters?: Parameters.GetAllFieldConfigurationSchemes, - callback?: never, - ): Promise; - async getAllFieldConfigurationSchemes( - parameters?: Parameters.GetAllFieldConfigurationSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/fieldconfigurationscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a field configuration scheme. - * - * This operation can only create field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfigurationScheme( - parameters: Parameters.CreateFieldConfigurationScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates a field configuration scheme. - * - * This operation can only create field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfigurationScheme( - parameters?: Parameters.CreateFieldConfigurationScheme, - callback?: never, - ): Promise; - async createFieldConfigurationScheme( - parameters?: Parameters.CreateFieldConfigurationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/fieldconfigurationscheme', - method: 'POST', - data: { - name: parameters?.name, - description: parameters?.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field - * configuration issue type items. - * - * Only items used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldConfigurationSchemeMappings( - parameters: Parameters.GetFieldConfigurationSchemeMappings | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field - * configuration issue type items. - * - * Only items used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldConfigurationSchemeMappings( - parameters?: Parameters.GetFieldConfigurationSchemeMappings, - callback?: never, - ): Promise; - async getFieldConfigurationSchemeMappings( - parameters?: Parameters.GetFieldConfigurationSchemeMappings, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/fieldconfigurationscheme/mapping', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - fieldConfigurationSchemeId: parameters?.fieldConfigurationSchemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field - * configuration schemes and, for each scheme, a list of the projects that use it. - * - * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to - * the default field configuration scheme. - * - * Only field configuration schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldConfigurationSchemeProjectMapping( - parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field - * configuration schemes and, for each scheme, a list of the projects that use it. - * - * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to - * the default field configuration scheme. - * - * Only field configuration schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldConfigurationSchemeProjectMapping( - parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, - callback?: never, - ): Promise; - async getFieldConfigurationSchemeProjectMapping( - parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/fieldconfigurationscheme/project', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation - * assigns the default field configuration scheme. - * - * Field configuration schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignFieldConfigurationSchemeToProject( - parameters: Parameters.AssignFieldConfigurationSchemeToProject | undefined, - callback: Callback, - ): Promise; - /** - * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation - * assigns the default field configuration scheme. - * - * Field configuration schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignFieldConfigurationSchemeToProject( - parameters?: Parameters.AssignFieldConfigurationSchemeToProject, - callback?: never, - ): Promise; - async assignFieldConfigurationSchemeToProject( - parameters?: Parameters.AssignFieldConfigurationSchemeToProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/fieldconfigurationscheme/project', - method: 'PUT', - data: { - fieldConfigurationSchemeId: parameters?.fieldConfigurationSchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a field configuration scheme. - * - * This operation can only update field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationScheme( - parameters: Parameters.UpdateFieldConfigurationScheme, - callback: Callback, - ): Promise; - /** - * Updates a field configuration scheme. - * - * This operation can only update field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationScheme( - parameters: Parameters.UpdateFieldConfigurationScheme, - callback?: never, - ): Promise; - async updateFieldConfigurationScheme( - parameters: Parameters.UpdateFieldConfigurationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a field configuration scheme. - * - * This operation can only delete field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfigurationScheme( - parameters: Parameters.DeleteFieldConfigurationScheme, - callback: Callback, - ): Promise; - /** - * Deletes a field configuration scheme. - * - * This operation can only delete field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfigurationScheme( - parameters: Parameters.DeleteFieldConfigurationScheme, - callback?: never, - ): Promise; - async deleteFieldConfigurationScheme( - parameters: Parameters.DeleteFieldConfigurationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns issue types to field configurations on field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setFieldConfigurationSchemeMapping( - parameters: Parameters.SetFieldConfigurationSchemeMapping, - callback: Callback, - ): Promise; - /** - * Assigns issue types to field configurations on field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setFieldConfigurationSchemeMapping( - parameters: Parameters.SetFieldConfigurationSchemeMapping, - callback?: never, - ): Promise; - async setFieldConfigurationSchemeMapping( - parameters: Parameters.SetFieldConfigurationSchemeMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}/mapping`, - method: 'PUT', - data: { - mappings: parameters.mappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes issue types from the field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromGlobalFieldConfigurationScheme( - parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, - callback: Callback, - ): Promise; - /** - * Removes issue types from the field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromGlobalFieldConfigurationScheme( - parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, - callback?: never, - ): Promise; - async removeIssueTypesFromGlobalFieldConfigurationScheme( - parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}/mapping/delete`, - method: 'POST', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueFields.mts b/src/version3/issueFields.mts new file mode 100644 index 000000000..9d3d36aa6 --- /dev/null +++ b/src/version3/issueFields.mts @@ -0,0 +1,319 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueFields { + constructor(private client: Client) {} + + /** + * Returns system and custom issue fields according to the following rules: + * + * - Fields that cannot be added to the issue navigator are always returned. + * - Fields that cannot be placed on an issue screen are always returned. + * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking + * fields, subtasks, votes, and watches. + * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the + * field is used in at least one project that the user has _Browse Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for.) + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getFields(callback: Callback): Promise; + /** + * Returns system and custom issue fields according to the following rules: + * + * - Fields that cannot be added to the issue navigator are always returned. + * - Fields that cannot be placed on an issue screen are always returned. + * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking + * fields, subtasks, votes, and watches. + * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the + * field is used in at least one project that the user has _Browse Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for.) + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getFields(callback?: never): Promise; + async getFields(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/field', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a custom field. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomField( + parameters: Parameters.CreateCustomField, + callback: Callback, + ): Promise; + /** + * Creates a custom field. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomField( + parameters: Parameters.CreateCustomField, + callback?: never, + ): Promise; + async createCustomField( + parameters: Parameters.CreateCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/field', + method: 'POST', + data: { + description: parameters.description, + name: parameters.name, + searcherKey: parameters.searcherKey, + type: parameters.type, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of fields + * for Classic Jira projects. The list can include: + * + * - All fields + * - Specific fields, by defining `id` + * - Fields that contain a string in the field name or description, by defining `query` + * - Specific fields that contain a string in the field name or description, by defining `id` and `query` + * + * Only custom fields can be queried, `type` must be set to `custom`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldsPaginated( + parameters: Parameters.GetFieldsPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of fields + * for Classic Jira projects. The list can include: + * + * - All fields + * - Specific fields, by defining `id` + * - Fields that contain a string in the field name or description, by defining `query` + * - Specific fields that contain a string in the field name or description, by defining `id` and `query` + * + * Only custom fields can be queried, `type` must be set to `custom`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldsPaginated( + parameters?: Parameters.GetFieldsPaginated, + callback?: never, + ): Promise; + async getFieldsPaginated( + parameters?: Parameters.GetFieldsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/field/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + type: parameters?.type, + id: parameters?.id, + query: parameters?.query, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of fields + * in the trash. The list may be restricted to fields whose field name or description partially match a string. + * + * Only custom fields can be queried, `type` must be set to `custom`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getTrashedFieldsPaginated( + parameters: Parameters.GetTrashedFieldsPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of fields + * in the trash. The list may be restricted to fields whose field name or description partially match a string. + * + * Only custom fields can be queried, `type` must be set to `custom`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getTrashedFieldsPaginated( + parameters?: Parameters.GetTrashedFieldsPaginated, + callback?: never, + ): Promise; + async getTrashedFieldsPaginated( + parameters?: Parameters.GetTrashedFieldsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/field/search/trashed', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + query: parameters?.query, + expand: parameters?.expand, + orderBy: parameters?.orderBy, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a custom field. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomField(parameters: Parameters.UpdateCustomField, callback: Callback): Promise; + /** + * Updates a custom field. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomField(parameters: Parameters.UpdateCustomField, callback?: never): Promise; + async updateCustomField( + parameters: Parameters.UpdateCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}`, + method: 'PUT', + data: { + description: parameters.description, + name: parameters.name, + searcherKey: parameters.searcherKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom + * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomField(parameters: Parameters.DeleteCustomField, callback: Callback): Promise; + /** + * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom + * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomField(parameters: Parameters.DeleteCustomField, callback?: never): Promise; + async deleteCustomField( + parameters: Parameters.DeleteCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) + * for more information on trashing and deleting custom fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async restoreCustomField( + parameters: Parameters.RestoreCustomField, + callback: Callback, + ): Promise; + /** + * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) + * for more information on trashing and deleting custom fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async restoreCustomField(parameters: Parameters.RestoreCustomField, callback?: never): Promise; + async restoreCustomField( + parameters: Parameters.RestoreCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.id}/restore`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for + * more information on trashing and deleting custom fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async trashCustomField(parameters: Parameters.TrashCustomField, callback: Callback): Promise; + /** + * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for + * more information on trashing and deleting custom fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async trashCustomField(parameters: Parameters.TrashCustomField, callback?: never): Promise; + async trashCustomField( + parameters: Parameters.TrashCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.id}/trash`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueFields.ts b/src/version3/issueFields.ts deleted file mode 100644 index 2cf542c93..000000000 --- a/src/version3/issueFields.ts +++ /dev/null @@ -1,319 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueFields { - constructor(private client: Client) {} - - /** - * Returns system and custom issue fields according to the following rules: - * - * - Fields that cannot be added to the issue navigator are always returned. - * - Fields that cannot be placed on an issue screen are always returned. - * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking - * fields, subtasks, votes, and watches. - * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the - * field is used in at least one project that the user has _Browse Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for.) - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getFields(callback: Callback): Promise; - /** - * Returns system and custom issue fields according to the following rules: - * - * - Fields that cannot be added to the issue navigator are always returned. - * - Fields that cannot be placed on an issue screen are always returned. - * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking - * fields, subtasks, votes, and watches. - * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the - * field is used in at least one project that the user has _Browse Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for.) - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getFields(callback?: never): Promise; - async getFields(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/field', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomField( - parameters: Parameters.CreateCustomField, - callback: Callback, - ): Promise; - /** - * Creates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomField( - parameters: Parameters.CreateCustomField, - callback?: never, - ): Promise; - async createCustomField( - parameters: Parameters.CreateCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/field', - method: 'POST', - data: { - description: parameters.description, - name: parameters.name, - searcherKey: parameters.searcherKey, - type: parameters.type, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of fields - * for Classic Jira projects. The list can include: - * - * - All fields - * - Specific fields, by defining `id` - * - Fields that contain a string in the field name or description, by defining `query` - * - Specific fields that contain a string in the field name or description, by defining `id` and `query` - * - * Only custom fields can be queried, `type` must be set to `custom`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldsPaginated( - parameters: Parameters.GetFieldsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of fields - * for Classic Jira projects. The list can include: - * - * - All fields - * - Specific fields, by defining `id` - * - Fields that contain a string in the field name or description, by defining `query` - * - Specific fields that contain a string in the field name or description, by defining `id` and `query` - * - * Only custom fields can be queried, `type` must be set to `custom`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldsPaginated( - parameters?: Parameters.GetFieldsPaginated, - callback?: never, - ): Promise; - async getFieldsPaginated( - parameters?: Parameters.GetFieldsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/field/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - type: parameters?.type, - id: parameters?.id, - query: parameters?.query, - orderBy: parameters?.orderBy, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of fields - * in the trash. The list may be restricted to fields whose field name or description partially match a string. - * - * Only custom fields can be queried, `type` must be set to `custom`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getTrashedFieldsPaginated( - parameters: Parameters.GetTrashedFieldsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of fields - * in the trash. The list may be restricted to fields whose field name or description partially match a string. - * - * Only custom fields can be queried, `type` must be set to `custom`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getTrashedFieldsPaginated( - parameters?: Parameters.GetTrashedFieldsPaginated, - callback?: never, - ): Promise; - async getTrashedFieldsPaginated( - parameters?: Parameters.GetTrashedFieldsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/field/search/trashed', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - query: parameters?.query, - expand: parameters?.expand, - orderBy: parameters?.orderBy, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomField(parameters: Parameters.UpdateCustomField, callback: Callback): Promise; - /** - * Updates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomField(parameters: Parameters.UpdateCustomField, callback?: never): Promise; - async updateCustomField( - parameters: Parameters.UpdateCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}`, - method: 'PUT', - data: { - description: parameters.description, - name: parameters.name, - searcherKey: parameters.searcherKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom - * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomField(parameters: Parameters.DeleteCustomField, callback: Callback): Promise; - /** - * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom - * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomField(parameters: Parameters.DeleteCustomField, callback?: never): Promise; - async deleteCustomField( - parameters: Parameters.DeleteCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) - * for more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async restoreCustomField( - parameters: Parameters.RestoreCustomField, - callback: Callback, - ): Promise; - /** - * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) - * for more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async restoreCustomField(parameters: Parameters.RestoreCustomField, callback?: never): Promise; - async restoreCustomField( - parameters: Parameters.RestoreCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.id}/restore`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for - * more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async trashCustomField(parameters: Parameters.TrashCustomField, callback: Callback): Promise; - /** - * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for - * more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async trashCustomField(parameters: Parameters.TrashCustomField, callback?: never): Promise; - async trashCustomField( - parameters: Parameters.TrashCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.id}/trash`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueLinkTypes.mts b/src/version3/issueLinkTypes.mts new file mode 100644 index 000000000..7e39825ff --- /dev/null +++ b/src/version3/issueLinkTypes.mts @@ -0,0 +1,198 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueLinkTypes { + constructor(private client: Client) {} + + /** + * Returns a list of all issue link types. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. + */ + async getIssueLinkTypes(callback: Callback): Promise; + /** + * Returns a list of all issue link types. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. + */ + async getIssueLinkTypes(callback?: never): Promise; + async getIssueLinkTypes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issueLinkType', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The + * issue link type consists of a name and descriptions for a link's inward and outward relationships. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueLinkType( + parameters: Parameters.CreateIssueLinkType, + callback: Callback, + ): Promise; + /** + * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The + * issue link type consists of a name and descriptions for a link's inward and outward relationships. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueLinkType( + parameters: Parameters.CreateIssueLinkType, + callback?: never, + ): Promise; + async createIssueLinkType( + parameters: Parameters.CreateIssueLinkType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issueLinkType', + method: 'POST', + data: { + id: parameters.id, + inward: parameters.inward, + name: parameters.name, + outward: parameters.outward, + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. + */ + async getIssueLinkType( + parameters: Parameters.GetIssueLinkType, + callback: Callback, + ): Promise; + /** + * Returns an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. + */ + async getIssueLinkType( + parameters: Parameters.GetIssueLinkType, + callback?: never, + ): Promise; + async getIssueLinkType( + parameters: Parameters.GetIssueLinkType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issueLinkType/${parameters.issueLinkTypeId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueLinkType( + parameters: Parameters.UpdateIssueLinkType, + callback: Callback, + ): Promise; + /** + * Updates an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueLinkType( + parameters: Parameters.UpdateIssueLinkType, + callback?: never, + ): Promise; + async updateIssueLinkType( + parameters: Parameters.UpdateIssueLinkType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issueLinkType/${parameters.issueLinkTypeId}`, + method: 'PUT', + data: { + id: parameters.id, + inward: parameters.inward, + name: parameters.name, + outward: parameters.outward, + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueLinkType(parameters: Parameters.DeleteIssueLinkType, callback: Callback): Promise; + /** + * Deletes an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueLinkType(parameters: Parameters.DeleteIssueLinkType, callback?: never): Promise; + async deleteIssueLinkType( + parameters: Parameters.DeleteIssueLinkType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issueLinkType/${parameters.issueLinkTypeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueLinkTypes.ts b/src/version3/issueLinkTypes.ts deleted file mode 100644 index 79be5b5d9..000000000 --- a/src/version3/issueLinkTypes.ts +++ /dev/null @@ -1,198 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueLinkTypes { - constructor(private client: Client) {} - - /** - * Returns a list of all issue link types. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. - */ - async getIssueLinkTypes(callback: Callback): Promise; - /** - * Returns a list of all issue link types. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. - */ - async getIssueLinkTypes(callback?: never): Promise; - async getIssueLinkTypes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issueLinkType', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The - * issue link type consists of a name and descriptions for a link's inward and outward relationships. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueLinkType( - parameters: Parameters.CreateIssueLinkType, - callback: Callback, - ): Promise; - /** - * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The - * issue link type consists of a name and descriptions for a link's inward and outward relationships. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueLinkType( - parameters: Parameters.CreateIssueLinkType, - callback?: never, - ): Promise; - async createIssueLinkType( - parameters: Parameters.CreateIssueLinkType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issueLinkType', - method: 'POST', - data: { - id: parameters.id, - inward: parameters.inward, - name: parameters.name, - outward: parameters.outward, - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. - */ - async getIssueLinkType( - parameters: Parameters.GetIssueLinkType, - callback: Callback, - ): Promise; - /** - * Returns an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. - */ - async getIssueLinkType( - parameters: Parameters.GetIssueLinkType, - callback?: never, - ): Promise; - async getIssueLinkType( - parameters: Parameters.GetIssueLinkType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issueLinkType/${parameters.issueLinkTypeId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueLinkType( - parameters: Parameters.UpdateIssueLinkType, - callback: Callback, - ): Promise; - /** - * Updates an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueLinkType( - parameters: Parameters.UpdateIssueLinkType, - callback?: never, - ): Promise; - async updateIssueLinkType( - parameters: Parameters.UpdateIssueLinkType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issueLinkType/${parameters.issueLinkTypeId}`, - method: 'PUT', - data: { - id: parameters.id, - inward: parameters.inward, - name: parameters.name, - outward: parameters.outward, - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueLinkType(parameters: Parameters.DeleteIssueLinkType, callback: Callback): Promise; - /** - * Deletes an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueLinkType(parameters: Parameters.DeleteIssueLinkType, callback?: never): Promise; - async deleteIssueLinkType( - parameters: Parameters.DeleteIssueLinkType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issueLinkType/${parameters.issueLinkTypeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueLinks.mts b/src/version3/issueLinks.mts new file mode 100644 index 000000000..bbb86747c --- /dev/null +++ b/src/version3/issueLinks.mts @@ -0,0 +1,149 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueLinks { + constructor(private client: Client) {} + + /** + * Creates a link between two issues. Use this operation to indicate a relationship between two issues and optionally + * add a comment to the from (outward) issue. To use this resource the site must have [Issue + * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use + * `https://your-domain.atlassian.net/rest/api/3/issue/[linked issue key]?fields=issuelinks`. + * + * If the link request duplicates a link, the response indicates that the issue link was created. If the request + * included a comment, the comment is added. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the issues to be linked, + * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from + * (outward) issue, + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async linkIssues(parameters: Parameters.LinkIssues | undefined, callback: Callback): Promise; + /** + * Creates a link between two issues. Use this operation to indicate a relationship between two issues and optionally + * add a comment to the from (outward) issue. To use this resource the site must have [Issue + * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use + * `https://your-domain.atlassian.net/rest/api/3/issue/[linked issue key]?fields=issuelinks`. + * + * If the link request duplicates a link, the response indicates that the issue link was created. If the request + * included a comment, the comment is added. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the issues to be linked, + * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from + * (outward) issue, + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async linkIssues(parameters?: Parameters.LinkIssues, callback?: never): Promise; + async linkIssues(parameters?: Parameters.LinkIssues, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issueLink', + method: 'POST', + data: { + type: parameters?.type, + inwardIssue: parameters?.inwardIssue, + outwardIssue: parameters?.outwardIssue, + comment: parameters?.comment, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue link. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the linked issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. + */ + async getIssueLink(parameters: Parameters.GetIssueLink, callback: Callback): Promise; + /** + * Returns an issue link. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the linked issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. + */ + async getIssueLink(parameters: Parameters.GetIssueLink, callback?: never): Promise; + async getIssueLink( + parameters: Parameters.GetIssueLink, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issueLink/${parameters.linkId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue link. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the + * issues in the link. + * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects + * containing issues in the link. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. + */ + async deleteIssueLink(parameters: Parameters.DeleteIssueLink, callback: Callback): Promise; + /** + * Deletes an issue link. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the + * issues in the link. + * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects + * containing issues in the link. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. + */ + async deleteIssueLink(parameters: Parameters.DeleteIssueLink, callback?: never): Promise; + async deleteIssueLink(parameters: Parameters.DeleteIssueLink, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issueLink/${parameters.linkId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueLinks.ts b/src/version3/issueLinks.ts deleted file mode 100644 index 4eda12705..000000000 --- a/src/version3/issueLinks.ts +++ /dev/null @@ -1,149 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueLinks { - constructor(private client: Client) {} - - /** - * Creates a link between two issues. Use this operation to indicate a relationship between two issues and optionally - * add a comment to the from (outward) issue. To use this resource the site must have [Issue - * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use - * `https://your-domain.atlassian.net/rest/api/3/issue/[linked issue key]?fields=issuelinks`. - * - * If the link request duplicates a link, the response indicates that the issue link was created. If the request - * included a comment, the comment is added. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the issues to be linked, - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from - * (outward) issue, - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async linkIssues(parameters: Parameters.LinkIssues | undefined, callback: Callback): Promise; - /** - * Creates a link between two issues. Use this operation to indicate a relationship between two issues and optionally - * add a comment to the from (outward) issue. To use this resource the site must have [Issue - * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use - * `https://your-domain.atlassian.net/rest/api/3/issue/[linked issue key]?fields=issuelinks`. - * - * If the link request duplicates a link, the response indicates that the issue link was created. If the request - * included a comment, the comment is added. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the issues to be linked, - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from - * (outward) issue, - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async linkIssues(parameters?: Parameters.LinkIssues, callback?: never): Promise; - async linkIssues(parameters?: Parameters.LinkIssues, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issueLink', - method: 'POST', - data: { - type: parameters?.type, - inwardIssue: parameters?.inwardIssue, - outwardIssue: parameters?.outwardIssue, - comment: parameters?.comment, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the linked issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async getIssueLink(parameters: Parameters.GetIssueLink, callback: Callback): Promise; - /** - * Returns an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the linked issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async getIssueLink(parameters: Parameters.GetIssueLink, callback?: never): Promise; - async getIssueLink( - parameters: Parameters.GetIssueLink, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issueLink/${parameters.linkId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the - * issues in the link. - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects - * containing issues in the link. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async deleteIssueLink(parameters: Parameters.DeleteIssueLink, callback: Callback): Promise; - /** - * Deletes an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the - * issues in the link. - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects - * containing issues in the link. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async deleteIssueLink(parameters: Parameters.DeleteIssueLink, callback?: never): Promise; - async deleteIssueLink(parameters: Parameters.DeleteIssueLink, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issueLink/${parameters.linkId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueNavigatorSettings.mts b/src/version3/issueNavigatorSettings.mts new file mode 100644 index 000000000..5f4d3280a --- /dev/null +++ b/src/version3/issueNavigatorSettings.mts @@ -0,0 +1,76 @@ +import * as Models from './models/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { RequestConfig } from '../requestConfig.mjs'; + +export class IssueNavigatorSettings { + constructor(private client: Client) {} + + /** + * Returns the default issue navigator columns. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueNavigatorDefaultColumns(callback: Callback): Promise; + /** + * Returns the default issue navigator columns. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueNavigatorDefaultColumns(callback?: never): Promise; + async getIssueNavigatorDefaultColumns(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/settings/columns', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default issue navigator columns. + * + * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple + * columns, pass multiple `columns` parameters. For example, in curl: + * + * `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/3/settings/columns` + * + * If no column details are sent, then all default columns are removed. + * + * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue + * columns using [Get fields](#api-rest-api-3-field-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setIssueNavigatorDefaultColumns(callback: Callback): Promise; + /** + * Sets the default issue navigator columns. + * + * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple + * columns, pass multiple `columns` parameters. For example, in curl: + * + * `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/3/settings/columns` + * + * If no column details are sent, then all default columns are removed. + * + * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue + * columns using [Get fields](#api-rest-api-3-field-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setIssueNavigatorDefaultColumns(callback?: never): Promise; + async setIssueNavigatorDefaultColumns(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/settings/columns', + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueNavigatorSettings.ts b/src/version3/issueNavigatorSettings.ts deleted file mode 100644 index 3ffca8e71..000000000 --- a/src/version3/issueNavigatorSettings.ts +++ /dev/null @@ -1,76 +0,0 @@ -import * as Models from './models/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueNavigatorSettings { - constructor(private client: Client) {} - - /** - * Returns the default issue navigator columns. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueNavigatorDefaultColumns(callback: Callback): Promise; - /** - * Returns the default issue navigator columns. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueNavigatorDefaultColumns(callback?: never): Promise; - async getIssueNavigatorDefaultColumns(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/settings/columns', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default issue navigator columns. - * - * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple - * columns, pass multiple `columns` parameters. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/3/settings/columns` - * - * If no column details are sent, then all default columns are removed. - * - * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue - * columns using [Get fields](#api-rest-api-3-field-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueNavigatorDefaultColumns(callback: Callback): Promise; - /** - * Sets the default issue navigator columns. - * - * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple - * columns, pass multiple `columns` parameters. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/3/settings/columns` - * - * If no column details are sent, then all default columns are removed. - * - * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue - * columns using [Get fields](#api-rest-api-3-field-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueNavigatorDefaultColumns(callback?: never): Promise; - async setIssueNavigatorDefaultColumns(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/settings/columns', - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueNotificationSchemes.mts b/src/version3/issueNotificationSchemes.mts new file mode 100644 index 000000000..c6706a7fc --- /dev/null +++ b/src/version3/issueNotificationSchemes.mts @@ -0,0 +1,281 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueNotificationSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. + * + * _Note that you should allow for events without recipients to appear in responses._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with a notification scheme for it to be returned. + */ + async getNotificationSchemes( + parameters: Parameters.GetNotificationSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. + * + * _Note that you should allow for events without recipients to appear in responses._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with a notification scheme for it to be returned. + */ + async getNotificationSchemes( + parameters?: Parameters.GetNotificationSchemes, + callback?: never, + ): Promise; + async getNotificationSchemes( + parameters?: Parameters.GetNotificationSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/notificationscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + projectId: parameters?.projectId, + onlyDefault: parameters?.onlyDefault, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createNotificationScheme( + parameters: Parameters.CreateNotificationScheme, + callback: Callback, + ): Promise; + /** + * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createNotificationScheme( + parameters: Parameters.CreateNotificationScheme, + callback?: never, + ): Promise; + async createNotificationScheme( + parameters: Parameters.CreateNotificationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/notificationscheme', + method: 'POST', + data: { + description: parameters.description, + name: parameters.name, + notificationSchemeEvents: parameters.notificationSchemeEvents, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) mapping of + * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or + * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only + * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a + * default notification scheme. The mappings are ordered by projectId. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getNotificationSchemeToProjectMappings( + parameters: Parameters.GetNotificationSchemeToProjectMappings | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) mapping of + * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or + * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only + * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a + * default notification scheme. The mappings are ordered by projectId. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getNotificationSchemeToProjectMappings( + parameters?: Parameters.GetNotificationSchemeToProjectMappings, + callback?: never, + ): Promise; + async getNotificationSchemeToProjectMappings( + parameters?: Parameters.GetNotificationSchemeToProjectMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/notificationscheme/project', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + notificationSchemeId: parameters?.notificationSchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the + * recipients who will receive notifications for those events. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with the notification scheme. + */ + async getNotificationScheme( + parameters: Parameters.GetNotificationScheme | string, + callback: Callback, + ): Promise; + /** + * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the + * recipients who will receive notifications for those events. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with the notification scheme. + */ + async getNotificationScheme( + parameters: Parameters.GetNotificationScheme | string, + callback?: never, + ): Promise; + async getNotificationScheme( + parameters: Parameters.GetNotificationScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/notificationscheme/${id}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a notification scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateNotificationScheme( + parameters: Parameters.UpdateNotificationScheme, + callback: Callback, + ): Promise; + /** + * Updates a notification scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateNotificationScheme( + parameters: Parameters.UpdateNotificationScheme, + callback?: never, + ): Promise; + async updateNotificationScheme( + parameters: Parameters.UpdateNotificationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/notificationscheme/${parameters.id}`, + method: 'PUT', + data: { + description: parameters.description, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a notification scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteNotificationScheme( + parameters: Parameters.DeleteNotificationScheme, + callback: Callback, + ): Promise; + /** + * Deletes a notification scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteNotificationScheme( + parameters: Parameters.DeleteNotificationScheme, + callback?: never, + ): Promise; + async deleteNotificationScheme( + parameters: Parameters.DeleteNotificationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/notificationscheme/${parameters.notificationSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a notification from a notification scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeNotificationFromNotificationScheme( + parameters: Parameters.RemoveNotificationFromNotificationScheme, + callback: Callback, + ): Promise; + /** + * Removes a notification from a notification scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeNotificationFromNotificationScheme( + parameters: Parameters.RemoveNotificationFromNotificationScheme, + callback?: never, + ): Promise; + async removeNotificationFromNotificationScheme( + parameters: Parameters.RemoveNotificationFromNotificationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/notificationscheme/${parameters.notificationSchemeId}/notification/${parameters.notificationId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueNotificationSchemes.ts b/src/version3/issueNotificationSchemes.ts deleted file mode 100644 index e3916df29..000000000 --- a/src/version3/issueNotificationSchemes.ts +++ /dev/null @@ -1,281 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueNotificationSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. - * - * _Note that you should allow for events without recipients to appear in responses._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with a notification scheme for it to be returned. - */ - async getNotificationSchemes( - parameters: Parameters.GetNotificationSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. - * - * _Note that you should allow for events without recipients to appear in responses._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with a notification scheme for it to be returned. - */ - async getNotificationSchemes( - parameters?: Parameters.GetNotificationSchemes, - callback?: never, - ): Promise; - async getNotificationSchemes( - parameters?: Parameters.GetNotificationSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/notificationscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - projectId: parameters?.projectId, - onlyDefault: parameters?.onlyDefault, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, - callback: Callback, - ): Promise; - /** - * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, - callback?: never, - ): Promise; - async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/notificationscheme', - method: 'POST', - data: { - description: parameters.description, - name: parameters.name, - notificationSchemeEvents: parameters.notificationSchemeEvents, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) mapping of - * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or - * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only - * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a - * default notification scheme. The mappings are ordered by projectId. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getNotificationSchemeToProjectMappings( - parameters: Parameters.GetNotificationSchemeToProjectMappings | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) mapping of - * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or - * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only - * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a - * default notification scheme. The mappings are ordered by projectId. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getNotificationSchemeToProjectMappings( - parameters?: Parameters.GetNotificationSchemeToProjectMappings, - callback?: never, - ): Promise; - async getNotificationSchemeToProjectMappings( - parameters?: Parameters.GetNotificationSchemeToProjectMappings, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/notificationscheme/project', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - notificationSchemeId: parameters?.notificationSchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the - * recipients who will receive notifications for those events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with the notification scheme. - */ - async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, - callback: Callback, - ): Promise; - /** - * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the - * recipients who will receive notifications for those events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with the notification scheme. - */ - async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, - callback?: never, - ): Promise; - async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/notificationscheme/${id}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a notification scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateNotificationScheme( - parameters: Parameters.UpdateNotificationScheme, - callback: Callback, - ): Promise; - /** - * Updates a notification scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateNotificationScheme( - parameters: Parameters.UpdateNotificationScheme, - callback?: never, - ): Promise; - async updateNotificationScheme( - parameters: Parameters.UpdateNotificationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/notificationscheme/${parameters.id}`, - method: 'PUT', - data: { - description: parameters.description, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a notification scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteNotificationScheme( - parameters: Parameters.DeleteNotificationScheme, - callback: Callback, - ): Promise; - /** - * Deletes a notification scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteNotificationScheme( - parameters: Parameters.DeleteNotificationScheme, - callback?: never, - ): Promise; - async deleteNotificationScheme( - parameters: Parameters.DeleteNotificationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/notificationscheme/${parameters.notificationSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a notification from a notification scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeNotificationFromNotificationScheme( - parameters: Parameters.RemoveNotificationFromNotificationScheme, - callback: Callback, - ): Promise; - /** - * Removes a notification from a notification scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeNotificationFromNotificationScheme( - parameters: Parameters.RemoveNotificationFromNotificationScheme, - callback?: never, - ): Promise; - async removeNotificationFromNotificationScheme( - parameters: Parameters.RemoveNotificationFromNotificationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/notificationscheme/${parameters.notificationSchemeId}/notification/${parameters.notificationId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issuePriorities.mts b/src/version3/issuePriorities.mts new file mode 100644 index 000000000..7b62a3d51 --- /dev/null +++ b/src/version3/issuePriorities.mts @@ -0,0 +1,236 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { paramSerializer } from '../paramSerializer.mjs'; +import { RequestConfig } from '../requestConfig.mjs'; + +export class IssuePriorities { + constructor(private client: Client) {} + + /** + * Returns the list of all issue priorities. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPriorities(callback: Callback): Promise; + /** + * Returns the list of all issue priorities. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPriorities(callback?: never): Promise; + async getPriorities(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priority', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPriority( + parameters: Parameters.CreatePriority, + callback: Callback, + ): Promise; + /** + * Creates an issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPriority(parameters: Parameters.CreatePriority, callback?: never): Promise; + async createPriority( + parameters: Parameters.CreatePriority, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priority', + method: 'POST', + data: { + description: parameters.description, + iconUrl: parameters.iconUrl, + name: parameters.name, + statusColor: parameters.statusColor, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets default issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultPriority( + parameters: Parameters.SetDefaultPriority | undefined, + callback: Callback, + ): Promise; + /** + * Sets default issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultPriority(parameters?: Parameters.SetDefaultPriority, callback?: never): Promise; + async setDefaultPriority( + parameters?: Parameters.SetDefaultPriority, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priority/default', + method: 'PUT', + data: { + id: parameters?.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the order of issue priorities. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async movePriorities(parameters: Parameters.MovePriorities, callback: Callback): Promise; + /** + * Changes the order of issue priorities. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async movePriorities(parameters: Parameters.MovePriorities, callback?: never): Promise; + async movePriorities(parameters: Parameters.MovePriorities, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priority/move', + method: 'PUT', + data: { + after: parameters.after, + ids: parameters.ids, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: + * + * - A list of priority IDs. Any invalid priority IDs are ignored. + * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project + * IDs are ignored. + * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, + * as there is no concept of default priorities in team-managed projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async searchPriorities( + parameters: Parameters.SearchPriorities | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: + * + * - A list of priority IDs. Any invalid priority IDs are ignored. + * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project + * IDs are ignored. + * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, + * as there is no concept of default priorities in team-managed projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async searchPriorities( + parameters?: Parameters.SearchPriorities, + callback?: never, + ): Promise; + async searchPriorities( + parameters?: Parameters.SearchPriorities, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priority/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + projectId: paramSerializer('projectId', parameters?.projectId), + onlyDefault: parameters?.onlyDefault, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPriority(parameters: Parameters.GetPriority, callback: Callback): Promise; + /** + * Returns an issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPriority(parameters: Parameters.GetPriority, callback?: never): Promise; + async getPriority( + parameters: Parameters.GetPriority, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/priority/${parameters.id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updatePriority(parameters: Parameters.UpdatePriority, callback: Callback): Promise; + /** + * Updates an issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updatePriority(parameters: Parameters.UpdatePriority, callback?: never): Promise; + async updatePriority(parameters: Parameters.UpdatePriority, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/priority/${parameters.id}`, + method: 'PUT', + data: { + description: parameters.description, + iconUrl: parameters.iconUrl, + name: parameters.name, + statusColor: parameters.statusColor, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issuePriorities.ts b/src/version3/issuePriorities.ts deleted file mode 100644 index a17985ee5..000000000 --- a/src/version3/issuePriorities.ts +++ /dev/null @@ -1,236 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import { paramSerializer } from '../paramSerializer.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssuePriorities { - constructor(private client: Client) {} - - /** - * Returns the list of all issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriorities(callback: Callback): Promise; - /** - * Returns the list of all issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriorities(callback?: never): Promise; - async getPriorities(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/priority', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPriority( - parameters: Parameters.CreatePriority, - callback: Callback, - ): Promise; - /** - * Creates an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPriority(parameters: Parameters.CreatePriority, callback?: never): Promise; - async createPriority( - parameters: Parameters.CreatePriority, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/priority', - method: 'POST', - data: { - description: parameters.description, - iconUrl: parameters.iconUrl, - name: parameters.name, - statusColor: parameters.statusColor, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets default issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultPriority( - parameters: Parameters.SetDefaultPriority | undefined, - callback: Callback, - ): Promise; - /** - * Sets default issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultPriority(parameters?: Parameters.SetDefaultPriority, callback?: never): Promise; - async setDefaultPriority( - parameters?: Parameters.SetDefaultPriority, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/priority/default', - method: 'PUT', - data: { - id: parameters?.id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the order of issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async movePriorities(parameters: Parameters.MovePriorities, callback: Callback): Promise; - /** - * Changes the order of issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async movePriorities(parameters: Parameters.MovePriorities, callback?: never): Promise; - async movePriorities(parameters: Parameters.MovePriorities, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/priority/move', - method: 'PUT', - data: { - after: parameters.after, - ids: parameters.ids, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: - * - * - A list of priority IDs. Any invalid priority IDs are ignored. - * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project - * IDs are ignored. - * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, - * as there is no concept of default priorities in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchPriorities( - parameters: Parameters.SearchPriorities | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: - * - * - A list of priority IDs. Any invalid priority IDs are ignored. - * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project - * IDs are ignored. - * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, - * as there is no concept of default priorities in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchPriorities( - parameters?: Parameters.SearchPriorities, - callback?: never, - ): Promise; - async searchPriorities( - parameters?: Parameters.SearchPriorities, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/priority/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - projectId: paramSerializer('projectId', parameters?.projectId), - onlyDefault: parameters?.onlyDefault, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriority(parameters: Parameters.GetPriority, callback: Callback): Promise; - /** - * Returns an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriority(parameters: Parameters.GetPriority, callback?: never): Promise; - async getPriority( - parameters: Parameters.GetPriority, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/priority/${parameters.id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updatePriority(parameters: Parameters.UpdatePriority, callback: Callback): Promise; - /** - * Updates an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updatePriority(parameters: Parameters.UpdatePriority, callback?: never): Promise; - async updatePriority(parameters: Parameters.UpdatePriority, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/priority/${parameters.id}`, - method: 'PUT', - data: { - description: parameters.description, - iconUrl: parameters.iconUrl, - name: parameters.name, - statusColor: parameters.statusColor, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueProperties.mts b/src/version3/issueProperties.mts new file mode 100644 index 000000000..e2f8a9544 --- /dev/null +++ b/src/version3/issueProperties.mts @@ -0,0 +1,509 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueProperties { + constructor(private client: Client) {} + + /** + * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified + * along with up to 10,000 issues on which to set or update that list of entity properties. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum + * length of single issue property value is 32768 characters. This operation can be accessed anonymously. + * + * This operation is: + * + * - Transactional, either all properties are updated in all eligible issues or, when errors occur, no properties are + * updated. + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async bulkSetIssuesProperties( + parameters: Parameters.BulkSetIssuesProperties | undefined, + callback: Callback, + ): Promise; + /** + * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified + * along with up to 10,000 issues on which to set or update that list of entity properties. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum + * length of single issue property value is 32768 characters. This operation can be accessed anonymously. + * + * This operation is: + * + * - Transactional, either all properties are updated in all eligible issues or, when errors occur, no properties are + * updated. + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async bulkSetIssuesProperties( + parameters?: Parameters.BulkSetIssuesProperties, + callback?: never, + ): Promise; + async bulkSetIssuesProperties( + parameters?: Parameters.BulkSetIssuesProperties, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/properties', + method: 'POST', + data: { + entitiesIds: parameters?.entitiesIds, + properties: parameters?.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up + * to 100 issues included in the request. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. + * + * This operation is: + * + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * - Non-transactional. Updating some entities may fail. Such information will available in the task result. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async bulkSetIssuePropertiesByIssue( + parameters: Parameters.BulkSetIssuePropertiesByIssue | undefined, + callback: Callback, + ): Promise; + /** + * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up + * to 100 issues included in the request. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. + * + * This operation is: + * + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * - Non-transactional. Updating some entities may fail. Such information will available in the task result. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async bulkSetIssuePropertiesByIssue( + parameters?: Parameters.BulkSetIssuePropertiesByIssue, + callback?: never, + ): Promise; + async bulkSetIssuePropertiesByIssue( + parameters?: Parameters.BulkSetIssuePropertiesByIssue, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/properties/multi', + method: 'POST', + data: { + issues: parameters?.issues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets a property value on multiple issues. + * + * The value set can be a constant or determined by a [Jira + * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable + * with constant complexity when applied to a set of issues. Expressions must also comply with the + * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to + * all Jira expressions. + * + * The issues to be updated can be specified by a filter. + * + * The filter identifies issues eligible for update using these criteria: + * + * - `entityIds` Only issues from this list are eligible. + * - `currentValue` Only issues with the property set to this value are eligible. + * - `hasProperty`: + * + * - If _true_, only issues with the property are eligible. + * - If _false_, only issues without the property are eligible. + * + * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all + * criteria are eligible. + * + * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` + * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a + * value). + * + * The filter is optional. Without the filter all the issues visible to the user and where the user has the + * EDIT_ISSUES permission for the issue are considered eligible. + * + * This operation is: + * + * - Transactional, either all eligible issues are updated or, when errors occur, none are updated. + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + */ + async bulkSetIssueProperty( + parameters: Parameters.BulkSetIssueProperty, + callback: Callback, + ): Promise; + /** + * Sets a property value on multiple issues. + * + * The value set can be a constant or determined by a [Jira + * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable + * with constant complexity when applied to a set of issues. Expressions must also comply with the + * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to + * all Jira expressions. + * + * The issues to be updated can be specified by a filter. + * + * The filter identifies issues eligible for update using these criteria: + * + * - `entityIds` Only issues from this list are eligible. + * - `currentValue` Only issues with the property set to this value are eligible. + * - `hasProperty`: + * + * - If _true_, only issues with the property are eligible. + * - If _false_, only issues without the property are eligible. + * + * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all + * criteria are eligible. + * + * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` + * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a + * value). + * + * The filter is optional. Without the filter all the issues visible to the user and where the user has the + * EDIT_ISSUES permission for the issue are considered eligible. + * + * This operation is: + * + * - Transactional, either all eligible issues are updated or, when errors occur, none are updated. + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + */ + async bulkSetIssueProperty(parameters: Parameters.BulkSetIssueProperty, callback?: never): Promise; + async bulkSetIssueProperty( + parameters: Parameters.BulkSetIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/properties/${parameters.propertyKey}`, + method: 'PUT', + data: { + value: parameters.value, + expression: parameters.expression, + filter: parameters.filter, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. + * + * The criteria the filter used to identify eligible issues are: + * + * - `entityIds` Only issues from this list are eligible. + * - `currentValue` Only issues with the property set to this value are eligible. + * + * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are + * considered eligible. + * + * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES + * permission for the issue are considered eligible. + * + * This operation is: + * + * - Transactional, either the property is deleted from all eligible issues or, when errors occur, no properties are + * deleted. + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + */ + async bulkDeleteIssueProperty( + parameters: Parameters.BulkDeleteIssueProperty, + callback: Callback, + ): Promise; + /** + * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. + * + * The criteria the filter used to identify eligible issues are: + * + * - `entityIds` Only issues from this list are eligible. + * - `currentValue` Only issues with the property set to this value are eligible. + * + * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are + * considered eligible. + * + * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES + * permission for the issue are considered eligible. + * + * This operation is: + * + * - Transactional, either the property is deleted from all eligible issues or, when errors occur, no properties are + * deleted. + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + */ + async bulkDeleteIssueProperty( + parameters: Parameters.BulkDeleteIssueProperty, + callback?: never, + ): Promise; + async bulkDeleteIssueProperty( + parameters: Parameters.BulkDeleteIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/properties/${parameters.propertyKey}`, + method: 'DELETE', + data: { + entityIds: parameters.entityIds, + currentValue: parameters.currentValue, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the URLs and keys of an issue's properties. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Property details are only returned where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIssuePropertyKeys( + parameters: Parameters.GetIssuePropertyKeys, + callback: Callback, + ): Promise; + /** + * Returns the URLs and keys of an issue's properties. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Property details are only returned where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIssuePropertyKeys( + parameters: Parameters.GetIssuePropertyKeys, + callback?: never, + ): Promise; + async getIssuePropertyKeys( + parameters: Parameters.GetIssuePropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the key and value of an issue's property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIssueProperty( + parameters: Parameters.GetIssueProperty, + callback: Callback, + ): Promise; + /** + * Returns the key and value of an issue's property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIssueProperty( + parameters: Parameters.GetIssueProperty, + callback?: never, + ): Promise; + async getIssueProperty( + parameters: Parameters.GetIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of an issue's property. Use this resource to store custom data against an issue. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async setIssueProperty(parameters: Parameters.SetIssueProperty, callback: Callback): Promise; + /** + * Sets the value of an issue's property. Use this resource to store custom data against an issue. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async setIssueProperty(parameters: Parameters.SetIssueProperty, callback?: never): Promise; + async setIssueProperty( + parameters: Parameters.SetIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue's property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback: Callback): Promise; + /** + * Deletes an issue's property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback?: never): Promise; + async deleteIssueProperty( + parameters: Parameters.DeleteIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueProperties.ts b/src/version3/issueProperties.ts deleted file mode 100644 index 788126820..000000000 --- a/src/version3/issueProperties.ts +++ /dev/null @@ -1,509 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueProperties { - constructor(private client: Client) {} - - /** - * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified - * along with up to 10,000 issues on which to set or update that list of entity properties. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum - * length of single issue property value is 32768 characters. This operation can be accessed anonymously. - * - * This operation is: - * - * - Transactional, either all properties are updated in all eligible issues or, when errors occur, no properties are - * updated. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async bulkSetIssuesProperties( - parameters: Parameters.BulkSetIssuesProperties | undefined, - callback: Callback, - ): Promise; - /** - * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified - * along with up to 10,000 issues on which to set or update that list of entity properties. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum - * length of single issue property value is 32768 characters. This operation can be accessed anonymously. - * - * This operation is: - * - * - Transactional, either all properties are updated in all eligible issues or, when errors occur, no properties are - * updated. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async bulkSetIssuesProperties( - parameters?: Parameters.BulkSetIssuesProperties, - callback?: never, - ): Promise; - async bulkSetIssuesProperties( - parameters?: Parameters.BulkSetIssuesProperties, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/properties', - method: 'POST', - data: { - entitiesIds: parameters?.entitiesIds, - properties: parameters?.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up - * to 100 issues included in the request. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. - * - * This operation is: - * - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - Non-transactional. Updating some entities may fail. Such information will available in the task result. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async bulkSetIssuePropertiesByIssue( - parameters: Parameters.BulkSetIssuePropertiesByIssue | undefined, - callback: Callback, - ): Promise; - /** - * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up - * to 100 issues included in the request. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. - * - * This operation is: - * - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - Non-transactional. Updating some entities may fail. Such information will available in the task result. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async bulkSetIssuePropertiesByIssue( - parameters?: Parameters.BulkSetIssuePropertiesByIssue, - callback?: never, - ): Promise; - async bulkSetIssuePropertiesByIssue( - parameters?: Parameters.BulkSetIssuePropertiesByIssue, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/properties/multi', - method: 'POST', - data: { - issues: parameters?.issues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets a property value on multiple issues. - * - * The value set can be a constant or determined by a [Jira - * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable - * with constant complexity when applied to a set of issues. Expressions must also comply with the - * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to - * all Jira expressions. - * - * The issues to be updated can be specified by a filter. - * - * The filter identifies issues eligible for update using these criteria: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - `hasProperty`: - * - * - If _true_, only issues with the property are eligible. - * - If _false_, only issues without the property are eligible. - * - * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all - * criteria are eligible. - * - * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` - * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a - * value). - * - * The filter is optional. Without the filter all the issues visible to the user and where the user has the - * EDIT_ISSUES permission for the issue are considered eligible. - * - * This operation is: - * - * - Transactional, either all eligible issues are updated or, when errors occur, none are updated. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkSetIssueProperty( - parameters: Parameters.BulkSetIssueProperty, - callback: Callback, - ): Promise; - /** - * Sets a property value on multiple issues. - * - * The value set can be a constant or determined by a [Jira - * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable - * with constant complexity when applied to a set of issues. Expressions must also comply with the - * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to - * all Jira expressions. - * - * The issues to be updated can be specified by a filter. - * - * The filter identifies issues eligible for update using these criteria: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - `hasProperty`: - * - * - If _true_, only issues with the property are eligible. - * - If _false_, only issues without the property are eligible. - * - * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all - * criteria are eligible. - * - * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` - * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a - * value). - * - * The filter is optional. Without the filter all the issues visible to the user and where the user has the - * EDIT_ISSUES permission for the issue are considered eligible. - * - * This operation is: - * - * - Transactional, either all eligible issues are updated or, when errors occur, none are updated. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkSetIssueProperty(parameters: Parameters.BulkSetIssueProperty, callback?: never): Promise; - async bulkSetIssueProperty( - parameters: Parameters.BulkSetIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/properties/${parameters.propertyKey}`, - method: 'PUT', - data: { - value: parameters.value, - expression: parameters.expression, - filter: parameters.filter, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. - * - * The criteria the filter used to identify eligible issues are: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are - * considered eligible. - * - * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES - * permission for the issue are considered eligible. - * - * This operation is: - * - * - Transactional, either the property is deleted from all eligible issues or, when errors occur, no properties are - * deleted. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkDeleteIssueProperty( - parameters: Parameters.BulkDeleteIssueProperty, - callback: Callback, - ): Promise; - /** - * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. - * - * The criteria the filter used to identify eligible issues are: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are - * considered eligible. - * - * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES - * permission for the issue are considered eligible. - * - * This operation is: - * - * - Transactional, either the property is deleted from all eligible issues or, when errors occur, no properties are - * deleted. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkDeleteIssueProperty( - parameters: Parameters.BulkDeleteIssueProperty, - callback?: never, - ): Promise; - async bulkDeleteIssueProperty( - parameters: Parameters.BulkDeleteIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/properties/${parameters.propertyKey}`, - method: 'DELETE', - data: { - entityIds: parameters.entityIds, - currentValue: parameters.currentValue, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the URLs and keys of an issue's properties. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Property details are only returned where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssuePropertyKeys( - parameters: Parameters.GetIssuePropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns the URLs and keys of an issue's properties. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Property details are only returned where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssuePropertyKeys( - parameters: Parameters.GetIssuePropertyKeys, - callback?: never, - ): Promise; - async getIssuePropertyKeys( - parameters: Parameters.GetIssuePropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the key and value of an issue's property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssueProperty( - parameters: Parameters.GetIssueProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of an issue's property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssueProperty( - parameters: Parameters.GetIssueProperty, - callback?: never, - ): Promise; - async getIssueProperty( - parameters: Parameters.GetIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of an issue's property. Use this resource to store custom data against an issue. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async setIssueProperty(parameters: Parameters.SetIssueProperty, callback: Callback): Promise; - /** - * Sets the value of an issue's property. Use this resource to store custom data against an issue. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async setIssueProperty(parameters: Parameters.SetIssueProperty, callback?: never): Promise; - async setIssueProperty( - parameters: Parameters.SetIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue's property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback: Callback): Promise; - /** - * Deletes an issue's property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback?: never): Promise; - async deleteIssueProperty( - parameters: Parameters.DeleteIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueRemoteLinks.mts b/src/version3/issueRemoteLinks.mts new file mode 100644 index 000000000..26dae6a89 --- /dev/null +++ b/src/version3/issueRemoteLinks.mts @@ -0,0 +1,332 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueRemoteLinks { + constructor(private client: Client) {} + + /** + * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that + * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL + * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getRemoteIssueLinks( + parameters: Parameters.GetRemoteIssueLinks, + callback: Callback, + ): Promise; + /** + * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that + * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL + * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getRemoteIssueLinks( + parameters: Parameters.GetRemoteIssueLinks, + callback?: never, + ): Promise; + async getRemoteIssueLinks( + parameters: Parameters.GetRemoteIssueLinks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink`, + method: 'GET', + params: { + globalId: parameters.globalId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates or updates a remote issue link for an issue. + * + * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without + * values in the request are set to null. Otherwise, the remote issue link is created. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async createOrUpdateRemoteIssueLink( + parameters: Parameters.CreateOrUpdateRemoteIssueLink, + callback: Callback, + ): Promise; + /** + * Creates or updates a remote issue link for an issue. + * + * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without + * values in the request are set to null. Otherwise, the remote issue link is created. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async createOrUpdateRemoteIssueLink( + parameters: Parameters.CreateOrUpdateRemoteIssueLink, + callback?: never, + ): Promise; + async createOrUpdateRemoteIssueLink( + parameters: Parameters.CreateOrUpdateRemoteIssueLink, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink`, + method: 'POST', + data: { + globalId: parameters.globalId, + application: parameters.application, + relationship: parameters.relationship, + object: parameters.object, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL + * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is implemented, issue-level security + * permission to view the issue. + */ + async deleteRemoteIssueLinkByGlobalId( + parameters: Parameters.DeleteRemoteIssueLinkByGlobalId, + callback: Callback, + ): Promise; + /** + * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL + * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is implemented, issue-level security + * permission to view the issue. + */ + async deleteRemoteIssueLinkByGlobalId( + parameters: Parameters.DeleteRemoteIssueLinkByGlobalId, + callback?: never, + ): Promise; + async deleteRemoteIssueLinkByGlobalId( + parameters: Parameters.DeleteRemoteIssueLinkByGlobalId, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink`, + method: 'DELETE', + params: { + globalId: parameters.globalId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a remote issue link for an issue. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getRemoteIssueLinkById( + parameters: Parameters.GetRemoteIssueLinkById, + callback: Callback, + ): Promise; + /** + * Returns a remote issue link for an issue. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getRemoteIssueLinkById( + parameters: Parameters.GetRemoteIssueLinkById, + callback?: never, + ): Promise; + async getRemoteIssueLinkById( + parameters: Parameters.GetRemoteIssueLinkById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a remote issue link for an issue. + * + * Note: Fields without values in the request are set to null. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async updateRemoteIssueLink( + parameters: Parameters.UpdateRemoteIssueLink, + callback: Callback, + ): Promise; + /** + * Updates a remote issue link for an issue. + * + * Note: Fields without values in the request are set to null. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async updateRemoteIssueLink(parameters: Parameters.UpdateRemoteIssueLink, callback?: never): Promise; + async updateRemoteIssueLink( + parameters: Parameters.UpdateRemoteIssueLink, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, + method: 'PUT', + data: { + globalId: parameters.globalId, + application: parameters.application, + relationship: parameters.relationship, + object: parameters.object, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a remote issue link from an issue. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_, _Edit issues_, and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for the project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async deleteRemoteIssueLinkById( + parameters: Parameters.DeleteRemoteIssueLinkById, + callback: Callback, + ): Promise; + /** + * Deletes a remote issue link from an issue. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_, _Edit issues_, and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) + * for the project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async deleteRemoteIssueLinkById( + parameters: Parameters.DeleteRemoteIssueLinkById, + callback?: never, + ): Promise; + async deleteRemoteIssueLinkById( + parameters: Parameters.DeleteRemoteIssueLinkById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueRemoteLinks.ts b/src/version3/issueRemoteLinks.ts deleted file mode 100644 index cd930bc38..000000000 --- a/src/version3/issueRemoteLinks.ts +++ /dev/null @@ -1,332 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueRemoteLinks { - constructor(private client: Client) {} - - /** - * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that - * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getRemoteIssueLinks( - parameters: Parameters.GetRemoteIssueLinks, - callback: Callback, - ): Promise; - /** - * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that - * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getRemoteIssueLinks( - parameters: Parameters.GetRemoteIssueLinks, - callback?: never, - ): Promise; - async getRemoteIssueLinks( - parameters: Parameters.GetRemoteIssueLinks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink`, - method: 'GET', - params: { - globalId: parameters.globalId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates or updates a remote issue link for an issue. - * - * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without - * values in the request are set to null. Otherwise, the remote issue link is created. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async createOrUpdateRemoteIssueLink( - parameters: Parameters.CreateOrUpdateRemoteIssueLink, - callback: Callback, - ): Promise; - /** - * Creates or updates a remote issue link for an issue. - * - * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without - * values in the request are set to null. Otherwise, the remote issue link is created. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async createOrUpdateRemoteIssueLink( - parameters: Parameters.CreateOrUpdateRemoteIssueLink, - callback?: never, - ): Promise; - async createOrUpdateRemoteIssueLink( - parameters: Parameters.CreateOrUpdateRemoteIssueLink, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink`, - method: 'POST', - data: { - globalId: parameters.globalId, - application: parameters.application, - relationship: parameters.relationship, - object: parameters.object, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is implemented, issue-level security - * permission to view the issue. - */ - async deleteRemoteIssueLinkByGlobalId( - parameters: Parameters.DeleteRemoteIssueLinkByGlobalId, - callback: Callback, - ): Promise; - /** - * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is implemented, issue-level security - * permission to view the issue. - */ - async deleteRemoteIssueLinkByGlobalId( - parameters: Parameters.DeleteRemoteIssueLinkByGlobalId, - callback?: never, - ): Promise; - async deleteRemoteIssueLinkByGlobalId( - parameters: Parameters.DeleteRemoteIssueLinkByGlobalId, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink`, - method: 'DELETE', - params: { - globalId: parameters.globalId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a remote issue link for an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getRemoteIssueLinkById( - parameters: Parameters.GetRemoteIssueLinkById, - callback: Callback, - ): Promise; - /** - * Returns a remote issue link for an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getRemoteIssueLinkById( - parameters: Parameters.GetRemoteIssueLinkById, - callback?: never, - ): Promise; - async getRemoteIssueLinkById( - parameters: Parameters.GetRemoteIssueLinkById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a remote issue link for an issue. - * - * Note: Fields without values in the request are set to null. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async updateRemoteIssueLink( - parameters: Parameters.UpdateRemoteIssueLink, - callback: Callback, - ): Promise; - /** - * Updates a remote issue link for an issue. - * - * Note: Fields without values in the request are set to null. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async updateRemoteIssueLink(parameters: Parameters.UpdateRemoteIssueLink, callback?: never): Promise; - async updateRemoteIssueLink( - parameters: Parameters.UpdateRemoteIssueLink, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, - method: 'PUT', - data: { - globalId: parameters.globalId, - application: parameters.application, - relationship: parameters.relationship, - object: parameters.object, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a remote issue link from an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_, _Edit issues_, and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for the project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteRemoteIssueLinkById( - parameters: Parameters.DeleteRemoteIssueLinkById, - callback: Callback, - ): Promise; - /** - * Deletes a remote issue link from an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_, _Edit issues_, and _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) - * for the project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteRemoteIssueLinkById( - parameters: Parameters.DeleteRemoteIssueLinkById, - callback?: never, - ): Promise; - async deleteRemoteIssueLinkById( - parameters: Parameters.DeleteRemoteIssueLinkById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueResolutions.mts b/src/version3/issueResolutions.mts new file mode 100644 index 000000000..988b42a7f --- /dev/null +++ b/src/version3/issueResolutions.mts @@ -0,0 +1,224 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueResolutions { + constructor(private client: Client) {} + + /** + * Creates an issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createResolution( + parameters: Parameters.CreateResolution, + callback: Callback, + ): Promise; + /** + * Creates an issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createResolution( + parameters: Parameters.CreateResolution, + callback?: never, + ): Promise; + async createResolution( + parameters: Parameters.CreateResolution, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/resolution', + method: 'POST', + data: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets default issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultResolution( + parameters: Parameters.SetDefaultResolution, + callback: Callback, + ): Promise; + /** + * Sets default issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultResolution(parameters: Parameters.SetDefaultResolution, callback?: never): Promise; + async setDefaultResolution( + parameters: Parameters.SetDefaultResolution, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/resolution/default', + method: 'PUT', + data: { + id: parameters.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the order of issue resolutions. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveResolutions(parameters: Parameters.MoveResolutions, callback: Callback): Promise; + /** + * Changes the order of issue resolutions. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveResolutions(parameters: Parameters.MoveResolutions, callback?: never): Promise; + async moveResolutions(parameters: Parameters.MoveResolutions, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/resolution/move', + method: 'PUT', + data: { + ids: parameters.ids, + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: + * + * - A list of resolutions IDs. + * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects + * only, as there is no concept of default resolutions in team-managed projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async searchResolutions( + parameters: Parameters.SearchResolutions | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: + * + * - A list of resolutions IDs. + * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects + * only, as there is no concept of default resolutions in team-managed projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async searchResolutions( + parameters?: Parameters.SearchResolutions, + callback?: never, + ): Promise; + async searchResolutions( + parameters?: Parameters.SearchResolutions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/resolution/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + onlyDefault: parameters?.onlyDefault, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateResolution(parameters: Parameters.UpdateResolution, callback: Callback): Promise; + /** + * Updates an issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateResolution(parameters: Parameters.UpdateResolution, callback?: never): Promise; + async updateResolution(parameters: Parameters.UpdateResolution, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/resolution/${parameters.id}`, + method: 'PUT', + data: { + ...parameters, + name: parameters.name, + description: parameters.description, + id: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue resolution. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteResolution( + parameters: Parameters.DeleteResolution, + callback: Callback, + ): Promise; + /** + * Deletes an issue resolution. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteResolution( + parameters: Parameters.DeleteResolution, + callback?: never, + ): Promise; + async deleteResolution( + parameters: Parameters.DeleteResolution, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/resolution/${parameters.id}`, + method: 'DELETE', + params: { + replaceWith: parameters.replaceWith, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueResolutions.ts b/src/version3/issueResolutions.ts deleted file mode 100644 index 0fdb5a438..000000000 --- a/src/version3/issueResolutions.ts +++ /dev/null @@ -1,224 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueResolutions { - constructor(private client: Client) {} - - /** - * Creates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createResolution( - parameters: Parameters.CreateResolution, - callback: Callback, - ): Promise; - /** - * Creates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createResolution( - parameters: Parameters.CreateResolution, - callback?: never, - ): Promise; - async createResolution( - parameters: Parameters.CreateResolution, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/resolution', - method: 'POST', - data: parameters, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets default issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultResolution( - parameters: Parameters.SetDefaultResolution, - callback: Callback, - ): Promise; - /** - * Sets default issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultResolution(parameters: Parameters.SetDefaultResolution, callback?: never): Promise; - async setDefaultResolution( - parameters: Parameters.SetDefaultResolution, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/resolution/default', - method: 'PUT', - data: { - id: parameters.id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the order of issue resolutions. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveResolutions(parameters: Parameters.MoveResolutions, callback: Callback): Promise; - /** - * Changes the order of issue resolutions. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveResolutions(parameters: Parameters.MoveResolutions, callback?: never): Promise; - async moveResolutions(parameters: Parameters.MoveResolutions, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/resolution/move', - method: 'PUT', - data: { - ids: parameters.ids, - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: - * - * - A list of resolutions IDs. - * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects - * only, as there is no concept of default resolutions in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchResolutions( - parameters: Parameters.SearchResolutions | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: - * - * - A list of resolutions IDs. - * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects - * only, as there is no concept of default resolutions in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchResolutions( - parameters?: Parameters.SearchResolutions, - callback?: never, - ): Promise; - async searchResolutions( - parameters?: Parameters.SearchResolutions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/resolution/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - onlyDefault: parameters?.onlyDefault, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateResolution(parameters: Parameters.UpdateResolution, callback: Callback): Promise; - /** - * Updates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateResolution(parameters: Parameters.UpdateResolution, callback?: never): Promise; - async updateResolution(parameters: Parameters.UpdateResolution, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/resolution/${parameters.id}`, - method: 'PUT', - data: { - ...parameters, - name: parameters.name, - description: parameters.description, - id: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue resolution. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteResolution( - parameters: Parameters.DeleteResolution, - callback: Callback, - ): Promise; - /** - * Deletes an issue resolution. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteResolution( - parameters: Parameters.DeleteResolution, - callback?: never, - ): Promise; - async deleteResolution( - parameters: Parameters.DeleteResolution, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/resolution/${parameters.id}`, - method: 'DELETE', - params: { - replaceWith: parameters.replaceWith, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueSearch.mts b/src/version3/issueSearch.mts new file mode 100644 index 000000000..30a0facb3 --- /dev/null +++ b/src/version3/issueSearch.mts @@ -0,0 +1,234 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueSearch { + constructor(private client: Client) {} + + /** + * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the + * user is looking for an issue using a word or string. + * + * This operation returns two lists: + * + * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain + * the string in the `query` parameter. + * - `Current Search` which includes issues that match the Jql expression in `currentJQL` and contain the string in the + * `query` parameter. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getIssuePickerResource( + parameters: Parameters.GetIssuePickerResource | undefined, + callback: Callback, + ): Promise; + /** + * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the + * user is looking for an issue using a word or string. + * + * This operation returns two lists: + * + * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain + * the string in the `query` parameter. + * - `Current Search` which includes issues that match the Jql expression in `currentJQL` and contain the string in the + * `query` parameter. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getIssuePickerResource( + parameters?: Parameters.GetIssuePickerResource, + callback?: never, + ): Promise; + async getIssuePickerResource( + parameters?: Parameters.GetIssuePickerResource, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/picker', + method: 'GET', + params: { + query: parameters?.query, + currentJQL: parameters?.currentJQL, + currentIssueKey: parameters?.currentIssueKey, + currentProjectId: parameters?.currentProjectId, + showSubTasks: parameters?.showSubTasks, + showSubTaskParent: parameters?.showSubTaskParent, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Checks whether one or more issues would be returned by one or more Jql queries. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, issues are only matched against Jql queries where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async matchIssues( + parameters: Parameters.MatchIssues | undefined, + callback: Callback, + ): Promise; + /** + * Checks whether one or more issues would be returned by one or more Jql queries. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, issues are only matched against Jql queries where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async matchIssues(parameters?: Parameters.MatchIssues, callback?: never): Promise; + async matchIssues( + parameters?: Parameters.MatchIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/match', + method: 'POST', + data: { + jqls: parameters?.jqls, + issueIds: parameters?.issueIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Searches for issues using [Jql](https://confluence.atlassian.com/x/egORLQ). + * + * If the Jql query expression is too large to be encoded as a query parameter, use the + * [POST](#api-rest-api-3-search-post) version of this resource. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesUsingJql( + parameters: Parameters.SearchForIssuesUsingJql | undefined, + callback: Callback, + ): Promise; + /** + * Searches for issues using [Jql](https://confluence.atlassian.com/x/egORLQ). + * + * If the Jql query expression is too large to be encoded as a query parameter, use the + * [POST](#api-rest-api-3-search-post) version of this resource. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesUsingJql( + parameters?: Parameters.SearchForIssuesUsingJql, + callback?: never, + ): Promise; + async searchForIssuesUsingJql( + parameters?: Parameters.SearchForIssuesUsingJql, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/search', + method: 'GET', + params: { + jql: parameters?.jql, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + validateQuery: parameters?.validateQuery, + fields: parameters?.fields, + expand: parameters?.expand, + properties: parameters?.properties, + fieldsByKeys: parameters?.fieldsByKeys, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Searches for issues using [Jql](https://confluence.atlassian.com/x/egORLQ). + * + * There is a [GET](#api-rest-api-3-search-get) version of this resource that can be used for smaller Jql query + * expressions. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesUsingJqlPost( + parameters: Parameters.SearchForIssuesUsingJqlPost | undefined, + callback: Callback, + ): Promise; + /** + * Searches for issues using [Jql](https://confluence.atlassian.com/x/egORLQ). + * + * There is a [GET](#api-rest-api-3-search-get) version of this resource that can be used for smaller Jql query + * expressions. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesUsingJqlPost( + parameters?: Parameters.SearchForIssuesUsingJqlPost, + callback?: never, + ): Promise; + async searchForIssuesUsingJqlPost( + parameters?: Parameters.SearchForIssuesUsingJqlPost, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/search', + method: 'POST', + data: { + jql: parameters?.jql, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + fields: parameters?.fields, + validateQuery: parameters?.validateQuery, + expand: parameters?.expand, + properties: parameters?.properties, + fieldsByKeys: parameters?.fieldsByKeys, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueSearch.ts b/src/version3/issueSearch.ts deleted file mode 100644 index 94151dae9..000000000 --- a/src/version3/issueSearch.ts +++ /dev/null @@ -1,234 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueSearch { - constructor(private client: Client) {} - - /** - * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the - * user is looking for an issue using a word or string. - * - * This operation returns two lists: - * - * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain - * the string in the `query` parameter. - * - `Current Search` which includes issues that match the JQL expression in `currentJQL` and contain the string in the - * `query` parameter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getIssuePickerResource( - parameters: Parameters.GetIssuePickerResource | undefined, - callback: Callback, - ): Promise; - /** - * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the - * user is looking for an issue using a word or string. - * - * This operation returns two lists: - * - * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain - * the string in the `query` parameter. - * - `Current Search` which includes issues that match the JQL expression in `currentJQL` and contain the string in the - * `query` parameter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getIssuePickerResource( - parameters?: Parameters.GetIssuePickerResource, - callback?: never, - ): Promise; - async getIssuePickerResource( - parameters?: Parameters.GetIssuePickerResource, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/picker', - method: 'GET', - params: { - query: parameters?.query, - currentJQL: parameters?.currentJQL, - currentIssueKey: parameters?.currentIssueKey, - currentProjectId: parameters?.currentProjectId, - showSubTasks: parameters?.showSubTasks, - showSubTaskParent: parameters?.showSubTaskParent, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Checks whether one or more issues would be returned by one or more JQL queries. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, issues are only matched against JQL queries where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async matchIssues( - parameters: Parameters.MatchIssues | undefined, - callback: Callback, - ): Promise; - /** - * Checks whether one or more issues would be returned by one or more JQL queries. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, issues are only matched against JQL queries where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async matchIssues(parameters?: Parameters.MatchIssues, callback?: never): Promise; - async matchIssues( - parameters?: Parameters.MatchIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/match', - method: 'POST', - data: { - jqls: parameters?.jqls, - issueIds: parameters?.issueIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * If the JQL query expression is too large to be encoded as a query parameter, use the - * [POST](#api-rest-api-3-search-post) version of this resource. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async searchForIssuesUsingJql( - parameters: Parameters.SearchForIssuesUsingJql | undefined, - callback: Callback, - ): Promise; - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * If the JQL query expression is too large to be encoded as a query parameter, use the - * [POST](#api-rest-api-3-search-post) version of this resource. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async searchForIssuesUsingJql( - parameters?: Parameters.SearchForIssuesUsingJql, - callback?: never, - ): Promise; - async searchForIssuesUsingJql( - parameters?: Parameters.SearchForIssuesUsingJql, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/search', - method: 'GET', - params: { - jql: parameters?.jql, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - validateQuery: parameters?.validateQuery, - fields: parameters?.fields, - expand: parameters?.expand, - properties: parameters?.properties, - fieldsByKeys: parameters?.fieldsByKeys, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * There is a [GET](#api-rest-api-3-search-get) version of this resource that can be used for smaller JQL query - * expressions. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async searchForIssuesUsingJqlPost( - parameters: Parameters.SearchForIssuesUsingJqlPost | undefined, - callback: Callback, - ): Promise; - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * There is a [GET](#api-rest-api-3-search-get) version of this resource that can be used for smaller JQL query - * expressions. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues - * are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async searchForIssuesUsingJqlPost( - parameters?: Parameters.SearchForIssuesUsingJqlPost, - callback?: never, - ): Promise; - async searchForIssuesUsingJqlPost( - parameters?: Parameters.SearchForIssuesUsingJqlPost, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/search', - method: 'POST', - data: { - jql: parameters?.jql, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - fields: parameters?.fields, - validateQuery: parameters?.validateQuery, - expand: parameters?.expand, - properties: parameters?.properties, - fieldsByKeys: parameters?.fieldsByKeys, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueSecurityLevel.mts b/src/version3/issueSecurityLevel.mts new file mode 100644 index 000000000..ee69f2e4a --- /dev/null +++ b/src/version3/issueSecurityLevel.mts @@ -0,0 +1,91 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueSecurityLevel { + constructor(private client: Client) {} + + /** + * Returns issue security level members. + * + * Only issue security level members in context of classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueSecurityLevelMembers( + parameters: Parameters.GetIssueSecurityLevelMembers, + callback: Callback, + ): Promise; + /** + * Returns issue security level members. + * + * Only issue security level members in context of classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueSecurityLevelMembers( + parameters: Parameters.GetIssueSecurityLevelMembers, + callback?: never, + ): Promise; + async getIssueSecurityLevelMembers( + parameters: Parameters.GetIssueSecurityLevelMembers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.issueSecuritySchemeId}/members`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + issueSecurityLevelId: parameters.issueSecurityLevelId, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns details of an issue security level. + * + * Use [Get issue security scheme](#api-rest-api-3-issuesecurityschemes-id-get) to obtain the IDs of issue security + * levels associated with the issue security scheme. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getIssueSecurityLevel( + parameters: Parameters.GetIssueSecurityLevel, + callback: Callback, + ): Promise; + /** + * Returns details of an issue security level. + * + * Use [Get issue security scheme](#api-rest-api-3-issuesecurityschemes-id-get) to obtain the IDs of issue security + * levels associated with the issue security scheme. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getIssueSecurityLevel( + parameters: Parameters.GetIssueSecurityLevel, + callback?: never, + ): Promise; + async getIssueSecurityLevel( + parameters: Parameters.GetIssueSecurityLevel, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/securitylevel/${parameters.id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueSecurityLevel.ts b/src/version3/issueSecurityLevel.ts deleted file mode 100644 index 05362d6f7..000000000 --- a/src/version3/issueSecurityLevel.ts +++ /dev/null @@ -1,91 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueSecurityLevel { - constructor(private client: Client) {} - - /** - * Returns issue security level members. - * - * Only issue security level members in context of classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueSecurityLevelMembers( - parameters: Parameters.GetIssueSecurityLevelMembers, - callback: Callback, - ): Promise; - /** - * Returns issue security level members. - * - * Only issue security level members in context of classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueSecurityLevelMembers( - parameters: Parameters.GetIssueSecurityLevelMembers, - callback?: never, - ): Promise; - async getIssueSecurityLevelMembers( - parameters: Parameters.GetIssueSecurityLevelMembers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.issueSecuritySchemeId}/members`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - issueSecurityLevelId: parameters.issueSecurityLevelId, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns details of an issue security level. - * - * Use [Get issue security scheme](#api-rest-api-3-issuesecurityschemes-id-get) to obtain the IDs of issue security - * levels associated with the issue security scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getIssueSecurityLevel( - parameters: Parameters.GetIssueSecurityLevel, - callback: Callback, - ): Promise; - /** - * Returns details of an issue security level. - * - * Use [Get issue security scheme](#api-rest-api-3-issuesecurityschemes-id-get) to obtain the IDs of issue security - * levels associated with the issue security scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getIssueSecurityLevel( - parameters: Parameters.GetIssueSecurityLevel, - callback?: never, - ): Promise; - async getIssueSecurityLevel( - parameters: Parameters.GetIssueSecurityLevel, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/securitylevel/${parameters.id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueSecuritySchemes.mts b/src/version3/issueSecuritySchemes.mts new file mode 100644 index 000000000..8ede5b35c --- /dev/null +++ b/src/version3/issueSecuritySchemes.mts @@ -0,0 +1,604 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueSecuritySchemes { + constructor(private client: Client) {} + + /** + * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueSecuritySchemes(callback: Callback): Promise; + /** + * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueSecuritySchemes(callback?: never): Promise; + async getIssueSecuritySchemes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuesecurityschemes', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme + * levels and security scheme levels' members per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueSecurityScheme( + parameters: Parameters.CreateIssueSecurityScheme, + callback: Callback, + ): Promise; + /** + * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme + * levels and security scheme levels' members per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueSecurityScheme( + parameters: Parameters.CreateIssueSecurityScheme, + callback?: never, + ): Promise; + async createIssueSecurityScheme( + parameters: Parameters.CreateIssueSecurityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuesecurityschemes', + method: 'POST', + data: { + description: parameters.description, + levels: parameters.levels, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * security levels. + * + * Only issue security levels in the context of classic projects are returned. + * + * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include + * both specified issue security levels and all issue security levels from the specified schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevels( + parameters: Parameters.GetSecurityLevels | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * security levels. + * + * Only issue security levels in the context of classic projects are returned. + * + * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include + * both specified issue security levels and all issue security levels from the specified schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevels( + parameters?: Parameters.GetSecurityLevels, + callback?: never, + ): Promise; + async getSecurityLevels( + parameters?: Parameters.GetSecurityLevels, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuesecurityschemes/level', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + schemeId: parameters?.schemeId, + onlyDefault: parameters?.onlyDefault, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets default issue security levels for schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultLevels( + parameters: Parameters.SetDefaultLevels | undefined, + callback: Callback, + ): Promise; + /** + * Sets default issue security levels for schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultLevels(parameters?: Parameters.SetDefaultLevels, callback?: never): Promise; + async setDefaultLevels( + parameters?: Parameters.SetDefaultLevels, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuesecurityschemes/level/default', + method: 'PUT', + data: { + defaultValues: parameters?.defaultValues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * security level members. + * + * Only issue security level members in the context of classic projects are returned. + * + * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will + * include all issue security level members from the specified schemes and levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevelMembers( + parameters: Parameters.GetSecurityLevelMembers | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * security level members. + * + * Only issue security level members in the context of classic projects are returned. + * + * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will + * include all issue security level members from the specified schemes and levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevelMembers( + parameters?: Parameters.GetSecurityLevelMembers, + callback?: never, + ): Promise; + async getSecurityLevelMembers( + parameters?: Parameters.GetSecurityLevelMembers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuesecurityschemes/level/member', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + schemeId: parameters?.schemeId, + levelId: parameters?.levelId, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) mapping of + * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs + * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the + * context of classic projects are supported. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchProjectsUsingSecuritySchemes( + parameters: Parameters.SearchProjectsUsingSecuritySchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) mapping of + * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs + * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the + * context of classic projects are supported. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchProjectsUsingSecuritySchemes( + parameters?: Parameters.SearchProjectsUsingSecuritySchemes, + callback?: never, + ): Promise; + async searchProjectsUsingSecuritySchemes( + parameters?: Parameters.SearchProjectsUsingSecuritySchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuesecurityschemes/project', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + issueSecuritySchemeId: parameters?.issueSecuritySchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if + * provided. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async associateSchemesToProjects( + parameters: Parameters.AssociateSchemesToProjects, + callback: Callback, + ): Promise; + /** + * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if + * provided. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async associateSchemesToProjects( + parameters: Parameters.AssociateSchemesToProjects, + callback?: never, + ): Promise; + async associateSchemesToProjects( + parameters: Parameters.AssociateSchemesToProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuesecurityschemes/project', + method: 'PUT', + data: { + oldToNewSecurityLevelMappings: parameters.oldToNewSecurityLevelMappings, + projectId: parameters.projectId, + schemeId: parameters.schemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * security schemes.\ + * If you specify the project ID parameter, the result will contain issue security schemes and related project IDs you + * filter by. + * + * Only issue security schemes in the context of classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchSecuritySchemes( + parameters: Parameters.SearchSecuritySchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * security schemes.\ + * If you specify the project ID parameter, the result will contain issue security schemes and related project IDs you + * filter by. + * + * Only issue security schemes in the context of classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchSecuritySchemes( + parameters?: Parameters.SearchSecuritySchemes, + callback?: never, + ): Promise; + async searchSecuritySchemes( + parameters?: Parameters.SearchSecuritySchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuesecurityschemes/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue security scheme along with its security levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the + * requested issue security scheme. + */ + async getIssueSecurityScheme( + parameters: Parameters.GetIssueSecurityScheme, + callback: Callback, + ): Promise; + /** + * Returns an issue security scheme along with its security levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the + * requested issue security scheme. + */ + async getIssueSecurityScheme( + parameters: Parameters.GetIssueSecurityScheme, + callback?: never, + ): Promise; + async getIssueSecurityScheme( + parameters: Parameters.GetIssueSecurityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the issue security scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueSecurityScheme( + parameters: Parameters.UpdateIssueSecurityScheme, + callback: Callback, + ): Promise; + /** + * Updates the issue security scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueSecurityScheme( + parameters: Parameters.UpdateIssueSecurityScheme, + callback?: never, + ): Promise; + async updateIssueSecurityScheme( + parameters: Parameters.UpdateIssueSecurityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.id}`, + method: 'PUT', + data: { + description: parameters.description, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue security scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteSecurityScheme( + parameters: Parameters.DeleteSecurityScheme, + callback: Callback, + ): Promise; + /** + * Deletes an issue security scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteSecurityScheme(parameters: Parameters.DeleteSecurityScheme, callback?: never): Promise; + async deleteSecurityScheme( + parameters: Parameters.DeleteSecurityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback: Callback): Promise; + /** + * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: never): Promise; + async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level`, + method: 'PUT', + data: { + levels: parameters.levels, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the issue security level. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback: Callback): Promise; + /** + * Updates the issue security level. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback?: never): Promise; + async updateSecurityLevel( + parameters: Parameters.UpdateSecurityLevel, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, + method: 'PUT', + data: { + description: parameters.description, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue security level. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeLevel(parameters: Parameters.RemoveLevel, callback: Callback): Promise; + /** + * Deletes an issue security level. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeLevel(parameters: Parameters.RemoveLevel, callback?: never): Promise; + async removeLevel(parameters: Parameters.RemoveLevel, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, + method: 'DELETE', + params: { + replaceWith: parameters.replaceWith, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds members to the issue security level. You can add up to 100 members per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addSecurityLevelMembers( + parameters: Parameters.AddSecurityLevelMembers, + callback: Callback, + ): Promise; + /** + * Adds members to the issue security level. You can add up to 100 members per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addSecurityLevelMembers(parameters: Parameters.AddSecurityLevelMembers, callback?: never): Promise; + async addSecurityLevelMembers( + parameters: Parameters.AddSecurityLevelMembers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member`, + method: 'PUT', + data: { + members: parameters.members, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes an issue security level member from an issue security scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeMemberFromSecurityLevel( + parameters: Parameters.RemoveMemberFromSecurityLevel, + callback: Callback, + ): Promise; + /** + * Removes an issue security level member from an issue security scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeMemberFromSecurityLevel( + parameters: Parameters.RemoveMemberFromSecurityLevel, + callback?: never, + ): Promise; + async removeMemberFromSecurityLevel( + parameters: Parameters.RemoveMemberFromSecurityLevel, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member/${parameters.memberId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueSecuritySchemes.ts b/src/version3/issueSecuritySchemes.ts deleted file mode 100644 index a5e050c6b..000000000 --- a/src/version3/issueSecuritySchemes.ts +++ /dev/null @@ -1,604 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueSecuritySchemes { - constructor(private client: Client) {} - - /** - * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueSecuritySchemes(callback: Callback): Promise; - /** - * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueSecuritySchemes(callback?: never): Promise; - async getIssueSecuritySchemes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuesecurityschemes', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme - * levels and security scheme levels' members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueSecurityScheme( - parameters: Parameters.CreateIssueSecurityScheme, - callback: Callback, - ): Promise; - /** - * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme - * levels and security scheme levels' members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueSecurityScheme( - parameters: Parameters.CreateIssueSecurityScheme, - callback?: never, - ): Promise; - async createIssueSecurityScheme( - parameters: Parameters.CreateIssueSecurityScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuesecurityschemes', - method: 'POST', - data: { - description: parameters.description, - levels: parameters.levels, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * security levels. - * - * Only issue security levels in the context of classic projects are returned. - * - * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include - * both specified issue security levels and all issue security levels from the specified schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevels( - parameters: Parameters.GetSecurityLevels | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * security levels. - * - * Only issue security levels in the context of classic projects are returned. - * - * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include - * both specified issue security levels and all issue security levels from the specified schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevels( - parameters?: Parameters.GetSecurityLevels, - callback?: never, - ): Promise; - async getSecurityLevels( - parameters?: Parameters.GetSecurityLevels, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuesecurityschemes/level', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - schemeId: parameters?.schemeId, - onlyDefault: parameters?.onlyDefault, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets default issue security levels for schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultLevels( - parameters: Parameters.SetDefaultLevels | undefined, - callback: Callback, - ): Promise; - /** - * Sets default issue security levels for schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultLevels(parameters?: Parameters.SetDefaultLevels, callback?: never): Promise; - async setDefaultLevels( - parameters?: Parameters.SetDefaultLevels, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuesecurityschemes/level/default', - method: 'PUT', - data: { - defaultValues: parameters?.defaultValues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * security level members. - * - * Only issue security level members in the context of classic projects are returned. - * - * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will - * include all issue security level members from the specified schemes and levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevelMembers( - parameters: Parameters.GetSecurityLevelMembers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * security level members. - * - * Only issue security level members in the context of classic projects are returned. - * - * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will - * include all issue security level members from the specified schemes and levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevelMembers( - parameters?: Parameters.GetSecurityLevelMembers, - callback?: never, - ): Promise; - async getSecurityLevelMembers( - parameters?: Parameters.GetSecurityLevelMembers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuesecurityschemes/level/member', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - schemeId: parameters?.schemeId, - levelId: parameters?.levelId, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) mapping of - * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs - * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the - * context of classic projects are supported. - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchProjectsUsingSecuritySchemes( - parameters: Parameters.SearchProjectsUsingSecuritySchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) mapping of - * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs - * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the - * context of classic projects are supported. - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchProjectsUsingSecuritySchemes( - parameters?: Parameters.SearchProjectsUsingSecuritySchemes, - callback?: never, - ): Promise; - async searchProjectsUsingSecuritySchemes( - parameters?: Parameters.SearchProjectsUsingSecuritySchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuesecurityschemes/project', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - issueSecuritySchemeId: parameters?.issueSecuritySchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if - * provided. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async associateSchemesToProjects( - parameters: Parameters.AssociateSchemesToProjects, - callback: Callback, - ): Promise; - /** - * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if - * provided. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async associateSchemesToProjects( - parameters: Parameters.AssociateSchemesToProjects, - callback?: never, - ): Promise; - async associateSchemesToProjects( - parameters: Parameters.AssociateSchemesToProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuesecurityschemes/project', - method: 'PUT', - data: { - oldToNewSecurityLevelMappings: parameters.oldToNewSecurityLevelMappings, - projectId: parameters.projectId, - schemeId: parameters.schemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * security schemes.\ - * If you specify the project ID parameter, the result will contain issue security schemes and related project IDs you - * filter by. - * - * Only issue security schemes in the context of classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchSecuritySchemes( - parameters: Parameters.SearchSecuritySchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * security schemes.\ - * If you specify the project ID parameter, the result will contain issue security schemes and related project IDs you - * filter by. - * - * Only issue security schemes in the context of classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchSecuritySchemes( - parameters?: Parameters.SearchSecuritySchemes, - callback?: never, - ): Promise; - async searchSecuritySchemes( - parameters?: Parameters.SearchSecuritySchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuesecurityschemes/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue security scheme along with its security levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the - * requested issue security scheme. - */ - async getIssueSecurityScheme( - parameters: Parameters.GetIssueSecurityScheme, - callback: Callback, - ): Promise; - /** - * Returns an issue security scheme along with its security levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the - * requested issue security scheme. - */ - async getIssueSecurityScheme( - parameters: Parameters.GetIssueSecurityScheme, - callback?: never, - ): Promise; - async getIssueSecurityScheme( - parameters: Parameters.GetIssueSecurityScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the issue security scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueSecurityScheme( - parameters: Parameters.UpdateIssueSecurityScheme, - callback: Callback, - ): Promise; - /** - * Updates the issue security scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueSecurityScheme( - parameters: Parameters.UpdateIssueSecurityScheme, - callback?: never, - ): Promise; - async updateIssueSecurityScheme( - parameters: Parameters.UpdateIssueSecurityScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.id}`, - method: 'PUT', - data: { - description: parameters.description, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue security scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteSecurityScheme( - parameters: Parameters.DeleteSecurityScheme, - callback: Callback, - ): Promise; - /** - * Deletes an issue security scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteSecurityScheme(parameters: Parameters.DeleteSecurityScheme, callback?: never): Promise; - async deleteSecurityScheme( - parameters: Parameters.DeleteSecurityScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback: Callback): Promise; - /** - * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: never): Promise; - async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level`, - method: 'PUT', - data: { - levels: parameters.levels, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the issue security level. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback: Callback): Promise; - /** - * Updates the issue security level. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback?: never): Promise; - async updateSecurityLevel( - parameters: Parameters.UpdateSecurityLevel, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, - method: 'PUT', - data: { - description: parameters.description, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue security level. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeLevel(parameters: Parameters.RemoveLevel, callback: Callback): Promise; - /** - * Deletes an issue security level. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeLevel(parameters: Parameters.RemoveLevel, callback?: never): Promise; - async removeLevel(parameters: Parameters.RemoveLevel, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, - method: 'DELETE', - params: { - replaceWith: parameters.replaceWith, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds members to the issue security level. You can add up to 100 members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevelMembers( - parameters: Parameters.AddSecurityLevelMembers, - callback: Callback, - ): Promise; - /** - * Adds members to the issue security level. You can add up to 100 members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevelMembers(parameters: Parameters.AddSecurityLevelMembers, callback?: never): Promise; - async addSecurityLevelMembers( - parameters: Parameters.AddSecurityLevelMembers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member`, - method: 'PUT', - data: { - members: parameters.members, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes an issue security level member from an issue security scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeMemberFromSecurityLevel( - parameters: Parameters.RemoveMemberFromSecurityLevel, - callback: Callback, - ): Promise; - /** - * Removes an issue security level member from an issue security scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeMemberFromSecurityLevel( - parameters: Parameters.RemoveMemberFromSecurityLevel, - callback?: never, - ): Promise; - async removeMemberFromSecurityLevel( - parameters: Parameters.RemoveMemberFromSecurityLevel, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member/${parameters.memberId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueTypeProperties.mts b/src/version3/issueTypeProperties.mts new file mode 100644 index 000000000..e6b2b08c4 --- /dev/null +++ b/src/version3/issueTypeProperties.mts @@ -0,0 +1,173 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueTypeProperties { + constructor(private client: Client) {} + + /** + * Returns all the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * keys of the issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any + * issue type. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any + * issue types associated with the projects the user has permission to browse. + */ + async getIssueTypePropertyKeys( + parameters: Parameters.GetIssueTypePropertyKeys, + callback: Callback, + ): Promise; + /** + * Returns all the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * keys of the issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any + * issue type. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any + * issue types associated with the projects the user has permission to browse. + */ + async getIssueTypePropertyKeys( + parameters: Parameters.GetIssueTypePropertyKeys, + callback?: never, + ): Promise; + async getIssueTypePropertyKeys( + parameters: Parameters.GetIssueTypePropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.issueTypeId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the key and value of the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue + * type. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue + * types associated with the projects the user has permission to browse. + */ + async getIssueTypeProperty( + parameters: Parameters.GetIssueTypeProperty, + callback: Callback, + ): Promise; + /** + * Returns the key and value of the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue + * type. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue + * types associated with the projects the user has permission to browse. + */ + async getIssueTypeProperty( + parameters: Parameters.GetIssueTypeProperty, + callback?: never, + ): Promise; + async getIssueTypeProperty( + parameters: Parameters.GetIssueTypeProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates or updates the value of the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * Use this resource to store and update data against an issue type. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setIssueTypeProperty( + parameters: Parameters.SetIssueTypeProperty, + callback: Callback, + ): Promise; + /** + * Creates or updates the value of the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * Use this resource to store and update data against an issue type. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setIssueTypeProperty(parameters: Parameters.SetIssueTypeProperty, callback?: never): Promise; + async setIssueTypeProperty( + parameters: Parameters.SetIssueTypeProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueTypeProperty( + parameters: Parameters.DeleteIssueTypeProperty, + callback: Callback, + ): Promise; + /** + * Deletes the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueTypeProperty(parameters: Parameters.DeleteIssueTypeProperty, callback?: never): Promise; + async deleteIssueTypeProperty( + parameters: Parameters.DeleteIssueTypeProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueTypeProperties.ts b/src/version3/issueTypeProperties.ts deleted file mode 100644 index ab1e2ca3f..000000000 --- a/src/version3/issueTypeProperties.ts +++ /dev/null @@ -1,173 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueTypeProperties { - constructor(private client: Client) {} - - /** - * Returns all the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys of the issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any - * issue type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any - * issue types associated with the projects the user has permission to browse. - */ - async getIssueTypePropertyKeys( - parameters: Parameters.GetIssueTypePropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns all the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys of the issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any - * issue type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any - * issue types associated with the projects the user has permission to browse. - */ - async getIssueTypePropertyKeys( - parameters: Parameters.GetIssueTypePropertyKeys, - callback?: never, - ): Promise; - async getIssueTypePropertyKeys( - parameters: Parameters.GetIssueTypePropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.issueTypeId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the key and value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue - * type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue - * types associated with the projects the user has permission to browse. - */ - async getIssueTypeProperty( - parameters: Parameters.GetIssueTypeProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue - * type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue - * types associated with the projects the user has permission to browse. - */ - async getIssueTypeProperty( - parameters: Parameters.GetIssueTypeProperty, - callback?: never, - ): Promise; - async getIssueTypeProperty( - parameters: Parameters.GetIssueTypeProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates or updates the value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * Use this resource to store and update data against an issue type. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueTypeProperty( - parameters: Parameters.SetIssueTypeProperty, - callback: Callback, - ): Promise; - /** - * Creates or updates the value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * Use this resource to store and update data against an issue type. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueTypeProperty(parameters: Parameters.SetIssueTypeProperty, callback?: never): Promise; - async setIssueTypeProperty( - parameters: Parameters.SetIssueTypeProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeProperty( - parameters: Parameters.DeleteIssueTypeProperty, - callback: Callback, - ): Promise; - /** - * Deletes the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeProperty(parameters: Parameters.DeleteIssueTypeProperty, callback?: never): Promise; - async deleteIssueTypeProperty( - parameters: Parameters.DeleteIssueTypeProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueTypeSchemes.mts b/src/version3/issueTypeSchemes.mts new file mode 100644 index 000000000..f817140bf --- /dev/null +++ b/src/version3/issueTypeSchemes.mts @@ -0,0 +1,432 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueTypeSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type schemes. + * + * Only issue type schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllIssueTypeSchemes( + parameters: Parameters.GetAllIssueTypeSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type schemes. + * + * Only issue type schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllIssueTypeSchemes( + parameters?: Parameters.GetAllIssueTypeSchemes, + callback?: never, + ): Promise; + async getAllIssueTypeSchemes( + parameters?: Parameters.GetAllIssueTypeSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + queryString: parameters?.queryString, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueTypeScheme( + parameters: Parameters.CreateIssueTypeScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates an issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueTypeScheme( + parameters?: Parameters.CreateIssueTypeScheme, + callback?: never, + ): Promise; + async createIssueTypeScheme( + parameters?: Parameters.CreateIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescheme', + method: 'POST', + data: { + name: parameters?.name, + description: parameters?.description, + defaultIssueTypeId: parameters?.defaultIssueTypeId, + issueTypeIds: parameters?.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type scheme items. + * + * Only issue type scheme items used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeSchemesMapping( + parameters: Parameters.GetIssueTypeSchemesMapping | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type scheme items. + * + * Only issue type scheme items used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeSchemesMapping( + parameters?: Parameters.GetIssueTypeSchemesMapping, + callback?: never, + ): Promise; + async getIssueTypeSchemesMapping( + parameters?: Parameters.GetIssueTypeSchemesMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescheme/mapping', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + issueTypeSchemeId: parameters?.issueTypeSchemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type schemes and, for each issue type scheme, a list of the projects that use it. + * + * Only issue type schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeSchemeForProjects( + parameters: Parameters.GetIssueTypeSchemeForProjects, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type schemes and, for each issue type scheme, a list of the projects that use it. + * + * Only issue type schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeSchemeForProjects( + parameters: Parameters.GetIssueTypeSchemeForProjects, + callback?: never, + ): Promise; + async getIssueTypeSchemeForProjects( + parameters: Parameters.GetIssueTypeSchemeForProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescheme/project', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns an issue type scheme to a project. + * + * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To + * complete the assignment those issues must be updated to use issue types in the new scheme. + * + * Issue type schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignIssueTypeSchemeToProject( + parameters: Parameters.AssignIssueTypeSchemeToProject | undefined, + callback: Callback, + ): Promise; + /** + * Assigns an issue type scheme to a project. + * + * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To + * complete the assignment those issues must be updated to use issue types in the new scheme. + * + * Issue type schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignIssueTypeSchemeToProject( + parameters?: Parameters.AssignIssueTypeSchemeToProject, + callback?: never, + ): Promise; + async assignIssueTypeSchemeToProject( + parameters?: Parameters.AssignIssueTypeSchemeToProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescheme/project', + method: 'PUT', + data: { + issueTypeSchemeId: parameters?.issueTypeSchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueTypeScheme( + parameters: Parameters.UpdateIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Updates an issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueTypeScheme(parameters: Parameters.UpdateIssueTypeScheme, callback?: never): Promise; + async updateIssueTypeScheme( + parameters: Parameters.UpdateIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + defaultIssueTypeId: parameters.defaultIssueTypeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue type scheme. + * + * Only issue type schemes used in classic projects can be deleted. + * + * Any projects assigned to the scheme are reassigned to the default issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueTypeScheme( + parameters: Parameters.DeleteIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Deletes an issue type scheme. + * + * Only issue type schemes used in classic projects can be deleted. + * + * Any projects assigned to the scheme are reassigned to the default issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueTypeScheme(parameters: Parameters.DeleteIssueTypeScheme, callback?: never): Promise; + async deleteIssueTypeScheme( + parameters: Parameters.DeleteIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds issue types to an issue type scheme. + * + * The added issue types are appended to the issue types list. + * + * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addIssueTypesToIssueTypeScheme( + parameters: Parameters.AddIssueTypesToIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Adds issue types to an issue type scheme. + * + * The added issue types are appended to the issue types list. + * + * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addIssueTypesToIssueTypeScheme( + parameters: Parameters.AddIssueTypesToIssueTypeScheme, + callback?: never, + ): Promise; + async addIssueTypesToIssueTypeScheme( + parameters: Parameters.AddIssueTypesToIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype`, + method: 'PUT', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the order of issue types in an issue type scheme. + * + * The request body parameters must meet the following requirements: + * + * - All of the issue types must belong to the issue type scheme. + * - Either `after` or `position` must be provided. + * - The issue type in `after` must not be in the issue type list. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async reorderIssueTypesInIssueTypeScheme( + parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Changes the order of issue types in an issue type scheme. + * + * The request body parameters must meet the following requirements: + * + * - All of the issue types must belong to the issue type scheme. + * - Either `after` or `position` must be provided. + * - The issue type in `after` must not be in the issue type list. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async reorderIssueTypesInIssueTypeScheme( + parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, + callback?: never, + ): Promise; + async reorderIssueTypesInIssueTypeScheme( + parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/move`, + method: 'PUT', + data: { + issueTypeIds: parameters.issueTypeIds, + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes an issue type from an issue type scheme. + * + * This operation cannot remove: + * + * - Any issue type used by issues. + * - Any issue types from the default issue type scheme. + * - The last standard issue type from an issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypeFromIssueTypeScheme( + parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Removes an issue type from an issue type scheme. + * + * This operation cannot remove: + * + * - Any issue type used by issues. + * - Any issue types from the default issue type scheme. + * - The last standard issue type from an issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypeFromIssueTypeScheme( + parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, + callback?: never, + ): Promise; + async removeIssueTypeFromIssueTypeScheme( + parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/${parameters.issueTypeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueTypeSchemes.ts b/src/version3/issueTypeSchemes.ts deleted file mode 100644 index 9d17e1a4a..000000000 --- a/src/version3/issueTypeSchemes.ts +++ /dev/null @@ -1,432 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueTypeSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type schemes. - * - * Only issue type schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllIssueTypeSchemes( - parameters: Parameters.GetAllIssueTypeSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type schemes. - * - * Only issue type schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllIssueTypeSchemes( - parameters?: Parameters.GetAllIssueTypeSchemes, - callback?: never, - ): Promise; - async getAllIssueTypeSchemes( - parameters?: Parameters.GetAllIssueTypeSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - orderBy: parameters?.orderBy, - expand: parameters?.expand, - queryString: parameters?.queryString, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeScheme( - parameters: Parameters.CreateIssueTypeScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates an issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeScheme( - parameters?: Parameters.CreateIssueTypeScheme, - callback?: never, - ): Promise; - async createIssueTypeScheme( - parameters?: Parameters.CreateIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescheme', - method: 'POST', - data: { - name: parameters?.name, - description: parameters?.description, - defaultIssueTypeId: parameters?.defaultIssueTypeId, - issueTypeIds: parameters?.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type scheme items. - * - * Only issue type scheme items used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeSchemesMapping( - parameters: Parameters.GetIssueTypeSchemesMapping | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type scheme items. - * - * Only issue type scheme items used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeSchemesMapping( - parameters?: Parameters.GetIssueTypeSchemesMapping, - callback?: never, - ): Promise; - async getIssueTypeSchemesMapping( - parameters?: Parameters.GetIssueTypeSchemesMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescheme/mapping', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - issueTypeSchemeId: parameters?.issueTypeSchemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type schemes and, for each issue type scheme, a list of the projects that use it. - * - * Only issue type schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeSchemeForProjects( - parameters: Parameters.GetIssueTypeSchemeForProjects, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type schemes and, for each issue type scheme, a list of the projects that use it. - * - * Only issue type schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeSchemeForProjects( - parameters: Parameters.GetIssueTypeSchemeForProjects, - callback?: never, - ): Promise; - async getIssueTypeSchemeForProjects( - parameters: Parameters.GetIssueTypeSchemeForProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescheme/project', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns an issue type scheme to a project. - * - * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To - * complete the assignment those issues must be updated to use issue types in the new scheme. - * - * Issue type schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeSchemeToProject( - parameters: Parameters.AssignIssueTypeSchemeToProject | undefined, - callback: Callback, - ): Promise; - /** - * Assigns an issue type scheme to a project. - * - * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To - * complete the assignment those issues must be updated to use issue types in the new scheme. - * - * Issue type schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeSchemeToProject( - parameters?: Parameters.AssignIssueTypeSchemeToProject, - callback?: never, - ): Promise; - async assignIssueTypeSchemeToProject( - parameters?: Parameters.AssignIssueTypeSchemeToProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescheme/project', - method: 'PUT', - data: { - issueTypeSchemeId: parameters?.issueTypeSchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueTypeScheme( - parameters: Parameters.UpdateIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Updates an issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueTypeScheme(parameters: Parameters.UpdateIssueTypeScheme, callback?: never): Promise; - async updateIssueTypeScheme( - parameters: Parameters.UpdateIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - defaultIssueTypeId: parameters.defaultIssueTypeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue type scheme. - * - * Only issue type schemes used in classic projects can be deleted. - * - * Any projects assigned to the scheme are reassigned to the default issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeScheme( - parameters: Parameters.DeleteIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Deletes an issue type scheme. - * - * Only issue type schemes used in classic projects can be deleted. - * - * Any projects assigned to the scheme are reassigned to the default issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeScheme(parameters: Parameters.DeleteIssueTypeScheme, callback?: never): Promise; - async deleteIssueTypeScheme( - parameters: Parameters.DeleteIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds issue types to an issue type scheme. - * - * The added issue types are appended to the issue types list. - * - * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToIssueTypeScheme( - parameters: Parameters.AddIssueTypesToIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Adds issue types to an issue type scheme. - * - * The added issue types are appended to the issue types list. - * - * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToIssueTypeScheme( - parameters: Parameters.AddIssueTypesToIssueTypeScheme, - callback?: never, - ): Promise; - async addIssueTypesToIssueTypeScheme( - parameters: Parameters.AddIssueTypesToIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype`, - method: 'PUT', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the order of issue types in an issue type scheme. - * - * The request body parameters must meet the following requirements: - * - * - All of the issue types must belong to the issue type scheme. - * - Either `after` or `position` must be provided. - * - The issue type in `after` must not be in the issue type list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderIssueTypesInIssueTypeScheme( - parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Changes the order of issue types in an issue type scheme. - * - * The request body parameters must meet the following requirements: - * - * - All of the issue types must belong to the issue type scheme. - * - Either `after` or `position` must be provided. - * - The issue type in `after` must not be in the issue type list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderIssueTypesInIssueTypeScheme( - parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, - callback?: never, - ): Promise; - async reorderIssueTypesInIssueTypeScheme( - parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/move`, - method: 'PUT', - data: { - issueTypeIds: parameters.issueTypeIds, - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes an issue type from an issue type scheme. - * - * This operation cannot remove: - * - * - Any issue type used by issues. - * - Any issue types from the default issue type scheme. - * - The last standard issue type from an issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypeFromIssueTypeScheme( - parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Removes an issue type from an issue type scheme. - * - * This operation cannot remove: - * - * - Any issue type used by issues. - * - Any issue types from the default issue type scheme. - * - The last standard issue type from an issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypeFromIssueTypeScheme( - parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, - callback?: never, - ): Promise; - async removeIssueTypeFromIssueTypeScheme( - parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/${parameters.issueTypeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueTypeScreenSchemes.mts b/src/version3/issueTypeScreenSchemes.mts new file mode 100644 index 000000000..696559528 --- /dev/null +++ b/src/version3/issueTypeScreenSchemes.mts @@ -0,0 +1,436 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueTypeScreenSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type screen schemes. + * + * Only issue type screen schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeScreenSchemes( + parameters: Parameters.GetIssueTypeScreenSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type screen schemes. + * + * Only issue type screen schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeScreenSchemes( + parameters?: Parameters.GetIssueTypeScreenSchemes, + callback?: never, + ): Promise; + async getIssueTypeScreenSchemes( + parameters?: Parameters.GetIssueTypeScreenSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescreenscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + queryString: parameters?.queryString, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueTypeScreenScheme( + parameters: Parameters.CreateIssueTypeScreenScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueTypeScreenScheme( + parameters?: Parameters.CreateIssueTypeScreenScheme, + callback?: never, + ): Promise; + async createIssueTypeScreenScheme( + parameters?: Parameters.CreateIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescreenscheme', + method: 'POST', + data: { + name: parameters?.name, + description: parameters?.description, + issueTypeMappings: parameters?.issueTypeMappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type screen scheme items. + * + * Only issue type screen schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeScreenSchemeMappings( + parameters: Parameters.GetIssueTypeScreenSchemeMappings | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type screen scheme items. + * + * Only issue type screen schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeScreenSchemeMappings( + parameters?: Parameters.GetIssueTypeScreenSchemeMappings, + callback?: never, + ): Promise; + async getIssueTypeScreenSchemeMappings( + parameters?: Parameters.GetIssueTypeScreenSchemeMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescreenscheme/mapping', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. + * + * Only issue type screen schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeScreenSchemeProjectAssociations( + parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. + * + * Only issue type screen schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeScreenSchemeProjectAssociations( + parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, + callback?: never, + ): Promise; + async getIssueTypeScreenSchemeProjectAssociations( + parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescreenscheme/project', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns an issue type screen scheme to a project. + * + * Issue type screen schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignIssueTypeScreenSchemeToProject( + parameters: Parameters.AssignIssueTypeScreenSchemeToProject | undefined, + callback: Callback, + ): Promise; + /** + * Assigns an issue type screen scheme to a project. + * + * Issue type screen schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignIssueTypeScreenSchemeToProject( + parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, + callback?: never, + ): Promise; + async assignIssueTypeScreenSchemeToProject( + parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescreenscheme/project', + method: 'PUT', + data: { + issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueTypeScreenScheme( + parameters: Parameters.UpdateIssueTypeScreenScheme, + callback: Callback, + ): Promise; + /** + * Updates an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueTypeScreenScheme( + parameters: Parameters.UpdateIssueTypeScreenScheme, + callback?: never, + ): Promise; + async updateIssueTypeScreenScheme( + parameters: Parameters.UpdateIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueTypeScreenScheme( + parameters: Parameters.DeleteIssueTypeScreenScheme, + callback: Callback, + ): Promise; + /** + * Deletes an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueTypeScreenScheme( + parameters: Parameters.DeleteIssueTypeScreenScheme, + callback?: never, + ): Promise; + async deleteIssueTypeScreenScheme( + parameters: Parameters.DeleteIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Appends issue type to screen scheme mappings to an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async appendMappingsForIssueTypeScreenScheme( + parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, + callback: Callback, + ): Promise; + /** + * Appends issue type to screen scheme mappings to an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async appendMappingsForIssueTypeScreenScheme( + parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, + callback?: never, + ): Promise; + async appendMappingsForIssueTypeScreenScheme( + parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping`, + method: 'PUT', + data: { + issueTypeMappings: parameters.issueTypeMappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all + * unmapped issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultScreenScheme( + parameters: Parameters.UpdateDefaultScreenScheme, + callback: Callback, + ): Promise; + /** + * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all + * unmapped issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultScreenScheme( + parameters: Parameters.UpdateDefaultScreenScheme, + callback?: never, + ): Promise; + async updateDefaultScreenScheme( + parameters: Parameters.UpdateDefaultScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/default`, + method: 'PUT', + data: { + screenSchemeId: parameters.screenSchemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes issue type to screen scheme mappings from an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeMappingsFromIssueTypeScreenScheme( + parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, + callback: Callback, + ): Promise; + /** + * Removes issue type to screen scheme mappings from an issue type screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeMappingsFromIssueTypeScreenScheme( + parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, + callback?: never, + ): Promise; + async removeMappingsFromIssueTypeScreenScheme( + parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/remove`, + method: 'POST', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * projects associated with an issue type screen scheme. + * + * Only company-managed projects associated with an issue type screen scheme are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectsForIssueTypeScreenScheme( + parameters: Parameters.GetProjectsForIssueTypeScreenScheme, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * projects associated with an issue type screen scheme. + * + * Only company-managed projects associated with an issue type screen scheme are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectsForIssueTypeScreenScheme( + parameters: Parameters.GetProjectsForIssueTypeScreenScheme, + callback?: never, + ): Promise; + async getProjectsForIssueTypeScreenScheme( + parameters: Parameters.GetProjectsForIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/project`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + query: parameters.query, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueTypeScreenSchemes.ts b/src/version3/issueTypeScreenSchemes.ts deleted file mode 100644 index e8c85190e..000000000 --- a/src/version3/issueTypeScreenSchemes.ts +++ /dev/null @@ -1,436 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueTypeScreenSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type screen schemes. - * - * Only issue type screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeScreenSchemes( - parameters: Parameters.GetIssueTypeScreenSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type screen schemes. - * - * Only issue type screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeScreenSchemes( - parameters?: Parameters.GetIssueTypeScreenSchemes, - callback?: never, - ): Promise; - async getIssueTypeScreenSchemes( - parameters?: Parameters.GetIssueTypeScreenSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescreenscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - queryString: parameters?.queryString, - orderBy: parameters?.orderBy, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeScreenScheme( - parameters: Parameters.CreateIssueTypeScreenScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeScreenScheme( - parameters?: Parameters.CreateIssueTypeScreenScheme, - callback?: never, - ): Promise; - async createIssueTypeScreenScheme( - parameters?: Parameters.CreateIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescreenscheme', - method: 'POST', - data: { - name: parameters?.name, - description: parameters?.description, - issueTypeMappings: parameters?.issueTypeMappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type screen scheme items. - * - * Only issue type screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeScreenSchemeMappings( - parameters: Parameters.GetIssueTypeScreenSchemeMappings | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type screen scheme items. - * - * Only issue type screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeScreenSchemeMappings( - parameters?: Parameters.GetIssueTypeScreenSchemeMappings, - callback?: never, - ): Promise; - async getIssueTypeScreenSchemeMappings( - parameters?: Parameters.GetIssueTypeScreenSchemeMappings, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescreenscheme/mapping', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. - * - * Only issue type screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeScreenSchemeProjectAssociations( - parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. - * - * Only issue type screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeScreenSchemeProjectAssociations( - parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, - callback?: never, - ): Promise; - async getIssueTypeScreenSchemeProjectAssociations( - parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescreenscheme/project', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns an issue type screen scheme to a project. - * - * Issue type screen schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeScreenSchemeToProject( - parameters: Parameters.AssignIssueTypeScreenSchemeToProject | undefined, - callback: Callback, - ): Promise; - /** - * Assigns an issue type screen scheme to a project. - * - * Issue type screen schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeScreenSchemeToProject( - parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, - callback?: never, - ): Promise; - async assignIssueTypeScreenSchemeToProject( - parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescreenscheme/project', - method: 'PUT', - data: { - issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueTypeScreenScheme( - parameters: Parameters.UpdateIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Updates an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueTypeScreenScheme( - parameters: Parameters.UpdateIssueTypeScreenScheme, - callback?: never, - ): Promise; - async updateIssueTypeScreenScheme( - parameters: Parameters.UpdateIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeScreenScheme( - parameters: Parameters.DeleteIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Deletes an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeScreenScheme( - parameters: Parameters.DeleteIssueTypeScreenScheme, - callback?: never, - ): Promise; - async deleteIssueTypeScreenScheme( - parameters: Parameters.DeleteIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Appends issue type to screen scheme mappings to an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async appendMappingsForIssueTypeScreenScheme( - parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Appends issue type to screen scheme mappings to an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async appendMappingsForIssueTypeScreenScheme( - parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, - callback?: never, - ): Promise; - async appendMappingsForIssueTypeScreenScheme( - parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping`, - method: 'PUT', - data: { - issueTypeMappings: parameters.issueTypeMappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all - * unmapped issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultScreenScheme( - parameters: Parameters.UpdateDefaultScreenScheme, - callback: Callback, - ): Promise; - /** - * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all - * unmapped issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultScreenScheme( - parameters: Parameters.UpdateDefaultScreenScheme, - callback?: never, - ): Promise; - async updateDefaultScreenScheme( - parameters: Parameters.UpdateDefaultScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/default`, - method: 'PUT', - data: { - screenSchemeId: parameters.screenSchemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes issue type to screen scheme mappings from an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeMappingsFromIssueTypeScreenScheme( - parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Removes issue type to screen scheme mappings from an issue type screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeMappingsFromIssueTypeScreenScheme( - parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, - callback?: never, - ): Promise; - async removeMappingsFromIssueTypeScreenScheme( - parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/remove`, - method: 'POST', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * projects associated with an issue type screen scheme. - * - * Only company-managed projects associated with an issue type screen scheme are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectsForIssueTypeScreenScheme( - parameters: Parameters.GetProjectsForIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * projects associated with an issue type screen scheme. - * - * Only company-managed projects associated with an issue type screen scheme are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectsForIssueTypeScreenScheme( - parameters: Parameters.GetProjectsForIssueTypeScreenScheme, - callback?: never, - ): Promise; - async getProjectsForIssueTypeScreenScheme( - parameters: Parameters.GetProjectsForIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/project`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - query: parameters.query, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueTypes.mts b/src/version3/issueTypes.mts new file mode 100644 index 000000000..7c9fbffe1 --- /dev/null +++ b/src/version3/issueTypes.mts @@ -0,0 +1,336 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueTypes { + constructor(private client: Client) {} + + /** + * Returns all issue types. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issue + * types are only returned as follows: + * + * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue + * types are returned. + * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or + * more projects, the issue types associated with the projects the user has permission to browse are returned. + */ + async getIssueAllTypes(callback: Callback): Promise; + /** + * Returns all issue types. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issue + * types are only returned as follows: + * + * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue + * types are returned. + * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or + * more projects, the issue types associated with the projects the user has permission to browse are returned. + */ + async getIssueAllTypes(callback?: never): Promise; + async getIssueAllTypes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetype', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue type and adds it to the default issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueType( + parameters: Parameters.CreateIssueType | undefined, + callback: Callback, + ): Promise; + /** + * Creates an issue type and adds it to the default issue type scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueType( + parameters?: Parameters.CreateIssueType, + callback?: never, + ): Promise; + async createIssueType( + parameters?: Parameters.CreateIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetype', + method: 'POST', + data: { + name: parameters?.name, + description: parameters?.description, + hierarchyLevel: parameters?.hierarchyLevel, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns issue types for a project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the relevant project or _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypesForProject( + parameters: Parameters.GetIssueTypesForProject, + callback: Callback, + ): Promise; + /** + * Returns issue types for a project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the relevant project or _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypesForProject( + parameters: Parameters.GetIssueTypesForProject, + callback?: never, + ): Promise; + async getIssueTypesForProject( + parameters: Parameters.GetIssueTypesForProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetype/project', + method: 'GET', + params: { + projectId: parameters.projectId, + level: parameters.level, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in a project the issue type is associated + * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueType( + parameters: Parameters.GetIssueType, + callback: Callback, + ): Promise; + /** + * Returns an issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in a project the issue type is associated + * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueType(parameters: Parameters.GetIssueType, callback?: never): Promise; + async getIssueType( + parameters: Parameters.GetIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the issue type. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueType( + parameters: Parameters.UpdateIssueType, + callback: Callback, + ): Promise; + /** + * Updates the issue type. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueType( + parameters: Parameters.UpdateIssueType, + callback?: never, + ): Promise; + async updateIssueType( + parameters: Parameters.UpdateIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + avatarId: parameters.avatarId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type + * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue + * types](#api-rest-api-3-issuetype-id-alternatives-get) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueType(parameters: Parameters.DeleteIssueType, callback: Callback): Promise; + /** + * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type + * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue + * types](#api-rest-api-3-issuetype-id-alternatives-get) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueType(parameters: Parameters.DeleteIssueType, callback?: never): Promise; + async deleteIssueType(parameters: Parameters.DeleteIssueType, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.id}`, + method: 'DELETE', + params: { + alternativeIssueTypeId: parameters.alternativeIssueTypeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those + * assigned to the same workflow scheme, field configuration scheme, and screen scheme. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAlternativeIssueTypes( + parameters: Parameters.GetAlternativeIssueTypes, + callback: Callback, + ): Promise; + /** + * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those + * assigned to the same workflow scheme, field configuration scheme, and screen scheme. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAlternativeIssueTypes( + parameters: Parameters.GetAlternativeIssueTypes, + callback?: never, + ): Promise; + async getAlternativeIssueTypes( + parameters: Parameters.GetAlternativeIssueTypes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.id}/alternatives`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Loads an avatar for the issue type. + * + * Specify the avatar's local file location in the body of the request. Also, include the following headers: + * + * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special + * Headers](#special-request-headers). + * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * + * For example: `curl --request POST \ --user email@example.com: \ --header 'X-Atlassian-Token: no-check'\ + * --header 'Content-Type: image/< image_type>' \ --data-binary "<@/path/to/file/with/your/avatar>" \ --url + * 'https://your-domain.atlassian.net/rest/api/3/issuetype/{issueTypeId}'This` + * + * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of + * the image. The length of the square's sides is set to the smaller of the height or width of the image. + * + * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. + * + * After creating the avatar, use [ Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's + * displayed avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueTypeAvatar( + parameters: Parameters.CreateIssueTypeAvatar, + callback: Callback, + ): Promise; + /** + * Loads an avatar for the issue type. + * + * Specify the avatar's local file location in the body of the request. Also, include the following headers: + * + * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special + * Headers](#special-request-headers). + * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * + * For example: `curl --request POST \ --user email@example.com: \ --header 'X-Atlassian-Token: no-check'\ + * --header 'Content-Type: image/< image_type>' \ --data-binary "<@/path/to/file/with/your/avatar>" \ --url + * 'https://your-domain.atlassian.net/rest/api/3/issuetype/{issueTypeId}'This` + * + * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of + * the image. The length of the square's sides is set to the smaller of the height or width of the image. + * + * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. + * + * After creating the avatar, use [ Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's + * displayed avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueTypeAvatar( + parameters: Parameters.CreateIssueTypeAvatar, + callback?: never, + ): Promise; + async createIssueTypeAvatar( + parameters: Parameters.CreateIssueTypeAvatar, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.id}/avatar2`, + method: 'POST', + params: { + x: parameters.x, + y: parameters.y, + size: parameters.size, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueTypes.ts b/src/version3/issueTypes.ts deleted file mode 100644 index ad587b006..000000000 --- a/src/version3/issueTypes.ts +++ /dev/null @@ -1,336 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueTypes { - constructor(private client: Client) {} - - /** - * Returns all issue types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issue - * types are only returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue - * types are returned. - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or - * more projects, the issue types associated with the projects the user has permission to browse are returned. - */ - async getIssueAllTypes(callback: Callback): Promise; - /** - * Returns all issue types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issue - * types are only returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue - * types are returned. - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or - * more projects, the issue types associated with the projects the user has permission to browse are returned. - */ - async getIssueAllTypes(callback?: never): Promise; - async getIssueAllTypes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetype', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue type and adds it to the default issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueType( - parameters: Parameters.CreateIssueType | undefined, - callback: Callback, - ): Promise; - /** - * Creates an issue type and adds it to the default issue type scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueType( - parameters?: Parameters.CreateIssueType, - callback?: never, - ): Promise; - async createIssueType( - parameters?: Parameters.CreateIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetype', - method: 'POST', - data: { - name: parameters?.name, - description: parameters?.description, - hierarchyLevel: parameters?.hierarchyLevel, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns issue types for a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the relevant project or _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypesForProject( - parameters: Parameters.GetIssueTypesForProject, - callback: Callback, - ): Promise; - /** - * Returns issue types for a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the relevant project or _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypesForProject( - parameters: Parameters.GetIssueTypesForProject, - callback?: never, - ): Promise; - async getIssueTypesForProject( - parameters: Parameters.GetIssueTypesForProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetype/project', - method: 'GET', - params: { - projectId: parameters.projectId, - level: parameters.level, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in a project the issue type is associated - * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueType( - parameters: Parameters.GetIssueType, - callback: Callback, - ): Promise; - /** - * Returns an issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) in a project the issue type is associated - * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueType(parameters: Parameters.GetIssueType, callback?: never): Promise; - async getIssueType( - parameters: Parameters.GetIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the issue type. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueType( - parameters: Parameters.UpdateIssueType, - callback: Callback, - ): Promise; - /** - * Updates the issue type. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueType( - parameters: Parameters.UpdateIssueType, - callback?: never, - ): Promise; - async updateIssueType( - parameters: Parameters.UpdateIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - avatarId: parameters.avatarId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type - * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue - * types](#api-rest-api-3-issuetype-id-alternatives-get) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueType(parameters: Parameters.DeleteIssueType, callback: Callback): Promise; - /** - * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type - * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue - * types](#api-rest-api-3-issuetype-id-alternatives-get) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueType(parameters: Parameters.DeleteIssueType, callback?: never): Promise; - async deleteIssueType(parameters: Parameters.DeleteIssueType, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.id}`, - method: 'DELETE', - params: { - alternativeIssueTypeId: parameters.alternativeIssueTypeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those - * assigned to the same workflow scheme, field configuration scheme, and screen scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes, - callback: Callback, - ): Promise; - /** - * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those - * assigned to the same workflow scheme, field configuration scheme, and screen scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes, - callback?: never, - ): Promise; - async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.id}/alternatives`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Loads an avatar for the issue type. - * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * For example: `curl --request POST \ --user email@example.com: \ --header 'X-Atlassian-Token: no-check'\ - * --header 'Content-Type: image/< image_type>' \ --data-binary "<@/path/to/file/with/your/avatar>" \ --url - * 'https://your-domain.atlassian.net/rest/api/3/issuetype/{issueTypeId}'This` - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar, use [ Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's - * displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeAvatar( - parameters: Parameters.CreateIssueTypeAvatar, - callback: Callback, - ): Promise; - /** - * Loads an avatar for the issue type. - * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * For example: `curl --request POST \ --user email@example.com: \ --header 'X-Atlassian-Token: no-check'\ - * --header 'Content-Type: image/< image_type>' \ --data-binary "<@/path/to/file/with/your/avatar>" \ --url - * 'https://your-domain.atlassian.net/rest/api/3/issuetype/{issueTypeId}'This` - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar, use [ Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's - * displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeAvatar( - parameters: Parameters.CreateIssueTypeAvatar, - callback?: never, - ): Promise; - async createIssueTypeAvatar( - parameters: Parameters.CreateIssueTypeAvatar, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.id}/avatar2`, - method: 'POST', - params: { - x: parameters.x, - y: parameters.y, - size: parameters.size, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueVotes.mts b/src/version3/issueVotes.mts new file mode 100644 index 000000000..6eecf2cbc --- /dev/null +++ b/src/version3/issueVotes.mts @@ -0,0 +1,139 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueVotes { + constructor(private client: Client) {} + + /** + * Returns details about the votes on an issue. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * ini + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * + * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ + * project permissions are not returned details in the `voters` field. + */ + async getVotes(parameters: Parameters.GetVotes, callback: Callback): Promise; + /** + * Returns details about the votes on an issue. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * ini + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * + * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ + * project permissions are not returned details in the `voters` field. + */ + async getVotes(parameters: Parameters.GetVotes, callback?: never): Promise; + async getVotes(parameters: Parameters.GetVotes, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/votes`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addVote(parameters: Parameters.AddVote, callback: Callback): Promise; + /** + * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addVote(parameters: Parameters.AddVote, callback?: never): Promise; + async addVote(parameters: Parameters.AddVote, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/votes`, + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async removeVote(parameters: Parameters.RemoveVote, callback: Callback): Promise; + /** + * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async removeVote(parameters: Parameters.RemoveVote, callback?: never): Promise; + async removeVote(parameters: Parameters.RemoveVote, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/votes`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueVotes.ts b/src/version3/issueVotes.ts deleted file mode 100644 index 9b3bfd713..000000000 --- a/src/version3/issueVotes.ts +++ /dev/null @@ -1,139 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueVotes { - constructor(private client: Client) {} - - /** - * Returns details about the votes on an issue. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ - * project permissions are not returned details in the `voters` field. - */ - async getVotes(parameters: Parameters.GetVotes, callback: Callback): Promise; - /** - * Returns details about the votes on an issue. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ - * project permissions are not returned details in the `voters` field. - */ - async getVotes(parameters: Parameters.GetVotes, callback?: never): Promise; - async getVotes(parameters: Parameters.GetVotes, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/votes`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addVote(parameters: Parameters.AddVote, callback: Callback): Promise; - /** - * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addVote(parameters: Parameters.AddVote, callback?: never): Promise; - async addVote(parameters: Parameters.AddVote, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/votes`, - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async removeVote(parameters: Parameters.RemoveVote, callback: Callback): Promise; - /** - * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async removeVote(parameters: Parameters.RemoveVote, callback?: never): Promise; - async removeVote(parameters: Parameters.RemoveVote, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/votes`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueWatchers.mts b/src/version3/issueWatchers.mts new file mode 100644 index 000000000..a3ff203ba --- /dev/null +++ b/src/version3/issueWatchers.mts @@ -0,0 +1,211 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueWatchers { + constructor(private client: Client) {} + + /** + * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned + * watched status is `false`. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIsWatchingIssueBulk( + parameters: Parameters.GetIsWatchingIssueBulk | undefined, + callback: Callback, + ): Promise; + /** + * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned + * watched status is `false`. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIsWatchingIssueBulk( + parameters?: Parameters.GetIsWatchingIssueBulk, + callback?: never, + ): Promise; + async getIsWatchingIssueBulk( + parameters?: Parameters.GetIsWatchingIssueBulk, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/watching', + method: 'POST', + data: { + issueIds: parameters?.issueIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the watchers for an issue. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * ini + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async getIssueWatchers( + parameters: Parameters.GetIssueWatchers, + callback: Callback, + ): Promise; + /** + * Returns the watchers for an issue. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * ini + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async getIssueWatchers(parameters: Parameters.GetIssueWatchers, callback?: never): Promise; + async getIssueWatchers( + parameters: Parameters.GetIssueWatchers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/watchers`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a user as a watcher of an issue by passing the account ID of the user. For example, + * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - To add users other than themselves to the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async addWatcher(parameters: Parameters.AddWatcher, callback: Callback): Promise; + /** + * Adds a user as a watcher of an issue by passing the account ID of the user. For example, + * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - To add users other than themselves to the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async addWatcher(parameters: Parameters.AddWatcher, callback?: never): Promise; + async addWatcher(parameters: Parameters.AddWatcher, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/watchers`, + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: parameters.accountId, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a user as a watcher of an issue. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async removeWatcher(parameters: Parameters.RemoveWatcher, callback: Callback): Promise; + /** + * Deletes a user as a watcher of an issue. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: never): Promise; + async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/watchers`, + method: 'DELETE', + params: { + username: parameters.username, + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueWatchers.ts b/src/version3/issueWatchers.ts deleted file mode 100644 index fd2ea5acb..000000000 --- a/src/version3/issueWatchers.ts +++ /dev/null @@ -1,211 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueWatchers { - constructor(private client: Client) {} - - /** - * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned - * watched status is `false`. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIsWatchingIssueBulk( - parameters: Parameters.GetIsWatchingIssueBulk | undefined, - callback: Callback, - ): Promise; - /** - * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned - * watched status is `false`. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIsWatchingIssueBulk( - parameters?: Parameters.GetIsWatchingIssueBulk, - callback?: never, - ): Promise; - async getIsWatchingIssueBulk( - parameters?: Parameters.GetIsWatchingIssueBulk, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/watching', - method: 'POST', - data: { - issueIds: parameters?.issueIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the watchers for an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async getIssueWatchers( - parameters: Parameters.GetIssueWatchers, - callback: Callback, - ): Promise; - /** - * Returns the watchers for an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async getIssueWatchers(parameters: Parameters.GetIssueWatchers, callback?: never): Promise; - async getIssueWatchers( - parameters: Parameters.GetIssueWatchers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/watchers`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a user as a watcher of an issue by passing the account ID of the user. For example, - * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To add users other than themselves to the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async addWatcher(parameters: Parameters.AddWatcher, callback: Callback): Promise; - /** - * Adds a user as a watcher of an issue by passing the account ID of the user. For example, - * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To add users other than themselves to the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async addWatcher(parameters: Parameters.AddWatcher, callback?: never): Promise; - async addWatcher(parameters: Parameters.AddWatcher, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/watchers`, - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - data: parameters.accountId, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a user as a watcher of an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async removeWatcher(parameters: Parameters.RemoveWatcher, callback: Callback): Promise; - /** - * Deletes a user as a watcher of an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: never): Promise; - async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/watchers`, - method: 'DELETE', - params: { - username: parameters.username, - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueWorklogProperties.mts b/src/version3/issueWorklogProperties.mts new file mode 100644 index 000000000..11e741db8 --- /dev/null +++ b/src/version3/issueWorklogProperties.mts @@ -0,0 +1,197 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueWorklogProperties { + constructor(private client: Client) {} + + /** + * Returns the keys of all properties for a worklog. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklogPropertyKeys( + parameters: Parameters.GetWorklogPropertyKeys, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for a worklog. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklogPropertyKeys( + parameters: Parameters.GetWorklogPropertyKeys, + callback?: never, + ): Promise; + async getWorklogPropertyKeys( + parameters: Parameters.GetWorklogPropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a worklog property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklogProperty( + parameters: Parameters.GetWorklogProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a worklog property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklogProperty( + parameters: Parameters.GetWorklogProperty, + callback?: never, + ): Promise; + async getWorklogProperty( + parameters: Parameters.GetWorklogProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a worklog property. Use this operation to store custom data against the worklog. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async setWorklogProperty( + parameters: Parameters.SetWorklogProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of a worklog property. Use this operation to store custom data against the worklog. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async setWorklogProperty(parameters: Parameters.SetWorklogProperty, callback?: never): Promise; + async setWorklogProperty( + parameters: Parameters.SetWorklogProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a worklog property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async deleteWorklogProperty( + parameters: Parameters.DeleteWorklogProperty, + callback: Callback, + ): Promise; + /** + * Deletes a worklog property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async deleteWorklogProperty(parameters: Parameters.DeleteWorklogProperty, callback?: never): Promise; + async deleteWorklogProperty( + parameters: Parameters.DeleteWorklogProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueWorklogProperties.ts b/src/version3/issueWorklogProperties.ts deleted file mode 100644 index 6dfe837e6..000000000 --- a/src/version3/issueWorklogProperties.ts +++ /dev/null @@ -1,197 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueWorklogProperties { - constructor(private client: Client) {} - - /** - * Returns the keys of all properties for a worklog. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogPropertyKeys( - parameters: Parameters.GetWorklogPropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for a worklog. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogPropertyKeys( - parameters: Parameters.GetWorklogPropertyKeys, - callback?: never, - ): Promise; - async getWorklogPropertyKeys( - parameters: Parameters.GetWorklogPropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a worklog property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogProperty( - parameters: Parameters.GetWorklogProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a worklog property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogProperty( - parameters: Parameters.GetWorklogProperty, - callback?: never, - ): Promise; - async getWorklogProperty( - parameters: Parameters.GetWorklogProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a worklog property. Use this operation to store custom data against the worklog. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async setWorklogProperty( - parameters: Parameters.SetWorklogProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of a worklog property. Use this operation to store custom data against the worklog. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async setWorklogProperty(parameters: Parameters.SetWorklogProperty, callback?: never): Promise; - async setWorklogProperty( - parameters: Parameters.SetWorklogProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a worklog property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklogProperty( - parameters: Parameters.DeleteWorklogProperty, - callback: Callback, - ): Promise; - /** - * Deletes a worklog property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklogProperty(parameters: Parameters.DeleteWorklogProperty, callback?: never): Promise; - async deleteWorklogProperty( - parameters: Parameters.DeleteWorklogProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueWorklogs.mts b/src/version3/issueWorklogs.mts new file mode 100644 index 000000000..73ebb37a2 --- /dev/null +++ b/src/version3/issueWorklogs.mts @@ -0,0 +1,498 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueWorklogs { + constructor(private client: Client) {} + + /** + * Returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and + * time. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Workloads are only returned where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getIssueWorklog( + parameters: Parameters.GetIssueWorklog, + callback: Callback, + ): Promise; + /** + * Returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and + * time. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Workloads are only returned where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getIssueWorklog( + parameters: Parameters.GetIssueWorklog, + callback?: never, + ): Promise; + async getIssueWorklog( + parameters: Parameters.GetIssueWorklog, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + startedAfter: parameters.startedAfter, + startedBefore: parameters.startedBefore, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a worklog to an issue. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Work on issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addWorklog(parameters: Parameters.AddWorklog, callback: Callback): Promise; + /** + * Adds a worklog to an issue. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Work on issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addWorklog(parameters: Parameters.AddWorklog, callback?: never): Promise; + async addWorklog(parameters: Parameters.AddWorklog, callback?: Callback): Promise { + let comment: Models.Document | undefined; + + if (typeof parameters.comment === 'string') { + comment = { + type: 'doc', + version: 1, + content: [ + { + type: 'paragraph', + content: [ + { + type: 'text', + text: parameters.comment, + }, + ], + }, + ], + }; + } else { + comment = parameters.comment; + } + + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog`, + method: 'POST', + params: { + notifyUsers: parameters.notifyUsers, + adjustEstimate: parameters.adjustEstimate, + newEstimate: parameters.newEstimate, + reduceBy: parameters.reduceBy, + expand: parameters.expand, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + data: { + self: parameters.self, + author: parameters.author, + updateAuthor: parameters.updateAuthor, + comment, + created: parameters.created, + updated: parameters.updated, + visibility: parameters.visibility, + started: parameters.started, + timeSpent: parameters.timeSpent, + timeSpentSeconds: parameters.timeSpentSeconds, + id: parameters.id, + issueId: parameters.issueId, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a worklog. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklog(parameters: Parameters.GetWorklog, callback: Callback): Promise; + /** + * Returns a worklog. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklog(parameters: Parameters.GetWorklog, callback?: never): Promise; + async getWorklog(parameters: Parameters.GetWorklog, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a worklog. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async updateWorklog(parameters: Parameters.UpdateWorklog, callback: Callback): Promise; + /** + * Updates a worklog. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async updateWorklog(parameters: Parameters.UpdateWorklog, callback?: never): Promise; + async updateWorklog( + parameters: Parameters.UpdateWorklog, + callback?: Callback, + ): Promise { + let comment: Models.Document | undefined; + + if (typeof parameters.comment === 'string') { + comment = { + type: 'doc', + version: 1, + content: [ + { + type: 'paragraph', + content: [ + { + type: 'text', + text: parameters.comment, + }, + ], + }, + ], + }; + } else { + comment = parameters.comment; + } + + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, + method: 'PUT', + params: { + notifyUsers: parameters.notifyUsers, + adjustEstimate: parameters.adjustEstimate, + newEstimate: parameters.newEstimate, + expand: parameters.expand, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + data: { + comment, + visibility: parameters.visibility, + started: parameters.started, + timeSpent: parameters.timeSpent, + timeSpentSeconds: parameters.timeSpentSeconds, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a worklog from an issue. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or + * _Delete own worklogs_ to delete worklogs created by the user, + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async deleteWorklog(parameters: Parameters.DeleteWorklog, callback: Callback): Promise; + /** + * Deletes a worklog from an issue. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or + * _Delete own worklogs_ to delete worklogs created by the user, + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: never): Promise; + async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, + method: 'DELETE', + params: { + notifyUsers: parameters.notifyUsers, + adjustEstimate: parameters.adjustEstimate, + newEstimate: parameters.newEstimate, + increaseBy: parameters.increaseBy, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. + * + * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set + * to true on the last page of worklogs. + * + * This resource does not return worklogs deleted during the minute preceding the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getIdsOfWorklogsDeletedSince( + parameters: Parameters.GetIdsOfWorklogsDeletedSince | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. + * + * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set + * to true on the last page of worklogs. + * + * This resource does not return worklogs deleted during the minute preceding the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getIdsOfWorklogsDeletedSince( + parameters?: Parameters.GetIdsOfWorklogsDeletedSince, + callback?: never, + ): Promise; + async getIdsOfWorklogsDeletedSince( + parameters?: Parameters.GetIdsOfWorklogsDeletedSince, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/worklog/deleted', + method: 'GET', + params: { + since: parameters?.since, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns worklog details for a list of worklog IDs. + * + * The returned list of worklogs is limited to 1000 items. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * + * - The worklog is set as _Viewable by All Users_. + * - The user is a member of a project role or group with permission to view the worklog. + */ + async getWorklogsForIds( + parameters: Parameters.GetWorklogsForIds | undefined, + callback: Callback, + ): Promise; + /** + * Returns worklog details for a list of worklog IDs. + * + * The returned list of worklogs is limited to 1000 items. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * + * - The worklog is set as _Viewable by All Users_. + * - The user is a member of a project role or group with permission to view the worklog. + */ + async getWorklogsForIds( + parameters?: Parameters.GetWorklogsForIds, + callback?: never, + ): Promise; + async getWorklogsForIds( + parameters?: Parameters.GetWorklogsForIds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/worklog/list', + method: 'POST', + params: { + expand: parameters?.expand, + }, + data: { + ids: parameters?.ids, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of IDs and update timestamps for worklogs updated after a date and time. + * + * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set + * to true on the last page of worklogs. + * + * This resource does not return worklogs updated during the minute preceding the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * + * - The worklog is set as _Viewable by All Users_. + * - The user is a member of a project role or group with permission to view the worklog. + */ + async getIdsOfWorklogsModifiedSince( + parameters: Parameters.GetIdsOfWorklogsModifiedSince | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of IDs and update timestamps for worklogs updated after a date and time. + * + * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set + * to true on the last page of worklogs. + * + * This resource does not return worklogs updated during the minute preceding the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * + * - The worklog is set as _Viewable by All Users_. + * - The user is a member of a project role or group with permission to view the worklog. + */ + async getIdsOfWorklogsModifiedSince( + parameters?: Parameters.GetIdsOfWorklogsModifiedSince, + callback?: never, + ): Promise; + async getIdsOfWorklogsModifiedSince( + parameters?: Parameters.GetIdsOfWorklogsModifiedSince, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/worklog/updated', + method: 'GET', + params: { + since: parameters?.since, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueWorklogs.ts b/src/version3/issueWorklogs.ts deleted file mode 100644 index db3ef72db..000000000 --- a/src/version3/issueWorklogs.ts +++ /dev/null @@ -1,498 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class IssueWorklogs { - constructor(private client: Client) {} - - /** - * Returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and - * time. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Workloads are only returned where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getIssueWorklog( - parameters: Parameters.GetIssueWorklog, - callback: Callback, - ): Promise; - /** - * Returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and - * time. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Workloads are only returned where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getIssueWorklog( - parameters: Parameters.GetIssueWorklog, - callback?: never, - ): Promise; - async getIssueWorklog( - parameters: Parameters.GetIssueWorklog, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - startedAfter: parameters.startedAfter, - startedBefore: parameters.startedBefore, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a worklog to an issue. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Work on issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addWorklog(parameters: Parameters.AddWorklog, callback: Callback): Promise; - /** - * Adds a worklog to an issue. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Work on issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addWorklog(parameters: Parameters.AddWorklog, callback?: never): Promise; - async addWorklog(parameters: Parameters.AddWorklog, callback?: Callback): Promise { - let comment: Models.Document | undefined; - - if (typeof parameters.comment === 'string') { - comment = { - type: 'doc', - version: 1, - content: [ - { - type: 'paragraph', - content: [ - { - type: 'text', - text: parameters.comment, - }, - ], - }, - ], - }; - } else { - comment = parameters.comment; - } - - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog`, - method: 'POST', - params: { - notifyUsers: parameters.notifyUsers, - adjustEstimate: parameters.adjustEstimate, - newEstimate: parameters.newEstimate, - reduceBy: parameters.reduceBy, - expand: parameters.expand, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - data: { - self: parameters.self, - author: parameters.author, - updateAuthor: parameters.updateAuthor, - comment, - created: parameters.created, - updated: parameters.updated, - visibility: parameters.visibility, - started: parameters.started, - timeSpent: parameters.timeSpent, - timeSpentSeconds: parameters.timeSpentSeconds, - id: parameters.id, - issueId: parameters.issueId, - properties: parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a worklog. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklog(parameters: Parameters.GetWorklog, callback: Callback): Promise; - /** - * Returns a worklog. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklog(parameters: Parameters.GetWorklog, callback?: never): Promise; - async getWorklog(parameters: Parameters.GetWorklog, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a worklog. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async updateWorklog(parameters: Parameters.UpdateWorklog, callback: Callback): Promise; - /** - * Updates a worklog. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async updateWorklog(parameters: Parameters.UpdateWorklog, callback?: never): Promise; - async updateWorklog( - parameters: Parameters.UpdateWorklog, - callback?: Callback, - ): Promise { - let comment: Models.Document | undefined; - - if (typeof parameters.comment === 'string') { - comment = { - type: 'doc', - version: 1, - content: [ - { - type: 'paragraph', - content: [ - { - type: 'text', - text: parameters.comment, - }, - ], - }, - ], - }; - } else { - comment = parameters.comment; - } - - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, - method: 'PUT', - params: { - notifyUsers: parameters.notifyUsers, - adjustEstimate: parameters.adjustEstimate, - newEstimate: parameters.newEstimate, - expand: parameters.expand, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - data: { - comment, - visibility: parameters.visibility, - started: parameters.started, - timeSpent: parameters.timeSpent, - timeSpentSeconds: parameters.timeSpentSeconds, - properties: parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a worklog from an issue. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or - * _Delete own worklogs_ to delete worklogs created by the user, - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklog(parameters: Parameters.DeleteWorklog, callback: Callback): Promise; - /** - * Deletes a worklog from an issue. - * - * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see - * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or - * _Delete own worklogs_ to delete worklogs created by the user, - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: never): Promise; - async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, - method: 'DELETE', - params: { - notifyUsers: parameters.notifyUsers, - adjustEstimate: parameters.adjustEstimate, - newEstimate: parameters.newEstimate, - increaseBy: parameters.increaseBy, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs deleted during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getIdsOfWorklogsDeletedSince( - parameters: Parameters.GetIdsOfWorklogsDeletedSince | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs deleted during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getIdsOfWorklogsDeletedSince( - parameters?: Parameters.GetIdsOfWorklogsDeletedSince, - callback?: never, - ): Promise; - async getIdsOfWorklogsDeletedSince( - parameters?: Parameters.GetIdsOfWorklogsDeletedSince, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/worklog/deleted', - method: 'GET', - params: { - since: parameters?.since, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns worklog details for a list of worklog IDs. - * - * The returned list of worklogs is limited to 1000 items. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getWorklogsForIds( - parameters: Parameters.GetWorklogsForIds | undefined, - callback: Callback, - ): Promise; - /** - * Returns worklog details for a list of worklog IDs. - * - * The returned list of worklogs is limited to 1000 items. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getWorklogsForIds( - parameters?: Parameters.GetWorklogsForIds, - callback?: never, - ): Promise; - async getWorklogsForIds( - parameters?: Parameters.GetWorklogsForIds, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/worklog/list', - method: 'POST', - params: { - expand: parameters?.expand, - }, - data: { - ids: parameters?.ids, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of IDs and update timestamps for worklogs updated after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs updated during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getIdsOfWorklogsModifiedSince( - parameters: Parameters.GetIdsOfWorklogsModifiedSince | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of IDs and update timestamps for worklogs updated after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs updated during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getIdsOfWorklogsModifiedSince( - parameters?: Parameters.GetIdsOfWorklogsModifiedSince, - callback?: never, - ): Promise; - async getIdsOfWorklogsModifiedSince( - parameters?: Parameters.GetIdsOfWorklogsModifiedSince, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/worklog/updated', - method: 'GET', - params: { - since: parameters?.since, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issues.mts b/src/version3/issues.mts new file mode 100644 index 000000000..e2ea96e11 --- /dev/null +++ b/src/version3/issues.mts @@ -0,0 +1,1119 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Issues { + constructor(private client: Client) {} + + /** + * Returns all issue events. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getEvents(callback: Callback): Promise; + /** + * Returns all issue events. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getEvents(callback?: never): Promise; + async getEvents(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/events', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be + * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties + * set. + * + * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue + * or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These are + * the same fields that appear on the issue's create screen. Note that the `description`, `environment`, and any + * `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom + * fields (`textfield`) accept a string and don't handle Atlassian Document Format content. + * + * Creating a subtask differs from creating an issue as follows: + * + * - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). + * - `parent` must contain the ID or key of the parent issue. + * + * In a next-gen project any issue may be made a child providing that the parent and child are members of the same + * project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which the issue or subtask is created. + */ + async createIssue(parameters: Parameters.CreateIssue, callback: Callback): Promise; + /** + * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be + * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties + * set. + * + * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue + * or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These are + * the same fields that appear on the issue's create screen. Note that the `description`, `environment`, and any + * `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom + * fields (`textfield`) accept a string and don't handle Atlassian Document Format content. + * + * Creating a subtask differs from creating an issue as follows: + * + * - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). + * - `parent` must contain the ID or key of the parent issue. + * + * In a next-gen project any issue may be made a child providing that the parent and child are members of the same + * project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which the issue or subtask is created. + */ + async createIssue(parameters: Parameters.CreateIssue, callback?: never): Promise; + async createIssue( + parameters: Parameters.CreateIssue, + callback?: Callback, + ): Promise { + if (parameters.fields?.description && typeof parameters.fields.description === 'string') { + parameters.fields.description = { + type: 'doc', + version: 1, + content: [ + { + type: 'paragraph', + content: [ + { + text: parameters.fields.description, + type: 'text', + }, + ], + }, + ], + }; + } + + const config: RequestConfig = { + url: '/rest/api/3/issue', + method: 'POST', + params: { + updateHistory: parameters.updateHistory, + }, + data: { + fields: parameters.fields, + historyMetadata: parameters.historyMetadata, + properties: parameters.properties, + transition: parameters.transition, + update: parameters.update, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Enables admins to archive up to 100,000 issues in a single request using Jql, returning the URL to check the status + * of the submitted request. + * + * You can use the [get + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-get) + * and [cancel + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) + * APIs to manage the request. + * + * **Note that:** + * + * - You can't archive subtasks directly, only through their parent issues + * - You can only archive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + * + * **Rate limiting:** Only a single request per user can be active at any given time. + */ + async archiveIssuesAsync( + parameters: Parameters.ArchiveIssuesAsync, + callback: Callback, + ): Promise; + /** + * Enables admins to archive up to 100,000 issues in a single request using Jql, returning the URL to check the status + * of the submitted request. + * + * You can use the [get + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-get) + * and [cancel + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) + * APIs to manage the request. + * + * **Note that:** + * + * - You can't archive subtasks directly, only through their parent issues + * - You can only archive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + * + * **Rate limiting:** Only a single request per user can be active at any given time. + */ + async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback?: never): Promise; + async archiveIssuesAsync( + parameters: Parameters.ArchiveIssuesAsync, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/archive', + method: 'POST', + data: { + jql: parameters.jql, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the + * issue(s) archived in the process and the errors encountered, if any. + * + * **Note that:** + * + * - You can't archive subtasks directly, only through their parent issues + * - You can only archive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + */ + async archiveIssues( + parameters: Parameters.ArchiveIssues, + callback: Callback, + ): Promise; + /** + * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the + * issue(s) archived in the process and the errors encountered, if any. + * + * **Note that:** + * + * - You can't archive subtasks directly, only through their parent issues + * - You can only archive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + */ + async archiveIssues(parameters: Parameters.ArchiveIssues, callback?: never): Promise; + async archiveIssues( + parameters: Parameters.ArchiveIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/archive', + method: 'PUT', + data: { + issueIdsOrKeys: parameters.issueIdsOrKeys, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may + * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue + * properties set. + * + * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the + * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These + * are the same fields that appear on the issues' create screens. Note that the `description`, `environment`, and any + * `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom + * fields (`textfield`) accept a string and don't handle Atlassian Document Format content. + * + * Creating a subtask differs from creating an issue as follows: + * + * - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). + * - `parent` the must contain the ID or key of the parent issue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which each issue or subtask is created. + */ + async createIssues( + parameters: Parameters.CreateIssues | undefined, + callback: Callback, + ): Promise; + /** + * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may + * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue + * properties set. + * + * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the + * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These + * are the same fields that appear on the issues' create screens. Note that the `description`, `environment`, and any + * `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom + * fields (`textfield`) accept a string and don't handle Atlassian Document Format content. + * + * Creating a subtask differs from creating an issue as follows: + * + * - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). + * - `parent` the must contain the ID or key of the parent issue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which each issue or subtask is created. + */ + async createIssues(parameters?: Parameters.CreateIssues, callback?: never): Promise; + async createIssues( + parameters?: Parameters.CreateIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/bulk', + method: 'POST', + data: { + issueUpdates: parameters?.issueUpdates, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each + * issue type for the user. Use the information to populate the requests in [ Create + * issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). + * + * The request can be restricted to specific projects or issue types using the query parameters. The response will + * contain information for the valid projects, issue types, or project and issue type combinations requested. Note + * that invalid project, issue type, or project and issue type combinations do not generate errors. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + */ + async getCreateIssueMeta( + parameters: Parameters.GetCreateIssueMeta | undefined, + callback: Callback, + ): Promise; + /** + * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each + * issue type for the user. Use the information to populate the requests in [ Create + * issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). + * + * The request can be restricted to specific projects or issue types using the query parameters. The response will + * contain information for the valid projects, issue types, or project and issue type combinations requested. Note + * that invalid project, issue type, or project and issue type combinations do not generate errors. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + */ + async getCreateIssueMeta( + parameters?: Parameters.GetCreateIssueMeta, + callback?: never, + ): Promise; + async getCreateIssueMeta( + parameters?: Parameters.GetCreateIssueMeta, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/createmeta', + method: 'GET', + params: { + projectIds: parameters?.projectIds, + projectKeys: parameters?.projectKeys, + issuetypeIds: parameters?.issuetypeIds, + issuetypeNames: parameters?.issuetypeNames, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Enables admins to unarchive up to 1000 issues in a single request using issue ID/key, returning details of the + * issue(s) unarchived in the process and the errors encountered, if any. + * + * **Note that:** + * + * - You can't unarchive subtasks directly, only through their parent issues + * - You can only unarchive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + */ + async unarchiveIssues( + parameters: Parameters.UnarchiveIssues, + callback: Callback, + ): Promise; + /** + * Enables admins to unarchive up to 1000 issues in a single request using issue ID/key, returning details of the + * issue(s) unarchived in the process and the errors encountered, if any. + * + * **Note that:** + * + * - You can't unarchive subtasks directly, only through their parent issues + * - You can only unarchive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + */ + async unarchiveIssues( + parameters: Parameters.UnarchiveIssues, + callback?: never, + ): Promise; + async unarchiveIssues( + parameters: Parameters.UnarchiveIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/unarchive', + method: 'PUT', + data: { + issueIdsOrKeys: parameters.issueIdsOrKeys, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the details for an issue. + * + * The issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive + * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or + * other redirect is **not** returned. The issue key returned in the response is the key of the issue found. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIssue(parameters: Parameters.GetIssue, callback: Callback): Promise; + /** + * Returns the details for an issue. + * + * The issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive + * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or + * other redirect is **not** returned. The issue key returned in the response is the key of the issue found. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIssue(parameters: Parameters.GetIssue, callback?: never): Promise; + async getIssue(parameters: Parameters.GetIssue, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}`, + method: 'GET', + params: { + fields: parameters.fields, + fieldsByKeys: parameters.fieldsByKeys, + expand: parameters.expand, + properties: parameters.properties, + updateHistory: parameters.updateHistory, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Edits an issue. A transition may be applied and issue properties updated as part of the edit. + * + * The edits to the issue's fields are defined using `update` and `fields`. The fields that can be edited are + * determined using [ Get edit issue metadata](#api-rest-api-3-issue-issueIdOrKey-editmeta-get). + * + * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting + * `update.parent.set.none` to _true_. Note that the `description`, `environment`, and any `textarea` type custom + * fields (multi-line text fields) take Atlassian Document Format content. Single line custom fields (`textfield`) + * accept a string and don't handle Atlassian Document Format content. + * + * Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security + * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async editIssue(parameters: Parameters.EditIssue, callback: Callback): Promise; + /** + * Edits an issue. A transition may be applied and issue properties updated as part of the edit. + * + * The edits to the issue's fields are defined using `update` and `fields`. The fields that can be edited are + * determined using [ Get edit issue metadata](#api-rest-api-3-issue-issueIdOrKey-editmeta-get). + * + * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting + * `update.parent.set.none` to _true_. Note that the `description`, `environment`, and any `textarea` type custom + * fields (multi-line text fields) take Atlassian Document Format content. Single line custom fields (`textfield`) + * accept a string and don't handle Atlassian Document Format content. + * + * Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security + * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project + * that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async editIssue(parameters: Parameters.EditIssue, callback?: never): Promise; + async editIssue(parameters: Parameters.EditIssue, callback?: Callback): Promise { + if (parameters.fields?.description && typeof parameters.fields.description === 'string') { + const { + fields: { description }, + } = await this.getIssue({ issueIdOrKey: parameters.issueIdOrKey }); + + parameters.fields.description = { + type: 'doc', + version: description?.version ?? 1, + content: [ + { + type: 'paragraph', + content: [ + { + text: parameters.fields.description, + type: 'text', + }, + ], + }, + ], + }; + } + + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}`, + method: 'PUT', + params: { + notifyUsers: parameters.notifyUsers, + overrideScreenSecurity: parameters.overrideScreenSecurity, + overrideEditableFlag: parameters.overrideEditableFlag, + returnIssue: parameters.returnIssue, + expand: parameters.expand, + }, + data: { + fields: parameters.fields, + historyMetadata: parameters.historyMetadata, + properties: parameters.properties, + transition: parameters.transition, + update: parameters.update, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue. + * + * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. + * This causes the issue's subtasks to be deleted with the issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Delete issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async deleteIssue(parameters: Parameters.DeleteIssue, callback: Callback): Promise; + /** + * Deletes an issue. + * + * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. + * This causes the issue's subtasks to be deleted with the issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Delete issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project containing the issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async deleteIssue(parameters: Parameters.DeleteIssue, callback?: never): Promise; + async deleteIssue(parameters: Parameters.DeleteIssue, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}`, + method: 'DELETE', + params: { + deleteSubtasks: parameters.deleteSubtasks, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but + * has the _Assign issue_ permission for the project that the issue is in. + * + * If `name` or `accountId` is set to: + * + * - `"-1"`, the issue is assigned to the default assignee for the project. + * - `null`, the issue is set to unassigned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse Projects_ and _Assign Issues_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async assignIssue(parameters: Parameters.AssignIssue, callback: Callback): Promise; + /** + * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but + * has the _Assign issue_ permission for the project that the issue is in. + * + * If `name` or `accountId` is set to: + * + * - `"-1"`, the issue is assigned to the default assignee for the project. + * - `null`, the issue is set to unassigned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse Projects_ and _Assign Issues_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async assignIssue(parameters: Parameters.AssignIssue, callback?: never): Promise; + async assignIssue(parameters: Parameters.AssignIssue, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/assignee`, + method: 'PUT', + data: { + accountId: parameters.accountId, + accountType: parameters.accountType, + active: parameters.active, + applicationRoles: parameters.applicationRoles, + avatarUrls: parameters.avatarUrls, + displayName: parameters.displayName, + emailAddress: parameters.emailAddress, + expand: parameters.expand, + groups: parameters.groups, + key: parameters.key, + locale: parameters.locale, + name: parameters.name, + self: parameters.self, + timeZone: parameters.timeZone, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * changelogs for an issue sorted by date, starting from the oldest. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getChangeLogs( + parameters: Parameters.GetChangeLogs, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * changelogs for an issue sorted by date, starting from the oldest. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getChangeLogs(parameters: Parameters.GetChangeLogs, callback?: never): Promise; + async getChangeLogs( + parameters: Parameters.GetChangeLogs, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/changelog`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns changelogs for an issue specified by a list of changelog IDs. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getChangeLogsByIds( + parameters: Parameters.GetChangeLogsByIds, + callback: Callback, + ): Promise; + /** + * Returns changelogs for an issue specified by a list of changelog IDs. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getChangeLogsByIds( + parameters: Parameters.GetChangeLogsByIds, + callback?: never, + ): Promise; + async getChangeLogsByIds( + parameters: Parameters.GetChangeLogsByIds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/changelog/list`, + method: 'POST', + data: { + changelogIds: parameters.changelogIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to + * populate the requests in [Edit issue](#api-rest-api-3-issue-issueIdOrKey-put). + * + * This endpoint will check for these conditions: + * + * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type + * scheme configuration. `overrideScreenSecurity=true` skips this condition. + * 2. Field is visible in the [field + * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). + * `overrideScreenSecurity=true` skips this condition. + * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if + * attachments are enabled. Assignee only shows if user has permissions to assign the issue. + * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All + * system fields are assumed to have context in all projects and all issue types. + * 5. Issue has a project, issue type, and status defined. + * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. + * `overrideEditableFlag=true` skips this condition. + * 7. The current workflow step is editable. This is true by default, but [can be disabled by + * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the + * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. + * 8. User has [Edit issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). + * 9. Workflow permissions allow editing a field. This is true by default but [can be + * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using + * `jira.permission.*` workflow properties. + * + * Fields hidden using [Issue layout settings + * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain + * editable. + * + * Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: + * + * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available + * through screens, and field configuration (conditions 1. and 2. from the list above). + * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if + * the current step is editable (conditions 6. and 7. from the list above). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * + * Note: For any fields to be editable the user must have the _Edit issues_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. + */ + async getEditIssueMeta( + parameters: Parameters.GetEditIssueMeta, + callback: Callback, + ): Promise; + /** + * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to + * populate the requests in [Edit issue](#api-rest-api-3-issue-issueIdOrKey-put). + * + * This endpoint will check for these conditions: + * + * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type + * scheme configuration. `overrideScreenSecurity=true` skips this condition. + * 2. Field is visible in the [field + * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). + * `overrideScreenSecurity=true` skips this condition. + * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if + * attachments are enabled. Assignee only shows if user has permissions to assign the issue. + * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All + * system fields are assumed to have context in all projects and all issue types. + * 5. Issue has a project, issue type, and status defined. + * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. + * `overrideEditableFlag=true` skips this condition. + * 7. The current workflow step is editable. This is true by default, but [can be disabled by + * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the + * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. + * 8. User has [Edit issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). + * 9. Workflow permissions allow editing a field. This is true by default but [can be + * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using + * `jira.permission.*` workflow properties. + * + * Fields hidden using [Issue layout settings + * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain + * editable. + * + * Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: + * + * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available + * through screens, and field configuration (conditions 1. and 2. from the list above). + * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if + * the current step is editable (conditions 6. and 7. from the list above). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * + * Note: For any fields to be editable the user must have the _Edit issues_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. + */ + async getEditIssueMeta( + parameters: Parameters.GetEditIssueMeta, + callback?: never, + ): Promise; + async getEditIssueMeta( + parameters: Parameters.GetEditIssueMeta, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/editmeta`, + method: 'GET', + params: { + overrideScreenSecurity: parameters.overrideScreenSecurity, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an email notification for an issue and adds it to the mail queue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async notify(parameters: Parameters.Notify, callback: Callback): Promise; + /** + * Creates an email notification for an issue and adds it to the mail queue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async notify(parameters: Parameters.Notify, callback?: never): Promise; + async notify(parameters: Parameters.Notify, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/notify`, + method: 'POST', + data: { + htmlBody: parameters.htmlBody, + restrict: parameters.restrict, + subject: parameters.subject, + textBody: parameters.textBody, + to: parameters.to, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's + * status. + * + * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its + * status, the response will return any empty transitions list. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: A list or + * transition is returned only when the user has:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * + * However, if the user does not have the _Transition issues_ [ project + * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. + */ + async getTransitions( + parameters: Parameters.GetTransitions, + callback: Callback, + ): Promise; + /** + * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's + * status. + * + * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its + * status, the response will return any empty transitions list. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: A list or + * transition is returned only when the user has:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * + * However, if the user does not have the _Transition issues_ [ project + * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. + */ + async getTransitions(parameters: Parameters.GetTransitions, callback?: never): Promise; + async getTransitions( + parameters: Parameters.GetTransitions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/transitions`, + method: 'GET', + params: { + expand: parameters.expand, + transitionId: parameters.transitionId, + skipRemoteOnlyCondition: parameters.skipRemoteOnlyCondition, + includeUnavailableTransitions: parameters.includeUnavailableTransitions, + sortByOpsBarAndStatus: parameters.sortByOpsBarAndStatus, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. + * + * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` + * parameters in the request body. Get details about the fields using [ Get + * transitions](#api-rest-api-3-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Transition issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async doTransition(parameters: Parameters.DoTransition, callback: Callback): Promise; + /** + * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. + * + * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` + * parameters in the request body. Get details about the fields using [ Get + * transitions](#api-rest-api-3-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Transition issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async doTransition(parameters: Parameters.DoTransition, callback?: never): Promise; + async doTransition(parameters: Parameters.DoTransition, callback?: Callback): Promise { + if (parameters.fields?.description && typeof parameters.fields.description === 'string') { + parameters.fields.description = { + type: 'doc', + version: 1, + content: [ + { + type: 'paragraph', + content: [ + { + text: parameters.fields.description, + type: 'text', + }, + ], + }, + ], + }; + } + + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/transitions`, + method: 'POST', + data: { + fields: parameters.fields, + historyMetadata: parameters.historyMetadata, + properties: parameters.properties, + transition: parameters.transition, + update: parameters.update, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it + * will receive an email with a link to download a CSV file with the issue details. + * + * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and + * `ArchivedDate`). Custom fields aren't supported. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + * + * **Rate limiting:** Only a single request can be active at any given time. + */ + async exportArchivedIssues( + parameters: Parameters.ExportArchivedIssues | undefined, + callback: Callback, + ): Promise; + /** + * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it + * will receive an email with a link to download a CSV file with the issue details. + * + * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and + * `ArchivedDate`). Custom fields aren't supported. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + * + * **Rate limiting:** Only a single request can be active at any given time. + */ + async exportArchivedIssues( + parameters?: Parameters.ExportArchivedIssues, + callback?: never, + ): Promise; + async exportArchivedIssues( + parameters?: Parameters.ExportArchivedIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issues/archive/export', + method: 'PUT', + data: { + archivedBy: parameters?.archivedBy, + archivedDateRange: parameters?.archivedDateRange, + issueTypes: parameters?.issueTypes, + projects: parameters?.projects, + reporters: parameters?.reporters, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issues.ts b/src/version3/issues.ts deleted file mode 100644 index 6894a6c7b..000000000 --- a/src/version3/issues.ts +++ /dev/null @@ -1,1119 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Issues { - constructor(private client: Client) {} - - /** - * Returns all issue events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getEvents(callback: Callback): Promise; - /** - * Returns all issue events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getEvents(callback?: never): Promise; - async getEvents(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/events', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be - * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties - * set. - * - * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue - * or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These are - * the same fields that appear on the issue's create screen. Note that the `description`, `environment`, and any - * `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom - * fields (`textfield`) accept a string and don't handle Atlassian Document Format content. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). - * - `parent` must contain the ID or key of the parent issue. - * - * In a next-gen project any issue may be made a child providing that the parent and child are members of the same - * project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which the issue or subtask is created. - */ - async createIssue(parameters: Parameters.CreateIssue, callback: Callback): Promise; - /** - * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be - * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties - * set. - * - * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue - * or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These are - * the same fields that appear on the issue's create screen. Note that the `description`, `environment`, and any - * `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom - * fields (`textfield`) accept a string and don't handle Atlassian Document Format content. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). - * - `parent` must contain the ID or key of the parent issue. - * - * In a next-gen project any issue may be made a child providing that the parent and child are members of the same - * project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which the issue or subtask is created. - */ - async createIssue(parameters: Parameters.CreateIssue, callback?: never): Promise; - async createIssue( - parameters: Parameters.CreateIssue, - callback?: Callback, - ): Promise { - if (parameters.fields?.description && typeof parameters.fields.description === 'string') { - parameters.fields.description = { - type: 'doc', - version: 1, - content: [ - { - type: 'paragraph', - content: [ - { - text: parameters.fields.description, - type: 'text', - }, - ], - }, - ], - }; - } - - const config: RequestConfig = { - url: '/rest/api/3/issue', - method: 'POST', - params: { - updateHistory: parameters.updateHistory, - }, - data: { - fields: parameters.fields, - historyMetadata: parameters.historyMetadata, - properties: parameters.properties, - transition: parameters.transition, - update: parameters.update, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Enables admins to archive up to 100,000 issues in a single request using JQL, returning the URL to check the status - * of the submitted request. - * - * You can use the [get - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-get) - * and [cancel - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) - * APIs to manage the request. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - * - * **Rate limiting:** Only a single request per user can be active at any given time. - */ - async archiveIssuesAsync( - parameters: Parameters.ArchiveIssuesAsync, - callback: Callback, - ): Promise; - /** - * Enables admins to archive up to 100,000 issues in a single request using JQL, returning the URL to check the status - * of the submitted request. - * - * You can use the [get - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-get) - * and [cancel - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) - * APIs to manage the request. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - * - * **Rate limiting:** Only a single request per user can be active at any given time. - */ - async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback?: never): Promise; - async archiveIssuesAsync( - parameters: Parameters.ArchiveIssuesAsync, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/archive', - method: 'POST', - data: { - jql: parameters.jql, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the - * issue(s) archived in the process and the errors encountered, if any. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async archiveIssues( - parameters: Parameters.ArchiveIssues, - callback: Callback, - ): Promise; - /** - * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the - * issue(s) archived in the process and the errors encountered, if any. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async archiveIssues(parameters: Parameters.ArchiveIssues, callback?: never): Promise; - async archiveIssues( - parameters: Parameters.ArchiveIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/archive', - method: 'PUT', - data: { - issueIdsOrKeys: parameters.issueIdsOrKeys, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may - * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue - * properties set. - * - * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the - * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These - * are the same fields that appear on the issues' create screens. Note that the `description`, `environment`, and any - * `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom - * fields (`textfield`) accept a string and don't handle Atlassian Document Format content. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). - * - `parent` the must contain the ID or key of the parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which each issue or subtask is created. - */ - async createIssues( - parameters: Parameters.CreateIssues | undefined, - callback: Callback, - ): Promise; - /** - * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may - * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue - * properties set. - * - * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the - * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These - * are the same fields that appear on the issues' create screens. Note that the `description`, `environment`, and any - * `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom - * fields (`textfield`) accept a string and don't handle Atlassian Document Format content. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). - * - `parent` the must contain the ID or key of the parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which each issue or subtask is created. - */ - async createIssues(parameters?: Parameters.CreateIssues, callback?: never): Promise; - async createIssues( - parameters?: Parameters.CreateIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/bulk', - method: 'POST', - data: { - issueUpdates: parameters?.issueUpdates, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each - * issue type for the user. Use the information to populate the requests in [ Create - * issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). - * - * The request can be restricted to specific projects or issue types using the query parameters. The response will - * contain information for the valid projects, issue types, or project and issue type combinations requested. Note - * that invalid project, issue type, or project and issue type combinations do not generate errors. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Create - * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. - */ - async getCreateIssueMeta( - parameters: Parameters.GetCreateIssueMeta | undefined, - callback: Callback, - ): Promise; - /** - * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each - * issue type for the user. Use the information to populate the requests in [ Create - * issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). - * - * The request can be restricted to specific projects or issue types using the query parameters. The response will - * contain information for the valid projects, issue types, or project and issue type combinations requested. Note - * that invalid project, issue type, or project and issue type combinations do not generate errors. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Create - * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. - */ - async getCreateIssueMeta( - parameters?: Parameters.GetCreateIssueMeta, - callback?: never, - ): Promise; - async getCreateIssueMeta( - parameters?: Parameters.GetCreateIssueMeta, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/createmeta', - method: 'GET', - params: { - projectIds: parameters?.projectIds, - projectKeys: parameters?.projectKeys, - issuetypeIds: parameters?.issuetypeIds, - issuetypeNames: parameters?.issuetypeNames, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Enables admins to unarchive up to 1000 issues in a single request using issue ID/key, returning details of the - * issue(s) unarchived in the process and the errors encountered, if any. - * - * **Note that:** - * - * - You can't unarchive subtasks directly, only through their parent issues - * - You can only unarchive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, - callback: Callback, - ): Promise; - /** - * Enables admins to unarchive up to 1000 issues in a single request using issue ID/key, returning details of the - * issue(s) unarchived in the process and the errors encountered, if any. - * - * **Note that:** - * - * - You can't unarchive subtasks directly, only through their parent issues - * - You can only unarchive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, - callback?: never, - ): Promise; - async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/unarchive', - method: 'PUT', - data: { - issueIdsOrKeys: parameters.issueIdsOrKeys, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the details for an issue. - * - * The issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive - * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or - * other redirect is **not** returned. The issue key returned in the response is the key of the issue found. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssue(parameters: Parameters.GetIssue, callback: Callback): Promise; - /** - * Returns the details for an issue. - * - * The issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive - * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or - * other redirect is **not** returned. The issue key returned in the response is the key of the issue found. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssue(parameters: Parameters.GetIssue, callback?: never): Promise; - async getIssue(parameters: Parameters.GetIssue, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}`, - method: 'GET', - params: { - fields: parameters.fields, - fieldsByKeys: parameters.fieldsByKeys, - expand: parameters.expand, - properties: parameters.properties, - updateHistory: parameters.updateHistory, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Edits an issue. A transition may be applied and issue properties updated as part of the edit. - * - * The edits to the issue's fields are defined using `update` and `fields`. The fields that can be edited are - * determined using [ Get edit issue metadata](#api-rest-api-3-issue-issueIdOrKey-editmeta-get). - * - * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting - * `update.parent.set.none` to _true_. Note that the `description`, `environment`, and any `textarea` type custom - * fields (multi-line text fields) take Atlassian Document Format content. Single line custom fields (`textfield`) - * accept a string and don't handle Atlassian Document Format content. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security - * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async editIssue(parameters: Parameters.EditIssue, callback: Callback): Promise; - /** - * Edits an issue. A transition may be applied and issue properties updated as part of the edit. - * - * The edits to the issue's fields are defined using `update` and `fields`. The fields that can be edited are - * determined using [ Get edit issue metadata](#api-rest-api-3-issue-issueIdOrKey-editmeta-get). - * - * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting - * `update.parent.set.none` to _true_. Note that the `description`, `environment`, and any `textarea` type custom - * fields (multi-line text fields) take Atlassian Document Format content. Single line custom fields (`textfield`) - * accept a string and don't handle Atlassian Document Format content. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security - * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project - * that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async editIssue(parameters: Parameters.EditIssue, callback?: never): Promise; - async editIssue(parameters: Parameters.EditIssue, callback?: Callback): Promise { - if (parameters.fields?.description && typeof parameters.fields.description === 'string') { - const { - fields: { description }, - } = await this.getIssue({ issueIdOrKey: parameters.issueIdOrKey }); - - parameters.fields.description = { - type: 'doc', - version: description?.version ?? 1, - content: [ - { - type: 'paragraph', - content: [ - { - text: parameters.fields.description, - type: 'text', - }, - ], - }, - ], - }; - } - - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}`, - method: 'PUT', - params: { - notifyUsers: parameters.notifyUsers, - overrideScreenSecurity: parameters.overrideScreenSecurity, - overrideEditableFlag: parameters.overrideEditableFlag, - returnIssue: parameters.returnIssue, - expand: parameters.expand, - }, - data: { - fields: parameters.fields, - historyMetadata: parameters.historyMetadata, - properties: parameters.properties, - transition: parameters.transition, - update: parameters.update, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue. - * - * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. - * This causes the issue's subtasks to be deleted with the issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Delete issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteIssue(parameters: Parameters.DeleteIssue, callback: Callback): Promise; - /** - * Deletes an issue. - * - * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. - * This causes the issue's subtasks to be deleted with the issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Delete issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project containing the issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async deleteIssue(parameters: Parameters.DeleteIssue, callback?: never): Promise; - async deleteIssue(parameters: Parameters.DeleteIssue, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}`, - method: 'DELETE', - params: { - deleteSubtasks: parameters.deleteSubtasks, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but - * has the _Assign issue_ permission for the project that the issue is in. - * - * If `name` or `accountId` is set to: - * - * - `"-1"`, the issue is assigned to the default assignee for the project. - * - `null`, the issue is set to unassigned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse Projects_ and _Assign Issues_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async assignIssue(parameters: Parameters.AssignIssue, callback: Callback): Promise; - /** - * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but - * has the _Assign issue_ permission for the project that the issue is in. - * - * If `name` or `accountId` is set to: - * - * - `"-1"`, the issue is assigned to the default assignee for the project. - * - `null`, the issue is set to unassigned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse Projects_ and _Assign Issues_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async assignIssue(parameters: Parameters.AssignIssue, callback?: never): Promise; - async assignIssue(parameters: Parameters.AssignIssue, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/assignee`, - method: 'PUT', - data: { - accountId: parameters.accountId, - accountType: parameters.accountType, - active: parameters.active, - applicationRoles: parameters.applicationRoles, - avatarUrls: parameters.avatarUrls, - displayName: parameters.displayName, - emailAddress: parameters.emailAddress, - expand: parameters.expand, - groups: parameters.groups, - key: parameters.key, - locale: parameters.locale, - name: parameters.name, - self: parameters.self, - timeZone: parameters.timeZone, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * changelogs for an issue sorted by date, starting from the oldest. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getChangeLogs( - parameters: Parameters.GetChangeLogs, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * changelogs for an issue sorted by date, starting from the oldest. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getChangeLogs(parameters: Parameters.GetChangeLogs, callback?: never): Promise; - async getChangeLogs( - parameters: Parameters.GetChangeLogs, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/changelog`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns changelogs for an issue specified by a list of changelog IDs. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getChangeLogsByIds( - parameters: Parameters.GetChangeLogsByIds, - callback: Callback, - ): Promise; - /** - * Returns changelogs for an issue specified by a list of changelog IDs. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getChangeLogsByIds( - parameters: Parameters.GetChangeLogsByIds, - callback?: never, - ): Promise; - async getChangeLogsByIds( - parameters: Parameters.GetChangeLogsByIds, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/changelog/list`, - method: 'POST', - data: { - changelogIds: parameters.changelogIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to - * populate the requests in [Edit issue](#api-rest-api-3-issue-issueIdOrKey-put). - * - * This endpoint will check for these conditions: - * - * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type - * scheme configuration. `overrideScreenSecurity=true` skips this condition. - * 2. Field is visible in the [field - * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). - * `overrideScreenSecurity=true` skips this condition. - * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if - * attachments are enabled. Assignee only shows if user has permissions to assign the issue. - * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All - * system fields are assumed to have context in all projects and all issue types. - * 5. Issue has a project, issue type, and status defined. - * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. - * `overrideEditableFlag=true` skips this condition. - * 7. The current workflow step is editable. This is true by default, but [can be disabled by - * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the - * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. - * 8. User has [Edit issues - * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). - * 9. Workflow permissions allow editing a field. This is true by default but [can be - * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using - * `jira.permission.*` workflow properties. - * - * Fields hidden using [Issue layout settings - * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain - * editable. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: - * - * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available - * through screens, and field configuration (conditions 1. and 2. from the list above). - * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if - * the current step is editable (conditions 6. and 7. from the list above). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * Note: For any fields to be editable the user must have the _Edit issues_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. - */ - async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta, - callback: Callback, - ): Promise; - /** - * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to - * populate the requests in [Edit issue](#api-rest-api-3-issue-issueIdOrKey-put). - * - * This endpoint will check for these conditions: - * - * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type - * scheme configuration. `overrideScreenSecurity=true` skips this condition. - * 2. Field is visible in the [field - * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). - * `overrideScreenSecurity=true` skips this condition. - * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if - * attachments are enabled. Assignee only shows if user has permissions to assign the issue. - * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All - * system fields are assumed to have context in all projects and all issue types. - * 5. Issue has a project, issue type, and status defined. - * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. - * `overrideEditableFlag=true` skips this condition. - * 7. The current workflow step is editable. This is true by default, but [can be disabled by - * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the - * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. - * 8. User has [Edit issues - * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). - * 9. Workflow permissions allow editing a field. This is true by default but [can be - * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using - * `jira.permission.*` workflow properties. - * - * Fields hidden using [Issue layout settings - * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain - * editable. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: - * - * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available - * through screens, and field configuration (conditions 1. and 2. from the list above). - * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if - * the current step is editable (conditions 6. and 7. from the list above). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * Note: For any fields to be editable the user must have the _Edit issues_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. - */ - async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta, - callback?: never, - ): Promise; - async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/editmeta`, - method: 'GET', - params: { - overrideScreenSecurity: parameters.overrideScreenSecurity, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an email notification for an issue and adds it to the mail queue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async notify(parameters: Parameters.Notify, callback: Callback): Promise; - /** - * Creates an email notification for an issue and adds it to the mail queue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async notify(parameters: Parameters.Notify, callback?: never): Promise; - async notify(parameters: Parameters.Notify, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/notify`, - method: 'POST', - data: { - htmlBody: parameters.htmlBody, - restrict: parameters.restrict, - subject: parameters.subject, - textBody: parameters.textBody, - to: parameters.to, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's - * status. - * - * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its - * status, the response will return any empty transitions list. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: A list or - * transition is returned only when the user has:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * However, if the user does not have the _Transition issues_ [ project - * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. - */ - async getTransitions( - parameters: Parameters.GetTransitions, - callback: Callback, - ): Promise; - /** - * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's - * status. - * - * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its - * status, the response will return any empty transitions list. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: A list or - * transition is returned only when the user has:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is - * in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * However, if the user does not have the _Transition issues_ [ project - * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. - */ - async getTransitions(parameters: Parameters.GetTransitions, callback?: never): Promise; - async getTransitions( - parameters: Parameters.GetTransitions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/transitions`, - method: 'GET', - params: { - expand: parameters.expand, - transitionId: parameters.transitionId, - skipRemoteOnlyCondition: parameters.skipRemoteOnlyCondition, - includeUnavailableTransitions: parameters.includeUnavailableTransitions, - sortByOpsBarAndStatus: parameters.sortByOpsBarAndStatus, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. - * - * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` - * parameters in the request body. Get details about the fields using [ Get - * transitions](#api-rest-api-3-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Transition issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async doTransition(parameters: Parameters.DoTransition, callback: Callback): Promise; - /** - * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. - * - * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` - * parameters in the request body. Get details about the fields using [ Get - * transitions](#api-rest-api-3-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Transition issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async doTransition(parameters: Parameters.DoTransition, callback?: never): Promise; - async doTransition(parameters: Parameters.DoTransition, callback?: Callback): Promise { - if (parameters.fields?.description && typeof parameters.fields.description === 'string') { - parameters.fields.description = { - type: 'doc', - version: 1, - content: [ - { - type: 'paragraph', - content: [ - { - text: parameters.fields.description, - type: 'text', - }, - ], - }, - ], - }; - } - - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/transitions`, - method: 'POST', - data: { - fields: parameters.fields, - historyMetadata: parameters.historyMetadata, - properties: parameters.properties, - transition: parameters.transition, - update: parameters.update, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it - * will receive an email with a link to download a CSV file with the issue details. - * - * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and - * `ArchivedDate`). Custom fields aren't supported. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - * - * **Rate limiting:** Only a single request can be active at any given time. - */ - async exportArchivedIssues( - parameters: Parameters.ExportArchivedIssues | undefined, - callback: Callback, - ): Promise; - /** - * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it - * will receive an email with a link to download a CSV file with the issue details. - * - * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and - * `ArchivedDate`). Custom fields aren't supported. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - * - * **Rate limiting:** Only a single request can be active at any given time. - */ - async exportArchivedIssues( - parameters?: Parameters.ExportArchivedIssues, - callback?: never, - ): Promise; - async exportArchivedIssues( - parameters?: Parameters.ExportArchivedIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issues/archive/export', - method: 'PUT', - data: { - archivedBy: parameters?.archivedBy, - archivedDateRange: parameters?.archivedDateRange, - issueTypes: parameters?.issueTypes, - projects: parameters?.projects, - reporters: parameters?.reporters, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/jQL.ts b/src/version3/jQL.ts deleted file mode 100644 index 42addd51e..000000000 --- a/src/version3/jQL.ts +++ /dev/null @@ -1,312 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class JQL { - constructor(private client: Client) {} - - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference - * data (POST)](#api-rest-api-3-jql-autocompletedata-post) can be used. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAutoComplete(callback: Callback): Promise; - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference - * data (POST)](#api-rest-api-3-jql-autocompletedata-post) can be used. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAutoComplete(callback?: never): Promise; - async getAutoComplete(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/autocompletedata', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. - * System fields are always returned. - * - * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across - * all fields with the same name and of the same field type. For example, the collapsed field `Component - - * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched - * simultaneously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAutoCompletePost( - parameters: Parameters.GetAutoCompletePost | undefined, - callback: Callback, - ): Promise; - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. - * System fields are always returned. - * - * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across - * all fields with the same name and of the same field type. For example, the collapsed field `Component - - * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched - * simultaneously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAutoCompletePost( - parameters?: Parameters.GetAutoCompletePost, - callback?: never, - ): Promise; - async getAutoCompletePost( - parameters?: Parameters.GetAutoCompletePost, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/autocompletedata', - method: 'POST', - data: { - projectIds: parameters?.projectIds, - includeCollapsedFields: parameters?.includeCollapsedFields, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the JQL search auto complete suggestions for a field. - * - * Suggestions can be obtained by providing: - * - * - `fieldName` to get a list of all values for the field. - * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. - * - `fieldName` and `predicateName` to get a list of all predicate values for the field. - * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in - * `predicateValue`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getFieldAutoCompleteForQueryString( - parameters: Parameters.GetFieldAutoCompleteForQueryString | undefined, - callback: Callback, - ): Promise; - /** - * Returns the JQL search auto complete suggestions for a field. - * - * Suggestions can be obtained by providing: - * - * - `fieldName` to get a list of all values for the field. - * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. - * - `fieldName` and `predicateName` to get a list of all predicate values for the field. - * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in - * `predicateValue`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getFieldAutoCompleteForQueryString( - parameters?: Parameters.GetFieldAutoCompleteForQueryString, - callback?: never, - ): Promise; - async getFieldAutoCompleteForQueryString( - parameters?: Parameters.GetFieldAutoCompleteForQueryString, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/autocompletedata/suggestions', - method: 'GET', - params: { - fieldName: parameters?.fieldName, - fieldValue: parameters?.fieldValue, - predicateName: parameters?.predicateName, - predicateValue: parameters?.predicateValue, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Parses and validates JQL queries. - * - * Validation is performed in context of the current user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async parseJqlQueries( - parameters: Parameters.ParseJqlQueries | undefined, - callback: Callback, - ): Promise; - /** - * Parses and validates JQL queries. - * - * Validation is performed in context of the current user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async parseJqlQueries( - parameters?: Parameters.ParseJqlQueries, - callback?: never, - ): Promise; - async parseJqlQueries( - parameters?: Parameters.ParseJqlQueries, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/parse', - method: 'POST', - params: { - validation: parameters?.validation, - }, - data: { - queries: parameters?.queries, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Converts one or more JQL queries with user identifiers (username or user key) to equivalent JQL queries with - * account IDs. - * - * You may wish to use this operation if your system stores JQL queries and you want to make them GDPR-compliant. For - * more information about GDPR-related changes, see the [migration - * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async migrateQueries( - parameters: Parameters.MigrateQueries | undefined, - callback: Callback, - ): Promise; - /** - * Converts one or more JQL queries with user identifiers (username or user key) to equivalent JQL queries with - * account IDs. - * - * You may wish to use this operation if your system stores JQL queries and you want to make them GDPR-compliant. For - * more information about GDPR-related changes, see the [migration - * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async migrateQueries( - parameters?: Parameters.MigrateQueries, - callback?: never, - ): Promise; - async migrateQueries( - parameters?: Parameters.MigrateQueries, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/pdcleaner', - method: 'POST', - data: { - queryStrings: parameters?.queryStrings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sanitizes one or more JQL queries by converting readable details into IDs where a user doesn't have permission to - * view the entity. - * - * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse - * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where - * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account - * ID is null, sanitizing is performed for an anonymous user. - * - * Note that sanitization doesn't make the queries GDPR-compliant, because it doesn't remove user identifiers - * (username or user key). If you need to make queries GDPR-compliant, use [Convert user identifiers to account IDs in - * JQL - * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/#api-rest-api-3-jql-sanitize-post). - * - * Before sanitization each JQL query is parsed. The queries are returned in the same order that they were passed. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async sanitiseJqlQueries( - parameters: Parameters.SanitiseJqlQueries | undefined, - callback: Callback, - ): Promise; - /** - * Sanitizes one or more JQL queries by converting readable details into IDs where a user doesn't have permission to - * view the entity. - * - * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse - * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where - * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account - * ID is null, sanitizing is performed for an anonymous user. - * - * Note that sanitization doesn't make the queries GDPR-compliant, because it doesn't remove user identifiers - * (username or user key). If you need to make queries GDPR-compliant, use [Convert user identifiers to account IDs in - * JQL - * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/#api-rest-api-3-jql-sanitize-post). - * - * Before sanitization each JQL query is parsed. The queries are returned in the same order that they were passed. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async sanitiseJqlQueries( - parameters?: Parameters.SanitiseJqlQueries, - callback?: never, - ): Promise; - async sanitiseJqlQueries( - parameters?: Parameters.SanitiseJqlQueries, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/sanitize', - method: 'POST', - data: { - queries: parameters?.queries, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/jiraExpressions.mts b/src/version3/jiraExpressions.mts new file mode 100644 index 000000000..032567299 --- /dev/null +++ b/src/version3/jiraExpressions.mts @@ -0,0 +1,193 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class JiraExpressions { + constructor(private client: Client) {} + + /** + * Analyses and validates Jira expressions. + * + * As an experimental feature, this operation can also attempt to type-check the expressions. + * + * Learn more about Jira expressions in the + * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required**: None. + */ + async analyseExpression( + parameters: Parameters.AnalyseExpression | undefined, + callback: Callback, + ): Promise; + /** + * Analyses and validates Jira expressions. + * + * As an experimental feature, this operation can also attempt to type-check the expressions. + * + * Learn more about Jira expressions in the + * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required**: None. + */ + async analyseExpression( + parameters?: Parameters.AnalyseExpression, + callback?: never, + ): Promise; + async analyseExpression( + parameters?: Parameters.AnalyseExpression, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/expression/analyse', + method: 'POST', + params: { + check: parameters?.check, + }, + data: { + expressions: parameters?.expressions, + contextVariables: parameters?.contextVariables, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Evaluates a Jira expression and returns its value. + * + * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible + * way. Consult the [Jira expressions + * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. + * + * #### Context variables + * + * The following context variables are available to Jira expressions evaluated by this resource. Their presence + * depends on various factors; usually you need to manually request them in the context object sent in the payload, + * but some of them are added automatically under certain conditions. + * + * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The + * current user. Always available and equal to `null` if the request is anonymous. + * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The + * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. + * Available only for authenticated requests made by Connect Apps (read more here: [Authentication for Connect + * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). + * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The + * current issue. Available only when the issue is provided in the request context object. + * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of + * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A + * collection of issues matching a Jql query. Available only when Jql is provided in the request context object. + * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): + * The current project. Available only when the project is provided in the request context object. + * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): + * The current sprint. Available only when the sprint is provided in the request context object. + * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The + * current board. Available only when the board is provided in the request context object. + * - `serviceDesk` + * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): + * The current service desk. Available only when the service desk is provided in the request context object. + * - `customerRequest` + * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): + * The current customer request. Available only when the customer request is provided in the request context + * object. + * + * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by + * key in the Jira expression. These variable types are available for use in a custom context: + * + * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) + * specified as an Atlassian account ID. + * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) + * specified by ID or key. All the fields of the issue object are available in the Jira expression. + * - `json`: A JSON object containing custom content. + * - `list`: A JSON list of `user`, `issue`, or `json` variable types. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required**: None. + * However, an expression may return different results for different users depending on their permissions. For + * example, different users may see different comments on the same issue. Permission to access Jira Software is + * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). + */ + async evaluateJiraExpression( + parameters: Parameters.EvaluateJiraExpression | undefined, + callback: Callback, + ): Promise; + /** + * Evaluates a Jira expression and returns its value. + * + * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible + * way. Consult the [Jira expressions + * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. + * + * #### Context variables + * + * The following context variables are available to Jira expressions evaluated by this resource. Their presence + * depends on various factors; usually you need to manually request them in the context object sent in the payload, + * but some of them are added automatically under certain conditions. + * + * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The + * current user. Always available and equal to `null` if the request is anonymous. + * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The + * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. + * Available only for authenticated requests made by Connect Apps (read more here: [Authentication for Connect + * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). + * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The + * current issue. Available only when the issue is provided in the request context object. + * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of + * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A + * collection of issues matching a Jql query. Available only when Jql is provided in the request context object. + * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): + * The current project. Available only when the project is provided in the request context object. + * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): + * The current sprint. Available only when the sprint is provided in the request context object. + * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The + * current board. Available only when the board is provided in the request context object. + * - `serviceDesk` + * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): + * The current service desk. Available only when the service desk is provided in the request context object. + * - `customerRequest` + * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): + * The current customer request. Available only when the customer request is provided in the request context + * object. + * + * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by + * key in the Jira expression. These variable types are available for use in a custom context: + * + * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) + * specified as an Atlassian account ID. + * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) + * specified by ID or key. All the fields of the issue object are available in the Jira expression. + * - `json`: A JSON object containing custom content. + * - `list`: A JSON list of `user`, `issue`, or `json` variable types. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required**: None. + * However, an expression may return different results for different users depending on their permissions. For + * example, different users may see different comments on the same issue. Permission to access Jira Software is + * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). + */ + async evaluateJiraExpression( + parameters?: Parameters.EvaluateJiraExpression, + callback?: never, + ): Promise; + async evaluateJiraExpression( + parameters?: Parameters.EvaluateJiraExpression, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/expression/eval', + method: 'POST', + params: { + expand: parameters?.expand, + }, + data: { + expression: parameters?.expression, + context: parameters?.context, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/jiraExpressions.ts b/src/version3/jiraExpressions.ts deleted file mode 100644 index 3ef4fe5d3..000000000 --- a/src/version3/jiraExpressions.ts +++ /dev/null @@ -1,193 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class JiraExpressions { - constructor(private client: Client) {} - - /** - * Analyses and validates Jira expressions. - * - * As an experimental feature, this operation can also attempt to type-check the expressions. - * - * Learn more about Jira expressions in the - * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required**: None. - */ - async analyseExpression( - parameters: Parameters.AnalyseExpression | undefined, - callback: Callback, - ): Promise; - /** - * Analyses and validates Jira expressions. - * - * As an experimental feature, this operation can also attempt to type-check the expressions. - * - * Learn more about Jira expressions in the - * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required**: None. - */ - async analyseExpression( - parameters?: Parameters.AnalyseExpression, - callback?: never, - ): Promise; - async analyseExpression( - parameters?: Parameters.AnalyseExpression, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/expression/analyse', - method: 'POST', - params: { - check: parameters?.check, - }, - data: { - expressions: parameters?.expressions, - contextVariables: parameters?.contextVariables, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Evaluates a Jira expression and returns its value. - * - * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible - * way. Consult the [Jira expressions - * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. - * - * #### Context variables - * - * The following context variables are available to Jira expressions evaluated by this resource. Their presence - * depends on various factors; usually you need to manually request them in the context object sent in the payload, - * but some of them are added automatically under certain conditions. - * - * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The - * current user. Always available and equal to `null` if the request is anonymous. - * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The - * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. - * Available only for authenticated requests made by Connect Apps (read more here: [Authentication for Connect - * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). - * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The - * current issue. Available only when the issue is provided in the request context object. - * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of - * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A - * collection of issues matching a JQL query. Available only when JQL is provided in the request context object. - * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): - * The current project. Available only when the project is provided in the request context object. - * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): - * The current sprint. Available only when the sprint is provided in the request context object. - * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The - * current board. Available only when the board is provided in the request context object. - * - `serviceDesk` - * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): - * The current service desk. Available only when the service desk is provided in the request context object. - * - `customerRequest` - * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): - * The current customer request. Available only when the customer request is provided in the request context - * object. - * - * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by - * key in the Jira expression. These variable types are available for use in a custom context: - * - * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) - * specified as an Atlassian account ID. - * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) - * specified by ID or key. All the fields of the issue object are available in the Jira expression. - * - `json`: A JSON object containing custom content. - * - `list`: A JSON list of `user`, `issue`, or `json` variable types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required**: None. - * However, an expression may return different results for different users depending on their permissions. For - * example, different users may see different comments on the same issue. Permission to access Jira Software is - * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). - */ - async evaluateJiraExpression( - parameters: Parameters.EvaluateJiraExpression | undefined, - callback: Callback, - ): Promise; - /** - * Evaluates a Jira expression and returns its value. - * - * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible - * way. Consult the [Jira expressions - * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. - * - * #### Context variables - * - * The following context variables are available to Jira expressions evaluated by this resource. Their presence - * depends on various factors; usually you need to manually request them in the context object sent in the payload, - * but some of them are added automatically under certain conditions. - * - * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The - * current user. Always available and equal to `null` if the request is anonymous. - * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The - * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. - * Available only for authenticated requests made by Connect Apps (read more here: [Authentication for Connect - * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). - * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The - * current issue. Available only when the issue is provided in the request context object. - * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of - * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A - * collection of issues matching a JQL query. Available only when JQL is provided in the request context object. - * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): - * The current project. Available only when the project is provided in the request context object. - * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): - * The current sprint. Available only when the sprint is provided in the request context object. - * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The - * current board. Available only when the board is provided in the request context object. - * - `serviceDesk` - * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): - * The current service desk. Available only when the service desk is provided in the request context object. - * - `customerRequest` - * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): - * The current customer request. Available only when the customer request is provided in the request context - * object. - * - * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by - * key in the Jira expression. These variable types are available for use in a custom context: - * - * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) - * specified as an Atlassian account ID. - * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) - * specified by ID or key. All the fields of the issue object are available in the Jira expression. - * - `json`: A JSON object containing custom content. - * - `list`: A JSON list of `user`, `issue`, or `json` variable types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required**: None. - * However, an expression may return different results for different users depending on their permissions. For - * example, different users may see different comments on the same issue. Permission to access Jira Software is - * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). - */ - async evaluateJiraExpression( - parameters?: Parameters.EvaluateJiraExpression, - callback?: never, - ): Promise; - async evaluateJiraExpression( - parameters?: Parameters.EvaluateJiraExpression, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/expression/eval', - method: 'POST', - params: { - expand: parameters?.expand, - }, - data: { - expression: parameters?.expression, - context: parameters?.context, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/jiraSettings.mts b/src/version3/jiraSettings.mts new file mode 100644 index 000000000..fef1c5704 --- /dev/null +++ b/src/version3/jiraSettings.mts @@ -0,0 +1,241 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class JiraSettings { + constructor(private client: Client) {} + + /** + * Returns all application properties or an application property. + * + * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an + * array). Otherwise, an array of all editable application properties is returned. See [Set application + * property](#api-rest-api-3-application-properties-id-put) for descriptions of editable properties. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApplicationProperty( + parameters: Parameters.GetApplicationProperty | undefined, + callback: Callback, + ): Promise; + /** + * Returns all application properties or an application property. + * + * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an + * array). Otherwise, an array of all editable application properties is returned. See [Set application + * property](#api-rest-api-3-application-properties-id-put) for descriptions of editable properties. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApplicationProperty( + parameters?: Parameters.GetApplicationProperty, + callback?: never, + ): Promise; + async getApplicationProperty( + parameters?: Parameters.GetApplicationProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/application-properties', + method: 'GET', + params: { + key: parameters?.key, + permissionLevel: parameters?.permissionLevel, + keyFilter: parameters?.keyFilter, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the + * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** + * and then click **Advanced Settings** (in the upper right). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAdvancedSettings(callback: Callback): Promise; + /** + * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the + * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** + * and then click **Advanced Settings** (in the upper right). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAdvancedSettings(callback?: never): Promise; + async getAdvancedSettings(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/application-properties/advanced-settings', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from + * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are + * described below along with their default values. + * + * #### Advanced settings + * + * The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). + * + * | Key | Description | Default value | + * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | + * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | + * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | + * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | + * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | + * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | + * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | + * | `jira.table.cols.subtasks` | The columns to show while viewing subtask issues in a table. For example, a list of subtasks on an issue. | `issuetype, status, assignee, progress` | + * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | + * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | + * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | + * + * #### Look and feel + * + * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). + * + * | Key | Description | Default value | + * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | + * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | + * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | + * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | + * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | + * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | + * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | + * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | + * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | + * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | + * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | + * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | + * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | + * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | + * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | + * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | + * + * #### Other settings + * + * | Key | Description | Default value | + * | ----------------------------------- | ----------------------------------------------------- | ------------- | + * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | + * + * _Note: Be careful when changing [application properties and advanced + * settings](https://confluence.atlassian.com/x/vYXKM)._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setApplicationProperty( + parameters: Parameters.SetApplicationProperty, + callback: Callback, + ): Promise; + /** + * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from + * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are + * described below along with their default values. + * + * #### Advanced settings + * + * The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). + * + * | Key | Description | Default value | + * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | + * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | + * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | + * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | + * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | + * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | + * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | + * | `jira.table.cols.subtasks` | The columns to show while viewing subtask issues in a table. For example, a list of subtasks on an issue. | `issuetype, status, assignee, progress` | + * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | + * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | + * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | + * + * #### Look and feel + * + * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). + * + * | Key | Description | Default value | + * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | + * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | + * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | + * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | + * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | + * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | + * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | + * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | + * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | + * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | + * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | + * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | + * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | + * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | + * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | + * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | + * + * #### Other settings + * + * | Key | Description | Default value | + * | ----------------------------------- | ----------------------------------------------------- | ------------- | + * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | + * + * _Note: Be careful when changing [application properties and advanced + * settings](https://confluence.atlassian.com/x/vYXKM)._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setApplicationProperty( + parameters: Parameters.SetApplicationProperty, + callback?: never, + ): Promise; + async setApplicationProperty( + parameters: Parameters.SetApplicationProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/application-properties/${parameters.id}`, + method: 'PUT', + data: parameters.body, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether + * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this + * operation also returns the time tracking configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getConfiguration(callback: Callback): Promise; + /** + * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether + * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this + * operation also returns the time tracking configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getConfiguration(callback?: never): Promise; + async getConfiguration(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/configuration', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/jiraSettings.ts b/src/version3/jiraSettings.ts deleted file mode 100644 index f802f2f04..000000000 --- a/src/version3/jiraSettings.ts +++ /dev/null @@ -1,241 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class JiraSettings { - constructor(private client: Client) {} - - /** - * Returns all application properties or an application property. - * - * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an - * array). Otherwise, an array of all editable application properties is returned. See [Set application - * property](#api-rest-api-3-application-properties-id-put) for descriptions of editable properties. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationProperty( - parameters: Parameters.GetApplicationProperty | undefined, - callback: Callback, - ): Promise; - /** - * Returns all application properties or an application property. - * - * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an - * array). Otherwise, an array of all editable application properties is returned. See [Set application - * property](#api-rest-api-3-application-properties-id-put) for descriptions of editable properties. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationProperty( - parameters?: Parameters.GetApplicationProperty, - callback?: never, - ): Promise; - async getApplicationProperty( - parameters?: Parameters.GetApplicationProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/application-properties', - method: 'GET', - params: { - key: parameters?.key, - permissionLevel: parameters?.permissionLevel, - keyFilter: parameters?.keyFilter, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the - * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** - * and then click **Advanced Settings** (in the upper right). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAdvancedSettings(callback: Callback): Promise; - /** - * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the - * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** - * and then click **Advanced Settings** (in the upper right). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAdvancedSettings(callback?: never): Promise; - async getAdvancedSettings(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/application-properties/advanced-settings', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from - * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are - * described below along with their default values. - * - * #### Advanced settings - * - * The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). - * - * | Key | Description | Default value | - * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | - * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | - * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | - * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | - * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | - * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | - * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | - * | `jira.table.cols.subtasks` | The columns to show while viewing subtask issues in a table. For example, a list of subtasks on an issue. | `issuetype, status, assignee, progress` | - * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | - * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | - * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | - * - * #### Look and feel - * - * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). - * - * | Key | Description | Default value | - * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | - * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | - * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | - * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | - * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | - * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | - * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | - * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | - * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | - * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | - * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | - * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | - * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | - * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | - * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | - * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | - * - * #### Other settings - * - * | Key | Description | Default value | - * | ----------------------------------- | ----------------------------------------------------- | ------------- | - * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | - * - * _Note: Be careful when changing [application properties and advanced - * settings](https://confluence.atlassian.com/x/vYXKM)._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setApplicationProperty( - parameters: Parameters.SetApplicationProperty, - callback: Callback, - ): Promise; - /** - * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from - * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are - * described below along with their default values. - * - * #### Advanced settings - * - * The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). - * - * | Key | Description | Default value | - * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | - * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | - * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | - * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | - * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | - * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | - * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | - * | `jira.table.cols.subtasks` | The columns to show while viewing subtask issues in a table. For example, a list of subtasks on an issue. | `issuetype, status, assignee, progress` | - * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | - * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | - * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | - * - * #### Look and feel - * - * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). - * - * | Key | Description | Default value | - * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | - * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | - * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | - * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | - * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | - * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | - * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | - * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | - * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | - * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | - * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | - * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | - * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | - * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | - * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | - * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | - * - * #### Other settings - * - * | Key | Description | Default value | - * | ----------------------------------- | ----------------------------------------------------- | ------------- | - * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | - * - * _Note: Be careful when changing [application properties and advanced - * settings](https://confluence.atlassian.com/x/vYXKM)._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setApplicationProperty( - parameters: Parameters.SetApplicationProperty, - callback?: never, - ): Promise; - async setApplicationProperty( - parameters: Parameters.SetApplicationProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/application-properties/${parameters.id}`, - method: 'PUT', - data: parameters.body, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether - * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this - * operation also returns the time tracking configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getConfiguration(callback: Callback): Promise; - /** - * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether - * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this - * operation also returns the time tracking configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getConfiguration(callback?: never): Promise; - async getConfiguration(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/configuration', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/jql.mts b/src/version3/jql.mts new file mode 100644 index 000000000..f7a491ccf --- /dev/null +++ b/src/version3/jql.mts @@ -0,0 +1,312 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class JQL { + constructor(private client: Client) {} + + /** + * Returns reference data for Jql searches. This is a downloadable version of the documentation provided in [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of Jql-reserved words. Use this + * information to assist with the programmatic creation of Jql queries or the validation of queries built in a custom + * query builder. + * + * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference + * data (POST)](#api-rest-api-3-jql-autocompletedata-post) can be used. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAutoComplete(callback: Callback): Promise; + /** + * Returns reference data for Jql searches. This is a downloadable version of the documentation provided in [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of Jql-reserved words. Use this + * information to assist with the programmatic creation of Jql queries or the validation of queries built in a custom + * query builder. + * + * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference + * data (POST)](#api-rest-api-3-jql-autocompletedata-post) can be used. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAutoComplete(callback?: never): Promise; + async getAutoComplete(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/autocompletedata', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns reference data for Jql searches. This is a downloadable version of the documentation provided in [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of Jql-reserved words. Use this + * information to assist with the programmatic creation of Jql queries or the validation of queries built in a custom + * query builder. + * + * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. + * System fields are always returned. + * + * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across + * all fields with the same name and of the same field type. For example, the collapsed field `Component - + * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched + * simultaneously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAutoCompletePost( + parameters: Parameters.GetAutoCompletePost | undefined, + callback: Callback, + ): Promise; + /** + * Returns reference data for Jql searches. This is a downloadable version of the documentation provided in [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of Jql-reserved words. Use this + * information to assist with the programmatic creation of Jql queries or the validation of queries built in a custom + * query builder. + * + * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. + * System fields are always returned. + * + * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across + * all fields with the same name and of the same field type. For example, the collapsed field `Component - + * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched + * simultaneously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAutoCompletePost( + parameters?: Parameters.GetAutoCompletePost, + callback?: never, + ): Promise; + async getAutoCompletePost( + parameters?: Parameters.GetAutoCompletePost, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/autocompletedata', + method: 'POST', + data: { + projectIds: parameters?.projectIds, + includeCollapsedFields: parameters?.includeCollapsedFields, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the Jql search auto complete suggestions for a field. + * + * Suggestions can be obtained by providing: + * + * - `fieldName` to get a list of all values for the field. + * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. + * - `fieldName` and `predicateName` to get a list of all predicate values for the field. + * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in + * `predicateValue`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getFieldAutoCompleteForQueryString( + parameters: Parameters.GetFieldAutoCompleteForQueryString | undefined, + callback: Callback, + ): Promise; + /** + * Returns the Jql search auto complete suggestions for a field. + * + * Suggestions can be obtained by providing: + * + * - `fieldName` to get a list of all values for the field. + * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. + * - `fieldName` and `predicateName` to get a list of all predicate values for the field. + * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in + * `predicateValue`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getFieldAutoCompleteForQueryString( + parameters?: Parameters.GetFieldAutoCompleteForQueryString, + callback?: never, + ): Promise; + async getFieldAutoCompleteForQueryString( + parameters?: Parameters.GetFieldAutoCompleteForQueryString, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/autocompletedata/suggestions', + method: 'GET', + params: { + fieldName: parameters?.fieldName, + fieldValue: parameters?.fieldValue, + predicateName: parameters?.predicateName, + predicateValue: parameters?.predicateValue, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Parses and validates Jql queries. + * + * Validation is performed in context of the current user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async parseJqlQueries( + parameters: Parameters.ParseJqlQueries | undefined, + callback: Callback, + ): Promise; + /** + * Parses and validates Jql queries. + * + * Validation is performed in context of the current user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async parseJqlQueries( + parameters?: Parameters.ParseJqlQueries, + callback?: never, + ): Promise; + async parseJqlQueries( + parameters?: Parameters.ParseJqlQueries, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/parse', + method: 'POST', + params: { + validation: parameters?.validation, + }, + data: { + queries: parameters?.queries, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Converts one or more Jql queries with user identifiers (username or user key) to equivalent Jql queries with + * account IDs. + * + * You may wish to use this operation if your system stores Jql queries and you want to make them GDPR-compliant. For + * more information about GDPR-related changes, see the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async migrateQueries( + parameters: Parameters.MigrateQueries | undefined, + callback: Callback, + ): Promise; + /** + * Converts one or more Jql queries with user identifiers (username or user key) to equivalent Jql queries with + * account IDs. + * + * You may wish to use this operation if your system stores Jql queries and you want to make them GDPR-compliant. For + * more information about GDPR-related changes, see the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async migrateQueries( + parameters?: Parameters.MigrateQueries, + callback?: never, + ): Promise; + async migrateQueries( + parameters?: Parameters.MigrateQueries, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/pdcleaner', + method: 'POST', + data: { + queryStrings: parameters?.queryStrings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sanitizes one or more Jql queries by converting readable details into IDs where a user doesn't have permission to + * view the entity. + * + * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse + * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where + * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account + * ID is null, sanitizing is performed for an anonymous user. + * + * Note that sanitization doesn't make the queries GDPR-compliant, because it doesn't remove user identifiers + * (username or user key). If you need to make queries GDPR-compliant, use [Convert user identifiers to account IDs in + * Jql + * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/#api-rest-api-3-jql-sanitize-post). + * + * Before sanitization each Jql query is parsed. The queries are returned in the same order that they were passed. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async sanitiseJqlQueries( + parameters: Parameters.SanitiseJqlQueries | undefined, + callback: Callback, + ): Promise; + /** + * Sanitizes one or more Jql queries by converting readable details into IDs where a user doesn't have permission to + * view the entity. + * + * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse + * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where + * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account + * ID is null, sanitizing is performed for an anonymous user. + * + * Note that sanitization doesn't make the queries GDPR-compliant, because it doesn't remove user identifiers + * (username or user key). If you need to make queries GDPR-compliant, use [Convert user identifiers to account IDs in + * Jql + * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/#api-rest-api-3-jql-sanitize-post). + * + * Before sanitization each Jql query is parsed. The queries are returned in the same order that they were passed. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async sanitiseJqlQueries( + parameters?: Parameters.SanitiseJqlQueries, + callback?: never, + ): Promise; + async sanitiseJqlQueries( + parameters?: Parameters.SanitiseJqlQueries, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/sanitize', + method: 'POST', + data: { + queries: parameters?.queries, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/jqlFunctionsApps.mts b/src/version3/jqlFunctionsApps.mts new file mode 100644 index 000000000..7fd01e204 --- /dev/null +++ b/src/version3/jqlFunctionsApps.mts @@ -0,0 +1,82 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class JqlFunctionsApps { + constructor(private client: Client) {} + + /** + * Returns the list of a function's precomputations along with information about when they were created, updated, and + * last used. Each precomputation has a `value` - the Jql fragment to replace the custom function clause with. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** This + * API is only accessible to apps and apps can only inspect their own functions. + */ + async getPrecomputations( + parameters: Parameters.GetPrecomputations | undefined, + callback: Callback, + ): Promise; + /** + * Returns the list of a function's precomputations along with information about when they were created, updated, and + * last used. Each precomputation has a `value` - the Jql fragment to replace the custom function clause with. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** This + * API is only accessible to apps and apps can only inspect their own functions. + */ + async getPrecomputations( + parameters?: Parameters.GetPrecomputations, + callback?: never, + ): Promise; + async getPrecomputations( + parameters?: Parameters.GetPrecomputations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/function/computation', + method: 'GET', + params: { + functionKey: parameters?.functionKey, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + orderBy: parameters?.orderBy, + filter: parameters?.filter, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update the precomputation value of a function created by a Forge/Connect app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** An API + * for apps to update their own precomputations. + */ + async updatePrecomputations( + parameters: Parameters.UpdatePrecomputations | undefined, + callback: Callback, + ): Promise; + /** + * Update the precomputation value of a function created by a Forge/Connect app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** An API + * for apps to update their own precomputations. + */ + async updatePrecomputations(parameters?: Parameters.UpdatePrecomputations, callback?: never): Promise; + async updatePrecomputations( + parameters?: Parameters.UpdatePrecomputations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/function/computation', + method: 'POST', + data: { + values: parameters?.values, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/jqlFunctionsApps.ts b/src/version3/jqlFunctionsApps.ts deleted file mode 100644 index caaf3a955..000000000 --- a/src/version3/jqlFunctionsApps.ts +++ /dev/null @@ -1,82 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class JqlFunctionsApps { - constructor(private client: Client) {} - - /** - * Returns the list of a function's precomputations along with information about when they were created, updated, and - * last used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** This - * API is only accessible to apps and apps can only inspect their own functions. - */ - async getPrecomputations( - parameters: Parameters.GetPrecomputations | undefined, - callback: Callback, - ): Promise; - /** - * Returns the list of a function's precomputations along with information about when they were created, updated, and - * last used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** This - * API is only accessible to apps and apps can only inspect their own functions. - */ - async getPrecomputations( - parameters?: Parameters.GetPrecomputations, - callback?: never, - ): Promise; - async getPrecomputations( - parameters?: Parameters.GetPrecomputations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/function/computation', - method: 'GET', - params: { - functionKey: parameters?.functionKey, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - orderBy: parameters?.orderBy, - filter: parameters?.filter, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Update the precomputation value of a function created by a Forge/Connect app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** An API - * for apps to update their own precomputations. - */ - async updatePrecomputations( - parameters: Parameters.UpdatePrecomputations | undefined, - callback: Callback, - ): Promise; - /** - * Update the precomputation value of a function created by a Forge/Connect app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** An API - * for apps to update their own precomputations. - */ - async updatePrecomputations(parameters?: Parameters.UpdatePrecomputations, callback?: never): Promise; - async updatePrecomputations( - parameters?: Parameters.UpdatePrecomputations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/function/computation', - method: 'POST', - data: { - values: parameters?.values, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/labels.mts b/src/version3/labels.mts new file mode 100644 index 000000000..598a05a0c --- /dev/null +++ b/src/version3/labels.mts @@ -0,0 +1,38 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Labels { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * labels. + */ + async getAllLabels( + parameters: Parameters.GetAllLabels | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * labels. + */ + async getAllLabels(parameters?: Parameters.GetAllLabels, callback?: never): Promise; + async getAllLabels( + parameters?: Parameters.GetAllLabels, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/label', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/labels.ts b/src/version3/labels.ts deleted file mode 100644 index ca88db91e..000000000 --- a/src/version3/labels.ts +++ /dev/null @@ -1,38 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Labels { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * labels. - */ - async getAllLabels( - parameters: Parameters.GetAllLabels | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * labels. - */ - async getAllLabels(parameters?: Parameters.GetAllLabels, callback?: never): Promise; - async getAllLabels( - parameters?: Parameters.GetAllLabels, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/label', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/licenseMetrics.mts b/src/version3/licenseMetrics.mts new file mode 100644 index 000000000..0f6a178b8 --- /dev/null +++ b/src/version3/licenseMetrics.mts @@ -0,0 +1,88 @@ +import * as Models from './models/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class LicenseMetrics { + constructor(private client: Client) {} + + /** + * Returns licensing information about the Jira instance. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getLicense(callback: Callback): Promise; + /** + * Returns licensing information about the Jira instance. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getLicense(callback?: never): Promise; + async getLicense(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/instance/license', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with + * a 7-day lifecycle and could be stale at the time of call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApproximateLicenseCount(callback: Callback): Promise; + /** + * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with + * a 7-day lifecycle and could be stale at the time of call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApproximateLicenseCount(callback?: never): Promise; + async getApproximateLicenseCount(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/license/approximateLicenseCount', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the total approximate number of user accounts for a single Jira license. Note that this information is + * cached with a 7-day lifecycle and could be stale at the time of call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApproximateApplicationLicenseCount( + applicationKey: string, + callback: Callback, + ): Promise; + /** + * Returns the total approximate number of user accounts for a single Jira license. Note that this information is + * cached with a 7-day lifecycle and could be stale at the time of call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApproximateApplicationLicenseCount( + applicationKey: string, + callback?: never, + ): Promise; + async getApproximateApplicationLicenseCount( + applicationKey: string, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/license/approximateLicenseCount/product/${applicationKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/licenseMetrics.ts b/src/version3/licenseMetrics.ts deleted file mode 100644 index 8203c2278..000000000 --- a/src/version3/licenseMetrics.ts +++ /dev/null @@ -1,88 +0,0 @@ -import * as Models from './models/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class LicenseMetrics { - constructor(private client: Client) {} - - /** - * Returns licensing information about the Jira instance. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getLicense(callback: Callback): Promise; - /** - * Returns licensing information about the Jira instance. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getLicense(callback?: never): Promise; - async getLicense(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/instance/license', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with - * a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateLicenseCount(callback: Callback): Promise; - /** - * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with - * a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateLicenseCount(callback?: never): Promise; - async getApproximateLicenseCount(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/license/approximateLicenseCount', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the total approximate number of user accounts for a single Jira license. Note that this information is - * cached with a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateApplicationLicenseCount( - applicationKey: string, - callback: Callback, - ): Promise; - /** - * Returns the total approximate number of user accounts for a single Jira license. Note that this information is - * cached with a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateApplicationLicenseCount( - applicationKey: string, - callback?: never, - ): Promise; - async getApproximateApplicationLicenseCount( - applicationKey: string, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/license/approximateLicenseCount/product/${applicationKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/models/actorInput.ts b/src/version3/models/actorInput.mts similarity index 100% rename from src/version3/models/actorInput.ts rename to src/version3/models/actorInput.mts diff --git a/src/version3/models/actorsMap.ts b/src/version3/models/actorsMap.mts similarity index 100% rename from src/version3/models/actorsMap.ts rename to src/version3/models/actorsMap.mts diff --git a/src/version3/models/addField.ts b/src/version3/models/addField.mts similarity index 100% rename from src/version3/models/addField.ts rename to src/version3/models/addField.mts diff --git a/src/version3/models/addGroup.ts b/src/version3/models/addGroup.mts similarity index 100% rename from src/version3/models/addGroup.ts rename to src/version3/models/addGroup.mts diff --git a/src/version3/models/addSecuritySchemeLevelsRequest.mts b/src/version3/models/addSecuritySchemeLevelsRequest.mts new file mode 100644 index 000000000..7d3c515ac --- /dev/null +++ b/src/version3/models/addSecuritySchemeLevelsRequest.mts @@ -0,0 +1,6 @@ +import { SecuritySchemeLevel } from './securitySchemeLevel.mjs'; + +export interface AddSecuritySchemeLevelsRequest { + /** The list of scheme levels which should be added to the security scheme. */ + levels?: SecuritySchemeLevel[]; +} diff --git a/src/version3/models/addSecuritySchemeLevelsRequest.ts b/src/version3/models/addSecuritySchemeLevelsRequest.ts deleted file mode 100644 index 7f831d1d0..000000000 --- a/src/version3/models/addSecuritySchemeLevelsRequest.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { SecuritySchemeLevel } from './securitySchemeLevel.js'; - -export interface AddSecuritySchemeLevelsRequest { - /** The list of scheme levels which should be added to the security scheme. */ - levels?: SecuritySchemeLevel[]; -} diff --git a/src/version3/models/announcementBannerConfiguration.ts b/src/version3/models/announcementBannerConfiguration.mts similarity index 100% rename from src/version3/models/announcementBannerConfiguration.ts rename to src/version3/models/announcementBannerConfiguration.mts diff --git a/src/version3/models/announcementBannerConfigurationUpdate.ts b/src/version3/models/announcementBannerConfigurationUpdate.mts similarity index 100% rename from src/version3/models/announcementBannerConfigurationUpdate.ts rename to src/version3/models/announcementBannerConfigurationUpdate.mts diff --git a/src/version3/models/application.ts b/src/version3/models/application.mts similarity index 100% rename from src/version3/models/application.ts rename to src/version3/models/application.mts diff --git a/src/version3/models/applicationProperty.ts b/src/version3/models/applicationProperty.mts similarity index 100% rename from src/version3/models/applicationProperty.ts rename to src/version3/models/applicationProperty.mts diff --git a/src/version3/models/applicationRole.mts b/src/version3/models/applicationRole.mts new file mode 100644 index 000000000..48ea67c92 --- /dev/null +++ b/src/version3/models/applicationRole.mts @@ -0,0 +1,36 @@ +import type { GroupName } from './groupName.mjs'; + +/** Details of an application role. */ +export interface ApplicationRole { + /** The key of the application role. */ + key?: string; + /** + * The groups associated with the application role. As a group's name can change, use of `groupDetails` is recommended + * to identify a groups. + */ + groups?: string[]; + /** The groups associated with the application role. */ + groupDetails?: GroupName[]; + /** The display name of the application role. */ + name?: string; + /** + * The groups that are granted default access for this application role. As a group's name can change, use of + * `defaultGroupsDetails` is recommended to identify a groups. + */ + defaultGroups?: string[]; + /** The groups that are granted default access for this application role. */ + defaultGroupsDetails?: GroupName[]; + /** Determines whether this application role should be selected by default on user creation. */ + selectedByDefault?: boolean; + /** The maximum count of users on your license. */ + numberOfSeats?: number; + /** The count of users remaining on your license. */ + remainingSeats?: number; + /** The number of users counting against your license. */ + userCount?: number; + /** The [type of users](https://confluence.atlassian.com/x/lRW3Ng) being counted against your license. */ + userCountDescription?: string; + hasUnlimitedSeats?: boolean; + /** Indicates if the application role belongs to Jira platform (`jira-core`). */ + platform?: boolean; +} diff --git a/src/version3/models/applicationRole.ts b/src/version3/models/applicationRole.ts deleted file mode 100644 index 59396cce6..000000000 --- a/src/version3/models/applicationRole.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { GroupName } from './groupName.js'; - -/** Details of an application role. */ -export interface ApplicationRole { - /** The key of the application role. */ - key?: string; - /** - * The groups associated with the application role. As a group's name can change, use of `groupDetails` is recommended - * to identify a groups. - */ - groups?: string[]; - /** The groups associated with the application role. */ - groupDetails?: GroupName[]; - /** The display name of the application role. */ - name?: string; - /** - * The groups that are granted default access for this application role. As a group's name can change, use of - * `defaultGroupsDetails` is recommended to identify a groups. - */ - defaultGroups?: string[]; - /** The groups that are granted default access for this application role. */ - defaultGroupsDetails?: GroupName[]; - /** Determines whether this application role should be selected by default on user creation. */ - selectedByDefault?: boolean; - /** The maximum count of users on your license. */ - numberOfSeats?: number; - /** The count of users remaining on your license. */ - remainingSeats?: number; - /** The number of users counting against your license. */ - userCount?: number; - /** The [type of users](https://confluence.atlassian.com/x/lRW3Ng) being counted against your license. */ - userCountDescription?: string; - hasUnlimitedSeats?: boolean; - /** Indicates if the application role belongs to Jira platform (`jira-core`). */ - platform?: boolean; -} diff --git a/src/version3/models/archiveIssueAsyncRequest.ts b/src/version3/models/archiveIssueAsyncRequest.mts similarity index 100% rename from src/version3/models/archiveIssueAsyncRequest.ts rename to src/version3/models/archiveIssueAsyncRequest.mts diff --git a/src/version3/models/associateFieldConfigurationsWithIssueTypesRequest.mts b/src/version3/models/associateFieldConfigurationsWithIssueTypesRequest.mts new file mode 100644 index 000000000..f829c744b --- /dev/null +++ b/src/version3/models/associateFieldConfigurationsWithIssueTypesRequest.mts @@ -0,0 +1,7 @@ +import { FieldConfigurationToIssueTypeMapping } from './fieldConfigurationToIssueTypeMapping.mjs'; + +/** Details of a field configuration to issue type mappings. */ +export interface AssociateFieldConfigurationsWithIssueTypesRequest { + /** Field configuration to issue type mappings. */ + mappings: FieldConfigurationToIssueTypeMapping[]; +} diff --git a/src/version3/models/associateFieldConfigurationsWithIssueTypesRequest.ts b/src/version3/models/associateFieldConfigurationsWithIssueTypesRequest.ts deleted file mode 100644 index 6754b859e..000000000 --- a/src/version3/models/associateFieldConfigurationsWithIssueTypesRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { FieldConfigurationToIssueTypeMapping } from './fieldConfigurationToIssueTypeMapping.js'; - -/** Details of a field configuration to issue type mappings. */ -export interface AssociateFieldConfigurationsWithIssueTypesRequest { - /** Field configuration to issue type mappings. */ - mappings: FieldConfigurationToIssueTypeMapping[]; -} diff --git a/src/version3/models/associatedItem.ts b/src/version3/models/associatedItem.mts similarity index 100% rename from src/version3/models/associatedItem.ts rename to src/version3/models/associatedItem.mts diff --git a/src/version3/models/attachment.mts b/src/version3/models/attachment.mts new file mode 100644 index 000000000..a7601a44c --- /dev/null +++ b/src/version3/models/attachment.mts @@ -0,0 +1,22 @@ +import { UserDetails } from './userDetails.mjs'; + +/** Details about an attachment. */ +export interface Attachment { + /** The URL of the attachment details response. */ + self?: string; + /** The ID of the attachment. */ + id: string; + /** The file name of the attachment. */ + filename?: string; + author?: UserDetails; + /** The datetime the attachment was created. */ + created?: string; + /** The size of the attachment. */ + size?: number; + /** The MIME type of the attachment. */ + mimeType?: string; + /** The content of the attachment. */ + content?: string; + /** The URL of a thumbnail representing the attachment. */ + thumbnail?: string; +} diff --git a/src/version3/models/attachment.ts b/src/version3/models/attachment.ts deleted file mode 100644 index 470308279..000000000 --- a/src/version3/models/attachment.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { UserDetails } from './userDetails.js'; - -/** Details about an attachment. */ -export interface Attachment { - /** The URL of the attachment details response. */ - self?: string; - /** The ID of the attachment. */ - id: string; - /** The file name of the attachment. */ - filename?: string; - author?: UserDetails; - /** The datetime the attachment was created. */ - created?: string; - /** The size of the attachment. */ - size?: number; - /** The MIME type of the attachment. */ - mimeType?: string; - /** The content of the attachment. */ - content?: string; - /** The URL of a thumbnail representing the attachment. */ - thumbnail?: string; -} diff --git a/src/version3/models/attachmentArchiveEntry.ts b/src/version3/models/attachmentArchiveEntry.mts similarity index 100% rename from src/version3/models/attachmentArchiveEntry.ts rename to src/version3/models/attachmentArchiveEntry.mts diff --git a/src/version3/models/attachmentArchiveImpl.mts b/src/version3/models/attachmentArchiveImpl.mts new file mode 100644 index 000000000..05d3d8c9b --- /dev/null +++ b/src/version3/models/attachmentArchiveImpl.mts @@ -0,0 +1,8 @@ +import { AttachmentArchiveEntry } from './attachmentArchiveEntry.mjs'; + +export interface AttachmentArchiveImpl { + /** The list of the items included in the archive. */ + entries?: AttachmentArchiveEntry[]; + /** The number of items in the archive. */ + totalEntryCount?: number; +} diff --git a/src/version3/models/attachmentArchiveImpl.ts b/src/version3/models/attachmentArchiveImpl.ts deleted file mode 100644 index 59188896a..000000000 --- a/src/version3/models/attachmentArchiveImpl.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { AttachmentArchiveEntry } from './attachmentArchiveEntry.js'; - -export interface AttachmentArchiveImpl { - /** The list of the items included in the archive. */ - entries?: AttachmentArchiveEntry[]; - /** The number of items in the archive. */ - totalEntryCount?: number; -} diff --git a/src/version3/models/attachmentArchiveItemReadable.ts b/src/version3/models/attachmentArchiveItemReadable.mts similarity index 100% rename from src/version3/models/attachmentArchiveItemReadable.ts rename to src/version3/models/attachmentArchiveItemReadable.mts diff --git a/src/version3/models/attachmentArchiveMetadataReadable.mts b/src/version3/models/attachmentArchiveMetadataReadable.mts new file mode 100644 index 000000000..6dc62a578 --- /dev/null +++ b/src/version3/models/attachmentArchiveMetadataReadable.mts @@ -0,0 +1,15 @@ +import { AttachmentArchiveItemReadable } from './attachmentArchiveItemReadable.mjs'; + +/** Metadata for an archive (for example a zip) and its contents. */ +export interface AttachmentArchiveMetadataReadable { + /** The ID of the attachment. */ + id?: number; + /** The name of the archive file. */ + name?: string; + /** The list of the items included in the archive. */ + entries?: AttachmentArchiveItemReadable[]; + /** The number of items included in the archive. */ + totalEntryCount?: number; + /** The MIME type of the attachment. */ + mediaType?: string; +} diff --git a/src/version3/models/attachmentArchiveMetadataReadable.ts b/src/version3/models/attachmentArchiveMetadataReadable.ts deleted file mode 100644 index dd46266d8..000000000 --- a/src/version3/models/attachmentArchiveMetadataReadable.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { AttachmentArchiveItemReadable } from './attachmentArchiveItemReadable.js'; - -/** Metadata for an archive (for example a zip) and its contents. */ -export interface AttachmentArchiveMetadataReadable { - /** The ID of the attachment. */ - id?: number; - /** The name of the archive file. */ - name?: string; - /** The list of the items included in the archive. */ - entries?: AttachmentArchiveItemReadable[]; - /** The number of items included in the archive. */ - totalEntryCount?: number; - /** The MIME type of the attachment. */ - mediaType?: string; -} diff --git a/src/version3/models/attachmentMetadata.mts b/src/version3/models/attachmentMetadata.mts new file mode 100644 index 000000000..a572eb9c0 --- /dev/null +++ b/src/version3/models/attachmentMetadata.mts @@ -0,0 +1,29 @@ +import { User } from './user.mjs'; + +/** Metadata for an issue attachment. */ +export interface AttachmentMetadata { + /** The ID of the attachment. */ + id?: number; + /** The URL of the attachment metadata details. */ + self?: string; + /** The name of the attachment file. */ + filename?: string; + author?: User; + /** The datetime the attachment was created. */ + created?: string; + /** The size of the attachment. */ + size?: number; + /** The MIME type of the attachment. */ + mimeType?: string; + /** Additional properties of the attachment. */ + properties?: {}; + /** The URL of the attachment. */ + content?: string; + /** The URL of a thumbnail representing the attachment. */ + thumbnail?: string; + /** + * File ID of the attachment in Media Store. See [ for more details on the Media + * API.](https://developer.atlassian.com/platform/media/) + */ + mediaApiFileId?: string; +} diff --git a/src/version3/models/attachmentMetadata.ts b/src/version3/models/attachmentMetadata.ts deleted file mode 100644 index 9fdc921cd..000000000 --- a/src/version3/models/attachmentMetadata.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { User } from './user.js'; - -/** Metadata for an issue attachment. */ -export interface AttachmentMetadata { - /** The ID of the attachment. */ - id?: number; - /** The URL of the attachment metadata details. */ - self?: string; - /** The name of the attachment file. */ - filename?: string; - author?: User; - /** The datetime the attachment was created. */ - created?: string; - /** The size of the attachment. */ - size?: number; - /** The MIME type of the attachment. */ - mimeType?: string; - /** Additional properties of the attachment. */ - properties?: {}; - /** The URL of the attachment. */ - content?: string; - /** The URL of a thumbnail representing the attachment. */ - thumbnail?: string; - /** - * File ID of the attachment in Media Store. See [ for more details on the Media - * API.](https://developer.atlassian.com/platform/media/) - */ - mediaApiFileId?: string; -} diff --git a/src/version3/models/attachmentSettings.ts b/src/version3/models/attachmentSettings.mts similarity index 100% rename from src/version3/models/attachmentSettings.ts rename to src/version3/models/attachmentSettings.mts diff --git a/src/version3/models/auditRecord.mts b/src/version3/models/auditRecord.mts new file mode 100644 index 000000000..771cc5b91 --- /dev/null +++ b/src/version3/models/auditRecord.mts @@ -0,0 +1,28 @@ +import { AssociatedItem } from './associatedItem.mjs'; +import { ChangedValue } from './changedValue.mjs'; + +/** An audit record. */ +export interface AuditRecord { + /** The ID of the audit record. */ + id?: number; + /** The summary of the audit record. */ + summary?: string; + /** The URL of the computer where the creation of the audit record was initiated. */ + remoteAddress?: string; + /** The date and time on which the audit record was created. */ + created?: string; + /** + * The category of the audit record. For a list of these categories, see the help article [Auditing in Jira + * applications](https://confluence.atlassian.com/x/noXKM). + */ + category?: string; + /** The event the audit record originated from. */ + eventSource?: string; + /** The description of the audit record. */ + description?: string; + objectItem?: AssociatedItem; + /** The list of values changed in the record event. */ + changedValues?: ChangedValue[]; + /** The list of items associated with the changed record. */ + associatedItems?: AssociatedItem[]; +} diff --git a/src/version3/models/auditRecord.ts b/src/version3/models/auditRecord.ts deleted file mode 100644 index ffecfda2d..000000000 --- a/src/version3/models/auditRecord.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { AssociatedItem } from './associatedItem.js'; -import type { ChangedValue } from './changedValue.js'; - -/** An audit record. */ -export interface AuditRecord { - /** The ID of the audit record. */ - id?: number; - /** The summary of the audit record. */ - summary?: string; - /** The URL of the computer where the creation of the audit record was initiated. */ - remoteAddress?: string; - /** The date and time on which the audit record was created. */ - created?: string; - /** - * The category of the audit record. For a list of these categories, see the help article [Auditing in Jira - * applications](https://confluence.atlassian.com/x/noXKM). - */ - category?: string; - /** The event the audit record originated from. */ - eventSource?: string; - /** The description of the audit record. */ - description?: string; - objectItem?: AssociatedItem; - /** The list of values changed in the record event. */ - changedValues?: ChangedValue[]; - /** The list of items associated with the changed record. */ - associatedItems?: AssociatedItem[]; -} diff --git a/src/version3/models/auditRecords.mts b/src/version3/models/auditRecords.mts new file mode 100644 index 000000000..66953e8d6 --- /dev/null +++ b/src/version3/models/auditRecords.mts @@ -0,0 +1,13 @@ +import { AuditRecord } from './auditRecord.mjs'; + +/** Container for a list of audit records. */ +export interface AuditRecords { + /** The number of audit items skipped before the first item in this list. */ + offset?: number; + /** The requested or default limit on the number of audit items to be returned. */ + limit?: number; + /** The total number of audit items returned. */ + total?: number; + /** The list of audit items. */ + records?: AuditRecord[]; +} diff --git a/src/version3/models/auditRecords.ts b/src/version3/models/auditRecords.ts deleted file mode 100644 index d2486fdcd..000000000 --- a/src/version3/models/auditRecords.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { AuditRecord } from './auditRecord.js'; - -/** Container for a list of audit records. */ -export interface AuditRecords { - /** The number of audit items skipped before the first item in this list. */ - offset?: number; - /** The requested or default limit on the number of audit items to be returned. */ - limit?: number; - /** The total number of audit items returned. */ - total?: number; - /** The list of audit items. */ - records?: AuditRecord[]; -} diff --git a/src/version3/models/autoCompleteSuggestion.ts b/src/version3/models/autoCompleteSuggestion.mts similarity index 100% rename from src/version3/models/autoCompleteSuggestion.ts rename to src/version3/models/autoCompleteSuggestion.mts diff --git a/src/version3/models/autoCompleteSuggestions.mts b/src/version3/models/autoCompleteSuggestions.mts new file mode 100644 index 000000000..c170b32c1 --- /dev/null +++ b/src/version3/models/autoCompleteSuggestions.mts @@ -0,0 +1,7 @@ +import { AutoCompleteSuggestion } from './autoCompleteSuggestion.mjs'; + +/** The results from a Jql query. */ +export interface AutoCompleteSuggestions { + /** The list of suggested item. */ + results?: AutoCompleteSuggestion[]; +} diff --git a/src/version3/models/autoCompleteSuggestions.ts b/src/version3/models/autoCompleteSuggestions.ts deleted file mode 100644 index 1dd1179a3..000000000 --- a/src/version3/models/autoCompleteSuggestions.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { AutoCompleteSuggestion } from './autoCompleteSuggestion.js'; - -/** The results from a JQL query. */ -export interface AutoCompleteSuggestions { - /** The list of suggested item. */ - results?: AutoCompleteSuggestion[]; -} diff --git a/src/version3/models/availableDashboardGadget.ts b/src/version3/models/availableDashboardGadget.mts similarity index 100% rename from src/version3/models/availableDashboardGadget.ts rename to src/version3/models/availableDashboardGadget.mts diff --git a/src/version3/models/availableDashboardGadgetsResponse.mts b/src/version3/models/availableDashboardGadgetsResponse.mts new file mode 100644 index 000000000..5f40eeae3 --- /dev/null +++ b/src/version3/models/availableDashboardGadgetsResponse.mts @@ -0,0 +1,7 @@ +import { AvailableDashboardGadget } from './availableDashboardGadget.mjs'; + +/** The list of available gadgets. */ +export interface AvailableDashboardGadgetsResponse { + /** The list of available gadgets. */ + gadgets: AvailableDashboardGadget[]; +} diff --git a/src/version3/models/availableDashboardGadgetsResponse.ts b/src/version3/models/availableDashboardGadgetsResponse.ts deleted file mode 100644 index 343598134..000000000 --- a/src/version3/models/availableDashboardGadgetsResponse.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { AvailableDashboardGadget } from './availableDashboardGadget.js'; - -/** The list of available gadgets. */ -export interface AvailableDashboardGadgetsResponse { - /** The list of available gadgets. */ - gadgets: AvailableDashboardGadget[]; -} diff --git a/src/version3/models/avatar.ts b/src/version3/models/avatar.mts similarity index 100% rename from src/version3/models/avatar.ts rename to src/version3/models/avatar.mts diff --git a/src/version3/models/avatarUrls.ts b/src/version3/models/avatarUrls.mts similarity index 100% rename from src/version3/models/avatarUrls.ts rename to src/version3/models/avatarUrls.mts diff --git a/src/version3/models/avatarWithDetails.ts b/src/version3/models/avatarWithDetails.mts similarity index 100% rename from src/version3/models/avatarWithDetails.ts rename to src/version3/models/avatarWithDetails.mts diff --git a/src/version3/models/avatars.mts b/src/version3/models/avatars.mts new file mode 100644 index 000000000..ae4e92054 --- /dev/null +++ b/src/version3/models/avatars.mts @@ -0,0 +1,9 @@ +import type { Avatar } from './avatar.mjs'; + +/** Details about system and custom avatars. */ +export interface Avatars { + /** System avatars list. */ + system?: Avatar[]; + /** Custom avatars list. */ + custom?: Avatar[]; +} diff --git a/src/version3/models/avatars.ts b/src/version3/models/avatars.ts deleted file mode 100644 index 5ec501db6..000000000 --- a/src/version3/models/avatars.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Avatar } from './avatar.js'; - -/** Details about system and custom avatars. */ -export interface Avatars { - /** System avatars list. */ - system?: Avatar[]; - /** Custom avatars list. */ - custom?: Avatar[]; -} diff --git a/src/version3/models/bulkChangeOwnerDetails.ts b/src/version3/models/bulkChangeOwnerDetails.mts similarity index 100% rename from src/version3/models/bulkChangeOwnerDetails.ts rename to src/version3/models/bulkChangeOwnerDetails.mts diff --git a/src/version3/models/bulkCustomFieldOptionCreateRequest.mts b/src/version3/models/bulkCustomFieldOptionCreateRequest.mts new file mode 100644 index 000000000..9374a43cc --- /dev/null +++ b/src/version3/models/bulkCustomFieldOptionCreateRequest.mts @@ -0,0 +1,7 @@ +import { CustomFieldOptionCreate } from './customFieldOptionCreate.mjs'; + +/** Details of the options to create for a custom field. */ +export interface BulkCustomFieldOptionCreateRequest { + /** Details of options to create. */ + options?: CustomFieldOptionCreate[]; +} diff --git a/src/version3/models/bulkCustomFieldOptionCreateRequest.ts b/src/version3/models/bulkCustomFieldOptionCreateRequest.ts deleted file mode 100644 index fc9734cde..000000000 --- a/src/version3/models/bulkCustomFieldOptionCreateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CustomFieldOptionCreate } from './customFieldOptionCreate.js'; - -/** Details of the options to create for a custom field. */ -export interface BulkCustomFieldOptionCreateRequest { - /** Details of options to create. */ - options?: CustomFieldOptionCreate[]; -} diff --git a/src/version3/models/bulkCustomFieldOptionUpdateRequest.mts b/src/version3/models/bulkCustomFieldOptionUpdateRequest.mts new file mode 100644 index 000000000..952315da4 --- /dev/null +++ b/src/version3/models/bulkCustomFieldOptionUpdateRequest.mts @@ -0,0 +1,7 @@ +import { CustomFieldOptionUpdate } from './customFieldOptionUpdate.mjs'; + +/** Details of the options to update for a custom field. */ +export interface BulkCustomFieldOptionUpdateRequest { + /** Details of the options to update. */ + options?: CustomFieldOptionUpdate[]; +} diff --git a/src/version3/models/bulkCustomFieldOptionUpdateRequest.ts b/src/version3/models/bulkCustomFieldOptionUpdateRequest.ts deleted file mode 100644 index a9d185d58..000000000 --- a/src/version3/models/bulkCustomFieldOptionUpdateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CustomFieldOptionUpdate } from './customFieldOptionUpdate.js'; - -/** Details of the options to update for a custom field. */ -export interface BulkCustomFieldOptionUpdateRequest { - /** Details of the options to update. */ - options?: CustomFieldOptionUpdate[]; -} diff --git a/src/version3/models/bulkEditShareableEntity.ts b/src/version3/models/bulkEditShareableEntity.mts similarity index 100% rename from src/version3/models/bulkEditShareableEntity.ts rename to src/version3/models/bulkEditShareableEntity.mts diff --git a/src/version3/models/bulkIssueIsWatching.ts b/src/version3/models/bulkIssueIsWatching.mts similarity index 100% rename from src/version3/models/bulkIssueIsWatching.ts rename to src/version3/models/bulkIssueIsWatching.mts diff --git a/src/version3/models/bulkIssuePropertyUpdateRequest.mts b/src/version3/models/bulkIssuePropertyUpdateRequest.mts new file mode 100644 index 000000000..6c04dde31 --- /dev/null +++ b/src/version3/models/bulkIssuePropertyUpdateRequest.mts @@ -0,0 +1,18 @@ +import { IssueFilterForBulkPropertySet } from './issueFilterForBulkPropertySet.mjs'; + +/** Bulk issue property update request details. */ +export interface BulkIssuePropertyUpdateRequest { + /** + * The value of the property. The value must be a [valid](https://tools.ietf.org/html/rfc4627), non-empty JSON blob. + * The maximum length is 32768 characters. + */ + value?: any; + /** + * EXPERIMENTAL. The Jira expression to calculate the value of the property. The value of the expression must be an + * object that can be converted to JSON, such as a number, boolean, string, list, or map. The context variables + * available to the expression are `issue` and `user`. Issues for which the expression returns a value whose JSON + * representation is longer than 32768 characters are ignored. + */ + expression?: string; + filter?: IssueFilterForBulkPropertySet; +} diff --git a/src/version3/models/bulkIssuePropertyUpdateRequest.ts b/src/version3/models/bulkIssuePropertyUpdateRequest.ts deleted file mode 100644 index d139cf132..000000000 --- a/src/version3/models/bulkIssuePropertyUpdateRequest.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { IssueFilterForBulkPropertySet } from './issueFilterForBulkPropertySet.js'; - -/** Bulk issue property update request details. */ -export interface BulkIssuePropertyUpdateRequest { - /** - * The value of the property. The value must be a [valid](https://tools.ietf.org/html/rfc4627), non-empty JSON blob. - * The maximum length is 32768 characters. - */ - value?: any; - /** - * EXPERIMENTAL. The Jira expression to calculate the value of the property. The value of the expression must be an - * object that can be converted to JSON, such as a number, boolean, string, list, or map. The context variables - * available to the expression are `issue` and `user`. Issues for which the expression returns a value whose JSON - * representation is longer than 32768 characters are ignored. - */ - expression?: string; - filter?: IssueFilterForBulkPropertySet; -} diff --git a/src/version3/models/bulkOperationErrorResult.mts b/src/version3/models/bulkOperationErrorResult.mts new file mode 100644 index 000000000..5a4b5eee7 --- /dev/null +++ b/src/version3/models/bulkOperationErrorResult.mts @@ -0,0 +1,7 @@ +import type { ErrorCollection } from './errorCollection.mjs'; + +export interface BulkOperationErrorResult { + status?: number; + elementErrors?: ErrorCollection; + failedElementNumber?: number; +} diff --git a/src/version3/models/bulkOperationErrorResult.ts b/src/version3/models/bulkOperationErrorResult.ts deleted file mode 100644 index a679502df..000000000 --- a/src/version3/models/bulkOperationErrorResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ErrorCollection } from './errorCollection.js'; - -export interface BulkOperationErrorResult { - status?: number; - elementErrors?: ErrorCollection; - failedElementNumber?: number; -} diff --git a/src/version3/models/bulkPermissionGrants.mts b/src/version3/models/bulkPermissionGrants.mts new file mode 100644 index 000000000..c2e4687a5 --- /dev/null +++ b/src/version3/models/bulkPermissionGrants.mts @@ -0,0 +1,9 @@ +import { BulkProjectPermissionGrants } from './bulkProjectPermissionGrants.mjs'; + +/** Details of global and project permissions granted to the user. */ +export interface BulkPermissionGrants { + /** List of project permissions and the projects and issues those permissions provide access to. */ + projectPermissions: BulkProjectPermissionGrants[]; + /** List of permissions granted to the user. */ + globalPermissions: string[]; +} diff --git a/src/version3/models/bulkPermissionGrants.ts b/src/version3/models/bulkPermissionGrants.ts deleted file mode 100644 index e57c46baf..000000000 --- a/src/version3/models/bulkPermissionGrants.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { BulkProjectPermissionGrants } from './bulkProjectPermissionGrants.js'; - -/** Details of global and project permissions granted to the user. */ -export interface BulkPermissionGrants { - /** List of project permissions and the projects and issues those permissions provide access to. */ - projectPermissions: BulkProjectPermissionGrants[]; - /** List of permissions granted to the user. */ - globalPermissions: string[]; -} diff --git a/src/version3/models/bulkPermissionsRequest.mts b/src/version3/models/bulkPermissionsRequest.mts new file mode 100644 index 000000000..09d00da8a --- /dev/null +++ b/src/version3/models/bulkPermissionsRequest.mts @@ -0,0 +1,11 @@ +import { BulkProjectPermissions } from './bulkProjectPermissions.mjs'; + +/** Details of global permissions to look up and project permissions with associated projects and issues to look up. */ +export interface BulkPermissionsRequest { + /** Project permissions with associated projects and issues to look up. */ + projectPermissions?: BulkProjectPermissions[]; + /** Global permissions to look up. */ + globalPermissions?: string[]; + /** The account ID of a user. */ + accountId?: string; +} diff --git a/src/version3/models/bulkPermissionsRequest.ts b/src/version3/models/bulkPermissionsRequest.ts deleted file mode 100644 index 2b0ef056d..000000000 --- a/src/version3/models/bulkPermissionsRequest.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { BulkProjectPermissions } from './bulkProjectPermissions.js'; - -/** Details of global permissions to look up and project permissions with associated projects and issues to look up. */ -export interface BulkPermissionsRequest { - /** Project permissions with associated projects and issues to look up. */ - projectPermissions?: BulkProjectPermissions[]; - /** Global permissions to look up. */ - globalPermissions?: string[]; - /** The account ID of a user. */ - accountId?: string; -} diff --git a/src/version3/models/bulkProjectPermissionGrants.ts b/src/version3/models/bulkProjectPermissionGrants.mts similarity index 100% rename from src/version3/models/bulkProjectPermissionGrants.ts rename to src/version3/models/bulkProjectPermissionGrants.mts diff --git a/src/version3/models/bulkProjectPermissions.ts b/src/version3/models/bulkProjectPermissions.mts similarity index 100% rename from src/version3/models/bulkProjectPermissions.ts rename to src/version3/models/bulkProjectPermissions.mts diff --git a/src/version3/models/changeDetails.ts b/src/version3/models/changeDetails.mts similarity index 100% rename from src/version3/models/changeDetails.ts rename to src/version3/models/changeDetails.mts diff --git a/src/version3/models/changedValue.ts b/src/version3/models/changedValue.mts similarity index 100% rename from src/version3/models/changedValue.ts rename to src/version3/models/changedValue.mts diff --git a/src/version3/models/changedWorklog.mts b/src/version3/models/changedWorklog.mts new file mode 100644 index 000000000..8bd87cf23 --- /dev/null +++ b/src/version3/models/changedWorklog.mts @@ -0,0 +1,11 @@ +import { EntityProperty } from './entityProperty.mjs'; + +/** Details of a changed worklog. */ +export interface ChangedWorklog { + /** The ID of the worklog. */ + worklogId?: number; + /** The datetime of the change. */ + updatedTime?: number; + /** Details of properties associated with the change. */ + properties?: EntityProperty[]; +} diff --git a/src/version3/models/changedWorklog.ts b/src/version3/models/changedWorklog.ts deleted file mode 100644 index eeb542c49..000000000 --- a/src/version3/models/changedWorklog.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { EntityProperty } from './entityProperty.js'; - -/** Details of a changed worklog. */ -export interface ChangedWorklog { - /** The ID of the worklog. */ - worklogId?: number; - /** The datetime of the change. */ - updatedTime?: number; - /** Details of properties associated with the change. */ - properties?: EntityProperty[]; -} diff --git a/src/version3/models/changedWorklogs.mts b/src/version3/models/changedWorklogs.mts new file mode 100644 index 000000000..f0ea7d595 --- /dev/null +++ b/src/version3/models/changedWorklogs.mts @@ -0,0 +1,16 @@ +import { ChangedWorklog } from './changedWorklog.mjs'; + +/** List of changed worklogs. */ +export interface ChangedWorklogs { + /** Changed worklog list. */ + values?: ChangedWorklog[]; + /** The datetime of the first worklog item in the list. */ + since?: number; + /** The datetime of the last worklog item in the list. */ + until?: number; + /** The URL of this changed worklogs list. */ + self?: string; + /** The URL of the next list of changed worklogs. */ + nextPage?: string; + lastPage?: boolean; +} diff --git a/src/version3/models/changedWorklogs.ts b/src/version3/models/changedWorklogs.ts deleted file mode 100644 index 2e8ba4568..000000000 --- a/src/version3/models/changedWorklogs.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { ChangedWorklog } from './changedWorklog.js'; - -/** List of changed worklogs. */ -export interface ChangedWorklogs { - /** Changed worklog list. */ - values?: ChangedWorklog[]; - /** The datetime of the first worklog item in the list. */ - since?: number; - /** The datetime of the last worklog item in the list. */ - until?: number; - /** The URL of this changed worklogs list. */ - self?: string; - /** The URL of the next list of changed worklogs. */ - nextPage?: string; - lastPage?: boolean; -} diff --git a/src/version3/models/changelog.mts b/src/version3/models/changelog.mts new file mode 100644 index 000000000..261110fa9 --- /dev/null +++ b/src/version3/models/changelog.mts @@ -0,0 +1,15 @@ +import { ChangeDetails } from './changeDetails.mjs'; +import { HistoryMetadata } from './historyMetadata.mjs'; +import { UserDetails } from './userDetails.mjs'; + +/** A changelog. */ +export interface Changelog { + /** The ID of the changelog. */ + id?: string; + author?: UserDetails; + /** The date on which the change took place. */ + created?: string; + /** The list of items changed. */ + items?: ChangeDetails[]; + historyMetadata?: HistoryMetadata; +} diff --git a/src/version3/models/changelog.ts b/src/version3/models/changelog.ts deleted file mode 100644 index fc4f75a7f..000000000 --- a/src/version3/models/changelog.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { ChangeDetails } from './changeDetails.js'; -import type { HistoryMetadata } from './historyMetadata.js'; -import type { UserDetails } from './userDetails.js'; - -/** A changelog. */ -export interface Changelog { - /** The ID of the changelog. */ - id?: string; - author?: UserDetails; - /** The date on which the change took place. */ - created?: string; - /** The list of items changed. */ - items?: ChangeDetails[]; - historyMetadata?: HistoryMetadata; -} diff --git a/src/version3/models/columnItem.ts b/src/version3/models/columnItem.mts similarity index 100% rename from src/version3/models/columnItem.ts rename to src/version3/models/columnItem.mts diff --git a/src/version3/models/comment.mts b/src/version3/models/comment.mts new file mode 100644 index 000000000..632a8204d --- /dev/null +++ b/src/version3/models/comment.mts @@ -0,0 +1,44 @@ +import type { Document } from './document.mjs'; +import { EntityProperty } from './entityProperty.mjs'; +import { UserDetails } from './userDetails.mjs'; +import { Visibility } from './visibility.mjs'; + +/** A comment. */ +export interface Comment { + /** The URL of the comment. */ + self?: string; + /** The ID of the comment. */ + id?: string; + author?: UserDetails; + /** + * The comment text in [Atlassian Document + * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). + */ + body?: Document; + /** The rendered version of the comment. */ + renderedBody?: string; + updateAuthor?: UserDetails; + /** The date and time at which the comment was created. */ + created?: string; + /** The date and time at which the comment was updated last. */ + updated?: string; + visibility?: Visibility; + /** + * Whether the comment is visible in Jira Service Desk. Defaults to true when comments are created in the Jira Cloud + * Platform. This includes when the site doesn't use Jira Service Desk or the project isn't a Jira Service Desk + * project and, therefore, there is no Jira Service Desk for the issue to be visible on. To create a comment with its + * visibility in Jira Service Desk set to false, use the Jira Service Desk REST API [Create request + * comment](https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-request-issueIdOrKey-comment-post) + * operation. + */ + jsdPublic?: boolean; + /** + * Whether the comment was added from an email sent by a person who is not part of the issue. See [Allow external + * emails to be added as comments on + * issues](https://support.atlassian.com/jira-service-management-cloud/docs/allow-external-emails-to-be-added-as-comments-on-issues/)for + * information on setting up this feature. + */ + jsdAuthorCanSeeRequest?: boolean; + /** A list of comment properties. Optional on create and update. */ + properties?: EntityProperty[]; +} diff --git a/src/version3/models/comment.ts b/src/version3/models/comment.ts deleted file mode 100644 index 07aa1223b..000000000 --- a/src/version3/models/comment.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { Document } from './document.js'; -import type { EntityProperty } from './entityProperty.js'; -import type { UserDetails } from './userDetails.js'; -import type { Visibility } from './visibility.js'; - -/** A comment. */ -export interface Comment { - /** The URL of the comment. */ - self?: string; - /** The ID of the comment. */ - id?: string; - author?: UserDetails; - /** - * The comment text in [Atlassian Document - * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). - */ - body?: Document; - /** The rendered version of the comment. */ - renderedBody?: string; - updateAuthor?: UserDetails; - /** The date and time at which the comment was created. */ - created?: string; - /** The date and time at which the comment was updated last. */ - updated?: string; - visibility?: Visibility; - /** - * Whether the comment is visible in Jira Service Desk. Defaults to true when comments are created in the Jira Cloud - * Platform. This includes when the site doesn't use Jira Service Desk or the project isn't a Jira Service Desk - * project and, therefore, there is no Jira Service Desk for the issue to be visible on. To create a comment with its - * visibility in Jira Service Desk set to false, use the Jira Service Desk REST API [Create request - * comment](https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-request-issueIdOrKey-comment-post) - * operation. - */ - jsdPublic?: boolean; - /** - * Whether the comment was added from an email sent by a person who is not part of the issue. See [Allow external - * emails to be added as comments on - * issues](https://support.atlassian.com/jira-service-management-cloud/docs/allow-external-emails-to-be-added-as-comments-on-issues/)for - * information on setting up this feature. - */ - jsdAuthorCanSeeRequest?: boolean; - /** A list of comment properties. Optional on create and update. */ - properties?: EntityProperty[]; -} diff --git a/src/version3/models/componentIssuesCount.ts b/src/version3/models/componentIssuesCount.mts similarity index 100% rename from src/version3/models/componentIssuesCount.ts rename to src/version3/models/componentIssuesCount.mts diff --git a/src/version3/models/componentWithIssueCount.mts b/src/version3/models/componentWithIssueCount.mts new file mode 100644 index 000000000..6fcdd84e8 --- /dev/null +++ b/src/version3/models/componentWithIssueCount.mts @@ -0,0 +1,51 @@ +import { User } from './user.mjs'; + +/** Details about a component with a count of the issues it contains. */ +export interface ComponentWithIssueCount { + /** Count of issues for the component. */ + issueCount?: number; + realAssignee?: User; + /** + * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but + * the component lead is not set, then `false` is returned. + */ + isAssigneeTypeValid?: boolean; + assignee?: User; + /** + * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set + * from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This + * property is set to one of the following values: + * + * `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in + * the project that the component is in. `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component + * lead has permission to be assigned issues in the project that the component is in. `UNASSIGNED` when `assigneeType` + * is `UNASSIGNED` and Jira is configured to allow unassigned issues. `PROJECT_DEFAULT` when none of the preceding + * cases are true. + */ + realAssigneeType?: string; + /** The description for the component. */ + description?: string; + /** The URL for this count of the issues contained in the component. */ + self?: string; + /** Not used. */ + projectId?: number; + /** The key of the project to which the component is assigned. */ + project?: string; + lead?: User; + /** + * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` + * for details on how the type of the user, and hence the user, assigned to issues is determined. Takes the following + * values: + * + * `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the + * component is in. `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for + * the component. `UNASSIGNED` an assignee is not set for issues created with this component. `PROJECT_DEFAULT` the + * assignee to any issues created with this component is nominally the default assignee for the project that the + * component is in. + */ + assigneeType?: string; + /** The name for the component. */ + name?: string; + /** The unique identifier for the component. */ + id?: string; +} diff --git a/src/version3/models/componentWithIssueCount.ts b/src/version3/models/componentWithIssueCount.ts deleted file mode 100644 index d1733a80d..000000000 --- a/src/version3/models/componentWithIssueCount.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { User } from './user.js'; - -/** Details about a component with a count of the issues it contains. */ -export interface ComponentWithIssueCount { - /** Count of issues for the component. */ - issueCount?: number; - realAssignee?: User; - /** - * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but - * the component lead is not set, then `false` is returned. - */ - isAssigneeTypeValid?: boolean; - assignee?: User; - /** - * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set - * from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This - * property is set to one of the following values: - * - * `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in - * the project that the component is in. `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component - * lead has permission to be assigned issues in the project that the component is in. `UNASSIGNED` when `assigneeType` - * is `UNASSIGNED` and Jira is configured to allow unassigned issues. `PROJECT_DEFAULT` when none of the preceding - * cases are true. - */ - realAssigneeType?: string; - /** The description for the component. */ - description?: string; - /** The URL for this count of the issues contained in the component. */ - self?: string; - /** Not used. */ - projectId?: number; - /** The key of the project to which the component is assigned. */ - project?: string; - lead?: User; - /** - * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` - * for details on how the type of the user, and hence the user, assigned to issues is determined. Takes the following - * values: - * - * `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the - * component is in. `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for - * the component. `UNASSIGNED` an assignee is not set for issues created with this component. `PROJECT_DEFAULT` the - * assignee to any issues created with this component is nominally the default assignee for the project that the - * component is in. - */ - assigneeType?: string; - /** The name for the component. */ - name?: string; - /** The unique identifier for the component. */ - id?: string; -} diff --git a/src/version3/models/configuration.mts b/src/version3/models/configuration.mts new file mode 100644 index 000000000..f6dfbe8eb --- /dev/null +++ b/src/version3/models/configuration.mts @@ -0,0 +1,27 @@ +import { TimeTrackingConfiguration } from './timeTrackingConfiguration.mjs'; + +/** Details about the configuration of Jira. */ +export interface Configuration { + /** + * Whether the ability for users to vote on issues is enabled. See [Configuring Jira application + * options](https://confluence.atlassian.com/x/uYXKM) for details. + */ + votingEnabled?: boolean; + /** + * Whether the ability for users to watch issues is enabled. See [Configuring Jira application + * options](https://confluence.atlassian.com/x/uYXKM) for details. + */ + watchingEnabled?: boolean; + /** + * Whether the ability to create unassigned issues is enabled. See [Configuring Jira application + * options](https://confluence.atlassian.com/x/uYXKM) for details. + */ + unassignedIssuesAllowed?: boolean; + /** Whether the ability to create subtasks for issues is enabled. */ + subTasksEnabled?: boolean; + /** Whether the ability to link issues is enabled. */ + issueLinkingEnabled?: boolean; + /** Whether the ability to add attachments to issues is enabled. */ + attachmentsEnabled?: boolean; + timeTrackingConfiguration?: TimeTrackingConfiguration; +} diff --git a/src/version3/models/configuration.ts b/src/version3/models/configuration.ts deleted file mode 100644 index b7522003a..000000000 --- a/src/version3/models/configuration.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { TimeTrackingConfiguration } from './timeTrackingConfiguration.js'; - -/** Details about the configuration of Jira. */ -export interface Configuration { - /** - * Whether the ability for users to vote on issues is enabled. See [Configuring Jira application - * options](https://confluence.atlassian.com/x/uYXKM) for details. - */ - votingEnabled?: boolean; - /** - * Whether the ability for users to watch issues is enabled. See [Configuring Jira application - * options](https://confluence.atlassian.com/x/uYXKM) for details. - */ - watchingEnabled?: boolean; - /** - * Whether the ability to create unassigned issues is enabled. See [Configuring Jira application - * options](https://confluence.atlassian.com/x/uYXKM) for details. - */ - unassignedIssuesAllowed?: boolean; - /** Whether the ability to create subtasks for issues is enabled. */ - subTasksEnabled?: boolean; - /** Whether the ability to link issues is enabled. */ - issueLinkingEnabled?: boolean; - /** Whether the ability to add attachments to issues is enabled. */ - attachmentsEnabled?: boolean; - timeTrackingConfiguration?: TimeTrackingConfiguration; -} diff --git a/src/version3/models/connectCustomFieldValue.ts b/src/version3/models/connectCustomFieldValue.mts similarity index 100% rename from src/version3/models/connectCustomFieldValue.ts rename to src/version3/models/connectCustomFieldValue.mts diff --git a/src/version3/models/connectCustomFieldValues.mts b/src/version3/models/connectCustomFieldValues.mts new file mode 100644 index 000000000..c9a349f47 --- /dev/null +++ b/src/version3/models/connectCustomFieldValues.mts @@ -0,0 +1,7 @@ +import { ConnectCustomFieldValue } from './connectCustomFieldValue.mjs'; + +/** Details of updates for a custom field. */ +export interface ConnectCustomFieldValues { + /** The list of custom field update details. */ + updateValueList?: ConnectCustomFieldValue[]; +} diff --git a/src/version3/models/connectCustomFieldValues.ts b/src/version3/models/connectCustomFieldValues.ts deleted file mode 100644 index 6a9c82601..000000000 --- a/src/version3/models/connectCustomFieldValues.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ConnectCustomFieldValue } from './connectCustomFieldValue.js'; - -/** Details of updates for a custom field. */ -export interface ConnectCustomFieldValues { - /** The list of custom field update details. */ - updateValueList?: ConnectCustomFieldValue[]; -} diff --git a/src/version3/models/connectModule.ts b/src/version3/models/connectModule.mts similarity index 100% rename from src/version3/models/connectModule.ts rename to src/version3/models/connectModule.mts diff --git a/src/version3/models/connectModules.mts b/src/version3/models/connectModules.mts new file mode 100644 index 000000000..4d5fe7c19 --- /dev/null +++ b/src/version3/models/connectModules.mts @@ -0,0 +1,9 @@ +import { ConnectModule } from './connectModule.mjs'; + +export interface ConnectModules { + /** + * A list of app modules in the same format as the `modules` property in the [app + * descriptor](https://developer.atlassian.com/cloud/jira/platform/app-descriptor/). + */ + modules: ConnectModule[]; +} diff --git a/src/version3/models/connectModules.ts b/src/version3/models/connectModules.ts deleted file mode 100644 index 185060e23..000000000 --- a/src/version3/models/connectModules.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ConnectModule } from './connectModule.js'; - -export interface ConnectModules { - /** - * A list of app modules in the same format as the `modules` property in the [app - * descriptor](https://developer.atlassian.com/cloud/jira/platform/app-descriptor/). - */ - modules: ConnectModule[]; -} diff --git a/src/version3/models/connectWorkflowTransitionRule.mts b/src/version3/models/connectWorkflowTransitionRule.mts new file mode 100644 index 000000000..a165b09df --- /dev/null +++ b/src/version3/models/connectWorkflowTransitionRule.mts @@ -0,0 +1,12 @@ +import { RuleConfiguration } from './ruleConfiguration.mjs'; +import { WorkflowTransition } from './workflowTransition.mjs'; + +/** A workflow transition rule. */ +export interface ConnectWorkflowTransitionRule { + /** The ID of the transition rule. */ + id: string; + /** The key of the rule, as defined in the Connect app descriptor. */ + key: string; + configuration: RuleConfiguration; + transition?: WorkflowTransition; +} diff --git a/src/version3/models/connectWorkflowTransitionRule.ts b/src/version3/models/connectWorkflowTransitionRule.ts deleted file mode 100644 index cac4560c7..000000000 --- a/src/version3/models/connectWorkflowTransitionRule.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { RuleConfiguration } from './ruleConfiguration.js'; -import type { WorkflowTransition } from './workflowTransition.js'; - -/** A workflow transition rule. */ -export interface ConnectWorkflowTransitionRule { - /** The ID of the transition rule. */ - id: string; - /** The key of the rule, as defined in the Connect app descriptor. */ - key: string; - configuration: RuleConfiguration; - transition?: WorkflowTransition; -} diff --git a/src/version3/models/containerForProjectFeatures.mts b/src/version3/models/containerForProjectFeatures.mts new file mode 100644 index 000000000..f0fd1db6a --- /dev/null +++ b/src/version3/models/containerForProjectFeatures.mts @@ -0,0 +1,7 @@ +import { ProjectFeature } from './projectFeature.mjs'; + +/** The list of features on a project. */ +export interface ContainerForProjectFeatures { + /** The project features. */ + features?: ProjectFeature[]; +} diff --git a/src/version3/models/containerForProjectFeatures.ts b/src/version3/models/containerForProjectFeatures.ts deleted file mode 100644 index 4cd842900..000000000 --- a/src/version3/models/containerForProjectFeatures.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ProjectFeature } from './projectFeature.js'; - -/** The list of features on a project. */ -export interface ContainerForProjectFeatures { - /** The project features. */ - features?: ProjectFeature[]; -} diff --git a/src/version3/models/containerForRegisteredWebhooks.mts b/src/version3/models/containerForRegisteredWebhooks.mts new file mode 100644 index 000000000..ce2973c7c --- /dev/null +++ b/src/version3/models/containerForRegisteredWebhooks.mts @@ -0,0 +1,7 @@ +import { RegisteredWebhook } from './registeredWebhook.mjs'; + +/** Container for a list of registered webhooks. Webhook details are returned in the same order as the request. */ +export interface ContainerForRegisteredWebhooks { + /** A list of registered webhooks. */ + webhookRegistrationResult?: RegisteredWebhook[]; +} diff --git a/src/version3/models/containerForRegisteredWebhooks.ts b/src/version3/models/containerForRegisteredWebhooks.ts deleted file mode 100644 index 1ccb8940c..000000000 --- a/src/version3/models/containerForRegisteredWebhooks.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { RegisteredWebhook } from './registeredWebhook.js'; - -/** Container for a list of registered webhooks. Webhook details are returned in the same order as the request. */ -export interface ContainerForRegisteredWebhooks { - /** A list of registered webhooks. */ - webhookRegistrationResult?: RegisteredWebhook[]; -} diff --git a/src/version3/models/containerForWebhookIDs.ts b/src/version3/models/containerForWebhookIDs.mts similarity index 100% rename from src/version3/models/containerForWebhookIDs.ts rename to src/version3/models/containerForWebhookIDs.mts diff --git a/src/version3/models/containerOfWorkflowSchemeAssociations.mts b/src/version3/models/containerOfWorkflowSchemeAssociations.mts new file mode 100644 index 000000000..2ecc5fc29 --- /dev/null +++ b/src/version3/models/containerOfWorkflowSchemeAssociations.mts @@ -0,0 +1,7 @@ +import { WorkflowSchemeAssociations } from './workflowSchemeAssociations.mjs'; + +/** A container for a list of workflow schemes together with the projects they are associated with. */ +export interface ContainerOfWorkflowSchemeAssociations { + /** A list of workflow schemes together with projects they are associated with. */ + values: WorkflowSchemeAssociations[]; +} diff --git a/src/version3/models/containerOfWorkflowSchemeAssociations.ts b/src/version3/models/containerOfWorkflowSchemeAssociations.ts deleted file mode 100644 index b7e156c85..000000000 --- a/src/version3/models/containerOfWorkflowSchemeAssociations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { WorkflowSchemeAssociations } from './workflowSchemeAssociations.js'; - -/** A container for a list of workflow schemes together with the projects they are associated with. */ -export interface ContainerOfWorkflowSchemeAssociations { - /** A list of workflow schemes together with projects they are associated with. */ - values: WorkflowSchemeAssociations[]; -} diff --git a/src/version3/models/contextForProjectAndIssueType.ts b/src/version3/models/contextForProjectAndIssueType.mts similarity index 100% rename from src/version3/models/contextForProjectAndIssueType.ts rename to src/version3/models/contextForProjectAndIssueType.mts diff --git a/src/version3/models/contextualConfiguration.ts b/src/version3/models/contextualConfiguration.mts similarity index 100% rename from src/version3/models/contextualConfiguration.ts rename to src/version3/models/contextualConfiguration.mts diff --git a/src/version3/models/convertedJQLQueries.mts b/src/version3/models/convertedJQLQueries.mts new file mode 100644 index 000000000..13da150c1 --- /dev/null +++ b/src/version3/models/convertedJQLQueries.mts @@ -0,0 +1,9 @@ +import { JQLQueryWithUnknownUsers } from './jQLQueryWithUnknownUsers.mjs'; + +/** The converted Jql queries. */ +export interface ConvertedJQLQueries { + /** The list of converted query strings with account IDs in place of user identifiers. */ + queryStrings?: string[]; + /** List of queries containing user information that could not be mapped to an existing user */ + queriesWithUnknownUsers?: JQLQueryWithUnknownUsers[]; +} diff --git a/src/version3/models/convertedJQLQueries.ts b/src/version3/models/convertedJQLQueries.ts deleted file mode 100644 index 523efb9de..000000000 --- a/src/version3/models/convertedJQLQueries.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { JQLQueryWithUnknownUsers } from './jQLQueryWithUnknownUsers.js'; - -/** The converted JQL queries. */ -export interface ConvertedJQLQueries { - /** The list of converted query strings with account IDs in place of user identifiers. */ - queryStrings?: string[]; - /** List of queries containing user information that could not be mapped to an existing user */ - queriesWithUnknownUsers?: JQLQueryWithUnknownUsers[]; -} diff --git a/src/version3/models/createCustomFieldContext.ts b/src/version3/models/createCustomFieldContext.mts similarity index 100% rename from src/version3/models/createCustomFieldContext.ts rename to src/version3/models/createCustomFieldContext.mts diff --git a/src/version3/models/createIssueSecuritySchemeDetails.mts b/src/version3/models/createIssueSecuritySchemeDetails.mts new file mode 100644 index 000000000..1a5a1f711 --- /dev/null +++ b/src/version3/models/createIssueSecuritySchemeDetails.mts @@ -0,0 +1,11 @@ +import { SecuritySchemeLevel } from './securitySchemeLevel.mjs'; + +/** Issue security scheme and it's details */ +export interface CreateIssueSecuritySchemeDetails { + /** The description of the issue security scheme. */ + description?: string; + /** The list of scheme levels which should be added to the security scheme. */ + levels?: SecuritySchemeLevel[]; + /** The name of the issue security scheme. Must be unique (case-insensitive). */ + name: string; +} diff --git a/src/version3/models/createIssueSecuritySchemeDetails.ts b/src/version3/models/createIssueSecuritySchemeDetails.ts deleted file mode 100644 index 5b8a273c7..000000000 --- a/src/version3/models/createIssueSecuritySchemeDetails.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { SecuritySchemeLevel } from './securitySchemeLevel.js'; - -/** Issue security scheme and it's details */ -export interface CreateIssueSecuritySchemeDetails { - /** The description of the issue security scheme. */ - description?: string; - /** The list of scheme levels which should be added to the security scheme. */ - levels?: SecuritySchemeLevel[]; - /** The name of the issue security scheme. Must be unique (case-insensitive). */ - name: string; -} diff --git a/src/version3/models/createNotificationSchemeDetails.mts b/src/version3/models/createNotificationSchemeDetails.mts new file mode 100644 index 000000000..d76d5f6e5 --- /dev/null +++ b/src/version3/models/createNotificationSchemeDetails.mts @@ -0,0 +1,11 @@ +import { NotificationSchemeEventDetails } from './notificationSchemeEventDetails.mjs'; + +/** Details of a notification scheme. */ +export interface CreateNotificationSchemeDetails { + /** The description of the notification scheme. */ + description?: string; + /** The name of the notification scheme. Must be unique (case-insensitive). */ + name: string; + /** The list of notifications which should be added to the notification scheme. */ + notificationSchemeEvents?: NotificationSchemeEventDetails[]; +} diff --git a/src/version3/models/createNotificationSchemeDetails.ts b/src/version3/models/createNotificationSchemeDetails.ts deleted file mode 100644 index 82187b563..000000000 --- a/src/version3/models/createNotificationSchemeDetails.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { NotificationSchemeEventDetails } from './notificationSchemeEventDetails.js'; - -/** Details of a notification scheme. */ -export interface CreateNotificationSchemeDetails { - /** The description of the notification scheme. */ - description?: string; - /** The name of the notification scheme. Must be unique (case-insensitive). */ - name: string; - /** The list of notifications which should be added to the notification scheme. */ - notificationSchemeEvents?: NotificationSchemeEventDetails[]; -} diff --git a/src/version3/models/createPriorityDetails.ts b/src/version3/models/createPriorityDetails.mts similarity index 100% rename from src/version3/models/createPriorityDetails.ts rename to src/version3/models/createPriorityDetails.mts diff --git a/src/version3/models/createProjectDetails.ts b/src/version3/models/createProjectDetails.mts similarity index 100% rename from src/version3/models/createProjectDetails.ts rename to src/version3/models/createProjectDetails.mts diff --git a/src/version3/models/createResolutionDetails.ts b/src/version3/models/createResolutionDetails.mts similarity index 100% rename from src/version3/models/createResolutionDetails.ts rename to src/version3/models/createResolutionDetails.mts diff --git a/src/version3/models/createUiModificationDetails.mts b/src/version3/models/createUiModificationDetails.mts new file mode 100644 index 000000000..9a7d6dbc5 --- /dev/null +++ b/src/version3/models/createUiModificationDetails.mts @@ -0,0 +1,13 @@ +import type { UiModificationContextDetails } from './uiModificationContextDetails.mjs'; + +/** The details of a UI modification. */ +export interface CreateUiModificationDetails { + /** The name of the UI modification. The maximum length is 255 characters. */ + name: string; + /** The description of the UI modification. The maximum length is 255 characters. */ + description?: string; + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data?: string; + /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ + contexts?: UiModificationContextDetails[]; +} diff --git a/src/version3/models/createUiModificationDetails.ts b/src/version3/models/createUiModificationDetails.ts deleted file mode 100644 index 803410fdb..000000000 --- a/src/version3/models/createUiModificationDetails.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { UiModificationContextDetails } from './uiModificationContextDetails.js'; - -/** The details of a UI modification. */ -export interface CreateUiModificationDetails { - /** The name of the UI modification. The maximum length is 255 characters. */ - name: string; - /** The description of the UI modification. The maximum length is 255 characters. */ - description?: string; - /** The data of the UI modification. The maximum size of the data is 50000 characters. */ - data?: string; - /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ - contexts?: UiModificationContextDetails[]; -} diff --git a/src/version3/models/createUpdateRoleRequest.ts b/src/version3/models/createUpdateRoleRequest.mts similarity index 100% rename from src/version3/models/createUpdateRoleRequest.ts rename to src/version3/models/createUpdateRoleRequest.mts diff --git a/src/version3/models/createWorkflowCondition.ts b/src/version3/models/createWorkflowCondition.mts similarity index 100% rename from src/version3/models/createWorkflowCondition.ts rename to src/version3/models/createWorkflowCondition.mts diff --git a/src/version3/models/createWorkflowDetails.mts b/src/version3/models/createWorkflowDetails.mts new file mode 100644 index 000000000..45197192a --- /dev/null +++ b/src/version3/models/createWorkflowDetails.mts @@ -0,0 +1,29 @@ +import { CreateWorkflowStatusDetails } from './createWorkflowStatusDetails.mjs'; +import { CreateWorkflowTransitionDetails } from './createWorkflowTransitionDetails.mjs'; + +/** The details of a workflow. */ +export interface CreateWorkflowDetails { + /** + * The name of the workflow. The name must be unique. The maximum length is 255 characters. Characters can be + * separated by a whitespace but the name cannot start or end with a whitespace. + */ + name: string; + /** The description of the workflow. The maximum length is 1000 characters. */ + description?: string; + /** + * The transitions of the workflow. For the request to be valid, these transitions must: + * + * Include one _initial_ transition. not use the same name for a _global_ and _directed_ transition. have a unique + * name for each _global_ transition. have a unique 'to' status for each _global_ transition. have unique names for + * each transition from a status. not have a 'from' status on _initial_ and _global_ transitions. have a 'from' status + * on _directed_ transitions. + * + * All the transition statuses must be included in `statuses`. + */ + transitions: CreateWorkflowTransitionDetails[]; + /** + * The statuses of the workflow. Any status that does not include a transition is added to the workflow without a + * transition. + */ + statuses: CreateWorkflowStatusDetails[]; +} diff --git a/src/version3/models/createWorkflowDetails.ts b/src/version3/models/createWorkflowDetails.ts deleted file mode 100644 index 5e2cce828..000000000 --- a/src/version3/models/createWorkflowDetails.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { CreateWorkflowStatusDetails } from './createWorkflowStatusDetails.js'; -import type { CreateWorkflowTransitionDetails } from './createWorkflowTransitionDetails.js'; - -/** The details of a workflow. */ -export interface CreateWorkflowDetails { - /** - * The name of the workflow. The name must be unique. The maximum length is 255 characters. Characters can be - * separated by a whitespace but the name cannot start or end with a whitespace. - */ - name: string; - /** The description of the workflow. The maximum length is 1000 characters. */ - description?: string; - /** - * The transitions of the workflow. For the request to be valid, these transitions must: - * - * Include one _initial_ transition. not use the same name for a _global_ and _directed_ transition. have a unique - * name for each _global_ transition. have a unique 'to' status for each _global_ transition. have unique names for - * each transition from a status. not have a 'from' status on _initial_ and _global_ transitions. have a 'from' status - * on _directed_ transitions. - * - * All the transition statuses must be included in `statuses`. - */ - transitions: CreateWorkflowTransitionDetails[]; - /** - * The statuses of the workflow. Any status that does not include a transition is added to the workflow without a - * transition. - */ - statuses: CreateWorkflowStatusDetails[]; -} diff --git a/src/version3/models/createWorkflowStatusDetails.ts b/src/version3/models/createWorkflowStatusDetails.mts similarity index 100% rename from src/version3/models/createWorkflowStatusDetails.ts rename to src/version3/models/createWorkflowStatusDetails.mts diff --git a/src/version3/models/createWorkflowTransitionDetails.mts b/src/version3/models/createWorkflowTransitionDetails.mts new file mode 100644 index 000000000..e8e58b85d --- /dev/null +++ b/src/version3/models/createWorkflowTransitionDetails.mts @@ -0,0 +1,20 @@ +import { CreateWorkflowTransitionRulesDetails } from './createWorkflowTransitionRulesDetails.mjs'; +import { CreateWorkflowTransitionScreenDetails } from './createWorkflowTransitionScreenDetails.mjs'; + +/** The details of a workflow transition. */ +export interface CreateWorkflowTransitionDetails { + /** The name of the transition. The maximum length is 60 characters. */ + name: string; + /** The description of the transition. The maximum length is 1000 characters. */ + description?: string; + /** The statuses the transition can start from. */ + from?: string[]; + /** The status the transition goes to. */ + to: string; + /** The type of the transition. */ + type: string; + rules?: CreateWorkflowTransitionRulesDetails; + screen?: CreateWorkflowTransitionScreenDetails; + /** The properties of the transition. */ + properties?: {}; +} diff --git a/src/version3/models/createWorkflowTransitionDetails.ts b/src/version3/models/createWorkflowTransitionDetails.ts deleted file mode 100644 index 7386bf244..000000000 --- a/src/version3/models/createWorkflowTransitionDetails.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { CreateWorkflowTransitionRulesDetails } from './createWorkflowTransitionRulesDetails.js'; -import type { CreateWorkflowTransitionScreenDetails } from './createWorkflowTransitionScreenDetails.js'; - -/** The details of a workflow transition. */ -export interface CreateWorkflowTransitionDetails { - /** The name of the transition. The maximum length is 60 characters. */ - name: string; - /** The description of the transition. The maximum length is 1000 characters. */ - description?: string; - /** The statuses the transition can start from. */ - from?: string[]; - /** The status the transition goes to. */ - to: string; - /** The type of the transition. */ - type: string; - rules?: CreateWorkflowTransitionRulesDetails; - screen?: CreateWorkflowTransitionScreenDetails; - /** The properties of the transition. */ - properties?: {}; -} diff --git a/src/version3/models/createWorkflowTransitionRule.ts b/src/version3/models/createWorkflowTransitionRule.mts similarity index 100% rename from src/version3/models/createWorkflowTransitionRule.ts rename to src/version3/models/createWorkflowTransitionRule.mts diff --git a/src/version3/models/createWorkflowTransitionRulesDetails.mts b/src/version3/models/createWorkflowTransitionRulesDetails.mts new file mode 100644 index 000000000..c965f0e7f --- /dev/null +++ b/src/version3/models/createWorkflowTransitionRulesDetails.mts @@ -0,0 +1,30 @@ +import { CreateWorkflowCondition } from './createWorkflowCondition.mjs'; +import { CreateWorkflowTransitionRule } from './createWorkflowTransitionRule.mjs'; + +/** The details of a workflow transition rules. */ +export interface CreateWorkflowTransitionRulesDetails { + conditions?: CreateWorkflowCondition; + /** + * The workflow validators. + * + * _Note:_* The default permission validator is always added to the _initial_ transition, as in: + * + * "validators": [ { "type": "PermissionValidator", "configuration": { "permissionKey": "CREATE_ISSUES" } } ] + */ + validators?: CreateWorkflowTransitionRule[]; + /** + * The workflow post functions. + * + * _Note:_* The default post functions are always added to the _initial_ transition, as in: + * + * "postFunctions": [ { "type": "IssueCreateFunction" }, { "type": "IssueReindexFunction" }, { "type": + * "FireIssueEventFunction", "configuration": { "event": { "id": "1", "name": "issue_created" } } } ] + * + * _Note:_* The default post functions are always added to the _global_ and _directed_ transitions, as in: + * + * "postFunctions": [ { "type": "UpdateIssueStatusFunction" }, { "type": "CreateCommentFunction" }, { "type": + * "GenerateChangeHistoryFunction" }, { "type": "IssueReindexFunction" }, { "type": "FireIssueEventFunction", + * "configuration": { "event": { "id": "13", "name": "issue_generic" } } } ] + */ + postFunctions?: CreateWorkflowTransitionRule[]; +} diff --git a/src/version3/models/createWorkflowTransitionRulesDetails.ts b/src/version3/models/createWorkflowTransitionRulesDetails.ts deleted file mode 100644 index 8499d1f41..000000000 --- a/src/version3/models/createWorkflowTransitionRulesDetails.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { CreateWorkflowCondition } from './createWorkflowCondition.js'; -import type { CreateWorkflowTransitionRule } from './createWorkflowTransitionRule.js'; - -/** The details of a workflow transition rules. */ -export interface CreateWorkflowTransitionRulesDetails { - conditions?: CreateWorkflowCondition; - /** - * The workflow validators. - * - * _Note:_* The default permission validator is always added to the _initial_ transition, as in: - * - * "validators": [ { "type": "PermissionValidator", "configuration": { "permissionKey": "CREATE_ISSUES" } } ] - */ - validators?: CreateWorkflowTransitionRule[]; - /** - * The workflow post functions. - * - * _Note:_* The default post functions are always added to the _initial_ transition, as in: - * - * "postFunctions": [ { "type": "IssueCreateFunction" }, { "type": "IssueReindexFunction" }, { "type": - * "FireIssueEventFunction", "configuration": { "event": { "id": "1", "name": "issue_created" } } } ] - * - * _Note:_* The default post functions are always added to the _global_ and _directed_ transitions, as in: - * - * "postFunctions": [ { "type": "UpdateIssueStatusFunction" }, { "type": "CreateCommentFunction" }, { "type": - * "GenerateChangeHistoryFunction" }, { "type": "IssueReindexFunction" }, { "type": "FireIssueEventFunction", - * "configuration": { "event": { "id": "13", "name": "issue_generic" } } } ] - */ - postFunctions?: CreateWorkflowTransitionRule[]; -} diff --git a/src/version3/models/createWorkflowTransitionScreenDetails.ts b/src/version3/models/createWorkflowTransitionScreenDetails.mts similarity index 100% rename from src/version3/models/createWorkflowTransitionScreenDetails.ts rename to src/version3/models/createWorkflowTransitionScreenDetails.mts diff --git a/src/version3/models/createdIssue.mts b/src/version3/models/createdIssue.mts new file mode 100644 index 000000000..778f197bc --- /dev/null +++ b/src/version3/models/createdIssue.mts @@ -0,0 +1,12 @@ +import { NestedResponse } from './nestedResponse.mjs'; + +/** Details about a created issue or subtask. */ +export interface CreatedIssue { + /** The ID of the created issue or subtask. */ + id: string; + /** The key of the created issue or subtask. */ + key: string; + /** The URL of the created issue or subtask. */ + self: string; + transition?: NestedResponse; +} diff --git a/src/version3/models/createdIssue.ts b/src/version3/models/createdIssue.ts deleted file mode 100644 index 23f96ce57..000000000 --- a/src/version3/models/createdIssue.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { NestedResponse } from './nestedResponse.js'; - -/** Details about a created issue or subtask. */ -export interface CreatedIssue { - /** The ID of the created issue or subtask. */ - id: string; - /** The key of the created issue or subtask. */ - key: string; - /** The URL of the created issue or subtask. */ - self: string; - transition?: NestedResponse; -} diff --git a/src/version3/models/createdIssues.mts b/src/version3/models/createdIssues.mts new file mode 100644 index 000000000..90ca1b6e0 --- /dev/null +++ b/src/version3/models/createdIssues.mts @@ -0,0 +1,10 @@ +import { BulkOperationErrorResult } from './bulkOperationErrorResult.mjs'; +import { CreatedIssue } from './createdIssue.mjs'; + +/** Details about the issues created and the errors for requests that failed. */ +export interface CreatedIssues { + /** Details of the issues created. */ + issues?: CreatedIssue[]; + /** Error details for failed issue creation requests. */ + errors?: BulkOperationErrorResult[]; +} diff --git a/src/version3/models/createdIssues.ts b/src/version3/models/createdIssues.ts deleted file mode 100644 index 74d7c6b24..000000000 --- a/src/version3/models/createdIssues.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { BulkOperationErrorResult } from './bulkOperationErrorResult.js'; -import type { CreatedIssue } from './createdIssue.js'; - -/** Details about the issues created and the errors for requests that failed. */ -export interface CreatedIssues { - /** Details of the issues created. */ - issues?: CreatedIssue[]; - /** Error details for failed issue creation requests. */ - errors?: BulkOperationErrorResult[]; -} diff --git a/src/version3/models/customContextVariable.ts b/src/version3/models/customContextVariable.mts similarity index 100% rename from src/version3/models/customContextVariable.ts rename to src/version3/models/customContextVariable.mts diff --git a/src/version3/models/customFieldConfigurations.mts b/src/version3/models/customFieldConfigurations.mts new file mode 100644 index 000000000..40575ba1e --- /dev/null +++ b/src/version3/models/customFieldConfigurations.mts @@ -0,0 +1,7 @@ +import { ContextualConfiguration } from './contextualConfiguration.mjs'; + +/** Details of configurations for a custom field. */ +export interface CustomFieldConfigurations { + /** The list of custom field configuration details. */ + configurations: ContextualConfiguration[]; +} diff --git a/src/version3/models/customFieldConfigurations.ts b/src/version3/models/customFieldConfigurations.ts deleted file mode 100644 index c82c67544..000000000 --- a/src/version3/models/customFieldConfigurations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ContextualConfiguration } from './contextualConfiguration.js'; - -/** Details of configurations for a custom field. */ -export interface CustomFieldConfigurations { - /** The list of custom field configuration details. */ - configurations: ContextualConfiguration[]; -} diff --git a/src/version3/models/customFieldContext.ts b/src/version3/models/customFieldContext.mts similarity index 100% rename from src/version3/models/customFieldContext.ts rename to src/version3/models/customFieldContext.mts diff --git a/src/version3/models/customFieldContextDefaultValue.ts b/src/version3/models/customFieldContextDefaultValue.mts similarity index 100% rename from src/version3/models/customFieldContextDefaultValue.ts rename to src/version3/models/customFieldContextDefaultValue.mts diff --git a/src/version3/models/customFieldContextDefaultValueUpdate.mts b/src/version3/models/customFieldContextDefaultValueUpdate.mts new file mode 100644 index 000000000..4247319b7 --- /dev/null +++ b/src/version3/models/customFieldContextDefaultValueUpdate.mts @@ -0,0 +1,6 @@ +import { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue.mjs'; + +/** Default values to update. */ +export interface CustomFieldContextDefaultValueUpdate { + defaultValues?: CustomFieldContextDefaultValue[]; +} diff --git a/src/version3/models/customFieldContextDefaultValueUpdate.ts b/src/version3/models/customFieldContextDefaultValueUpdate.ts deleted file mode 100644 index 6b59de00e..000000000 --- a/src/version3/models/customFieldContextDefaultValueUpdate.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue.js'; - -/** Default values to update. */ -export interface CustomFieldContextDefaultValueUpdate { - defaultValues?: CustomFieldContextDefaultValue[]; -} diff --git a/src/version3/models/customFieldContextOption.ts b/src/version3/models/customFieldContextOption.mts similarity index 100% rename from src/version3/models/customFieldContextOption.ts rename to src/version3/models/customFieldContextOption.mts diff --git a/src/version3/models/customFieldContextProjectMapping.ts b/src/version3/models/customFieldContextProjectMapping.mts similarity index 100% rename from src/version3/models/customFieldContextProjectMapping.ts rename to src/version3/models/customFieldContextProjectMapping.mts diff --git a/src/version3/models/customFieldContextUpdateDetails.ts b/src/version3/models/customFieldContextUpdateDetails.mts similarity index 100% rename from src/version3/models/customFieldContextUpdateDetails.ts rename to src/version3/models/customFieldContextUpdateDetails.mts diff --git a/src/version3/models/customFieldCreatedContextOptionsList.mts b/src/version3/models/customFieldCreatedContextOptionsList.mts new file mode 100644 index 000000000..1ae6d0203 --- /dev/null +++ b/src/version3/models/customFieldCreatedContextOptionsList.mts @@ -0,0 +1,7 @@ +import { CustomFieldContextOption } from './customFieldContextOption.mjs'; + +/** A list of custom field options for a context. */ +export interface CustomFieldCreatedContextOptionsList { + /** The created custom field options. */ + options?: CustomFieldContextOption[]; +} diff --git a/src/version3/models/customFieldCreatedContextOptionsList.ts b/src/version3/models/customFieldCreatedContextOptionsList.ts deleted file mode 100644 index 9d2205e49..000000000 --- a/src/version3/models/customFieldCreatedContextOptionsList.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CustomFieldContextOption } from './customFieldContextOption.js'; - -/** A list of custom field options for a context. */ -export interface CustomFieldCreatedContextOptionsList { - /** The created custom field options. */ - options?: CustomFieldContextOption[]; -} diff --git a/src/version3/models/customFieldDefinitionJson.mts b/src/version3/models/customFieldDefinitionJson.mts new file mode 100644 index 000000000..fdb6e97f0 --- /dev/null +++ b/src/version3/models/customFieldDefinitionJson.mts @@ -0,0 +1,61 @@ +export interface CustomFieldDefinitionJson { + /** The name of the custom field, which is displayed in Jira. This is not the unique identifier. */ + name: string; + /** The description of the custom field, which is displayed in Jira. */ + description?: string; + /** + * The type of the custom field. These built-in custom field types are available: + * + * `cascadingselect`: Enables values to be selected from two levels of select lists (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect`) `datepicker`: Stores a date using a picker + * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:datepicker`) `datetime`: Stores a date with a + * time component (value: `com.atlassian.jira.plugin.system.customfieldtypes:datetime`) `float`: Stores and validates + * a numeric (floating point) input (value: `com.atlassian.jira.plugin.system.customfieldtypes:float`) `grouppicker`: + * Stores a user group using a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:grouppicker`) + * `importid`: A read-only field that stores the ID the issue had in the system it was imported from (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:importid`) `labels`: Stores labels (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:labels`) `multicheckboxes`: Stores multiple values using + * checkboxes (value: `) `multigrouppicker`: Stores multiple user groups using a picker control (value: `) + * `multiselect`: Stores multiple values using a select list (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes`) `multiuserpicker`: Stores multiple users using + * a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker`) `multiversion`: + * Stores multiple versions from the versions available in a project using a picker control (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:multiversion`) `project`: Stores a project from a list of + * projects that the user is permitted to view (value: `com.atlassian.jira.plugin.system.customfieldtypes:project`) + * `radiobuttons`: Stores a value using radio buttons (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons`) `readonlyfield`: Stores a read-only text value, + * which can only be populated via the API (value: `com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield`) + * `select`: Stores a value from a configurable list of options (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:select`) `textarea`: Stores a long text string using a multiline + * text area (value: `com.atlassian.jira.plugin.system.customfieldtypes:textarea`) `textfield`: Stores a text string + * using a single-line text box (value: `com.atlassian.jira.plugin.system.customfieldtypes:textfield`) `url`: Stores a + * URL (value: `com.atlassian.jira.plugin.system.customfieldtypes:url`) `userpicker`: Stores a user using a picker + * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:userpicker`) `version`: Stores a version using a + * picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:version`) + * + * To create a field based on a [Forge custom field + * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-), + * use the ID of the Forge custom field type as the value. For example, + * `ari:cloud:ecosystem::extension/e62f20a2-4b61-4dbe-bfb9-9a88b5e3ac84/548c5df1-24aa-4f7c-bbbb-3038d947cb05/static/my-cf-type-key`. + */ + type: string; + /** + * The searcher defines the way the field is searched in Jira. For example, + * _com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher_. The search UI (basic search and Jql + * search) will display different operations and values for the field, based on the field searcher. You must specify a + * searcher that is valid for the field type, as listed below (abbreviated values shown): + * + * `cascadingselect`: `cascadingselectsearcher` `datepicker`: `daterange` `datetime`: `datetimerange` `float`: + * `exactnumber` or `numberrange` `grouppicker`: `grouppickersearcher` `importid`: `exactnumber` or `numberrange` + * `labels`: `labelsearcher` `multicheckboxes`: `multiselectsearcher` `multigrouppicker`: `multiselectsearcher` + * `multiselect`: `multiselectsearcher` `multiuserpicker`: `userpickergroupsearcher` `multiversion`: `versionsearcher` + * `project`: `projectsearcher` `radiobuttons`: `multiselectsearcher` `readonlyfield`: `textsearcher` `select`: + * `multiselectsearcher` `textarea`: `textsearcher` `textfield`: `textsearcher` `url`: `exacttextsearcher` + * `userpicker`: `userpickergroupsearcher` `version`: `versionsearcher` + * + * If no searcher is provided, the field isn't searchable. However, [Forge custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-) + * have a searcher set automatically, so are always searchable. + */ + searcherKey?: string; +} diff --git a/src/version3/models/customFieldDefinitionJson.ts b/src/version3/models/customFieldDefinitionJson.ts deleted file mode 100644 index b55d9a816..000000000 --- a/src/version3/models/customFieldDefinitionJson.ts +++ /dev/null @@ -1,61 +0,0 @@ -export interface CustomFieldDefinitionJson { - /** The name of the custom field, which is displayed in Jira. This is not the unique identifier. */ - name: string; - /** The description of the custom field, which is displayed in Jira. */ - description?: string; - /** - * The type of the custom field. These built-in custom field types are available: - * - * `cascadingselect`: Enables values to be selected from two levels of select lists (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect`) `datepicker`: Stores a date using a picker - * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:datepicker`) `datetime`: Stores a date with a - * time component (value: `com.atlassian.jira.plugin.system.customfieldtypes:datetime`) `float`: Stores and validates - * a numeric (floating point) input (value: `com.atlassian.jira.plugin.system.customfieldtypes:float`) `grouppicker`: - * Stores a user group using a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:grouppicker`) - * `importid`: A read-only field that stores the ID the issue had in the system it was imported from (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:importid`) `labels`: Stores labels (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:labels`) `multicheckboxes`: Stores multiple values using - * checkboxes (value: `) `multigrouppicker`: Stores multiple user groups using a picker control (value: `) - * `multiselect`: Stores multiple values using a select list (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes`) `multiuserpicker`: Stores multiple users using - * a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker`) `multiversion`: - * Stores multiple versions from the versions available in a project using a picker control (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:multiversion`) `project`: Stores a project from a list of - * projects that the user is permitted to view (value: `com.atlassian.jira.plugin.system.customfieldtypes:project`) - * `radiobuttons`: Stores a value using radio buttons (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons`) `readonlyfield`: Stores a read-only text value, - * which can only be populated via the API (value: `com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield`) - * `select`: Stores a value from a configurable list of options (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:select`) `textarea`: Stores a long text string using a multiline - * text area (value: `com.atlassian.jira.plugin.system.customfieldtypes:textarea`) `textfield`: Stores a text string - * using a single-line text box (value: `com.atlassian.jira.plugin.system.customfieldtypes:textfield`) `url`: Stores a - * URL (value: `com.atlassian.jira.plugin.system.customfieldtypes:url`) `userpicker`: Stores a user using a picker - * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:userpicker`) `version`: Stores a version using a - * picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:version`) - * - * To create a field based on a [Forge custom field - * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-), - * use the ID of the Forge custom field type as the value. For example, - * `ari:cloud:ecosystem::extension/e62f20a2-4b61-4dbe-bfb9-9a88b5e3ac84/548c5df1-24aa-4f7c-bbbb-3038d947cb05/static/my-cf-type-key`. - */ - type: string; - /** - * The searcher defines the way the field is searched in Jira. For example, - * _com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher_. The search UI (basic search and JQL - * search) will display different operations and values for the field, based on the field searcher. You must specify a - * searcher that is valid for the field type, as listed below (abbreviated values shown): - * - * `cascadingselect`: `cascadingselectsearcher` `datepicker`: `daterange` `datetime`: `datetimerange` `float`: - * `exactnumber` or `numberrange` `grouppicker`: `grouppickersearcher` `importid`: `exactnumber` or `numberrange` - * `labels`: `labelsearcher` `multicheckboxes`: `multiselectsearcher` `multigrouppicker`: `multiselectsearcher` - * `multiselect`: `multiselectsearcher` `multiuserpicker`: `userpickergroupsearcher` `multiversion`: `versionsearcher` - * `project`: `projectsearcher` `radiobuttons`: `multiselectsearcher` `readonlyfield`: `textsearcher` `select`: - * `multiselectsearcher` `textarea`: `textsearcher` `textfield`: `textsearcher` `url`: `exacttextsearcher` - * `userpicker`: `userpickergroupsearcher` `version`: `versionsearcher` - * - * If no searcher is provided, the field isn't searchable. However, [Forge custom - * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-) - * have a searcher set automatically, so are always searchable. - */ - searcherKey?: string; -} diff --git a/src/version3/models/customFieldOption.ts b/src/version3/models/customFieldOption.mts similarity index 100% rename from src/version3/models/customFieldOption.ts rename to src/version3/models/customFieldOption.mts diff --git a/src/version3/models/customFieldOptionCreate.ts b/src/version3/models/customFieldOptionCreate.mts similarity index 100% rename from src/version3/models/customFieldOptionCreate.ts rename to src/version3/models/customFieldOptionCreate.mts diff --git a/src/version3/models/customFieldOptionUpdate.ts b/src/version3/models/customFieldOptionUpdate.mts similarity index 100% rename from src/version3/models/customFieldOptionUpdate.ts rename to src/version3/models/customFieldOptionUpdate.mts diff --git a/src/version3/models/customFieldReplacement.ts b/src/version3/models/customFieldReplacement.mts similarity index 100% rename from src/version3/models/customFieldReplacement.ts rename to src/version3/models/customFieldReplacement.mts diff --git a/src/version3/models/customFieldUpdatedContextOptionsList.mts b/src/version3/models/customFieldUpdatedContextOptionsList.mts new file mode 100644 index 000000000..e9d8f1478 --- /dev/null +++ b/src/version3/models/customFieldUpdatedContextOptionsList.mts @@ -0,0 +1,7 @@ +import { CustomFieldOptionUpdate } from './customFieldOptionUpdate.mjs'; + +/** A list of custom field options for a context. */ +export interface CustomFieldUpdatedContextOptionsList { + /** The updated custom field options. */ + options?: CustomFieldOptionUpdate[]; +} diff --git a/src/version3/models/customFieldUpdatedContextOptionsList.ts b/src/version3/models/customFieldUpdatedContextOptionsList.ts deleted file mode 100644 index bb8a9ee46..000000000 --- a/src/version3/models/customFieldUpdatedContextOptionsList.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CustomFieldOptionUpdate } from './customFieldOptionUpdate.js'; - -/** A list of custom field options for a context. */ -export interface CustomFieldUpdatedContextOptionsList { - /** The updated custom field options. */ - options?: CustomFieldOptionUpdate[]; -} diff --git a/src/version3/models/customFieldValueUpdate.ts b/src/version3/models/customFieldValueUpdate.mts similarity index 100% rename from src/version3/models/customFieldValueUpdate.ts rename to src/version3/models/customFieldValueUpdate.mts diff --git a/src/version3/models/customFieldValueUpdateRequest.mts b/src/version3/models/customFieldValueUpdateRequest.mts new file mode 100644 index 000000000..c5040547c --- /dev/null +++ b/src/version3/models/customFieldValueUpdateRequest.mts @@ -0,0 +1,7 @@ +import { CustomFieldValueUpdate } from './customFieldValueUpdate.mjs'; + +/** Details of updates for a custom field. */ +export interface CustomFieldValueUpdateRequest { + /** The list of custom field update details. */ + updates?: CustomFieldValueUpdate[]; +} diff --git a/src/version3/models/customFieldValueUpdateRequest.ts b/src/version3/models/customFieldValueUpdateRequest.ts deleted file mode 100644 index 1164bf381..000000000 --- a/src/version3/models/customFieldValueUpdateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CustomFieldValueUpdate } from './customFieldValueUpdate.js'; - -/** Details of updates for a custom field. */ -export interface CustomFieldValueUpdateRequest { - /** The list of custom field update details. */ - updates?: CustomFieldValueUpdate[]; -} diff --git a/src/version3/models/dashboard.mts b/src/version3/models/dashboard.mts new file mode 100644 index 000000000..dba892cac --- /dev/null +++ b/src/version3/models/dashboard.mts @@ -0,0 +1,32 @@ +import type { DashboardUser } from './dashboardUser.mjs'; +import type { SharePermission } from './sharePermission.mjs'; + +/** Details of a dashboard. */ +export interface Dashboard { + description?: string; + /** The ID of the dashboard. */ + id: string; + /** Whether the dashboard is selected as a favorite by the user. */ + isFavourite?: boolean; + /** The name of the dashboard. */ + name?: string; + owner?: DashboardUser; + /** The number of users who have this dashboard as a favorite. */ + popularity?: number; + /** The rank of this dashboard. */ + rank?: number; + /** The URL of these dashboard details. */ + self?: string; + /** The details of any view share permissions for the dashboard. */ + sharePermissions?: SharePermission[]; + /** The details of any edit share permissions for the dashboard. */ + editPermissions?: SharePermission[]; + /** The automatic refresh interval for the dashboard in milliseconds. */ + automaticRefreshMs?: number; + /** The URL of the dashboard. */ + view?: string; + /** Whether the current user has permission to edit the dashboard. */ + isWritable?: boolean; + /** Whether the current dashboard is system dashboard. */ + systemDashboard?: boolean; +} diff --git a/src/version3/models/dashboard.ts b/src/version3/models/dashboard.ts deleted file mode 100644 index 3edd66c1c..000000000 --- a/src/version3/models/dashboard.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { DashboardUser } from './dashboardUser.js'; -import type { SharePermission } from './sharePermission.js'; - -/** Details of a dashboard. */ -export interface Dashboard { - description?: string; - /** The ID of the dashboard. */ - id: string; - /** Whether the dashboard is selected as a favorite by the user. */ - isFavourite?: boolean; - /** The name of the dashboard. */ - name?: string; - owner?: DashboardUser; - /** The number of users who have this dashboard as a favorite. */ - popularity?: number; - /** The rank of this dashboard. */ - rank?: number; - /** The URL of these dashboard details. */ - self?: string; - /** The details of any view share permissions for the dashboard. */ - sharePermissions?: SharePermission[]; - /** The details of any edit share permissions for the dashboard. */ - editPermissions?: SharePermission[]; - /** The automatic refresh interval for the dashboard in milliseconds. */ - automaticRefreshMs?: number; - /** The URL of the dashboard. */ - view?: string; - /** Whether the current user has permission to edit the dashboard. */ - isWritable?: boolean; - /** Whether the current dashboard is system dashboard. */ - systemDashboard?: boolean; -} diff --git a/src/version3/models/dashboardDetails.mts b/src/version3/models/dashboardDetails.mts new file mode 100644 index 000000000..30c35525e --- /dev/null +++ b/src/version3/models/dashboardDetails.mts @@ -0,0 +1,13 @@ +import type { SharePermission } from './sharePermission.mjs'; + +/** Details of a dashboard. */ +export interface DashboardDetails { + /** The name of the dashboard. */ + name: string; + /** The description of the dashboard. */ + description?: string; + /** The share permissions for the dashboard. */ + sharePermissions: SharePermission[]; + /** The edit permissions for the dashboard. */ + editPermissions: SharePermission[]; +} diff --git a/src/version3/models/dashboardDetails.ts b/src/version3/models/dashboardDetails.ts deleted file mode 100644 index 317a68950..000000000 --- a/src/version3/models/dashboardDetails.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { SharePermission } from './sharePermission.js'; - -/** Details of a dashboard. */ -export interface DashboardDetails { - /** The name of the dashboard. */ - name: string; - /** The description of the dashboard. */ - description?: string; - /** The share permissions for the dashboard. */ - sharePermissions: SharePermission[]; - /** The edit permissions for the dashboard. */ - editPermissions: SharePermission[]; -} diff --git a/src/version3/models/dashboardGadget.mts b/src/version3/models/dashboardGadget.mts new file mode 100644 index 000000000..b4cc36a03 --- /dev/null +++ b/src/version3/models/dashboardGadget.mts @@ -0,0 +1,16 @@ +import { DashboardGadgetPosition } from './dashboardGadgetPosition.mjs'; + +/** Details of a gadget. */ +export interface DashboardGadget { + /** The ID of the gadget instance. */ + id: number; + /** The module key of the gadget type. */ + moduleKey?: string; + /** The URI of the gadget type. */ + uri?: string; + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color: string; + position?: DashboardGadgetPosition; + /** The title of the gadget. */ + title: string; +} diff --git a/src/version3/models/dashboardGadget.ts b/src/version3/models/dashboardGadget.ts deleted file mode 100644 index 101358295..000000000 --- a/src/version3/models/dashboardGadget.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { DashboardGadgetPosition } from './dashboardGadgetPosition.js'; - -/** Details of a gadget. */ -export interface DashboardGadget { - /** The ID of the gadget instance. */ - id: number; - /** The module key of the gadget type. */ - moduleKey?: string; - /** The URI of the gadget type. */ - uri?: string; - /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ - color: string; - position?: DashboardGadgetPosition; - /** The title of the gadget. */ - title: string; -} diff --git a/src/version3/models/dashboardGadgetPosition.ts b/src/version3/models/dashboardGadgetPosition.mts similarity index 100% rename from src/version3/models/dashboardGadgetPosition.ts rename to src/version3/models/dashboardGadgetPosition.mts diff --git a/src/version3/models/dashboardGadgetResponse.mts b/src/version3/models/dashboardGadgetResponse.mts new file mode 100644 index 000000000..8d8d2c3bb --- /dev/null +++ b/src/version3/models/dashboardGadgetResponse.mts @@ -0,0 +1,7 @@ +import { DashboardGadget } from './dashboardGadget.mjs'; + +/** The list of gadgets on the dashboard. */ +export interface DashboardGadgetResponse { + /** The list of gadgets. */ + gadgets: DashboardGadget[]; +} diff --git a/src/version3/models/dashboardGadgetResponse.ts b/src/version3/models/dashboardGadgetResponse.ts deleted file mode 100644 index 252a1f1fe..000000000 --- a/src/version3/models/dashboardGadgetResponse.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { DashboardGadget } from './dashboardGadget.js'; - -/** The list of gadgets on the dashboard. */ -export interface DashboardGadgetResponse { - /** The list of gadgets. */ - gadgets: DashboardGadget[]; -} diff --git a/src/version3/models/dashboardGadgetSettings.mts b/src/version3/models/dashboardGadgetSettings.mts new file mode 100644 index 000000000..22124a35e --- /dev/null +++ b/src/version3/models/dashboardGadgetSettings.mts @@ -0,0 +1,19 @@ +import { DashboardGadgetPosition } from './dashboardGadgetPosition.mjs'; + +/** Details of the settings for a dashboard gadget. */ +export interface DashboardGadgetSettings { + /** The module key of the gadget type. Can't be provided with `uri`. */ + moduleKey?: string; + /** The URI of the gadget type. Can't be provided with `moduleKey`. */ + uri?: string; + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color?: string; + position?: DashboardGadgetPosition; + /** The title of the gadget. */ + title?: string; + /** + * Whether to ignore the validation of module key and URI. For example, when a gadget is created that is a part of an + * application that isn't installed. + */ + ignoreUriAndModuleKeyValidation?: boolean; +} diff --git a/src/version3/models/dashboardGadgetSettings.ts b/src/version3/models/dashboardGadgetSettings.ts deleted file mode 100644 index ef25f7d7e..000000000 --- a/src/version3/models/dashboardGadgetSettings.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { DashboardGadgetPosition } from './dashboardGadgetPosition.js'; - -/** Details of the settings for a dashboard gadget. */ -export interface DashboardGadgetSettings { - /** The module key of the gadget type. Can't be provided with `uri`. */ - moduleKey?: string; - /** The URI of the gadget type. Can't be provided with `moduleKey`. */ - uri?: string; - /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ - color?: string; - position?: DashboardGadgetPosition; - /** The title of the gadget. */ - title?: string; - /** - * Whether to ignore the validation of module key and URI. For example, when a gadget is created that is a part of an - * application that isn't installed. - */ - ignoreUriAndModuleKeyValidation?: boolean; -} diff --git a/src/version3/models/dashboardGadgetUpdateRequest.mts b/src/version3/models/dashboardGadgetUpdateRequest.mts new file mode 100644 index 000000000..436e2c12e --- /dev/null +++ b/src/version3/models/dashboardGadgetUpdateRequest.mts @@ -0,0 +1,10 @@ +import { DashboardGadgetPosition } from './dashboardGadgetPosition.mjs'; + +/** The details of the gadget to update. */ +export interface DashboardGadgetUpdateRequest { + /** The title of the gadget. */ + title?: string; + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color?: string; + position?: DashboardGadgetPosition; +} diff --git a/src/version3/models/dashboardGadgetUpdateRequest.ts b/src/version3/models/dashboardGadgetUpdateRequest.ts deleted file mode 100644 index 2c8cec5a7..000000000 --- a/src/version3/models/dashboardGadgetUpdateRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { DashboardGadgetPosition } from './dashboardGadgetPosition.js'; - -/** The details of the gadget to update. */ -export interface DashboardGadgetUpdateRequest { - /** The title of the gadget. */ - title?: string; - /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ - color?: string; - position?: DashboardGadgetPosition; -} diff --git a/src/version3/models/dashboardUser.mts b/src/version3/models/dashboardUser.mts new file mode 100644 index 000000000..723c864d5 --- /dev/null +++ b/src/version3/models/dashboardUser.mts @@ -0,0 +1,16 @@ +import { UserAvatarUrls } from './userAvatarUrls.mjs'; + +export interface DashboardUser { + /** The URL of the user. */ + self?: string; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** Whether the user is active. */ + active?: boolean; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + avatarUrls?: UserAvatarUrls; +} diff --git a/src/version3/models/dashboardUser.ts b/src/version3/models/dashboardUser.ts deleted file mode 100644 index f7b13a414..000000000 --- a/src/version3/models/dashboardUser.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { UserAvatarUrls } from './userAvatarUrls.js'; - -export interface DashboardUser { - /** The URL of the user. */ - self?: string; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active?: boolean; - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - avatarUrls?: UserAvatarUrls; -} diff --git a/src/version3/models/dateRangeFilter.ts b/src/version3/models/dateRangeFilter.mts similarity index 100% rename from src/version3/models/dateRangeFilter.ts rename to src/version3/models/dateRangeFilter.mts diff --git a/src/version3/models/defaultLevelValue.ts b/src/version3/models/defaultLevelValue.mts similarity index 100% rename from src/version3/models/defaultLevelValue.ts rename to src/version3/models/defaultLevelValue.mts diff --git a/src/version3/models/defaultShareScope.ts b/src/version3/models/defaultShareScope.mts similarity index 100% rename from src/version3/models/defaultShareScope.ts rename to src/version3/models/defaultShareScope.mts diff --git a/src/version3/models/defaultWorkflow.ts b/src/version3/models/defaultWorkflow.mts similarity index 100% rename from src/version3/models/defaultWorkflow.ts rename to src/version3/models/defaultWorkflow.mts diff --git a/src/version3/models/deleteAndReplaceVersion.mts b/src/version3/models/deleteAndReplaceVersion.mts new file mode 100644 index 000000000..0c7b47a6d --- /dev/null +++ b/src/version3/models/deleteAndReplaceVersion.mts @@ -0,0 +1,13 @@ +import { CustomFieldReplacement } from './customFieldReplacement.mjs'; + +export interface DeleteAndReplaceVersion { + /** The ID of the version to update `fixVersion` to when the field contains the deleted version. */ + moveFixIssuesTo?: number; + /** The ID of the version to update `affectedVersion` to when the field contains the deleted version. */ + moveAffectedIssuesTo?: number; + /** + * An array of custom field IDs (`customFieldId`) and version IDs (`moveTo`) to update when the fields contain the + * deleted version. + */ + customFieldReplacementList?: CustomFieldReplacement[]; +} diff --git a/src/version3/models/deleteAndReplaceVersion.ts b/src/version3/models/deleteAndReplaceVersion.ts deleted file mode 100644 index ecd96f868..000000000 --- a/src/version3/models/deleteAndReplaceVersion.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { CustomFieldReplacement } from './customFieldReplacement.js'; - -export interface DeleteAndReplaceVersion { - /** The ID of the version to update `fixVersion` to when the field contains the deleted version. */ - moveFixIssuesTo?: number; - /** The ID of the version to update `affectedVersion` to when the field contains the deleted version. */ - moveAffectedIssuesTo?: number; - /** - * An array of custom field IDs (`customFieldId`) and version IDs (`moveTo`) to update when the fields contain the - * deleted version. - */ - customFieldReplacementList?: CustomFieldReplacement[]; -} diff --git a/src/version3/models/document.mts b/src/version3/models/document.mts new file mode 100644 index 000000000..0a06475de --- /dev/null +++ b/src/version3/models/document.mts @@ -0,0 +1,33 @@ +import { Mark } from './mark.mjs'; + +export interface Document { + type: + | 'doc' + | 'paragraph' + | 'table' + | 'blockquote' + | 'bulletList' + | 'codeBlock' + | 'heading' + | 'mediaGroup' + | 'mediaSingle' + | 'orderedList' + | 'panel' + | 'rule' + | 'listItem' + | 'media' + | 'table_cell' + | 'table_header' + | 'table_row' + | 'emoji' + | 'hardBreak' + | 'inlineCard' + | 'mention' + | 'text' + | string; + content?: Omit[]; + version: number; + marks?: Mark[]; + attrs?: any; + text?: string; +} diff --git a/src/version3/models/document.ts b/src/version3/models/document.ts deleted file mode 100644 index 332bf67a5..000000000 --- a/src/version3/models/document.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { Mark } from './mark.js'; - -export interface Document { - type: - | 'doc' - | 'paragraph' - | 'table' - | 'blockquote' - | 'bulletList' - | 'codeBlock' - | 'heading' - | 'mediaGroup' - | 'mediaSingle' - | 'orderedList' - | 'panel' - | 'rule' - | 'listItem' - | 'media' - | 'table_cell' - | 'table_header' - | 'table_row' - | 'emoji' - | 'hardBreak' - | 'inlineCard' - | 'mention' - | 'text' - | string; - content?: Omit[]; - version: number; - marks?: Mark[]; - attrs?: any; - text?: string; -} diff --git a/src/version3/models/entityProperty.ts b/src/version3/models/entityProperty.mts similarity index 100% rename from src/version3/models/entityProperty.ts rename to src/version3/models/entityProperty.mts diff --git a/src/version3/models/entityPropertyDetails.ts b/src/version3/models/entityPropertyDetails.mts similarity index 100% rename from src/version3/models/entityPropertyDetails.ts rename to src/version3/models/entityPropertyDetails.mts diff --git a/src/version3/models/error.ts b/src/version3/models/error.mts similarity index 100% rename from src/version3/models/error.ts rename to src/version3/models/error.mts diff --git a/src/version3/models/errorCollection.ts b/src/version3/models/errorCollection.mts similarity index 100% rename from src/version3/models/errorCollection.ts rename to src/version3/models/errorCollection.mts diff --git a/src/version3/models/errors.mts b/src/version3/models/errors.mts new file mode 100644 index 000000000..f18557824 --- /dev/null +++ b/src/version3/models/errors.mts @@ -0,0 +1,8 @@ +import { Error } from './error.mjs'; + +export interface Errors { + issueIsSubtask?: Error; + issuesInArchivedProjects?: Error; + issuesInUnlicensedProjects?: Error; + issuesNotFound?: Error; +} diff --git a/src/version3/models/errors.ts b/src/version3/models/errors.ts deleted file mode 100644 index 3cf939417..000000000 --- a/src/version3/models/errors.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Error } from './error.js'; - -export interface Errors { - issueIsSubtask?: Error; - issuesInArchivedProjects?: Error; - issuesInUnlicensedProjects?: Error; - issuesNotFound?: Error; -} diff --git a/src/version3/models/eventNotification.mts b/src/version3/models/eventNotification.mts new file mode 100644 index 000000000..d8519589c --- /dev/null +++ b/src/version3/models/eventNotification.mts @@ -0,0 +1,39 @@ +import { FieldDetails } from './fieldDetails.mjs'; +import type { GroupName } from './groupName.mjs'; +import type { ProjectRole } from './projectRole.mjs'; +import { UserDetails } from './userDetails.mjs'; + +/** Details about a notification associated with an event. */ +export interface EventNotification { + /** Expand options that include additional event notification details in the response. */ + expand?: string; + /** The ID of the notification. */ + id?: number; + /** Identifies the recipients of the notification. */ + notificationType?: string; + /** + * As a group's name can change, use of `recipient` is recommended. The identifier associated with the + * `notificationType` value that defines the receiver of the notification, where the receiver isn't implied by + * `notificationType` value. So, when `notificationType` is: + * + * `User` The `parameter` is the user account ID. `Group` The `parameter` is the group name. `ProjectRole` The + * `parameter` is the project role ID. `UserCustomField` The `parameter` is the ID of the custom field. + * `GroupCustomField` The `parameter` is the ID of the custom field. + */ + parameter?: string; + /** + * The identifier associated with the `notificationType` value that defines the receiver of the notification, where + * the receiver isn't implied by the `notificationType` value. So, when `notificationType` is: + * + * `User`, `recipient` is the user account ID. `Group`, `recipient` is the group ID. `ProjectRole`, `recipient` is the + * project role ID. `UserCustomField`, `recipient` is the ID of the custom field. `GroupCustomField`, `recipient` is + * the ID of the custom field. + */ + recipient?: string; + group?: GroupName; + field?: FieldDetails; + /** The email address. */ + emailAddress?: string; + projectRole?: ProjectRole; + user?: UserDetails; +} diff --git a/src/version3/models/eventNotification.ts b/src/version3/models/eventNotification.ts deleted file mode 100644 index 6ddd19696..000000000 --- a/src/version3/models/eventNotification.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { FieldDetails } from './fieldDetails.js'; -import type { GroupName } from './groupName.js'; -import type { ProjectRole } from './projectRole.js'; -import type { UserDetails } from './userDetails.js'; - -/** Details about a notification associated with an event. */ -export interface EventNotification { - /** Expand options that include additional event notification details in the response. */ - expand?: string; - /** The ID of the notification. */ - id?: number; - /** Identifies the recipients of the notification. */ - notificationType?: string; - /** - * As a group's name can change, use of `recipient` is recommended. The identifier associated with the - * `notificationType` value that defines the receiver of the notification, where the receiver isn't implied by - * `notificationType` value. So, when `notificationType` is: - * - * `User` The `parameter` is the user account ID. `Group` The `parameter` is the group name. `ProjectRole` The - * `parameter` is the project role ID. `UserCustomField` The `parameter` is the ID of the custom field. - * `GroupCustomField` The `parameter` is the ID of the custom field. - */ - parameter?: string; - /** - * The identifier associated with the `notificationType` value that defines the receiver of the notification, where - * the receiver isn't implied by the `notificationType` value. So, when `notificationType` is: - * - * `User`, `recipient` is the user account ID. `Group`, `recipient` is the group ID. `ProjectRole`, `recipient` is the - * project role ID. `UserCustomField`, `recipient` is the ID of the custom field. `GroupCustomField`, `recipient` is - * the ID of the custom field. - */ - recipient?: string; - group?: GroupName; - field?: FieldDetails; - /** The email address. */ - emailAddress?: string; - projectRole?: ProjectRole; - user?: UserDetails; -} diff --git a/src/version3/models/exportArchivedIssuesTaskProgress.ts b/src/version3/models/exportArchivedIssuesTaskProgress.mts similarity index 100% rename from src/version3/models/exportArchivedIssuesTaskProgress.ts rename to src/version3/models/exportArchivedIssuesTaskProgress.mts diff --git a/src/version3/models/failedWebhook.ts b/src/version3/models/failedWebhook.mts similarity index 100% rename from src/version3/models/failedWebhook.ts rename to src/version3/models/failedWebhook.mts diff --git a/src/version3/models/failedWebhooks.mts b/src/version3/models/failedWebhooks.mts new file mode 100644 index 000000000..d22ea5769 --- /dev/null +++ b/src/version3/models/failedWebhooks.mts @@ -0,0 +1,18 @@ +import { FailedWebhook } from './failedWebhook.mjs'; + +/** A page of failed webhooks. */ +export interface FailedWebhooks { + /** The list of webhooks. */ + values: FailedWebhook[]; + /** + * The maximum number of items on the page. If the list of values is shorter than this number, then there are no more + * pages. + */ + maxResults: number; + /** + * The URL to the next page of results. Present only if the request returned at least one result.The next page may be + * empty at the time of receiving the response, but new failed webhooks may appear in time. You can save the URL to + * the next page and query for new results periodically (for example, every hour). + */ + next?: string; +} diff --git a/src/version3/models/failedWebhooks.ts b/src/version3/models/failedWebhooks.ts deleted file mode 100644 index 95c0424b4..000000000 --- a/src/version3/models/failedWebhooks.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { FailedWebhook } from './failedWebhook.js'; - -/** A page of failed webhooks. */ -export interface FailedWebhooks { - /** The list of webhooks. */ - values: FailedWebhook[]; - /** - * The maximum number of items on the page. If the list of values is shorter than this number, then there are no more - * pages. - */ - maxResults: number; - /** - * The URL to the next page of results. Present only if the request returned at least one result.The next page may be - * empty at the time of receiving the response, but new failed webhooks may appear in time. You can save the URL to - * the next page and query for new results periodically (for example, every hour). - */ - next?: string; -} diff --git a/src/version3/models/field.mts b/src/version3/models/field.mts new file mode 100644 index 000000000..4d3c7d50c --- /dev/null +++ b/src/version3/models/field.mts @@ -0,0 +1,26 @@ +import { FieldLastUsed } from './fieldLastUsed.mjs'; +import { JsonType } from './jsonType.mjs'; + +/** Details of a field. */ +export interface Field { + /** The ID of the field. */ + id: string; + /** The name of the field. */ + name: string; + schema: JsonType; + /** The description of the field. */ + description?: string; + /** The key of the field. */ + key?: string; + /** Whether the field is locked. */ + isLocked?: boolean; + /** Whether the field is shown on screen or not. */ + isUnscreenable?: boolean; + /** The searcher key of the field. Returned for custom fields. */ + searcherKey?: string; + /** Number of screens where the field is used. */ + screensCount?: number; + /** Number of contexts where the field is used. */ + contextsCount?: number; + lastUsed?: FieldLastUsed; +} diff --git a/src/version3/models/field.ts b/src/version3/models/field.ts deleted file mode 100644 index eda7a9a62..000000000 --- a/src/version3/models/field.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { FieldLastUsed } from './fieldLastUsed.js'; -import type { JsonType } from './jsonType.js'; - -/** Details of a field. */ -export interface Field { - /** The ID of the field. */ - id: string; - /** The name of the field. */ - name: string; - schema: JsonType; - /** The description of the field. */ - description?: string; - /** The key of the field. */ - key?: string; - /** Whether the field is locked. */ - isLocked?: boolean; - /** Whether the field is shown on screen or not. */ - isUnscreenable?: boolean; - /** The searcher key of the field. Returned for custom fields. */ - searcherKey?: string; - /** Number of screens where the field is used. */ - screensCount?: number; - /** Number of contexts where the field is used. */ - contextsCount?: number; - lastUsed?: FieldLastUsed; -} diff --git a/src/version3/models/fieldConfiguration.ts b/src/version3/models/fieldConfiguration.mts similarity index 100% rename from src/version3/models/fieldConfiguration.ts rename to src/version3/models/fieldConfiguration.mts diff --git a/src/version3/models/fieldConfigurationDetails.ts b/src/version3/models/fieldConfigurationDetails.mts similarity index 100% rename from src/version3/models/fieldConfigurationDetails.ts rename to src/version3/models/fieldConfigurationDetails.mts diff --git a/src/version3/models/fieldConfigurationIssueTypeItem.ts b/src/version3/models/fieldConfigurationIssueTypeItem.mts similarity index 100% rename from src/version3/models/fieldConfigurationIssueTypeItem.ts rename to src/version3/models/fieldConfigurationIssueTypeItem.mts diff --git a/src/version3/models/fieldConfigurationItem.ts b/src/version3/models/fieldConfigurationItem.mts similarity index 100% rename from src/version3/models/fieldConfigurationItem.ts rename to src/version3/models/fieldConfigurationItem.mts diff --git a/src/version3/models/fieldConfigurationItemsDetails.mts b/src/version3/models/fieldConfigurationItemsDetails.mts new file mode 100644 index 000000000..05d214a2c --- /dev/null +++ b/src/version3/models/fieldConfigurationItemsDetails.mts @@ -0,0 +1,7 @@ +import { FieldConfigurationItem } from './fieldConfigurationItem.mjs'; + +/** Details of field configuration items. */ +export interface FieldConfigurationItemsDetails { + /** Details of fields in a field configuration. */ + fieldConfigurationItems: FieldConfigurationItem[]; +} diff --git a/src/version3/models/fieldConfigurationItemsDetails.ts b/src/version3/models/fieldConfigurationItemsDetails.ts deleted file mode 100644 index 65b1078fe..000000000 --- a/src/version3/models/fieldConfigurationItemsDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { FieldConfigurationItem } from './fieldConfigurationItem.js'; - -/** Details of field configuration items. */ -export interface FieldConfigurationItemsDetails { - /** Details of fields in a field configuration. */ - fieldConfigurationItems: FieldConfigurationItem[]; -} diff --git a/src/version3/models/fieldConfigurationScheme.ts b/src/version3/models/fieldConfigurationScheme.mts similarity index 100% rename from src/version3/models/fieldConfigurationScheme.ts rename to src/version3/models/fieldConfigurationScheme.mts diff --git a/src/version3/models/fieldConfigurationSchemeProjectAssociation.ts b/src/version3/models/fieldConfigurationSchemeProjectAssociation.mts similarity index 100% rename from src/version3/models/fieldConfigurationSchemeProjectAssociation.ts rename to src/version3/models/fieldConfigurationSchemeProjectAssociation.mts diff --git a/src/version3/models/fieldConfigurationSchemeProjects.mts b/src/version3/models/fieldConfigurationSchemeProjects.mts new file mode 100644 index 000000000..18d456c99 --- /dev/null +++ b/src/version3/models/fieldConfigurationSchemeProjects.mts @@ -0,0 +1,8 @@ +import { FieldConfigurationScheme } from './fieldConfigurationScheme.mjs'; + +/** Project list with assigned field configuration schema. */ +export interface FieldConfigurationSchemeProjects { + fieldConfigurationScheme?: FieldConfigurationScheme; + /** The IDs of projects using the field configuration scheme. */ + projectIds: string[]; +} diff --git a/src/version3/models/fieldConfigurationSchemeProjects.ts b/src/version3/models/fieldConfigurationSchemeProjects.ts deleted file mode 100644 index addca085b..000000000 --- a/src/version3/models/fieldConfigurationSchemeProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { FieldConfigurationScheme } from './fieldConfigurationScheme.js'; - -/** Project list with assigned field configuration schema. */ -export interface FieldConfigurationSchemeProjects { - fieldConfigurationScheme?: FieldConfigurationScheme; - /** The IDs of projects using the field configuration scheme. */ - projectIds: string[]; -} diff --git a/src/version3/models/fieldConfigurationToIssueTypeMapping.ts b/src/version3/models/fieldConfigurationToIssueTypeMapping.mts similarity index 100% rename from src/version3/models/fieldConfigurationToIssueTypeMapping.ts rename to src/version3/models/fieldConfigurationToIssueTypeMapping.mts diff --git a/src/version3/models/fieldDetails.mts b/src/version3/models/fieldDetails.mts new file mode 100644 index 000000000..28074d3c1 --- /dev/null +++ b/src/version3/models/fieldDetails.mts @@ -0,0 +1,27 @@ +import { JsonType } from './jsonType.mjs'; +import type { Scope } from './scope.mjs'; + +/** Details about a field. */ +export interface FieldDetails { + /** The ID of the field. */ + id?: string; + /** The key of the field. */ + key?: string; + /** The name of the field. */ + name?: string; + /** Whether the field is a custom field. */ + custom?: boolean; + /** Whether the content of the field can be used to order lists. */ + orderable?: boolean; + /** Whether the field can be used as a column on the issue navigator. */ + navigable?: boolean; + /** Whether the content of the field can be searched. */ + searchable?: boolean; + /** + * The names that can be used to reference the field in an advanced search. For more information, see [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ). + */ + clauseNames?: string[]; + scope?: Scope; + schema?: JsonType; +} diff --git a/src/version3/models/fieldDetails.ts b/src/version3/models/fieldDetails.ts deleted file mode 100644 index c8dc64172..000000000 --- a/src/version3/models/fieldDetails.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { JsonType } from './jsonType.js'; -import type { Scope } from './scope.js'; - -/** Details about a field. */ -export interface FieldDetails { - /** The ID of the field. */ - id?: string; - /** The key of the field. */ - key?: string; - /** The name of the field. */ - name?: string; - /** Whether the field is a custom field. */ - custom?: boolean; - /** Whether the content of the field can be used to order lists. */ - orderable?: boolean; - /** Whether the field can be used as a column on the issue navigator. */ - navigable?: boolean; - /** Whether the content of the field can be searched. */ - searchable?: boolean; - /** - * The names that can be used to reference the field in an advanced search. For more information, see [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ). - */ - clauseNames?: string[]; - scope?: Scope; - schema?: JsonType; -} diff --git a/src/version3/models/fieldLastUsed.ts b/src/version3/models/fieldLastUsed.mts similarity index 100% rename from src/version3/models/fieldLastUsed.ts rename to src/version3/models/fieldLastUsed.mts diff --git a/src/version3/models/fieldReferenceData.ts b/src/version3/models/fieldReferenceData.mts similarity index 100% rename from src/version3/models/fieldReferenceData.ts rename to src/version3/models/fieldReferenceData.mts diff --git a/src/version3/models/fields.mts b/src/version3/models/fields.mts new file mode 100644 index 000000000..3bd9a0715 --- /dev/null +++ b/src/version3/models/fields.mts @@ -0,0 +1,85 @@ +import type { Attachment } from './attachment.mjs'; +import type { Comment } from './comment.mjs'; +import type { Document } from './document.mjs'; +import type { FixVersion } from './fixVersion.mjs'; +import type { Issue } from './issue.mjs'; +import type { IssueLink } from './issueLink.mjs'; +import type { IssueTypeDetails } from './issueTypeDetails.mjs'; +import type { Priority } from './priority.mjs'; +import type { ProjectComponent } from './projectComponent.mjs'; +import type { Resolution } from './resolution.mjs'; +import type { RichText } from './richText.mjs'; +import type { StatusDetails } from './statusDetails.mjs'; +import type { TimeTrackingDetails } from './timeTrackingDetails.mjs'; +import type { User } from './user.mjs'; +import type { UserDetails } from './userDetails.mjs'; +import type { Votes } from './votes.mjs'; +import type { Watchers } from './watchers.mjs'; +import type { Worklog } from './worklog.mjs'; + +/** Key fields from the linked issue. */ +export interface Fields { + /** The estimate of how much longer working on the issue will take, in seconds. */ + aggregatetimespent: number | null; + /** The assignee of the linked issue. */ + assignee: UserDetails; + /** The time the issue is due. */ + duedate: string | null; + /** The list of versions where the issue was fixed. */ + fixVersions: FixVersion[]; + lastViewed: string | null; + /** The issue parent. */ + parent?: Issue; + /** The priority of the linked issue. */ + priority: Priority; + /** The resolution of the issue. */ + resolution: Resolution | null; + /** The time the issue was resolved at. */ + resolutiondate: string | null; + /** The status of the linked issue. */ + status: StatusDetails; + /** The summary description of the linked issue. */ + summary: string; + /** The time that was spent working on the issue, in seconds. */ + timespent: number | null; + /** The time tracking of the linked issue. */ + timetracking: TimeTrackingDetails; + /** The type of the linked issue. */ + issuetype?: IssueTypeDetails; + /** The type of the linked issue. */ + issueType?: IssueTypeDetails; + environment: RichText | null; + issuelinks: IssueLink[]; + workratio: number; + issuerestriction?: { + issuerestrictions: any; + shouldDisplay: boolean; + }; + watches: Watchers; + created: string; + labels: string[]; + updated: string; + components: ProjectComponent[]; + timeoriginalestimate?: any; + description?: Document; + attachment: Attachment[]; + creator: User; + subtasks: Issue[]; + reporter: User; + comment: { + comments: Comment[]; + self: string; + maxResults: number; + total: number; + startAt: number; + }; + votes: Votes & { voters: never }; + worklog: { + startAt: number; + maxResults: number; + total: number; + worklogs: Worklog[]; + }; + + [key: string]: any; +} diff --git a/src/version3/models/fields.ts b/src/version3/models/fields.ts deleted file mode 100644 index ef4445b8d..000000000 --- a/src/version3/models/fields.ts +++ /dev/null @@ -1,85 +0,0 @@ -import type { Attachment } from './attachment.js'; -import type { Comment } from './comment.js'; -import type { Document } from './document.js'; -import type { FixVersion } from './fixVersion.js'; -import type { Issue } from './issue.js'; -import type { IssueLink } from './issueLink.js'; -import type { IssueTypeDetails } from './issueTypeDetails.js'; -import type { Priority } from './priority.js'; -import type { ProjectComponent } from './projectComponent.js'; -import type { Resolution } from './resolution.js'; -import type { RichText } from './richText.js'; -import type { StatusDetails } from './statusDetails.js'; -import type { TimeTrackingDetails } from './timeTrackingDetails.js'; -import type { User } from './user.js'; -import type { UserDetails } from './userDetails.js'; -import type { Votes } from './votes.js'; -import type { Watchers } from './watchers.js'; -import type { Worklog } from './worklog.js'; - -/** Key fields from the linked issue. */ -export interface Fields { - /** The estimate of how much longer working on the issue will take, in seconds. */ - aggregatetimespent: number | null; - /** The assignee of the linked issue. */ - assignee: UserDetails; - /** The time the issue is due. */ - duedate: string | null; - /** The list of versions where the issue was fixed. */ - fixVersions: FixVersion[]; - lastViewed: string | null; - /** The issue parent. */ - parent?: Issue; - /** The priority of the linked issue. */ - priority: Priority; - /** The resolution of the issue. */ - resolution: Resolution | null; - /** The time the issue was resolved at. */ - resolutiondate: string | null; - /** The status of the linked issue. */ - status: StatusDetails; - /** The summary description of the linked issue. */ - summary: string; - /** The time that was spent working on the issue, in seconds. */ - timespent: number | null; - /** The time tracking of the linked issue. */ - timetracking: TimeTrackingDetails; - /** The type of the linked issue. */ - issuetype?: IssueTypeDetails; - /** The type of the linked issue. */ - issueType?: IssueTypeDetails; - environment: RichText | null; - issuelinks: IssueLink[]; - workratio: number; - issuerestriction?: { - issuerestrictions: any; - shouldDisplay: boolean; - }; - watches: Watchers; - created: string; - labels: string[]; - updated: string; - components: ProjectComponent[]; - timeoriginalestimate?: any; - description?: Document; - attachment: Attachment[]; - creator: User; - subtasks: Issue[]; - reporter: User; - comment: { - comments: Comment[]; - self: string; - maxResults: number; - total: number; - startAt: number; - }; - votes: Votes & { voters: never }; - worklog: { - startAt: number; - maxResults: number; - total: number; - worklogs: Worklog[]; - }; - - [key: string]: any; -} diff --git a/src/version3/models/filter.mts b/src/version3/models/filter.mts new file mode 100644 index 000000000..2fac694ed --- /dev/null +++ b/src/version3/models/filter.mts @@ -0,0 +1,40 @@ +import { FilterSubscriptionsList } from './filterSubscriptionsList.mjs'; +import type { SharePermission } from './sharePermission.mjs'; +import { User } from './user.mjs'; +import { UserList } from './userList.mjs'; + +/** Details about a filter. */ +export interface Filter { + /** The URL of the filter. */ + self?: string; + /** The unique identifier for the filter. */ + id?: string; + /** The name of the filter. Must be unique. */ + name: string; + /** A description of the filter. */ + description?: string; + owner?: User; + /** The Jql query for the filter. For example, _project = SSP AND issuetype = Bug_. */ + jql?: string; + /** + * A URL to view the filter results in Jira, using the ID of the filter. For example, + * _https://your-domain.atlassian.net/issues/?filter=10100_. + */ + viewUrl?: string; + /** + * A URL to view the filter results in Jira, using the [Search for issues using + * Jql](#api-rest-api-3-filter-search-get) operation with the filter's Jql string to return the filter results. For + * example, _https://your-domain.atlassian.net/rest/api/3/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. + */ + searchUrl?: string; + /** Whether the filter is selected as a favorite. */ + favourite?: boolean; + /** The count of how many users have selected this filter as a favorite, including the filter owner. */ + favouritedCount?: number; + /** The groups and projects that the filter is shared with. */ + sharePermissions?: SharePermission[]; + /** The groups and projects that can edit the filter. */ + editPermissions?: SharePermission[]; + sharedUsers?: UserList; + subscriptions?: FilterSubscriptionsList; +} diff --git a/src/version3/models/filter.ts b/src/version3/models/filter.ts deleted file mode 100644 index 90a15834d..000000000 --- a/src/version3/models/filter.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { FilterSubscriptionsList } from './filterSubscriptionsList.js'; -import type { SharePermission } from './sharePermission.js'; -import type { User } from './user.js'; -import type { UserList } from './userList.js'; - -/** Details about a filter. */ -export interface Filter { - /** The URL of the filter. */ - self?: string; - /** The unique identifier for the filter. */ - id?: string; - /** The name of the filter. Must be unique. */ - name: string; - /** A description of the filter. */ - description?: string; - owner?: User; - /** The JQL query for the filter. For example, _project = SSP AND issuetype = Bug_. */ - jql?: string; - /** - * A URL to view the filter results in Jira, using the ID of the filter. For example, - * _https://your-domain.atlassian.net/issues/?filter=10100_. - */ - viewUrl?: string; - /** - * A URL to view the filter results in Jira, using the [Search for issues using - * JQL](#api-rest-api-3-filter-search-get) operation with the filter's JQL string to return the filter results. For - * example, _https://your-domain.atlassian.net/rest/api/3/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. - */ - searchUrl?: string; - /** Whether the filter is selected as a favorite. */ - favourite?: boolean; - /** The count of how many users have selected this filter as a favorite, including the filter owner. */ - favouritedCount?: number; - /** The groups and projects that the filter is shared with. */ - sharePermissions?: SharePermission[]; - /** The groups and projects that can edit the filter. */ - editPermissions?: SharePermission[]; - sharedUsers?: UserList; - subscriptions?: FilterSubscriptionsList; -} diff --git a/src/version3/models/filterDetails.mts b/src/version3/models/filterDetails.mts new file mode 100644 index 000000000..c440b6df5 --- /dev/null +++ b/src/version3/models/filterDetails.mts @@ -0,0 +1,47 @@ +import { FilterSubscription } from './filterSubscription.mjs'; +import type { SharePermission } from './sharePermission.mjs'; +import { User } from './user.mjs'; + +/** Details of a filter. */ +export interface FilterDetails { + /** Expand options that include additional filter details in the response. */ + expand?: string; + /** The URL of the filter. */ + self?: string; + /** The unique identifier for the filter. */ + id?: string; + /** The name of the filter. */ + name: string; + /** The description of the filter. */ + description?: string; + owner?: User; + /** The Jql query for the filter. For example, _project = SSP AND issuetype = Bug_. */ + jql?: string; + /** + * A URL to view the filter results in Jira, using the ID of the filter. For example, + * _https://your-domain.atlassian.net/issues/?filter=10100_. + */ + viewUrl?: string; + /** + * A URL to view the filter results in Jira, using the [Search for issues using + * Jql](#api-rest-api-3-filter-search-get) operation with the filter's Jql string to return the filter results. For + * example, _https://your-domain.atlassian.net/rest/api/3/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. + */ + searchUrl?: string; + /** Whether the filter is selected as a favorite by any users, not including the filter owner. */ + favourite?: boolean; + /** The count of how many users have selected this filter as a favorite, including the filter owner. */ + favouritedCount?: number; + /** + * The groups and projects that the filter is shared with. This can be specified when updating a filter, but not when + * creating a filter. + */ + sharePermissions?: SharePermission[]; + /** + * The groups and projects that can edit the filter. This can be specified when updating a filter, but not when + * creating a filter. + */ + editPermissions?: SharePermission[]; + /** The users that are subscribed to the filter. */ + subscriptions?: FilterSubscription[]; +} diff --git a/src/version3/models/filterDetails.ts b/src/version3/models/filterDetails.ts deleted file mode 100644 index d491689c8..000000000 --- a/src/version3/models/filterDetails.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { FilterSubscription } from './filterSubscription.js'; -import type { SharePermission } from './sharePermission.js'; -import type { User } from './user.js'; - -/** Details of a filter. */ -export interface FilterDetails { - /** Expand options that include additional filter details in the response. */ - expand?: string; - /** The URL of the filter. */ - self?: string; - /** The unique identifier for the filter. */ - id?: string; - /** The name of the filter. */ - name: string; - /** The description of the filter. */ - description?: string; - owner?: User; - /** The JQL query for the filter. For example, _project = SSP AND issuetype = Bug_. */ - jql?: string; - /** - * A URL to view the filter results in Jira, using the ID of the filter. For example, - * _https://your-domain.atlassian.net/issues/?filter=10100_. - */ - viewUrl?: string; - /** - * A URL to view the filter results in Jira, using the [Search for issues using - * JQL](#api-rest-api-3-filter-search-get) operation with the filter's JQL string to return the filter results. For - * example, _https://your-domain.atlassian.net/rest/api/3/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. - */ - searchUrl?: string; - /** Whether the filter is selected as a favorite by any users, not including the filter owner. */ - favourite?: boolean; - /** The count of how many users have selected this filter as a favorite, including the filter owner. */ - favouritedCount?: number; - /** - * The groups and projects that the filter is shared with. This can be specified when updating a filter, but not when - * creating a filter. - */ - sharePermissions?: SharePermission[]; - /** - * The groups and projects that can edit the filter. This can be specified when updating a filter, but not when - * creating a filter. - */ - editPermissions?: SharePermission[]; - /** The users that are subscribed to the filter. */ - subscriptions?: FilterSubscription[]; -} diff --git a/src/version3/models/filterSubscription.mts b/src/version3/models/filterSubscription.mts new file mode 100644 index 000000000..edfbee7a4 --- /dev/null +++ b/src/version3/models/filterSubscription.mts @@ -0,0 +1,10 @@ +import type { GroupName } from './groupName.mjs'; +import { User } from './user.mjs'; + +/** Details of a user or group subscribing to a filter. */ +export interface FilterSubscription { + /** The ID of the filter subscription. */ + id?: number; + user?: User; + group?: GroupName; +} diff --git a/src/version3/models/filterSubscription.ts b/src/version3/models/filterSubscription.ts deleted file mode 100644 index 0544e236d..000000000 --- a/src/version3/models/filterSubscription.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { GroupName } from './groupName.js'; -import type { User } from './user.js'; - -/** Details of a user or group subscribing to a filter. */ -export interface FilterSubscription { - /** The ID of the filter subscription. */ - id?: number; - user?: User; - group?: GroupName; -} diff --git a/src/version3/models/filterSubscriptionsList.mts b/src/version3/models/filterSubscriptionsList.mts new file mode 100644 index 000000000..cad7f466c --- /dev/null +++ b/src/version3/models/filterSubscriptionsList.mts @@ -0,0 +1,15 @@ +import { FilterSubscription } from './filterSubscription.mjs'; + +/** A paginated list of subscriptions to a filter. */ +export interface FilterSubscriptionsList { + /** The number of items on the page. */ + size?: number; + /** The list of items. */ + items?: FilterSubscription[]; + /** The maximum number of results that could be on the page. */ + 'max-results'?: number; + /** The index of the first item returned on the page. */ + 'start-index'?: number; + /** The index of the last item returned on the page. */ + 'end-index'?: number; +} diff --git a/src/version3/models/filterSubscriptionsList.ts b/src/version3/models/filterSubscriptionsList.ts deleted file mode 100644 index c99b80be9..000000000 --- a/src/version3/models/filterSubscriptionsList.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { FilterSubscription } from './filterSubscription.js'; - -/** A paginated list of subscriptions to a filter. */ -export interface FilterSubscriptionsList { - /** The number of items on the page. */ - size?: number; - /** The list of items. */ - items?: FilterSubscription[]; - /** The maximum number of results that could be on the page. */ - 'max-results'?: number; - /** The index of the first item returned on the page. */ - 'start-index'?: number; - /** The index of the last item returned on the page. */ - 'end-index'?: number; -} diff --git a/src/version3/models/fixVersion.ts b/src/version3/models/fixVersion.mts similarity index 100% rename from src/version3/models/fixVersion.ts rename to src/version3/models/fixVersion.mts diff --git a/src/version3/models/foundGroup.mts b/src/version3/models/foundGroup.mts new file mode 100644 index 000000000..adb3b30d4 --- /dev/null +++ b/src/version3/models/foundGroup.mts @@ -0,0 +1,15 @@ +import { GroupLabel } from './groupLabel.mjs'; + +/** A group found in a search. */ +export interface FoundGroup { + /** The name of the group. The name of a group is mutable, to reliably identify a group use ``groupId`.` */ + name?: string; + /** The group name with the matched query string highlighted with the HTML bold tag. */ + html?: string; + labels?: GroupLabel[]; + /** + * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, + * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. + */ + groupId?: string; +} diff --git a/src/version3/models/foundGroup.ts b/src/version3/models/foundGroup.ts deleted file mode 100644 index e8abf2ba8..000000000 --- a/src/version3/models/foundGroup.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { GroupLabel } from './groupLabel.js'; - -/** A group found in a search. */ -export interface FoundGroup { - /** The name of the group. The name of a group is mutable, to reliably identify a group use ``groupId`.` */ - name?: string; - /** The group name with the matched query string highlighted with the HTML bold tag. */ - html?: string; - labels?: GroupLabel[]; - /** - * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, - * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. - */ - groupId?: string; -} diff --git a/src/version3/models/foundGroups.mts b/src/version3/models/foundGroups.mts new file mode 100644 index 000000000..0b579f839 --- /dev/null +++ b/src/version3/models/foundGroups.mts @@ -0,0 +1,13 @@ +import { FoundGroup } from './foundGroup.mjs'; + +/** + * The list of groups found in a search, including header text (Showing X of Y matching groups) and total of matched + * groups. + */ +export interface FoundGroups { + /** Header text indicating the number of groups in the response and the total number of groups found in the search. */ + header?: string; + /** The total number of groups found in the search. */ + total?: number; + groups?: FoundGroup[]; +} diff --git a/src/version3/models/foundGroups.ts b/src/version3/models/foundGroups.ts deleted file mode 100644 index 9e8a81378..000000000 --- a/src/version3/models/foundGroups.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { FoundGroup } from './foundGroup.js'; - -/** - * The list of groups found in a search, including header text (Showing X of Y matching groups) and total of matched - * groups. - */ -export interface FoundGroups { - /** Header text indicating the number of groups in the response and the total number of groups found in the search. */ - header?: string; - /** The total number of groups found in the search. */ - total?: number; - groups?: FoundGroup[]; -} diff --git a/src/version3/models/foundUsers.mts b/src/version3/models/foundUsers.mts new file mode 100644 index 000000000..7bd91da2b --- /dev/null +++ b/src/version3/models/foundUsers.mts @@ -0,0 +1,13 @@ +import { UserPickerUser } from './userPickerUser.mjs'; + +/** + * The list of users found in a search, including header text (Showing X of Y matching users) and total of matched + * users. + */ +export interface FoundUsers { + users?: UserPickerUser[]; + /** The total number of users found in the search. */ + total?: number; + /** Header text indicating the number of users in the response and the total number of users found in the search. */ + header?: string; +} diff --git a/src/version3/models/foundUsers.ts b/src/version3/models/foundUsers.ts deleted file mode 100644 index 134a869bb..000000000 --- a/src/version3/models/foundUsers.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { UserPickerUser } from './userPickerUser.js'; - -/** - * The list of users found in a search, including header text (Showing X of Y matching users) and total of matched - * users. - */ -export interface FoundUsers { - users?: UserPickerUser[]; - /** The total number of users found in the search. */ - total?: number; - /** Header text indicating the number of users in the response and the total number of users found in the search. */ - header?: string; -} diff --git a/src/version3/models/foundUsersAndGroups.mts b/src/version3/models/foundUsersAndGroups.mts new file mode 100644 index 000000000..ff7cc45e4 --- /dev/null +++ b/src/version3/models/foundUsersAndGroups.mts @@ -0,0 +1,8 @@ +import { FoundGroups } from './foundGroups.mjs'; +import { FoundUsers } from './foundUsers.mjs'; + +/** List of users and groups found in a search. */ +export interface FoundUsersAndGroups { + users?: FoundUsers; + groups?: FoundGroups; +} diff --git a/src/version3/models/foundUsersAndGroups.ts b/src/version3/models/foundUsersAndGroups.ts deleted file mode 100644 index 7de4cf99a..000000000 --- a/src/version3/models/foundUsersAndGroups.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { FoundGroups } from './foundGroups.js'; -import type { FoundUsers } from './foundUsers.js'; - -/** List of users and groups found in a search. */ -export interface FoundUsersAndGroups { - users?: FoundUsers; - groups?: FoundGroups; -} diff --git a/src/version3/models/functionReferenceData.ts b/src/version3/models/functionReferenceData.mts similarity index 100% rename from src/version3/models/functionReferenceData.ts rename to src/version3/models/functionReferenceData.mts diff --git a/src/version3/models/globalScope.ts b/src/version3/models/globalScope.mts similarity index 100% rename from src/version3/models/globalScope.ts rename to src/version3/models/globalScope.mts diff --git a/src/version3/models/group.mts b/src/version3/models/group.mts new file mode 100644 index 000000000..e81e0757a --- /dev/null +++ b/src/version3/models/group.mts @@ -0,0 +1,16 @@ +import { PagedListUserDetailsApplicationUser } from './pagedListUserDetailsApplicationUser.mjs'; + +export interface Group { + /** The name of group. */ + name?: string; + /** + * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, + * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. + */ + groupId?: string; + /** The URL for these group details. */ + self?: string; + users?: PagedListUserDetailsApplicationUser; + /** Expand options that include additional group details in the response. */ + expand?: string; +} diff --git a/src/version3/models/group.ts b/src/version3/models/group.ts deleted file mode 100644 index bfbd5a955..000000000 --- a/src/version3/models/group.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { PagedListUserDetailsApplicationUser } from './pagedListUserDetailsApplicationUser.js'; - -export interface Group { - /** The name of group. */ - name?: string; - /** - * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, - * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. - */ - groupId?: string; - /** The URL for these group details. */ - self?: string; - users?: PagedListUserDetailsApplicationUser; - /** Expand options that include additional group details in the response. */ - expand?: string; -} diff --git a/src/version3/models/groupDetails.ts b/src/version3/models/groupDetails.mts similarity index 100% rename from src/version3/models/groupDetails.ts rename to src/version3/models/groupDetails.mts diff --git a/src/version3/models/groupLabel.ts b/src/version3/models/groupLabel.mts similarity index 100% rename from src/version3/models/groupLabel.ts rename to src/version3/models/groupLabel.mts diff --git a/src/version3/models/groupName.ts b/src/version3/models/groupName.mts similarity index 100% rename from src/version3/models/groupName.ts rename to src/version3/models/groupName.mts diff --git a/src/version3/models/hierarchy.mts b/src/version3/models/hierarchy.mts new file mode 100644 index 000000000..e118049eb --- /dev/null +++ b/src/version3/models/hierarchy.mts @@ -0,0 +1,7 @@ +import { HierarchyLevel } from './hierarchyLevel.mjs'; + +/** The project issue type hierarchy. */ +export interface Hierarchy { + /** Details about the hierarchy level. */ + levels?: HierarchyLevel[]; +} diff --git a/src/version3/models/hierarchy.ts b/src/version3/models/hierarchy.ts deleted file mode 100644 index eaa4641cb..000000000 --- a/src/version3/models/hierarchy.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { HierarchyLevel } from './hierarchyLevel.js'; - -/** The project issue type hierarchy. */ -export interface Hierarchy { - /** Details about the hierarchy level. */ - levels?: HierarchyLevel[]; -} diff --git a/src/version3/models/hierarchyLevel.ts b/src/version3/models/hierarchyLevel.mts similarity index 100% rename from src/version3/models/hierarchyLevel.ts rename to src/version3/models/hierarchyLevel.mts diff --git a/src/version3/models/historyMetadata.mts b/src/version3/models/historyMetadata.mts new file mode 100644 index 000000000..e8c0396b0 --- /dev/null +++ b/src/version3/models/historyMetadata.mts @@ -0,0 +1,24 @@ +import { HistoryMetadataParticipant } from './historyMetadataParticipant.mjs'; + +/** Details of issue history metadata. */ +export interface HistoryMetadata { + /** The type of the history record. */ + type?: string; + /** The description of the history record. */ + description?: string; + /** The description key of the history record. */ + descriptionKey?: string; + /** The activity described in the history record. */ + activityDescription?: string; + /** The key of the activity described in the history record. */ + activityDescriptionKey?: string; + /** The description of the email address associated the history record. */ + emailDescription?: string; + /** The description key of the email address associated the history record. */ + emailDescriptionKey?: string; + actor?: HistoryMetadataParticipant; + generator?: HistoryMetadataParticipant; + cause?: HistoryMetadataParticipant; + /** Additional arbitrary information about the history record. */ + extraData?: {}; +} diff --git a/src/version3/models/historyMetadata.ts b/src/version3/models/historyMetadata.ts deleted file mode 100644 index abb523b78..000000000 --- a/src/version3/models/historyMetadata.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { HistoryMetadataParticipant } from './historyMetadataParticipant.js'; - -/** Details of issue history metadata. */ -export interface HistoryMetadata { - /** The type of the history record. */ - type?: string; - /** The description of the history record. */ - description?: string; - /** The description key of the history record. */ - descriptionKey?: string; - /** The activity described in the history record. */ - activityDescription?: string; - /** The key of the activity described in the history record. */ - activityDescriptionKey?: string; - /** The description of the email address associated the history record. */ - emailDescription?: string; - /** The description key of the email address associated the history record. */ - emailDescriptionKey?: string; - actor?: HistoryMetadataParticipant; - generator?: HistoryMetadataParticipant; - cause?: HistoryMetadataParticipant; - /** Additional arbitrary information about the history record. */ - extraData?: {}; -} diff --git a/src/version3/models/historyMetadataParticipant.ts b/src/version3/models/historyMetadataParticipant.mts similarity index 100% rename from src/version3/models/historyMetadataParticipant.ts rename to src/version3/models/historyMetadataParticipant.mts diff --git a/src/version3/models/icon.ts b/src/version3/models/icon.mts similarity index 100% rename from src/version3/models/icon.ts rename to src/version3/models/icon.mts diff --git a/src/version3/models/id.ts b/src/version3/models/id.mts similarity index 100% rename from src/version3/models/id.ts rename to src/version3/models/id.mts diff --git a/src/version3/models/idOrKey.ts b/src/version3/models/idOrKey.mts similarity index 100% rename from src/version3/models/idOrKey.ts rename to src/version3/models/idOrKey.mts diff --git a/src/version3/models/includedFields.ts b/src/version3/models/includedFields.mts similarity index 100% rename from src/version3/models/includedFields.ts rename to src/version3/models/includedFields.mts diff --git a/src/version3/models/index.mts b/src/version3/models/index.mts new file mode 100644 index 000000000..1e5e385eb --- /dev/null +++ b/src/version3/models/index.mts @@ -0,0 +1,510 @@ +export * from './actorInput.mjs'; +export * from './actorsMap.mjs'; +export * from './addField.mjs'; +export * from './addGroup.mjs'; +export * from './addSecuritySchemeLevelsRequest.mjs'; +export * from './announcementBannerConfiguration.mjs'; +export * from './announcementBannerConfigurationUpdate.mjs'; +export * from './application.mjs'; +export * from './applicationProperty.mjs'; +export * from './applicationRole.mjs'; +export * from './archiveIssueAsyncRequest.mjs'; +export * from './associatedItem.mjs'; +export * from './associateFieldConfigurationsWithIssueTypesRequest.mjs'; +export * from './attachment.mjs'; +export * from './attachmentArchiveEntry.mjs'; +export * from './attachmentArchiveImpl.mjs'; +export * from './attachmentArchiveItemReadable.mjs'; +export * from './attachmentArchiveMetadataReadable.mjs'; +export * from './attachmentMetadata.mjs'; +export * from './attachmentSettings.mjs'; +export * from './auditRecord.mjs'; +export * from './auditRecords.mjs'; +export * from './autoCompleteSuggestion.mjs'; +export * from './autoCompleteSuggestions.mjs'; +export * from './availableDashboardGadget.mjs'; +export * from './availableDashboardGadgetsResponse.mjs'; +export * from './avatar.mjs'; +export * from './avatars.mjs'; +export * from './avatarUrls.mjs'; +export * from './avatarWithDetails.mjs'; +export * from './bulkChangeOwnerDetails.mjs'; +export * from './bulkCustomFieldOptionCreateRequest.mjs'; +export * from './bulkCustomFieldOptionUpdateRequest.mjs'; +export * from './bulkEditShareableEntity.mjs'; +export * from './bulkIssueIsWatching.mjs'; +export * from './bulkIssuePropertyUpdateRequest.mjs'; +export * from './bulkOperationErrorResult.mjs'; +export * from './bulkPermissionGrants.mjs'; +export * from './bulkPermissionsRequest.mjs'; +export * from './bulkProjectPermissionGrants.mjs'; +export * from './bulkProjectPermissions.mjs'; +export * from './changeDetails.mjs'; +export * from './changedValue.mjs'; +export * from './changedWorklog.mjs'; +export * from './changedWorklogs.mjs'; +export * from './changelog.mjs'; +export * from './columnItem.mjs'; +export * from './comment.mjs'; +export * from './componentIssuesCount.mjs'; +export * from './componentWithIssueCount.mjs'; +export * from './configuration.mjs'; +export * from './connectCustomFieldValue.mjs'; +export * from './connectCustomFieldValues.mjs'; +export * from './connectModule.mjs'; +export * from './connectModules.mjs'; +export * from './connectWorkflowTransitionRule.mjs'; +export * from './containerForProjectFeatures.mjs'; +export * from './containerForRegisteredWebhooks.mjs'; +export * from './containerForWebhookIDs.mjs'; +export * from './containerOfWorkflowSchemeAssociations.mjs'; +export * from './contextForProjectAndIssueType.mjs'; +export * from './contextualConfiguration.mjs'; +export * from './convertedJQLQueries.mjs'; +export * from './createCustomFieldContext.mjs'; +export * from './createdIssue.mjs'; +export * from './createdIssues.mjs'; +export * from './createIssueSecuritySchemeDetails.mjs'; +export * from './createNotificationSchemeDetails.mjs'; +export * from './createPriorityDetails.mjs'; +export * from './createProjectDetails.mjs'; +export * from './createResolutionDetails.mjs'; +export * from './createUiModificationDetails.mjs'; +export * from './createUpdateRoleRequest.mjs'; +export * from './createWorkflowCondition.mjs'; +export * from './createWorkflowDetails.mjs'; +export * from './createWorkflowStatusDetails.mjs'; +export * from './createWorkflowTransitionDetails.mjs'; +export * from './createWorkflowTransitionRule.mjs'; +export * from './createWorkflowTransitionRulesDetails.mjs'; +export * from './createWorkflowTransitionScreenDetails.mjs'; +export * from './customContextVariable.mjs'; +export * from './customFieldConfigurations.mjs'; +export * from './customFieldContext.mjs'; +export * from './customFieldContextDefaultValue.mjs'; +export * from './customFieldContextDefaultValueUpdate.mjs'; +export * from './customFieldContextOption.mjs'; +export * from './customFieldContextProjectMapping.mjs'; +export * from './customFieldContextUpdateDetails.mjs'; +export * from './customFieldCreatedContextOptionsList.mjs'; +export * from './customFieldDefinitionJson.mjs'; +export * from './customFieldOption.mjs'; +export * from './customFieldOptionCreate.mjs'; +export * from './customFieldOptionUpdate.mjs'; +export * from './customFieldReplacement.mjs'; +export * from './customFieldUpdatedContextOptionsList.mjs'; +export * from './customFieldValueUpdate.mjs'; +export * from './customFieldValueUpdateRequest.mjs'; +export * from './dashboard.mjs'; +export * from './dashboardDetails.mjs'; +export * from './dashboardGadget.mjs'; +export * from './dashboardGadgetPosition.mjs'; +export * from './dashboardGadgetResponse.mjs'; +export * from './dashboardGadgetSettings.mjs'; +export * from './dashboardGadgetUpdateRequest.mjs'; +export * from './dashboardUser.mjs'; +export * from './dateRangeFilter.mjs'; +export * from './defaultLevelValue.mjs'; +export * from './defaultShareScope.mjs'; +export * from './defaultWorkflow.mjs'; +export * from './deleteAndReplaceVersion.mjs'; +export * from './document.mjs'; +export * from './entityProperty.mjs'; +export * from './entityPropertyDetails.mjs'; +export * from './error.mjs'; +export * from './errorCollection.mjs'; +export * from './errors.mjs'; +export * from './eventNotification.mjs'; +export * from './exportArchivedIssuesTaskProgress.mjs'; +export * from './failedWebhook.mjs'; +export * from './failedWebhooks.mjs'; +export * from './field.mjs'; +export * from './fieldConfiguration.mjs'; +export * from './fieldConfigurationDetails.mjs'; +export * from './fieldConfigurationIssueTypeItem.mjs'; +export * from './fieldConfigurationItem.mjs'; +export * from './fieldConfigurationItemsDetails.mjs'; +export * from './fieldConfigurationScheme.mjs'; +export * from './fieldConfigurationSchemeProjectAssociation.mjs'; +export * from './fieldConfigurationSchemeProjects.mjs'; +export * from './fieldConfigurationToIssueTypeMapping.mjs'; +export * from './fieldDetails.mjs'; +export * from './fieldLastUsed.mjs'; +export * from './fieldReferenceData.mjs'; +export * from './fields.mjs'; +export * from './filter.mjs'; +export * from './filterDetails.mjs'; +export * from './filterSubscription.mjs'; +export * from './filterSubscriptionsList.mjs'; +export * from './fixVersion.mjs'; +export * from './foundGroup.mjs'; +export * from './foundGroups.mjs'; +export * from './foundUsers.mjs'; +export * from './foundUsersAndGroups.mjs'; +export * from './functionReferenceData.mjs'; +export * from './globalScope.mjs'; +export * from './group.mjs'; +export * from './groupDetails.mjs'; +export * from './groupLabel.mjs'; +export * from './groupName.mjs'; +export * from './hierarchy.mjs'; +export * from './hierarchyLevel.mjs'; +export * from './historyMetadata.mjs'; +export * from './historyMetadataParticipant.mjs'; +export * from './icon.mjs'; +export * from './id.mjs'; +export * from './idOrKey.mjs'; +export * from './includedFields.mjs'; +export * from './issue.mjs'; +export * from './issueArchivalSync.mjs'; +export * from './issueArchivalSyncRequest.mjs'; +export * from './issueChangelogIds.mjs'; +export * from './issueCommentListRequest.mjs'; +export * from './issueCreateMetadata.mjs'; +export * from './issueEntityProperties.mjs'; +export * from './issueEntityPropertiesForMultiUpdate.mjs'; +export * from './issueEvent.mjs'; +export * from './issueFieldOption.mjs'; +export * from './issueFieldOptionConfiguration.mjs'; +export * from './issueFieldOptionCreate.mjs'; +export * from './issueFieldOptionScope.mjs'; +export * from './issueFilterForBulkPropertyDelete.mjs'; +export * from './issueFilterForBulkPropertySet.mjs'; +export * from './issueLink.mjs'; +export * from './issueLinkType.mjs'; +export * from './issueLinkTypes.mjs'; +export * from './issueList.mjs'; +export * from './issueMatches.mjs'; +export * from './issueMatchesForJQL.mjs'; +export * from './issuePickerSuggestions.mjs'; +export * from './issuePickerSuggestionsIssueType.mjs'; +export * from './issuesAndJQLQueries.mjs'; +export * from './issueSecurityLevelMember.mjs'; +export * from './issueSecuritySchemeToProjectMapping.mjs'; +export * from './issuesJqlMetaData.mjs'; +export * from './issuesMeta.mjs'; +export * from './issuesUpdate.mjs'; +export * from './issueTransition.mjs'; +export * from './issueTypeCreate.mjs'; +export * from './issueTypeDetails.mjs'; +export * from './issueTypeIds.mjs'; +export * from './issueTypeIdsToRemove.mjs'; +export * from './issueTypeInfo.mjs'; +export * from './issueTypeIssueCreateMetadata.mjs'; +export * from './issueTypeScheme.mjs'; +export * from './issueTypeSchemeDetails.mjs'; +export * from './issueTypeSchemeID.mjs'; +export * from './issueTypeSchemeMapping.mjs'; +export * from './issueTypeSchemeProjectAssociation.mjs'; +export * from './issueTypeSchemeProjects.mjs'; +export * from './issueTypeSchemeUpdateDetails.mjs'; +export * from './issueTypeScreenScheme.mjs'; +export * from './issueTypeScreenSchemeDetails.mjs'; +export * from './issueTypeScreenSchemeId.mjs'; +export * from './issueTypeScreenSchemeItem.mjs'; +export * from './issueTypeScreenSchemeMapping.mjs'; +export * from './issueTypeScreenSchemeMappingDetails.mjs'; +export * from './issueTypeScreenSchemeProjectAssociation.mjs'; +export * from './issueTypeScreenSchemesProjects.mjs'; +export * from './issueTypeScreenSchemeUpdateDetails.mjs'; +export * from './issueTypesWorkflowMapping.mjs'; +export * from './issueTypeToContextMapping.mjs'; +export * from './issueTypeUpdate.mjs'; +export * from './issueTypeWithStatus.mjs'; +export * from './issueTypeWorkflowMapping.mjs'; +export * from './issueUpdateDetails.mjs'; +export * from './issueUpdateMetadata.mjs'; +export * from './jexpIssues.mjs'; +export * from './jexpJqlIssues.mjs'; +export * from './jiraExpressionAnalysis.mjs'; +export * from './jiraExpressionComplexity.mjs'; +export * from './jiraExpressionEvalContext.mjs'; +export * from './jiraExpressionEvalRequest.mjs'; +export * from './jiraExpressionEvaluationMetaData.mjs'; +export * from './jiraExpressionForAnalysis.mjs'; +export * from './jiraExpressionResult.mjs'; +export * from './jiraExpressionsAnalysis.mjs'; +export * from './jiraExpressionsComplexity.mjs'; +export * from './jiraExpressionsComplexityValue.mjs'; +export * from './jiraExpressionValidationError.mjs'; +export * from './jiraStatus.mjs'; +export * from './jqlFunctionPrecomputation.mjs'; +export * from './jqlFunctionPrecomputationUpdate.mjs'; +export * from './jqlFunctionPrecomputationUpdateRequest.mjs'; +export * from './jQLPersonalDataMigrationRequest.mjs'; +export * from './jqlQueriesToParse.mjs'; +export * from './jqlQueriesToSanitize.mjs'; +export * from './jqlQuery.mjs'; +export * from './jqlQueryClause.mjs'; +export * from './jqlQueryField.mjs'; +export * from './jqlQueryFieldEntityProperty.mjs'; +export * from './jqlQueryOrderByClause.mjs'; +export * from './jqlQueryOrderByClauseElement.mjs'; +export * from './jqlQueryToSanitize.mjs'; +export * from './jQLQueryWithUnknownUsers.mjs'; +export * from './jQLReferenceData.mjs'; +export * from './jsonType.mjs'; +export * from './license.mjs'; +export * from './licensedApplication.mjs'; +export * from './licenseMetric.mjs'; +export * from './linkedIssue.mjs'; +export * from './linkGroup.mjs'; +export * from './linkIssueRequestJson.mjs'; +export * from './listWrapperCallbackApplicationRole.mjs'; +export * from './listWrapperCallbackGroupName.mjs'; +export * from './locale.mjs'; +export * from './mark.mjs'; +export * from './moveField.mjs'; +export * from './multiIssueEntityProperties.mjs'; +export * from './multipleCustomFieldValuesUpdate.mjs'; +export * from './multipleCustomFieldValuesUpdateDetails.mjs'; +export * from './nestedResponse.mjs'; +export * from './newUserDetails.mjs'; +export * from './notification.mjs'; +export * from './notificationEvent.mjs'; +export * from './notificationRecipients.mjs'; +export * from './notificationRecipientsRestrictions.mjs'; +export * from './notificationScheme.mjs'; +export * from './notificationSchemeAndProjectMapping.mjs'; +export * from './notificationSchemeAndProjectMappingPage.mjs'; +export * from './notificationSchemeEvent.mjs'; +export * from './notificationSchemeEventDetails.mjs'; +export * from './notificationSchemeEventTypeId.mjs'; +export * from './notificationSchemeId.mjs'; +export * from './notificationSchemeNotificationDetails.mjs'; +export * from './oldToNewSecurityLevelMappings.mjs'; +export * from './operationMessage.mjs'; +export * from './operations.mjs'; +export * from './orderOfCustomFieldOptions.mjs'; +export * from './orderOfIssueTypes.mjs'; +export * from './pageBeanFieldConfigurationDetails.mjs'; +export * from './pageChangelog.mjs'; +export * from './pageComment.mjs'; +export * from './pageComponentWithIssueCount.mjs'; +export * from './pageContextForProjectAndIssueType.mjs'; +export * from './pageContextualConfiguration.mjs'; +export * from './pageCustomFieldContext.mjs'; +export * from './pageCustomFieldContextDefaultValue.mjs'; +export * from './pageCustomFieldContextOption.mjs'; +export * from './pageCustomFieldContextProjectMapping.mjs'; +export * from './pageDashboard.mjs'; +export * from './pagedListUserDetailsApplicationUser.mjs'; +export * from './pageField.mjs'; +export * from './pageFieldConfigurationIssueTypeItem.mjs'; +export * from './pageFieldConfigurationItem.mjs'; +export * from './pageFieldConfigurationScheme.mjs'; +export * from './pageFieldConfigurationSchemeProjects.mjs'; +export * from './pageFilterDetails.mjs'; +export * from './pageGroupDetails.mjs'; +export * from './pageIssueFieldOption.mjs'; +export * from './pageIssueSecurityLevelMember.mjs'; +export * from './pageIssueSecuritySchemeToProjectMapping.mjs'; +export * from './pageIssueTypeScheme.mjs'; +export * from './pageIssueTypeSchemeMapping.mjs'; +export * from './pageIssueTypeSchemeProjects.mjs'; +export * from './pageIssueTypeScreenScheme.mjs'; +export * from './pageIssueTypeScreenSchemeItem.mjs'; +export * from './pageIssueTypeScreenSchemesProjects.mjs'; +export * from './pageIssueTypeToContextMapping.mjs'; +export * from './pageJqlFunctionPrecomputation.mjs'; +export * from './pageNotificationScheme.mjs'; +export * from './pageOfChangelogs.mjs'; +export * from './pageOfComments.mjs'; +export * from './pageOfDashboards.mjs'; +export * from './pageOfStatuses.mjs'; +export * from './pageOfWorklogs.mjs'; +export * from './pagePriority.mjs'; +export * from './pageProject.mjs'; +export * from './pageProjectDetails.mjs'; +export * from './pageResolution.mjs'; +export * from './pageScreen.mjs'; +export * from './pageScreenScheme.mjs'; +export * from './pageScreenWithTab.mjs'; +export * from './pageSecurityLevel.mjs'; +export * from './pageSecurityLevelMember.mjs'; +export * from './pageSecuritySchemeWithProjects.mjs'; +export * from './pageString.mjs'; +export * from './pageUiModificationDetails.mjs'; +export * from './pageUser.mjs'; +export * from './pageUserDetails.mjs'; +export * from './pageUserKey.mjs'; +export * from './pageVersion.mjs'; +export * from './pageWebhook.mjs'; +export * from './pageWorkflow.mjs'; +export * from './pageWorkflowScheme.mjs'; +export * from './pageWorkflowTransitionRules.mjs'; +export * from './parsedJqlQueries.mjs'; +export * from './parsedJqlQuery.mjs'; +export * from './permissionDetails.mjs'; +export * from './permissionGrant.mjs'; +export * from './permissionGrants.mjs'; +export * from './permissionHolder.mjs'; +export * from './permissions.mjs'; +export * from './permissionScheme.mjs'; +export * from './permissionSchemes.mjs'; +export * from './permissionsKeys.mjs'; +export * from './permittedProjects.mjs'; +export * from './priority.mjs'; +export * from './priorityId.mjs'; +export * from './project.mjs'; +export * from './projectAvatars.mjs'; +export * from './projectCategory.mjs'; +export * from './projectComponent.mjs'; +export * from './projectDetails.mjs'; +export * from './projectEmailAddress.mjs'; +export * from './projectFeature.mjs'; +export * from './projectFeatureToggleRequest.mjs'; +export * from './projectId.mjs'; +export * from './projectIdentifier.mjs'; +export * from './projectIdentifiers.mjs'; +export * from './projectIds.mjs'; +export * from './projectInsight.mjs'; +export * from './projectIssueCreateMetadata.mjs'; +export * from './projectIssueSecurityLevels.mjs'; +export * from './projectIssueTypeHierarchy.mjs'; +export * from './projectIssueTypeMapping.mjs'; +export * from './projectIssueTypeMappings.mjs'; +export * from './projectIssueTypes.mjs'; +export * from './projectIssueTypesHierarchyLevel.mjs'; +export * from './projectLandingPageInfo.mjs'; +export * from './projectPermissions.mjs'; +export * from './projectRole.mjs'; +export * from './projectRoleActorsUpdate.mjs'; +export * from './projectRoleDetails.mjs'; +export * from './projectRoleGroup.mjs'; +export * from './projectRoleUser.mjs'; +export * from './projectScope.mjs'; +export * from './projectType.mjs'; +export * from './propertyKey.mjs'; +export * from './propertyKeys.mjs'; +export * from './publishedWorkflowId.mjs'; +export * from './registeredWebhook.mjs'; +export * from './remoteIssueLink.mjs'; +export * from './remoteIssueLinkIdentifies.mjs'; +export * from './remoteIssueLinkRequest.mjs'; +export * from './remoteObject.mjs'; +export * from './removeOptionFromIssuesResult.mjs'; +export * from './reorderIssuePriorities.mjs'; +export * from './reorderIssueResolutionsRequest.mjs'; +export * from './resolution.mjs'; +export * from './resolutionId.mjs'; +export * from './restrictedPermission.mjs'; +export * from './richText.mjs'; +export * from './roleActor.mjs'; +export * from './ruleConfiguration.mjs'; +export * from './sanitizedJqlQueries.mjs'; +export * from './sanitizedJqlQuery.mjs'; +export * from './scope.mjs'; +export * from './screen.mjs'; +export * from './screenableField.mjs'; +export * from './screenableTab.mjs'; +export * from './screenDetails.mjs'; +export * from './screenID.mjs'; +export * from './screenScheme.mjs'; +export * from './screenSchemeDetails.mjs'; +export * from './screenSchemeId.mjs'; +export * from './screenTypes.mjs'; +export * from './screenWithTab.mjs'; +export * from './searchAutoCompleteFilter.mjs'; +export * from './searchRequest.mjs'; +export * from './searchResults.mjs'; +export * from './securityLevel.mjs'; +export * from './securityLevelMember.mjs'; +export * from './securityScheme.mjs'; +export * from './securitySchemeId.mjs'; +export * from './securitySchemeLevel.mjs'; +export * from './securitySchemeLevelMember.mjs'; +export * from './securitySchemeMembersRequest.mjs'; +export * from './securitySchemes.mjs'; +export * from './securitySchemeWithProjects.mjs'; +export * from './serverInformation.mjs'; +export * from './setDefaultLevelsRequest.mjs'; +export * from './setDefaultPriorityRequest.mjs'; +export * from './setDefaultResolutionRequest.mjs'; +export * from './sharePermission.mjs'; +export * from './sharePermissionInput.mjs'; +export * from './simpleApplicationProperty.mjs'; +export * from './simpleErrorCollection.mjs'; +export * from './simpleLink.mjs'; +export * from './simpleListWrapperApplicationRole.mjs'; +export * from './simpleListWrapperGroupName.mjs'; +export * from './status.mjs'; +export * from './statusCategory.mjs'; +export * from './statusCreate.mjs'; +export * from './statusCreateRequest.mjs'; +export * from './statusDetails.mjs'; +export * from './statusMapping.mjs'; +export * from './statusScope.mjs'; +export * from './statusUpdate.mjs'; +export * from './statusUpdateRequest.mjs'; +export * from './suggestedIssue.mjs'; +export * from './systemAvatars.mjs'; +export * from './taskProgressObject.mjs'; +export * from './taskProgressRemoveOptionFromIssuesResult.mjs'; +export * from './timeTrackingConfiguration.mjs'; +export * from './timeTrackingDetails.mjs'; +export * from './timeTrackingProvider.mjs'; +export * from './transition.mjs'; +export * from './transitions.mjs'; +export * from './uiModificationContextDetails.mjs'; +export * from './uiModificationDetails.mjs'; +export * from './uiModificationIdentifiers.mjs'; +export * from './unrestrictedUserEmail.mjs'; +export * from './updateCustomFieldDetails.mjs'; +export * from './updatedProjectCategory.mjs'; +export * from './updateFieldConfigurationSchemeDetails.mjs'; +export * from './updateIssueSecurityLevelDetails.mjs'; +export * from './updateIssueSecuritySchemeRequest.mjs'; +export * from './updateNotificationSchemeDetails.mjs'; +export * from './updatePriorityDetails.mjs'; +export * from './updateProjectDetails.mjs'; +export * from './updateResolutionDetails.mjs'; +export * from './updateScreenDetails.mjs'; +export * from './updateScreenSchemeDetails.mjs'; +export * from './updateScreenTypes.mjs'; +export * from './updateUiModificationDetails.mjs'; +export * from './updateUserToGroup.mjs'; +export * from './user.mjs'; +export * from './userAvatarUrls.mjs'; +export * from './userDetails.mjs'; +export * from './userKey.mjs'; +export * from './userList.mjs'; +export * from './userMigration.mjs'; +export * from './userPickerUser.mjs'; +export * from './version.mjs'; +export * from './versionIssueCounts.mjs'; +export * from './versionIssuesStatus.mjs'; +export * from './versionMove.mjs'; +export * from './versionUnresolvedIssuesCount.mjs'; +export * from './versionUsageInCustomField.mjs'; +export * from './visibility.mjs'; +export * from './votes.mjs'; +export * from './watchers.mjs'; +export * from './webhook.mjs'; +export * from './webhookDetails.mjs'; +export * from './webhookRegistrationDetails.mjs'; +export * from './webhooksExpirationDate.mjs'; +export * from './workflow.mjs'; +export * from './workflowCondition.mjs'; +export * from './workflowId.mjs'; +export * from './workflowOperations.mjs'; +export * from './workflowRules.mjs'; +export * from './workflowRulesSearch.mjs'; +export * from './workflowRulesSearchDetails.mjs'; +export * from './workflowScheme.mjs'; +export * from './workflowSchemeAssociations.mjs'; +export * from './workflowSchemeIdName.mjs'; +export * from './workflowSchemeProjectAssociation.mjs'; +export * from './workflowStatus.mjs'; +export * from './workflowStatusProperties.mjs'; +export * from './workflowsWithTransitionRulesDetails.mjs'; +export * from './workflowTransition.mjs'; +export * from './workflowTransitionProperty.mjs'; +export * from './workflowTransitionRule.mjs'; +export * from './workflowTransitionRules.mjs'; +export * from './workflowTransitionRulesDetails.mjs'; +export * from './workflowTransitionRulesUpdate.mjs'; +export * from './workflowTransitionRulesUpdateErrorDetails.mjs'; +export * from './workflowTransitionRulesUpdateErrors.mjs'; +export * from './worklog.mjs'; +export * from './worklogIdsRequest.mjs'; diff --git a/src/version3/models/index.ts b/src/version3/models/index.ts deleted file mode 100644 index 85fb2741a..000000000 --- a/src/version3/models/index.ts +++ /dev/null @@ -1,511 +0,0 @@ -export * from './actorInput.js'; -export * from './actorsMap.js'; -export * from './addField.js'; -export * from './addGroup.js'; -export * from './addSecuritySchemeLevelsRequest.js'; -export * from './announcementBannerConfiguration.js'; -export * from './announcementBannerConfigurationUpdate.js'; -export * from './application.js'; -export * from './applicationProperty.js'; -export * from './applicationRole.js'; -export * from './archiveIssueAsyncRequest.js'; -export * from './associatedItem.js'; -export * from './associateFieldConfigurationsWithIssueTypesRequest.js'; -export * from './attachment.js'; -export * from './attachmentArchiveEntry.js'; -export * from './attachmentArchiveImpl.js'; -export * from './attachmentArchiveItemReadable.js'; -export * from './attachmentArchiveMetadataReadable.js'; -export * from './attachmentMetadata.js'; -export * from './attachmentSettings.js'; -export * from './auditRecord.js'; -export * from './auditRecords.js'; -export * from './autoCompleteSuggestion.js'; -export * from './autoCompleteSuggestions.js'; -export * from './availableDashboardGadget.js'; -export * from './availableDashboardGadgetsResponse.js'; -export * from './avatar.js'; -export * from './avatars.js'; -export * from './avatarUrls.js'; -export * from './avatarWithDetails.js'; -export * from './bulkChangeOwnerDetails.js'; -export * from './bulkCustomFieldOptionCreateRequest.js'; -export * from './bulkCustomFieldOptionUpdateRequest.js'; -export * from './bulkEditShareableEntity.js'; -export * from './bulkIssueIsWatching.js'; -export * from './bulkIssuePropertyUpdateRequest.js'; -export * from './bulkOperationErrorResult.js'; -export * from './bulkPermissionGrants.js'; -export * from './bulkPermissionsRequest.js'; -export * from './bulkProjectPermissionGrants.js'; -export * from './bulkProjectPermissions.js'; -export * from './changeDetails.js'; -export * from './changedValue.js'; -export * from './changedWorklog.js'; -export * from './changedWorklogs.js'; -export * from './changelog.js'; -export * from './columnItem.js'; -export * from './comment.js'; -export * from './componentIssuesCount.js'; -export * from './componentWithIssueCount.js'; -export * from './configuration.js'; -export * from './connectCustomFieldValue.js'; -export * from './connectCustomFieldValues.js'; -export * from './connectModule.js'; -export * from './connectModules.js'; -export * from './connectWorkflowTransitionRule.js'; -export * from './containerForProjectFeatures.js'; -export * from './containerForRegisteredWebhooks.js'; -export * from './containerForWebhookIDs.js'; -export * from './containerOfWorkflowSchemeAssociations.js'; -export * from './contextForProjectAndIssueType.js'; -export * from './contextualConfiguration.js'; -export * from './convertedJQLQueries.js'; -export * from './createCustomFieldContext.js'; -export * from './createdIssue.js'; -export * from './createdIssues.js'; -export * from './createIssueSecuritySchemeDetails.js'; -export * from './createNotificationSchemeDetails.js'; -export * from './createPriorityDetails.js'; -export * from './createProjectDetails.js'; -export * from './createResolutionDetails.js'; -export * from './createUiModificationDetails.js'; -export * from './createUpdateRoleRequest.js'; -export * from './createWorkflowCondition.js'; -export * from './createWorkflowDetails.js'; -export * from './createWorkflowStatusDetails.js'; -export * from './createWorkflowTransitionDetails.js'; -export * from './createWorkflowTransitionRule.js'; -export * from './createWorkflowTransitionRulesDetails.js'; -export * from './createWorkflowTransitionScreenDetails.js'; -export * from './customContextVariable.js'; -export * from './customFieldConfigurations.js'; -export * from './customFieldContext.js'; -export * from './customFieldContextDefaultValue.js'; -export * from './customFieldContextDefaultValueUpdate.js'; -export * from './customFieldContextOption.js'; -export * from './customFieldContextProjectMapping.js'; -export * from './customFieldContextUpdateDetails.js'; -export * from './customFieldCreatedContextOptionsList.js'; -export * from './customFieldDefinitionJson.js'; -export * from './customFieldOption.js'; -export * from './customFieldOptionCreate.js'; -export * from './customFieldOptionUpdate.js'; -export * from './customFieldReplacement.js'; -export * from './customFieldUpdatedContextOptionsList.js'; -export * from './customFieldValueUpdate.js'; -export * from './customFieldValueUpdateRequest.js'; -export * from './dashboard.js'; -export * from './dashboardDetails.js'; -export * from './dashboardGadget.js'; -export * from './dashboardGadgetPosition.js'; -export * from './dashboardGadgetResponse.js'; -export * from './dashboardGadgetSettings.js'; -export * from './dashboardGadgetUpdateRequest.js'; -export * from './dashboardUser.js'; -export * from './dateRangeFilter.js'; -export * from './defaultLevelValue.js'; -export * from './defaultShareScope.js'; -export * from './defaultWorkflow.js'; -export * from './deleteAndReplaceVersion.js'; -export * from './document.js'; -export * from './entityProperty.js'; -export * from './entityPropertyDetails.js'; -export * from './error.js'; -export * from './errorCollection.js'; -export * from './errors.js'; -export * from './eventNotification.js'; -export * from './exportArchivedIssuesTaskProgress.js'; -export * from './failedWebhook.js'; -export * from './failedWebhooks.js'; -export * from './field.js'; -export * from './fieldConfiguration.js'; -export * from './fieldConfigurationDetails.js'; -export * from './fieldConfigurationIssueTypeItem.js'; -export * from './fieldConfigurationItem.js'; -export * from './fieldConfigurationItemsDetails.js'; -export * from './fieldConfigurationScheme.js'; -export * from './fieldConfigurationSchemeProjectAssociation.js'; -export * from './fieldConfigurationSchemeProjects.js'; -export * from './fieldConfigurationToIssueTypeMapping.js'; -export * from './fieldDetails.js'; -export * from './fieldLastUsed.js'; -export * from './fieldReferenceData.js'; -export * from './fields.js'; -export * from './filter.js'; -export * from './filterDetails.js'; -export * from './filterSubscription.js'; -export * from './filterSubscriptionsList.js'; -export * from './fixVersion.js'; -export * from './foundGroup.js'; -export * from './foundGroups.js'; -export * from './foundUsers.js'; -export * from './foundUsersAndGroups.js'; -export * from './functionReferenceData.js'; -export * from './globalScope.js'; -export * from './group.js'; -export * from './groupDetails.js'; -export * from './groupLabel.js'; -export * from './groupName.js'; -export * from './hierarchy.js'; -export * from './hierarchyLevel.js'; -export * from './historyMetadata.js'; -export * from './historyMetadataParticipant.js'; -export * from './icon.js'; -export * from './id.js'; -export * from './idOrKey.js'; -export * from './includedFields.js'; -export * from './index.js'; -export * from './issue.js'; -export * from './issueArchivalSync.js'; -export * from './issueArchivalSyncRequest.js'; -export * from './issueChangelogIds.js'; -export * from './issueCommentListRequest.js'; -export * from './issueCreateMetadata.js'; -export * from './issueEntityProperties.js'; -export * from './issueEntityPropertiesForMultiUpdate.js'; -export * from './issueEvent.js'; -export * from './issueFieldOption.js'; -export * from './issueFieldOptionConfiguration.js'; -export * from './issueFieldOptionCreate.js'; -export * from './issueFieldOptionScope.js'; -export * from './issueFilterForBulkPropertyDelete.js'; -export * from './issueFilterForBulkPropertySet.js'; -export * from './issueLink.js'; -export * from './issueLinkType.js'; -export * from './issueLinkTypes.js'; -export * from './issueList.js'; -export * from './issueMatches.js'; -export * from './issueMatchesForJQL.js'; -export * from './issuePickerSuggestions.js'; -export * from './issuePickerSuggestionsIssueType.js'; -export * from './issuesAndJQLQueries.js'; -export * from './issueSecurityLevelMember.js'; -export * from './issueSecuritySchemeToProjectMapping.js'; -export * from './issuesJqlMetaData.js'; -export * from './issuesMeta.js'; -export * from './issuesUpdate.js'; -export * from './issueTransition.js'; -export * from './issueTypeCreate.js'; -export * from './issueTypeDetails.js'; -export * from './issueTypeIds.js'; -export * from './issueTypeIdsToRemove.js'; -export * from './issueTypeInfo.js'; -export * from './issueTypeIssueCreateMetadata.js'; -export * from './issueTypeScheme.js'; -export * from './issueTypeSchemeDetails.js'; -export * from './issueTypeSchemeID.js'; -export * from './issueTypeSchemeMapping.js'; -export * from './issueTypeSchemeProjectAssociation.js'; -export * from './issueTypeSchemeProjects.js'; -export * from './issueTypeSchemeUpdateDetails.js'; -export * from './issueTypeScreenScheme.js'; -export * from './issueTypeScreenSchemeDetails.js'; -export * from './issueTypeScreenSchemeId.js'; -export * from './issueTypeScreenSchemeItem.js'; -export * from './issueTypeScreenSchemeMapping.js'; -export * from './issueTypeScreenSchemeMappingDetails.js'; -export * from './issueTypeScreenSchemeProjectAssociation.js'; -export * from './issueTypeScreenSchemesProjects.js'; -export * from './issueTypeScreenSchemeUpdateDetails.js'; -export * from './issueTypesWorkflowMapping.js'; -export * from './issueTypeToContextMapping.js'; -export * from './issueTypeUpdate.js'; -export * from './issueTypeWithStatus.js'; -export * from './issueTypeWorkflowMapping.js'; -export * from './issueUpdateDetails.js'; -export * from './issueUpdateMetadata.js'; -export * from './jexpIssues.js'; -export * from './jexpJqlIssues.js'; -export * from './jiraExpressionAnalysis.js'; -export * from './jiraExpressionComplexity.js'; -export * from './jiraExpressionEvalContext.js'; -export * from './jiraExpressionEvalRequest.js'; -export * from './jiraExpressionEvaluationMetaData.js'; -export * from './jiraExpressionForAnalysis.js'; -export * from './jiraExpressionResult.js'; -export * from './jiraExpressionsAnalysis.js'; -export * from './jiraExpressionsComplexity.js'; -export * from './jiraExpressionsComplexityValue.js'; -export * from './jiraExpressionValidationError.js'; -export * from './jiraStatus.js'; -export * from './jqlFunctionPrecomputation.js'; -export * from './jqlFunctionPrecomputationUpdate.js'; -export * from './jqlFunctionPrecomputationUpdateRequest.js'; -export * from './jQLPersonalDataMigrationRequest.js'; -export * from './jqlQueriesToParse.js'; -export * from './jqlQueriesToSanitize.js'; -export * from './jqlQuery.js'; -export * from './jqlQueryClause.js'; -export * from './jqlQueryField.js'; -export * from './jqlQueryFieldEntityProperty.js'; -export * from './jqlQueryOrderByClause.js'; -export * from './jqlQueryOrderByClauseElement.js'; -export * from './jqlQueryToSanitize.js'; -export * from './jQLQueryWithUnknownUsers.js'; -export * from './jQLReferenceData.js'; -export * from './jsonType.js'; -export * from './license.js'; -export * from './licensedApplication.js'; -export * from './licenseMetric.js'; -export * from './linkedIssue.js'; -export * from './linkGroup.js'; -export * from './linkIssueRequestJson.js'; -export * from './listWrapperCallbackApplicationRole.js'; -export * from './listWrapperCallbackGroupName.js'; -export * from './locale.js'; -export * from './mark.js'; -export * from './moveField.js'; -export * from './multiIssueEntityProperties.js'; -export * from './multipleCustomFieldValuesUpdate.js'; -export * from './multipleCustomFieldValuesUpdateDetails.js'; -export * from './nestedResponse.js'; -export * from './newUserDetails.js'; -export * from './notification.js'; -export * from './notificationEvent.js'; -export * from './notificationRecipients.js'; -export * from './notificationRecipientsRestrictions.js'; -export * from './notificationScheme.js'; -export * from './notificationSchemeAndProjectMapping.js'; -export * from './notificationSchemeAndProjectMappingPage.js'; -export * from './notificationSchemeEvent.js'; -export * from './notificationSchemeEventDetails.js'; -export * from './notificationSchemeEventTypeId.js'; -export * from './notificationSchemeId.js'; -export * from './notificationSchemeNotificationDetails.js'; -export * from './oldToNewSecurityLevelMappings.js'; -export * from './operationMessage.js'; -export * from './operations.js'; -export * from './orderOfCustomFieldOptions.js'; -export * from './orderOfIssueTypes.js'; -export * from './pageBeanFieldConfigurationDetails.js'; -export * from './pageChangelog.js'; -export * from './pageComment.js'; -export * from './pageComponentWithIssueCount.js'; -export * from './pageContextForProjectAndIssueType.js'; -export * from './pageContextualConfiguration.js'; -export * from './pageCustomFieldContext.js'; -export * from './pageCustomFieldContextDefaultValue.js'; -export * from './pageCustomFieldContextOption.js'; -export * from './pageCustomFieldContextProjectMapping.js'; -export * from './pageDashboard.js'; -export * from './pagedListUserDetailsApplicationUser.js'; -export * from './pageField.js'; -export * from './pageFieldConfigurationIssueTypeItem.js'; -export * from './pageFieldConfigurationItem.js'; -export * from './pageFieldConfigurationScheme.js'; -export * from './pageFieldConfigurationSchemeProjects.js'; -export * from './pageFilterDetails.js'; -export * from './pageGroupDetails.js'; -export * from './pageIssueFieldOption.js'; -export * from './pageIssueSecurityLevelMember.js'; -export * from './pageIssueSecuritySchemeToProjectMapping.js'; -export * from './pageIssueTypeScheme.js'; -export * from './pageIssueTypeSchemeMapping.js'; -export * from './pageIssueTypeSchemeProjects.js'; -export * from './pageIssueTypeScreenScheme.js'; -export * from './pageIssueTypeScreenSchemeItem.js'; -export * from './pageIssueTypeScreenSchemesProjects.js'; -export * from './pageIssueTypeToContextMapping.js'; -export * from './pageJqlFunctionPrecomputation.js'; -export * from './pageNotificationScheme.js'; -export * from './pageOfChangelogs.js'; -export * from './pageOfComments.js'; -export * from './pageOfDashboards.js'; -export * from './pageOfStatuses.js'; -export * from './pageOfWorklogs.js'; -export * from './pagePriority.js'; -export * from './pageProject.js'; -export * from './pageProjectDetails.js'; -export * from './pageResolution.js'; -export * from './pageScreen.js'; -export * from './pageScreenScheme.js'; -export * from './pageScreenWithTab.js'; -export * from './pageSecurityLevel.js'; -export * from './pageSecurityLevelMember.js'; -export * from './pageSecuritySchemeWithProjects.js'; -export * from './pageString.js'; -export * from './pageUiModificationDetails.js'; -export * from './pageUser.js'; -export * from './pageUserDetails.js'; -export * from './pageUserKey.js'; -export * from './pageVersion.js'; -export * from './pageWebhook.js'; -export * from './pageWorkflow.js'; -export * from './pageWorkflowScheme.js'; -export * from './pageWorkflowTransitionRules.js'; -export * from './parsedJqlQueries.js'; -export * from './parsedJqlQuery.js'; -export * from './permissionDetails.js'; -export * from './permissionGrant.js'; -export * from './permissionGrants.js'; -export * from './permissionHolder.js'; -export * from './permissions.js'; -export * from './permissionScheme.js'; -export * from './permissionSchemes.js'; -export * from './permissionsKeys.js'; -export * from './permittedProjects.js'; -export * from './priority.js'; -export * from './priorityId.js'; -export * from './project.js'; -export * from './projectAvatars.js'; -export * from './projectCategory.js'; -export * from './projectComponent.js'; -export * from './projectDetails.js'; -export * from './projectEmailAddress.js'; -export * from './projectFeature.js'; -export * from './projectFeatureToggleRequest.js'; -export * from './projectId.js'; -export * from './projectIdentifier.js'; -export * from './projectIdentifiers.js'; -export * from './projectIds.js'; -export * from './projectInsight.js'; -export * from './projectIssueCreateMetadata.js'; -export * from './projectIssueSecurityLevels.js'; -export * from './projectIssueTypeHierarchy.js'; -export * from './projectIssueTypeMapping.js'; -export * from './projectIssueTypeMappings.js'; -export * from './projectIssueTypes.js'; -export * from './projectIssueTypesHierarchyLevel.js'; -export * from './projectLandingPageInfo.js'; -export * from './projectPermissions.js'; -export * from './projectRole.js'; -export * from './projectRoleActorsUpdate.js'; -export * from './projectRoleDetails.js'; -export * from './projectRoleGroup.js'; -export * from './projectRoleUser.js'; -export * from './projectScope.js'; -export * from './projectType.js'; -export * from './propertyKey.js'; -export * from './propertyKeys.js'; -export * from './publishedWorkflowId.js'; -export * from './registeredWebhook.js'; -export * from './remoteIssueLink.js'; -export * from './remoteIssueLinkIdentifies.js'; -export * from './remoteIssueLinkRequest.js'; -export * from './remoteObject.js'; -export * from './removeOptionFromIssuesResult.js'; -export * from './reorderIssuePriorities.js'; -export * from './reorderIssueResolutionsRequest.js'; -export * from './resolution.js'; -export * from './resolutionId.js'; -export * from './restrictedPermission.js'; -export * from './richText.js'; -export * from './roleActor.js'; -export * from './ruleConfiguration.js'; -export * from './sanitizedJqlQueries.js'; -export * from './sanitizedJqlQuery.js'; -export * from './scope.js'; -export * from './screen.js'; -export * from './screenableField.js'; -export * from './screenableTab.js'; -export * from './screenDetails.js'; -export * from './screenID.js'; -export * from './screenScheme.js'; -export * from './screenSchemeDetails.js'; -export * from './screenSchemeId.js'; -export * from './screenTypes.js'; -export * from './screenWithTab.js'; -export * from './searchAutoCompleteFilter.js'; -export * from './searchRequest.js'; -export * from './searchResults.js'; -export * from './securityLevel.js'; -export * from './securityLevelMember.js'; -export * from './securityScheme.js'; -export * from './securitySchemeId.js'; -export * from './securitySchemeLevel.js'; -export * from './securitySchemeLevelMember.js'; -export * from './securitySchemeMembersRequest.js'; -export * from './securitySchemes.js'; -export * from './securitySchemeWithProjects.js'; -export * from './serverInformation.js'; -export * from './setDefaultLevelsRequest.js'; -export * from './setDefaultPriorityRequest.js'; -export * from './setDefaultResolutionRequest.js'; -export * from './sharePermission.js'; -export * from './sharePermissionInput.js'; -export * from './simpleApplicationProperty.js'; -export * from './simpleErrorCollection.js'; -export * from './simpleLink.js'; -export * from './simpleListWrapperApplicationRole.js'; -export * from './simpleListWrapperGroupName.js'; -export * from './status.js'; -export * from './statusCategory.js'; -export * from './statusCreate.js'; -export * from './statusCreateRequest.js'; -export * from './statusDetails.js'; -export * from './statusMapping.js'; -export * from './statusScope.js'; -export * from './statusUpdate.js'; -export * from './statusUpdateRequest.js'; -export * from './suggestedIssue.js'; -export * from './systemAvatars.js'; -export * from './taskProgressObject.js'; -export * from './taskProgressRemoveOptionFromIssuesResult.js'; -export * from './timeTrackingConfiguration.js'; -export * from './timeTrackingDetails.js'; -export * from './timeTrackingProvider.js'; -export * from './transition.js'; -export * from './transitions.js'; -export * from './uiModificationContextDetails.js'; -export * from './uiModificationDetails.js'; -export * from './uiModificationIdentifiers.js'; -export * from './unrestrictedUserEmail.js'; -export * from './updateCustomFieldDetails.js'; -export * from './updatedProjectCategory.js'; -export * from './updateFieldConfigurationSchemeDetails.js'; -export * from './updateIssueSecurityLevelDetails.js'; -export * from './updateIssueSecuritySchemeRequest.js'; -export * from './updateNotificationSchemeDetails.js'; -export * from './updatePriorityDetails.js'; -export * from './updateProjectDetails.js'; -export * from './updateResolutionDetails.js'; -export * from './updateScreenDetails.js'; -export * from './updateScreenSchemeDetails.js'; -export * from './updateScreenTypes.js'; -export * from './updateUiModificationDetails.js'; -export * from './updateUserToGroup.js'; -export * from './user.js'; -export * from './userAvatarUrls.js'; -export * from './userDetails.js'; -export * from './userKey.js'; -export * from './userList.js'; -export * from './userMigration.js'; -export * from './userPickerUser.js'; -export * from './version.js'; -export * from './versionIssueCounts.js'; -export * from './versionIssuesStatus.js'; -export * from './versionMove.js'; -export * from './versionUnresolvedIssuesCount.js'; -export * from './versionUsageInCustomField.js'; -export * from './visibility.js'; -export * from './votes.js'; -export * from './watchers.js'; -export * from './webhook.js'; -export * from './webhookDetails.js'; -export * from './webhookRegistrationDetails.js'; -export * from './webhooksExpirationDate.js'; -export * from './workflow.js'; -export * from './workflowCondition.js'; -export * from './workflowId.js'; -export * from './workflowOperations.js'; -export * from './workflowRules.js'; -export * from './workflowRulesSearch.js'; -export * from './workflowRulesSearchDetails.js'; -export * from './workflowScheme.js'; -export * from './workflowSchemeAssociations.js'; -export * from './workflowSchemeIdName.js'; -export * from './workflowSchemeProjectAssociation.js'; -export * from './workflowStatus.js'; -export * from './workflowStatusProperties.js'; -export * from './workflowsWithTransitionRulesDetails.js'; -export * from './workflowTransition.js'; -export * from './workflowTransitionProperty.js'; -export * from './workflowTransitionRule.js'; -export * from './workflowTransitionRules.js'; -export * from './workflowTransitionRulesDetails.js'; -export * from './workflowTransitionRulesUpdate.js'; -export * from './workflowTransitionRulesUpdateErrorDetails.js'; -export * from './workflowTransitionRulesUpdateErrors.js'; -export * from './worklog.js'; -export * from './worklogIdsRequest.js'; diff --git a/src/version3/models/issue.mts b/src/version3/models/issue.mts new file mode 100644 index 000000000..7cb3183a5 --- /dev/null +++ b/src/version3/models/issue.mts @@ -0,0 +1,35 @@ +import { Fields } from './fields.mjs'; +import { IncludedFields } from './includedFields.mjs'; +import type { IssueTransition } from './issueTransition.mjs'; +import { IssueUpdateMetadata } from './issueUpdateMetadata.mjs'; +import { Operations } from './operations.mjs'; +import { PageOfChangelogs } from './pageOfChangelogs.mjs'; + +/** Details about an issue. */ +export interface Issue { + /** Expand options that include additional issue details in the response. */ + expand?: string; + /** The ID of the issue. */ + id: string; + /** The URL of the issue details. */ + self?: string; + /** The key of the issue. */ + key: string; + /** The rendered value of each field present on the issue. */ + renderedFields?: {}; + /** Details of the issue properties identified in the request. */ + properties?: {}; + /** The ID and name of each field present on the issue. */ + names?: {}; + /** The schema describing each field present on the issue. */ + schema?: {}; + /** The transitions that can be performed on the issue. */ + transitions?: IssueTransition[]; + operations?: Operations; + editmeta?: IssueUpdateMetadata; + changelog?: PageOfChangelogs; + /** The versions of each field on the issue. */ + versionedRepresentations?: {}; + fieldsToInclude?: IncludedFields; + fields: Fields; +} diff --git a/src/version3/models/issue.ts b/src/version3/models/issue.ts deleted file mode 100644 index 97ed15b94..000000000 --- a/src/version3/models/issue.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { Fields } from './fields.js'; -import type { IncludedFields } from './includedFields.js'; -import type { IssueTransition } from './issueTransition.js'; -import type { IssueUpdateMetadata } from './issueUpdateMetadata.js'; -import type { Operations } from './operations.js'; -import type { PageOfChangelogs } from './pageOfChangelogs.js'; - -/** Details about an issue. */ -export interface Issue { - /** Expand options that include additional issue details in the response. */ - expand?: string; - /** The ID of the issue. */ - id: string; - /** The URL of the issue details. */ - self?: string; - /** The key of the issue. */ - key: string; - /** The rendered value of each field present on the issue. */ - renderedFields?: {}; - /** Details of the issue properties identified in the request. */ - properties?: {}; - /** The ID and name of each field present on the issue. */ - names?: {}; - /** The schema describing each field present on the issue. */ - schema?: {}; - /** The transitions that can be performed on the issue. */ - transitions?: IssueTransition[]; - operations?: Operations; - editmeta?: IssueUpdateMetadata; - changelog?: PageOfChangelogs; - /** The versions of each field on the issue. */ - versionedRepresentations?: {}; - fieldsToInclude?: IncludedFields; - fields: Fields; -} diff --git a/src/version3/models/issueArchivalSync.mts b/src/version3/models/issueArchivalSync.mts new file mode 100644 index 000000000..f9277fa1f --- /dev/null +++ b/src/version3/models/issueArchivalSync.mts @@ -0,0 +1,7 @@ +import { Errors } from './errors.mjs'; + +/** Number of archived/unarchived issues and list of errors that occurred during the action, if any. */ +export interface IssueArchivalSync { + errors?: Errors; + numberOfIssuesUpdated?: number; +} diff --git a/src/version3/models/issueArchivalSync.ts b/src/version3/models/issueArchivalSync.ts deleted file mode 100644 index 3151f6413..000000000 --- a/src/version3/models/issueArchivalSync.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Errors } from './errors.js'; - -/** Number of archived/unarchived issues and list of errors that occurred during the action, if any. */ -export interface IssueArchivalSync { - errors?: Errors; - numberOfIssuesUpdated?: number; -} diff --git a/src/version3/models/issueArchivalSyncRequest.ts b/src/version3/models/issueArchivalSyncRequest.mts similarity index 100% rename from src/version3/models/issueArchivalSyncRequest.ts rename to src/version3/models/issueArchivalSyncRequest.mts diff --git a/src/version3/models/issueChangelogIds.ts b/src/version3/models/issueChangelogIds.mts similarity index 100% rename from src/version3/models/issueChangelogIds.ts rename to src/version3/models/issueChangelogIds.mts diff --git a/src/version3/models/issueCommentListRequest.ts b/src/version3/models/issueCommentListRequest.mts similarity index 100% rename from src/version3/models/issueCommentListRequest.ts rename to src/version3/models/issueCommentListRequest.mts diff --git a/src/version3/models/issueCreateMetadata.mts b/src/version3/models/issueCreateMetadata.mts new file mode 100644 index 000000000..38cebd5da --- /dev/null +++ b/src/version3/models/issueCreateMetadata.mts @@ -0,0 +1,9 @@ +import { ProjectIssueCreateMetadata } from './projectIssueCreateMetadata.mjs'; + +/** The wrapper for the issue creation metadata for a list of projects. */ +export interface IssueCreateMetadata { + /** Expand options that include additional project details in the response. */ + expand?: string; + /** List of projects and their issue creation metadata. */ + projects?: ProjectIssueCreateMetadata[]; +} diff --git a/src/version3/models/issueCreateMetadata.ts b/src/version3/models/issueCreateMetadata.ts deleted file mode 100644 index 3cebe89b2..000000000 --- a/src/version3/models/issueCreateMetadata.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ProjectIssueCreateMetadata } from './projectIssueCreateMetadata.js'; - -/** The wrapper for the issue creation metadata for a list of projects. */ -export interface IssueCreateMetadata { - /** Expand options that include additional project details in the response. */ - expand?: string; - /** List of projects and their issue creation metadata. */ - projects?: ProjectIssueCreateMetadata[]; -} diff --git a/src/version3/models/issueEntityProperties.ts b/src/version3/models/issueEntityProperties.mts similarity index 100% rename from src/version3/models/issueEntityProperties.ts rename to src/version3/models/issueEntityProperties.mts diff --git a/src/version3/models/issueEntityPropertiesForMultiUpdate.ts b/src/version3/models/issueEntityPropertiesForMultiUpdate.mts similarity index 100% rename from src/version3/models/issueEntityPropertiesForMultiUpdate.ts rename to src/version3/models/issueEntityPropertiesForMultiUpdate.mts diff --git a/src/version3/models/issueEvent.ts b/src/version3/models/issueEvent.mts similarity index 100% rename from src/version3/models/issueEvent.ts rename to src/version3/models/issueEvent.mts diff --git a/src/version3/models/issueFieldOption.mts b/src/version3/models/issueFieldOption.mts new file mode 100644 index 000000000..f75dd6f62 --- /dev/null +++ b/src/version3/models/issueFieldOption.mts @@ -0,0 +1,17 @@ +import { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration.mjs'; + +/** Details of the options for a select list issue field. */ +export interface IssueFieldOption { + /** The unique identifier for the option. This is only unique within the select field's set of options. */ + id: number; + /** The option's name, which is displayed in Jira. */ + value: string; + /** + * The properties of the object, as arbitrary key-value pairs. These properties can be searched using Jql, if the + * extractions (see [Issue Field Option Property + * Index](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/)) are defined + * in the descriptor for the issue field module. + */ + properties?: {}; + config?: IssueFieldOptionConfiguration; +} diff --git a/src/version3/models/issueFieldOption.ts b/src/version3/models/issueFieldOption.ts deleted file mode 100644 index aaa70af2e..000000000 --- a/src/version3/models/issueFieldOption.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration.js'; - -/** Details of the options for a select list issue field. */ -export interface IssueFieldOption { - /** The unique identifier for the option. This is only unique within the select field's set of options. */ - id: number; - /** The option's name, which is displayed in Jira. */ - value: string; - /** - * The properties of the object, as arbitrary key-value pairs. These properties can be searched using JQL, if the - * extractions (see [Issue Field Option Property - * Index](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/)) are defined - * in the descriptor for the issue field module. - */ - properties?: {}; - config?: IssueFieldOptionConfiguration; -} diff --git a/src/version3/models/issueFieldOptionConfiguration.mts b/src/version3/models/issueFieldOptionConfiguration.mts new file mode 100644 index 000000000..0b49ac3e4 --- /dev/null +++ b/src/version3/models/issueFieldOptionConfiguration.mts @@ -0,0 +1,6 @@ +import { IssueFieldOptionScope } from './issueFieldOptionScope.mjs'; + +/** Details of the projects the option is available in. */ +export interface IssueFieldOptionConfiguration { + scope?: IssueFieldOptionScope; +} diff --git a/src/version3/models/issueFieldOptionConfiguration.ts b/src/version3/models/issueFieldOptionConfiguration.ts deleted file mode 100644 index d1b44374f..000000000 --- a/src/version3/models/issueFieldOptionConfiguration.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueFieldOptionScope } from './issueFieldOptionScope.js'; - -/** Details of the projects the option is available in. */ -export interface IssueFieldOptionConfiguration { - scope?: IssueFieldOptionScope; -} diff --git a/src/version3/models/issueFieldOptionCreate.mts b/src/version3/models/issueFieldOptionCreate.mts new file mode 100644 index 000000000..8c41d0f45 --- /dev/null +++ b/src/version3/models/issueFieldOptionCreate.mts @@ -0,0 +1,13 @@ +import { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration.mjs'; + +export interface IssueFieldOptionCreate { + /** The option's name, which is displayed in Jira. */ + value: string; + /** + * The properties of the option as arbitrary key-value pairs. These properties can be searched using Jql, if the + * extractions (see https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/) + * are defined in the descriptor for the issue field module. + */ + properties?: {}; + config?: IssueFieldOptionConfiguration; +} diff --git a/src/version3/models/issueFieldOptionCreate.ts b/src/version3/models/issueFieldOptionCreate.ts deleted file mode 100644 index 8d2368b9e..000000000 --- a/src/version3/models/issueFieldOptionCreate.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration.js'; - -export interface IssueFieldOptionCreate { - /** The option's name, which is displayed in Jira. */ - value: string; - /** - * The properties of the option as arbitrary key-value pairs. These properties can be searched using JQL, if the - * extractions (see https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/) - * are defined in the descriptor for the issue field module. - */ - properties?: {}; - config?: IssueFieldOptionConfiguration; -} diff --git a/src/version3/models/issueFieldOptionScope.mts b/src/version3/models/issueFieldOptionScope.mts new file mode 100644 index 000000000..c2b39e8a7 --- /dev/null +++ b/src/version3/models/issueFieldOptionScope.mts @@ -0,0 +1,12 @@ +import { GlobalScope } from './globalScope.mjs'; +import { ProjectScope } from './projectScope.mjs'; + +export interface IssueFieldOptionScope { + /** + * Defines the projects in which the option is available and the behavior of the option within each project. Specify + * one object per project. The behavior of the option in a project context overrides the behavior in the global + * context. + */ + projects2?: ProjectScope[]; + global?: GlobalScope; +} diff --git a/src/version3/models/issueFieldOptionScope.ts b/src/version3/models/issueFieldOptionScope.ts deleted file mode 100644 index 4293c331b..000000000 --- a/src/version3/models/issueFieldOptionScope.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { GlobalScope } from './globalScope.js'; -import type { ProjectScope } from './projectScope.js'; - -export interface IssueFieldOptionScope { - /** - * Defines the projects in which the option is available and the behavior of the option within each project. Specify - * one object per project. The behavior of the option in a project context overrides the behavior in the global - * context. - */ - projects2?: ProjectScope[]; - global?: GlobalScope; -} diff --git a/src/version3/models/issueFilterForBulkPropertyDelete.ts b/src/version3/models/issueFilterForBulkPropertyDelete.mts similarity index 100% rename from src/version3/models/issueFilterForBulkPropertyDelete.ts rename to src/version3/models/issueFilterForBulkPropertyDelete.mts diff --git a/src/version3/models/issueFilterForBulkPropertySet.ts b/src/version3/models/issueFilterForBulkPropertySet.mts similarity index 100% rename from src/version3/models/issueFilterForBulkPropertySet.ts rename to src/version3/models/issueFilterForBulkPropertySet.mts diff --git a/src/version3/models/issueLink.mts b/src/version3/models/issueLink.mts new file mode 100644 index 000000000..7c7a0e8bc --- /dev/null +++ b/src/version3/models/issueLink.mts @@ -0,0 +1,13 @@ +import { IssueLinkType } from './issueLinkType.mjs'; +import { LinkedIssue } from './linkedIssue.mjs'; + +/** Details of a link between issues. */ +export interface IssueLink { + /** The ID of the issue link. */ + id?: string; + /** The URL of the issue link. */ + self?: string; + type?: IssueLinkType; + inwardIssue?: LinkedIssue; + outwardIssue?: LinkedIssue; +} diff --git a/src/version3/models/issueLink.ts b/src/version3/models/issueLink.ts deleted file mode 100644 index 21fde5924..000000000 --- a/src/version3/models/issueLink.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { IssueLinkType } from './issueLinkType.js'; -import type { LinkedIssue } from './linkedIssue.js'; - -/** Details of a link between issues. */ -export interface IssueLink { - /** The ID of the issue link. */ - id?: string; - /** The URL of the issue link. */ - self?: string; - type?: IssueLinkType; - inwardIssue?: LinkedIssue; - outwardIssue?: LinkedIssue; -} diff --git a/src/version3/models/issueLinkType.ts b/src/version3/models/issueLinkType.mts similarity index 100% rename from src/version3/models/issueLinkType.ts rename to src/version3/models/issueLinkType.mts diff --git a/src/version3/models/issueLinkTypes.mts b/src/version3/models/issueLinkTypes.mts new file mode 100644 index 000000000..696252c57 --- /dev/null +++ b/src/version3/models/issueLinkTypes.mts @@ -0,0 +1,7 @@ +import { IssueLinkType } from './issueLinkType.mjs'; + +/** A list of issue link type beans. */ +export interface IssueLinkTypes { + /** The issue link type bean. */ + issueLinkTypes?: IssueLinkType[]; +} diff --git a/src/version3/models/issueLinkTypes.ts b/src/version3/models/issueLinkTypes.ts deleted file mode 100644 index a9a9b4441..000000000 --- a/src/version3/models/issueLinkTypes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IssueLinkType } from './issueLinkType.js'; - -/** A list of issue link type beans. */ -export interface IssueLinkTypes { - /** The issue link type bean. */ - issueLinkTypes?: IssueLinkType[]; -} diff --git a/src/version3/models/issueList.ts b/src/version3/models/issueList.mts similarity index 100% rename from src/version3/models/issueList.ts rename to src/version3/models/issueList.mts diff --git a/src/version3/models/issueMatches.mts b/src/version3/models/issueMatches.mts new file mode 100644 index 000000000..2dea52f98 --- /dev/null +++ b/src/version3/models/issueMatches.mts @@ -0,0 +1,6 @@ +import { IssueMatchesForJQL } from './issueMatchesForJQL.mjs'; + +/** A list of matched issues or errors for each Jql query, in the order the Jql queries were passed. */ +export interface IssueMatches { + matches: IssueMatchesForJQL[]; +} diff --git a/src/version3/models/issueMatches.ts b/src/version3/models/issueMatches.ts deleted file mode 100644 index 5c4421961..000000000 --- a/src/version3/models/issueMatches.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueMatchesForJQL } from './issueMatchesForJQL.js'; - -/** A list of matched issues or errors for each JQL query, in the order the JQL queries were passed. */ -export interface IssueMatches { - matches: IssueMatchesForJQL[]; -} diff --git a/src/version3/models/issueMatchesForJQL.mts b/src/version3/models/issueMatchesForJQL.mts new file mode 100644 index 000000000..574a4e4ce --- /dev/null +++ b/src/version3/models/issueMatchesForJQL.mts @@ -0,0 +1,7 @@ +/** A list of the issues matched to a Jql query or details of errors encountered during matching. */ +export interface IssueMatchesForJQL { + /** A list of issue IDs. */ + matchedIssues: number[]; + /** A list of errors. */ + errors: string[]; +} diff --git a/src/version3/models/issueMatchesForJQL.ts b/src/version3/models/issueMatchesForJQL.ts deleted file mode 100644 index a50a51b13..000000000 --- a/src/version3/models/issueMatchesForJQL.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** A list of the issues matched to a JQL query or details of errors encountered during matching. */ -export interface IssueMatchesForJQL { - /** A list of issue IDs. */ - matchedIssues: number[]; - /** A list of errors. */ - errors: string[]; -} diff --git a/src/version3/models/issuePickerSuggestions.mts b/src/version3/models/issuePickerSuggestions.mts new file mode 100644 index 000000000..3c49bbd5f --- /dev/null +++ b/src/version3/models/issuePickerSuggestions.mts @@ -0,0 +1,7 @@ +import { IssuePickerSuggestionsIssueType } from './issuePickerSuggestionsIssueType.mjs'; + +/** A list of issues suggested for use in auto-completion. */ +export interface IssuePickerSuggestions { + /** A list of issues for an issue type suggested for use in auto-completion. */ + sections?: IssuePickerSuggestionsIssueType[]; +} diff --git a/src/version3/models/issuePickerSuggestions.ts b/src/version3/models/issuePickerSuggestions.ts deleted file mode 100644 index a448a8494..000000000 --- a/src/version3/models/issuePickerSuggestions.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IssuePickerSuggestionsIssueType } from './issuePickerSuggestionsIssueType.js'; - -/** A list of issues suggested for use in auto-completion. */ -export interface IssuePickerSuggestions { - /** A list of issues for an issue type suggested for use in auto-completion. */ - sections?: IssuePickerSuggestionsIssueType[]; -} diff --git a/src/version3/models/issuePickerSuggestionsIssueType.mts b/src/version3/models/issuePickerSuggestionsIssueType.mts new file mode 100644 index 000000000..8fa3047c7 --- /dev/null +++ b/src/version3/models/issuePickerSuggestionsIssueType.mts @@ -0,0 +1,15 @@ +import { SuggestedIssue } from './suggestedIssue.mjs'; + +/** A type of issue suggested for use in auto-completion. */ +export interface IssuePickerSuggestionsIssueType { + /** The label of the type of issues suggested for use in auto-completion. */ + label?: string; + /** If issue suggestions are found, returns a message indicating the number of issues suggestions found and returned. */ + sub?: string; + /** The ID of the type of issues suggested for use in auto-completion. */ + id?: string; + /** If no issue suggestions are found, returns a message indicating no suggestions were found, */ + msg?: string; + /** A list of issues suggested for use in auto-completion. */ + issues?: SuggestedIssue[]; +} diff --git a/src/version3/models/issuePickerSuggestionsIssueType.ts b/src/version3/models/issuePickerSuggestionsIssueType.ts deleted file mode 100644 index e5840fa4f..000000000 --- a/src/version3/models/issuePickerSuggestionsIssueType.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { SuggestedIssue } from './suggestedIssue.js'; - -/** A type of issue suggested for use in auto-completion. */ -export interface IssuePickerSuggestionsIssueType { - /** The label of the type of issues suggested for use in auto-completion. */ - label?: string; - /** If issue suggestions are found, returns a message indicating the number of issues suggestions found and returned. */ - sub?: string; - /** The ID of the type of issues suggested for use in auto-completion. */ - id?: string; - /** If no issue suggestions are found, returns a message indicating no suggestions were found, */ - msg?: string; - /** A list of issues suggested for use in auto-completion. */ - issues?: SuggestedIssue[]; -} diff --git a/src/version3/models/issueSecurityLevelMember.mts b/src/version3/models/issueSecurityLevelMember.mts new file mode 100644 index 000000000..50f0f8864 --- /dev/null +++ b/src/version3/models/issueSecurityLevelMember.mts @@ -0,0 +1,10 @@ +import type { PermissionHolder } from './permissionHolder.mjs'; + +/** Issue security level member. */ +export interface IssueSecurityLevelMember { + /** The ID of the issue security level member. */ + id: number; + /** The ID of the issue security level. */ + issueSecurityLevelId: number; + holder?: PermissionHolder; +} diff --git a/src/version3/models/issueSecurityLevelMember.ts b/src/version3/models/issueSecurityLevelMember.ts deleted file mode 100644 index 43ff96263..000000000 --- a/src/version3/models/issueSecurityLevelMember.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { PermissionHolder } from './permissionHolder.js'; - -/** Issue security level member. */ -export interface IssueSecurityLevelMember { - /** The ID of the issue security level member. */ - id: number; - /** The ID of the issue security level. */ - issueSecurityLevelId: number; - holder?: PermissionHolder; -} diff --git a/src/version3/models/issueSecuritySchemeToProjectMapping.ts b/src/version3/models/issueSecuritySchemeToProjectMapping.mts similarity index 100% rename from src/version3/models/issueSecuritySchemeToProjectMapping.ts rename to src/version3/models/issueSecuritySchemeToProjectMapping.mts diff --git a/src/version3/models/issueTransition.mts b/src/version3/models/issueTransition.mts new file mode 100644 index 000000000..c9b9cf107 --- /dev/null +++ b/src/version3/models/issueTransition.mts @@ -0,0 +1,28 @@ +import type { StatusDetails } from './statusDetails.mjs'; + +/** Details of an issue transition. */ +export interface IssueTransition { + /** The ID of the issue transition. Required when specifying a transition to undertake. */ + id?: string; + /** The name of the issue transition. */ + name?: string; + to?: StatusDetails; + /** Whether there is a screen associated with the issue transition. */ + hasScreen?: boolean; + /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ + isGlobal?: boolean; + /** Whether this is the initial issue transition for the workflow. */ + isInitial?: boolean; + /** Whether the transition is available to be performed. */ + isAvailable?: boolean; + /** Whether the issue has to meet criteria before the issue transition is applied. */ + isConditional?: boolean; + /** + * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and + * `update` in a transition request. + */ + fields?: {}; + /** Expand options that include additional transition details in the response. */ + expand?: string; + looped?: boolean; +} diff --git a/src/version3/models/issueTransition.ts b/src/version3/models/issueTransition.ts deleted file mode 100644 index cacddba1c..000000000 --- a/src/version3/models/issueTransition.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { StatusDetails } from './statusDetails.js'; - -/** Details of an issue transition. */ -export interface IssueTransition { - /** The ID of the issue transition. Required when specifying a transition to undertake. */ - id?: string; - /** The name of the issue transition. */ - name?: string; - to?: StatusDetails; - /** Whether there is a screen associated with the issue transition. */ - hasScreen?: boolean; - /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ - isGlobal?: boolean; - /** Whether this is the initial issue transition for the workflow. */ - isInitial?: boolean; - /** Whether the transition is available to be performed. */ - isAvailable?: boolean; - /** Whether the issue has to meet criteria before the issue transition is applied. */ - isConditional?: boolean; - /** - * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and - * `update` in a transition request. - */ - fields?: {}; - /** Expand options that include additional transition details in the response. */ - expand?: string; - looped?: boolean; -} diff --git a/src/version3/models/issueTypeCreate.ts b/src/version3/models/issueTypeCreate.mts similarity index 100% rename from src/version3/models/issueTypeCreate.ts rename to src/version3/models/issueTypeCreate.mts diff --git a/src/version3/models/issueTypeDetails.mts b/src/version3/models/issueTypeDetails.mts new file mode 100644 index 000000000..be08ff2ba --- /dev/null +++ b/src/version3/models/issueTypeDetails.mts @@ -0,0 +1,24 @@ +import type { Scope } from './scope.mjs'; + +/** Details about an issue type. */ +export interface IssueTypeDetails { + /** The URL of these issue type details. */ + self?: string; + /** The ID of the issue type. */ + id?: string; + /** The description of the issue type. */ + description?: string; + /** The URL of the issue type's avatar. */ + iconUrl?: string; + /** The name of the issue type. */ + name?: string; + /** Whether this issue type is used to create subtasks. */ + subtask?: boolean; + /** The ID of the issue type's avatar. */ + avatarId?: number; + /** Unique ID for next-gen projects. */ + entityId?: string; + /** Hierarchy level of the issue type. */ + hierarchyLevel?: number; + scope?: Scope; +} diff --git a/src/version3/models/issueTypeDetails.ts b/src/version3/models/issueTypeDetails.ts deleted file mode 100644 index 8bb38d58e..000000000 --- a/src/version3/models/issueTypeDetails.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { Scope } from './scope.js'; - -/** Details about an issue type. */ -export interface IssueTypeDetails { - /** The URL of these issue type details. */ - self?: string; - /** The ID of the issue type. */ - id?: string; - /** The description of the issue type. */ - description?: string; - /** The URL of the issue type's avatar. */ - iconUrl?: string; - /** The name of the issue type. */ - name?: string; - /** Whether this issue type is used to create subtasks. */ - subtask?: boolean; - /** The ID of the issue type's avatar. */ - avatarId?: number; - /** Unique ID for next-gen projects. */ - entityId?: string; - /** Hierarchy level of the issue type. */ - hierarchyLevel?: number; - scope?: Scope; -} diff --git a/src/version3/models/issueTypeIds.ts b/src/version3/models/issueTypeIds.mts similarity index 100% rename from src/version3/models/issueTypeIds.ts rename to src/version3/models/issueTypeIds.mts diff --git a/src/version3/models/issueTypeIdsToRemove.ts b/src/version3/models/issueTypeIdsToRemove.mts similarity index 100% rename from src/version3/models/issueTypeIdsToRemove.ts rename to src/version3/models/issueTypeIdsToRemove.mts diff --git a/src/version3/models/issueTypeInfo.ts b/src/version3/models/issueTypeInfo.mts similarity index 100% rename from src/version3/models/issueTypeInfo.ts rename to src/version3/models/issueTypeInfo.mts diff --git a/src/version3/models/issueTypeIssueCreateMetadata.mts b/src/version3/models/issueTypeIssueCreateMetadata.mts new file mode 100644 index 000000000..7e44ca18a --- /dev/null +++ b/src/version3/models/issueTypeIssueCreateMetadata.mts @@ -0,0 +1,28 @@ +import type { Scope } from './scope.mjs'; + +/** Details of the issue creation metadata for an issue type. */ +export interface IssueTypeIssueCreateMetadata { + /** The URL of these issue type details. */ + self?: string; + /** The ID of the issue type. */ + id?: string; + /** The description of the issue type. */ + description?: string; + /** The URL of the issue type's avatar. */ + iconUrl?: string; + /** The name of the issue type. */ + name?: string; + /** Whether this issue type is used to create subtasks. */ + subtask?: boolean; + /** The ID of the issue type's avatar. */ + avatarId?: number; + /** Unique ID for next-gen projects. */ + entityId?: string; + /** Hierarchy level of the issue type. */ + hierarchyLevel?: number; + scope?: Scope; + /** Expand options that include additional issue type metadata details in the response. */ + expand?: string; + /** List of the fields available when creating an issue for the issue type. */ + fields?: {}; +} diff --git a/src/version3/models/issueTypeIssueCreateMetadata.ts b/src/version3/models/issueTypeIssueCreateMetadata.ts deleted file mode 100644 index 9d10d5067..000000000 --- a/src/version3/models/issueTypeIssueCreateMetadata.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Scope } from './scope.js'; - -/** Details of the issue creation metadata for an issue type. */ -export interface IssueTypeIssueCreateMetadata { - /** The URL of these issue type details. */ - self?: string; - /** The ID of the issue type. */ - id?: string; - /** The description of the issue type. */ - description?: string; - /** The URL of the issue type's avatar. */ - iconUrl?: string; - /** The name of the issue type. */ - name?: string; - /** Whether this issue type is used to create subtasks. */ - subtask?: boolean; - /** The ID of the issue type's avatar. */ - avatarId?: number; - /** Unique ID for next-gen projects. */ - entityId?: string; - /** Hierarchy level of the issue type. */ - hierarchyLevel?: number; - scope?: Scope; - /** Expand options that include additional issue type metadata details in the response. */ - expand?: string; - /** List of the fields available when creating an issue for the issue type. */ - fields?: {}; -} diff --git a/src/version3/models/issueTypeScheme.ts b/src/version3/models/issueTypeScheme.mts similarity index 100% rename from src/version3/models/issueTypeScheme.ts rename to src/version3/models/issueTypeScheme.mts diff --git a/src/version3/models/issueTypeSchemeDetails.ts b/src/version3/models/issueTypeSchemeDetails.mts similarity index 100% rename from src/version3/models/issueTypeSchemeDetails.ts rename to src/version3/models/issueTypeSchemeDetails.mts diff --git a/src/version3/models/issueTypeSchemeID.ts b/src/version3/models/issueTypeSchemeID.mts similarity index 100% rename from src/version3/models/issueTypeSchemeID.ts rename to src/version3/models/issueTypeSchemeID.mts diff --git a/src/version3/models/issueTypeSchemeMapping.ts b/src/version3/models/issueTypeSchemeMapping.mts similarity index 100% rename from src/version3/models/issueTypeSchemeMapping.ts rename to src/version3/models/issueTypeSchemeMapping.mts diff --git a/src/version3/models/issueTypeSchemeProjectAssociation.ts b/src/version3/models/issueTypeSchemeProjectAssociation.mts similarity index 100% rename from src/version3/models/issueTypeSchemeProjectAssociation.ts rename to src/version3/models/issueTypeSchemeProjectAssociation.mts diff --git a/src/version3/models/issueTypeSchemeProjects.mts b/src/version3/models/issueTypeSchemeProjects.mts new file mode 100644 index 000000000..b975f1026 --- /dev/null +++ b/src/version3/models/issueTypeSchemeProjects.mts @@ -0,0 +1,8 @@ +import { IssueTypeScheme } from './issueTypeScheme.mjs'; + +/** Issue type scheme with a list of the projects that use it. */ +export interface IssueTypeSchemeProjects { + issueTypeScheme?: IssueTypeScheme; + /** The IDs of the projects using the issue type scheme. */ + projectIds: string[]; +} diff --git a/src/version3/models/issueTypeSchemeProjects.ts b/src/version3/models/issueTypeSchemeProjects.ts deleted file mode 100644 index ac0f50b74..000000000 --- a/src/version3/models/issueTypeSchemeProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypeScheme } from './issueTypeScheme.js'; - -/** Issue type scheme with a list of the projects that use it. */ -export interface IssueTypeSchemeProjects { - issueTypeScheme?: IssueTypeScheme; - /** The IDs of the projects using the issue type scheme. */ - projectIds: string[]; -} diff --git a/src/version3/models/issueTypeSchemeUpdateDetails.ts b/src/version3/models/issueTypeSchemeUpdateDetails.mts similarity index 100% rename from src/version3/models/issueTypeSchemeUpdateDetails.ts rename to src/version3/models/issueTypeSchemeUpdateDetails.mts diff --git a/src/version3/models/issueTypeScreenScheme.ts b/src/version3/models/issueTypeScreenScheme.mts similarity index 100% rename from src/version3/models/issueTypeScreenScheme.ts rename to src/version3/models/issueTypeScreenScheme.mts diff --git a/src/version3/models/issueTypeScreenSchemeDetails.mts b/src/version3/models/issueTypeScreenSchemeDetails.mts new file mode 100644 index 000000000..8c997c0c1 --- /dev/null +++ b/src/version3/models/issueTypeScreenSchemeDetails.mts @@ -0,0 +1,14 @@ +import { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping.mjs'; + +/** The details of an issue type screen scheme. */ +export interface IssueTypeScreenSchemeDetails { + /** The name of the issue type screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: string; + /** The description of the issue type screen scheme. The maximum length is 255 characters. */ + description?: string; + /** + * The IDs of the screen schemes for the issue type IDs and _default_. A _default_ entry is required to create an + * issue type screen scheme, it defines the mapping for all issue types without a screen scheme. + */ + issueTypeMappings: IssueTypeScreenSchemeMapping[]; +} diff --git a/src/version3/models/issueTypeScreenSchemeDetails.ts b/src/version3/models/issueTypeScreenSchemeDetails.ts deleted file mode 100644 index f84282511..000000000 --- a/src/version3/models/issueTypeScreenSchemeDetails.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping.js'; - -/** The details of an issue type screen scheme. */ -export interface IssueTypeScreenSchemeDetails { - /** The name of the issue type screen scheme. The name must be unique. The maximum length is 255 characters. */ - name: string; - /** The description of the issue type screen scheme. The maximum length is 255 characters. */ - description?: string; - /** - * The IDs of the screen schemes for the issue type IDs and _default_. A _default_ entry is required to create an - * issue type screen scheme, it defines the mapping for all issue types without a screen scheme. - */ - issueTypeMappings: IssueTypeScreenSchemeMapping[]; -} diff --git a/src/version3/models/issueTypeScreenSchemeId.ts b/src/version3/models/issueTypeScreenSchemeId.mts similarity index 100% rename from src/version3/models/issueTypeScreenSchemeId.ts rename to src/version3/models/issueTypeScreenSchemeId.mts diff --git a/src/version3/models/issueTypeScreenSchemeItem.ts b/src/version3/models/issueTypeScreenSchemeItem.mts similarity index 100% rename from src/version3/models/issueTypeScreenSchemeItem.ts rename to src/version3/models/issueTypeScreenSchemeItem.mts diff --git a/src/version3/models/issueTypeScreenSchemeMapping.ts b/src/version3/models/issueTypeScreenSchemeMapping.mts similarity index 100% rename from src/version3/models/issueTypeScreenSchemeMapping.ts rename to src/version3/models/issueTypeScreenSchemeMapping.mts diff --git a/src/version3/models/issueTypeScreenSchemeMappingDetails.mts b/src/version3/models/issueTypeScreenSchemeMappingDetails.mts new file mode 100644 index 000000000..b8d7f4d5f --- /dev/null +++ b/src/version3/models/issueTypeScreenSchemeMappingDetails.mts @@ -0,0 +1,10 @@ +import { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping.mjs'; + +/** A list of issue type screen scheme mappings. */ +export interface IssueTypeScreenSchemeMappingDetails { + /** + * The list of issue type to screen scheme mappings. A _default_ entry cannot be specified because a default entry is + * added when an issue type screen scheme is created. + */ + issueTypeMappings: IssueTypeScreenSchemeMapping[]; +} diff --git a/src/version3/models/issueTypeScreenSchemeMappingDetails.ts b/src/version3/models/issueTypeScreenSchemeMappingDetails.ts deleted file mode 100644 index db73374ac..000000000 --- a/src/version3/models/issueTypeScreenSchemeMappingDetails.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping.js'; - -/** A list of issue type screen scheme mappings. */ -export interface IssueTypeScreenSchemeMappingDetails { - /** - * The list of issue type to screen scheme mappings. A _default_ entry cannot be specified because a default entry is - * added when an issue type screen scheme is created. - */ - issueTypeMappings: IssueTypeScreenSchemeMapping[]; -} diff --git a/src/version3/models/issueTypeScreenSchemeProjectAssociation.ts b/src/version3/models/issueTypeScreenSchemeProjectAssociation.mts similarity index 100% rename from src/version3/models/issueTypeScreenSchemeProjectAssociation.ts rename to src/version3/models/issueTypeScreenSchemeProjectAssociation.mts diff --git a/src/version3/models/issueTypeScreenSchemeUpdateDetails.ts b/src/version3/models/issueTypeScreenSchemeUpdateDetails.mts similarity index 100% rename from src/version3/models/issueTypeScreenSchemeUpdateDetails.ts rename to src/version3/models/issueTypeScreenSchemeUpdateDetails.mts diff --git a/src/version3/models/issueTypeScreenSchemesProjects.mts b/src/version3/models/issueTypeScreenSchemesProjects.mts new file mode 100644 index 000000000..896e054ad --- /dev/null +++ b/src/version3/models/issueTypeScreenSchemesProjects.mts @@ -0,0 +1,8 @@ +import { IssueTypeScreenScheme } from './issueTypeScreenScheme.mjs'; + +/** Issue type screen scheme with a list of the projects that use it. */ +export interface IssueTypeScreenSchemesProjects { + issueTypeScreenScheme?: IssueTypeScreenScheme; + /** The IDs of the projects using the issue type screen scheme. */ + projectIds: string[]; +} diff --git a/src/version3/models/issueTypeScreenSchemesProjects.ts b/src/version3/models/issueTypeScreenSchemesProjects.ts deleted file mode 100644 index 8fe7e994b..000000000 --- a/src/version3/models/issueTypeScreenSchemesProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypeScreenScheme } from './issueTypeScreenScheme.js'; - -/** Issue type screen scheme with a list of the projects that use it. */ -export interface IssueTypeScreenSchemesProjects { - issueTypeScreenScheme?: IssueTypeScreenScheme; - /** The IDs of the projects using the issue type screen scheme. */ - projectIds: string[]; -} diff --git a/src/version3/models/issueTypeToContextMapping.ts b/src/version3/models/issueTypeToContextMapping.mts similarity index 100% rename from src/version3/models/issueTypeToContextMapping.ts rename to src/version3/models/issueTypeToContextMapping.mts diff --git a/src/version3/models/issueTypeUpdate.ts b/src/version3/models/issueTypeUpdate.mts similarity index 100% rename from src/version3/models/issueTypeUpdate.ts rename to src/version3/models/issueTypeUpdate.mts diff --git a/src/version3/models/issueTypeWithStatus.mts b/src/version3/models/issueTypeWithStatus.mts new file mode 100644 index 000000000..1fb3c216c --- /dev/null +++ b/src/version3/models/issueTypeWithStatus.mts @@ -0,0 +1,15 @@ +import type { StatusDetails } from './statusDetails.mjs'; + +/** Status details for an issue type. */ +export interface IssueTypeWithStatus { + /** The URL of the issue type's status details. */ + self: string; + /** The ID of the issue type. */ + id: string; + /** The name of the issue type. */ + name: string; + /** Whether this issue type represents subtasks. */ + subtask: boolean; + /** List of status details for the issue type. */ + statuses: StatusDetails[]; +} diff --git a/src/version3/models/issueTypeWithStatus.ts b/src/version3/models/issueTypeWithStatus.ts deleted file mode 100644 index db0b3fa53..000000000 --- a/src/version3/models/issueTypeWithStatus.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { StatusDetails } from './statusDetails.js'; - -/** Status details for an issue type. */ -export interface IssueTypeWithStatus { - /** The URL of the issue type's status details. */ - self: string; - /** The ID of the issue type. */ - id: string; - /** The name of the issue type. */ - name: string; - /** Whether this issue type represents subtasks. */ - subtask: boolean; - /** List of status details for the issue type. */ - statuses: StatusDetails[]; -} diff --git a/src/version3/models/issueTypeWorkflowMapping.ts b/src/version3/models/issueTypeWorkflowMapping.mts similarity index 100% rename from src/version3/models/issueTypeWorkflowMapping.ts rename to src/version3/models/issueTypeWorkflowMapping.mts diff --git a/src/version3/models/issueTypesWorkflowMapping.ts b/src/version3/models/issueTypesWorkflowMapping.mts similarity index 100% rename from src/version3/models/issueTypesWorkflowMapping.ts rename to src/version3/models/issueTypesWorkflowMapping.mts diff --git a/src/version3/models/issueUpdateDetails.mts b/src/version3/models/issueUpdateDetails.mts new file mode 100644 index 000000000..b6bca7e8c --- /dev/null +++ b/src/version3/models/issueUpdateDetails.mts @@ -0,0 +1,24 @@ +import type { Document } from './document.mjs'; +import { EntityProperty } from './entityProperty.mjs'; +import { Fields } from './fields.mjs'; +import { HistoryMetadata } from './historyMetadata.mjs'; +import type { IssueTransition } from './issueTransition.mjs'; + +/** Details of an issue update request. */ +export interface IssueUpdateDetails { + transition?: IssueTransition; + /** + * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field + * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are + * required, use `update`. Fields included in here cannot be included in `update`. + */ + fields?: Partial & { description: string | Document }> | any; + /** + * A Map containing the field field name and a list of operations to perform on the issue screen field. Note that + * fields included in here cannot be included in `fields`. + */ + update?: {}; + historyMetadata?: HistoryMetadata; + /** Details of issue properties to be add or update. */ + properties?: EntityProperty[]; +} diff --git a/src/version3/models/issueUpdateDetails.ts b/src/version3/models/issueUpdateDetails.ts deleted file mode 100644 index f9950a765..000000000 --- a/src/version3/models/issueUpdateDetails.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { Document } from './document.js'; -import type { EntityProperty } from './entityProperty.js'; -import type { Fields } from './fields.js'; -import type { HistoryMetadata } from './historyMetadata.js'; -import type { IssueTransition } from './issueTransition.js'; - -/** Details of an issue update request. */ -export interface IssueUpdateDetails { - transition?: IssueTransition; - /** - * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field - * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are - * required, use `update`. Fields included in here cannot be included in `update`. - */ - fields?: Partial & { description: string | Document }> | any; - /** - * A Map containing the field field name and a list of operations to perform on the issue screen field. Note that - * fields included in here cannot be included in `fields`. - */ - update?: {}; - historyMetadata?: HistoryMetadata; - /** Details of issue properties to be add or update. */ - properties?: EntityProperty[]; -} diff --git a/src/version3/models/issueUpdateMetadata.ts b/src/version3/models/issueUpdateMetadata.mts similarity index 100% rename from src/version3/models/issueUpdateMetadata.ts rename to src/version3/models/issueUpdateMetadata.mts diff --git a/src/version3/models/issuesAndJQLQueries.mts b/src/version3/models/issuesAndJQLQueries.mts new file mode 100644 index 000000000..b1992168b --- /dev/null +++ b/src/version3/models/issuesAndJQLQueries.mts @@ -0,0 +1,7 @@ +/** List of issues and Jql queries. */ +export interface IssuesAndJQLQueries { + /** A list of Jql queries. */ + jqls: string[]; + /** A list of issue IDs. */ + issueIds: number[]; +} diff --git a/src/version3/models/issuesAndJQLQueries.ts b/src/version3/models/issuesAndJQLQueries.ts deleted file mode 100644 index 9137c4b2b..000000000 --- a/src/version3/models/issuesAndJQLQueries.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** List of issues and JQL queries. */ -export interface IssuesAndJQLQueries { - /** A list of JQL queries. */ - jqls: string[]; - /** A list of issue IDs. */ - issueIds: number[]; -} diff --git a/src/version3/models/issuesJqlMetaData.mts b/src/version3/models/issuesJqlMetaData.mts new file mode 100644 index 000000000..9ecbd6188 --- /dev/null +++ b/src/version3/models/issuesJqlMetaData.mts @@ -0,0 +1,13 @@ +/** The description of the page of issues loaded by the provided Jql query. */ +export interface IssuesJqlMetaData { + /** The index of the first issue. */ + startAt: number; + /** The maximum number of issues that could be loaded in this evaluation. */ + maxResults: number; + /** The number of issues that were loaded in this evaluation. */ + count: number; + /** The total number of issues the Jql returned. */ + totalCount: number; + /** Any warnings related to the Jql query. Present only if the validation mode was set to `warn`. */ + validationWarnings?: string[]; +} diff --git a/src/version3/models/issuesJqlMetaData.ts b/src/version3/models/issuesJqlMetaData.ts deleted file mode 100644 index ee3e5827e..000000000 --- a/src/version3/models/issuesJqlMetaData.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** The description of the page of issues loaded by the provided JQL query. */ -export interface IssuesJqlMetaData { - /** The index of the first issue. */ - startAt: number; - /** The maximum number of issues that could be loaded in this evaluation. */ - maxResults: number; - /** The number of issues that were loaded in this evaluation. */ - count: number; - /** The total number of issues the JQL returned. */ - totalCount: number; - /** Any warnings related to the JQL query. Present only if the validation mode was set to `warn`. */ - validationWarnings?: string[]; -} diff --git a/src/version3/models/issuesMeta.mts b/src/version3/models/issuesMeta.mts new file mode 100644 index 000000000..569f4bf2a --- /dev/null +++ b/src/version3/models/issuesMeta.mts @@ -0,0 +1,6 @@ +import { IssuesJqlMetaData } from './issuesJqlMetaData.mjs'; + +/** Meta data describing the `issues` context variable. */ +export interface IssuesMeta { + jql?: IssuesJqlMetaData; +} diff --git a/src/version3/models/issuesMeta.ts b/src/version3/models/issuesMeta.ts deleted file mode 100644 index 786db99f5..000000000 --- a/src/version3/models/issuesMeta.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssuesJqlMetaData } from './issuesJqlMetaData.js'; - -/** Meta data describing the `issues` context variable. */ -export interface IssuesMeta { - jql?: IssuesJqlMetaData; -} diff --git a/src/version3/models/issuesUpdate.mts b/src/version3/models/issuesUpdate.mts new file mode 100644 index 000000000..3c850d1da --- /dev/null +++ b/src/version3/models/issuesUpdate.mts @@ -0,0 +1,5 @@ +import { IssueUpdateDetails } from './issueUpdateDetails.mjs'; + +export interface IssuesUpdate { + issueUpdates?: IssueUpdateDetails[]; +} diff --git a/src/version3/models/issuesUpdate.ts b/src/version3/models/issuesUpdate.ts deleted file mode 100644 index 005e0623e..000000000 --- a/src/version3/models/issuesUpdate.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { IssueUpdateDetails } from './issueUpdateDetails.js'; - -export interface IssuesUpdate { - issueUpdates?: IssueUpdateDetails[]; -} diff --git a/src/version3/models/jQLPersonalDataMigrationRequest.mts b/src/version3/models/jQLPersonalDataMigrationRequest.mts new file mode 100644 index 000000000..793136c7c --- /dev/null +++ b/src/version3/models/jQLPersonalDataMigrationRequest.mts @@ -0,0 +1,5 @@ +/** The Jql queries to be converted. */ +export interface JQLPersonalDataMigrationRequest { + /** A list of queries with user identifiers. Maximum of 100 queries. */ + queryStrings?: string[]; +} diff --git a/src/version3/models/jQLPersonalDataMigrationRequest.ts b/src/version3/models/jQLPersonalDataMigrationRequest.ts deleted file mode 100644 index 0a0730817..000000000 --- a/src/version3/models/jQLPersonalDataMigrationRequest.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The JQL queries to be converted. */ -export interface JQLPersonalDataMigrationRequest { - /** A list of queries with user identifiers. Maximum of 100 queries. */ - queryStrings?: string[]; -} diff --git a/src/version3/models/jQLQueryWithUnknownUsers.mts b/src/version3/models/jQLQueryWithUnknownUsers.mts new file mode 100644 index 000000000..cfdda79f6 --- /dev/null +++ b/src/version3/models/jQLQueryWithUnknownUsers.mts @@ -0,0 +1,7 @@ +/** Jql queries that contained users that could not be found */ +export interface JQLQueryWithUnknownUsers { + /** The original query, for reference */ + originalQuery?: string; + /** The converted query, with accountIDs instead of user identifiers, or 'unknown' for users that could not be found */ + convertedQuery?: string; +} diff --git a/src/version3/models/jQLQueryWithUnknownUsers.ts b/src/version3/models/jQLQueryWithUnknownUsers.ts deleted file mode 100644 index fc6005951..000000000 --- a/src/version3/models/jQLQueryWithUnknownUsers.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** JQL queries that contained users that could not be found */ -export interface JQLQueryWithUnknownUsers { - /** The original query, for reference */ - originalQuery?: string; - /** The converted query, with accountIDs instead of user identifiers, or 'unknown' for users that could not be found */ - convertedQuery?: string; -} diff --git a/src/version3/models/jQLReferenceData.mts b/src/version3/models/jQLReferenceData.mts new file mode 100644 index 000000000..a76b47e97 --- /dev/null +++ b/src/version3/models/jQLReferenceData.mts @@ -0,0 +1,12 @@ +import { FieldReferenceData } from './fieldReferenceData.mjs'; +import { FunctionReferenceData } from './functionReferenceData.mjs'; + +/** Lists of Jql reference data. */ +export interface JQLReferenceData { + /** List of fields usable in Jql queries. */ + visibleFieldNames?: FieldReferenceData[]; + /** List of functions usable in Jql queries. */ + visibleFunctionNames?: FunctionReferenceData[]; + /** List of Jql query reserved words. */ + jqlReservedWords?: string[]; +} diff --git a/src/version3/models/jQLReferenceData.ts b/src/version3/models/jQLReferenceData.ts deleted file mode 100644 index 5b980504e..000000000 --- a/src/version3/models/jQLReferenceData.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { FieldReferenceData } from './fieldReferenceData.js'; -import type { FunctionReferenceData } from './functionReferenceData.js'; - -/** Lists of JQL reference data. */ -export interface JQLReferenceData { - /** List of fields usable in JQL queries. */ - visibleFieldNames?: FieldReferenceData[]; - /** List of functions usable in JQL queries. */ - visibleFunctionNames?: FunctionReferenceData[]; - /** List of JQL query reserved words. */ - jqlReservedWords?: string[]; -} diff --git a/src/version3/models/jexpIssues.mts b/src/version3/models/jexpIssues.mts new file mode 100644 index 000000000..1b6e22b86 --- /dev/null +++ b/src/version3/models/jexpIssues.mts @@ -0,0 +1,6 @@ +import { JexpJqlIssues } from './jexpJqlIssues.mjs'; + +/** The Jql specifying the issues available in the evaluated Jira expression under the `issues` context variable. */ +export interface JexpIssues { + jql?: JexpJqlIssues; +} diff --git a/src/version3/models/jexpIssues.ts b/src/version3/models/jexpIssues.ts deleted file mode 100644 index ffb725892..000000000 --- a/src/version3/models/jexpIssues.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { JexpJqlIssues } from './jexpJqlIssues.js'; - -/** The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. */ -export interface JexpIssues { - jql?: JexpJqlIssues; -} diff --git a/src/version3/models/jexpJqlIssues.mts b/src/version3/models/jexpJqlIssues.mts new file mode 100644 index 000000000..9de6c6aa0 --- /dev/null +++ b/src/version3/models/jexpJqlIssues.mts @@ -0,0 +1,19 @@ +/** + * The Jql specifying the issues available in the evaluated Jira expression under the `issues` context variable. Not all + * issues returned by the Jql query are loaded, only those described by the `startAt` and `maxResults` properties. To + * determine whether it is necessary to iterate to ensure all the issues returned by the Jql query are evaluated, + * inspect `meta.issues.jql.count` in the response. + */ +export interface JexpJqlIssues { + /** The Jql query. */ + query?: string; + /** The index of the first issue to return from the Jql query. */ + startAt?: number; + /** + * The maximum number of issues to return from the Jql query. Inspect `meta.issues.jql.maxResults` in the response to + * ensure the maximum value has not been exceeded. + */ + maxResults?: number; + /** Determines how to validate the Jql query and treat the validation results. */ + validation?: string; +} diff --git a/src/version3/models/jexpJqlIssues.ts b/src/version3/models/jexpJqlIssues.ts deleted file mode 100644 index 3ed84d5ed..000000000 --- a/src/version3/models/jexpJqlIssues.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. Not all - * issues returned by the JQL query are loaded, only those described by the `startAt` and `maxResults` properties. To - * determine whether it is necessary to iterate to ensure all the issues returned by the JQL query are evaluated, - * inspect `meta.issues.jql.count` in the response. - */ -export interface JexpJqlIssues { - /** The JQL query. */ - query?: string; - /** The index of the first issue to return from the JQL query. */ - startAt?: number; - /** - * The maximum number of issues to return from the JQL query. Inspect `meta.issues.jql.maxResults` in the response to - * ensure the maximum value has not been exceeded. - */ - maxResults?: number; - /** Determines how to validate the JQL query and treat the validation results. */ - validation?: string; -} diff --git a/src/version3/models/jiraExpressionAnalysis.mts b/src/version3/models/jiraExpressionAnalysis.mts new file mode 100644 index 000000000..8b301a37c --- /dev/null +++ b/src/version3/models/jiraExpressionAnalysis.mts @@ -0,0 +1,18 @@ +import { JiraExpressionComplexity } from './jiraExpressionComplexity.mjs'; +import { JiraExpressionValidationError } from './jiraExpressionValidationError.mjs'; + +/** Details about the analysed Jira expression. */ +export interface JiraExpressionAnalysis { + /** The analysed expression. */ + expression: string; + /** A list of validation errors. Not included if the expression is valid. */ + errors?: JiraExpressionValidationError[]; + /** + * Whether the expression is valid and the interpreter will evaluate it. Note that the expression may fail at runtime + * (for example, if it executes too many expensive operations). + */ + valid: boolean; + /** EXPERIMENTAL. The inferred type of the expression. */ + type?: string; + complexity?: JiraExpressionComplexity; +} diff --git a/src/version3/models/jiraExpressionAnalysis.ts b/src/version3/models/jiraExpressionAnalysis.ts deleted file mode 100644 index b49abe7f1..000000000 --- a/src/version3/models/jiraExpressionAnalysis.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { JiraExpressionComplexity } from './jiraExpressionComplexity.js'; -import type { JiraExpressionValidationError } from './jiraExpressionValidationError.js'; - -/** Details about the analysed Jira expression. */ -export interface JiraExpressionAnalysis { - /** The analysed expression. */ - expression: string; - /** A list of validation errors. Not included if the expression is valid. */ - errors?: JiraExpressionValidationError[]; - /** - * Whether the expression is valid and the interpreter will evaluate it. Note that the expression may fail at runtime - * (for example, if it executes too many expensive operations). - */ - valid: boolean; - /** EXPERIMENTAL. The inferred type of the expression. */ - type?: string; - complexity?: JiraExpressionComplexity; -} diff --git a/src/version3/models/jiraExpressionComplexity.ts b/src/version3/models/jiraExpressionComplexity.mts similarity index 100% rename from src/version3/models/jiraExpressionComplexity.ts rename to src/version3/models/jiraExpressionComplexity.mts diff --git a/src/version3/models/jiraExpressionEvalContext.mts b/src/version3/models/jiraExpressionEvalContext.mts new file mode 100644 index 000000000..67cc03213 --- /dev/null +++ b/src/version3/models/jiraExpressionEvalContext.mts @@ -0,0 +1,31 @@ +import { CustomContextVariable } from './customContextVariable.mjs'; +import { IdOrKey } from './idOrKey.mjs'; +import { JexpIssues } from './jexpIssues.mjs'; + +export interface JiraExpressionEvalContext { + issue?: IdOrKey; + issues?: JexpIssues; + project?: IdOrKey; + /** The ID of the sprint that is available under the `sprint` variable when evaluating the expression. */ + sprint?: number; + /** The ID of the board that is available under the `board` variable when evaluating the expression. */ + board?: number; + /** The ID of the service desk that is available under the `serviceDesk` variable when evaluating the expression. */ + serviceDesk?: number; + /** + * The ID of the customer request that is available under the `customerRequest` variable when evaluating the + * expression. This is the same as the ID of the underlying Jira issue, but the customer request context variable will + * have a different type. + */ + customerRequest?: number; + /** + * Custom context variables and their types. These variable types are available for use in a custom context: + * + * `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) + * specified as an Atlassian account ID. `issue`: An + * [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) specified by ID + * or key. All the fields of the issue object are available in the Jira expression. `json`: A JSON object containing + * custom content. `list`: A JSON list of `user`, `issue`, or `json` variable types. + */ + custom?: CustomContextVariable[]; +} diff --git a/src/version3/models/jiraExpressionEvalContext.ts b/src/version3/models/jiraExpressionEvalContext.ts deleted file mode 100644 index 648dd991f..000000000 --- a/src/version3/models/jiraExpressionEvalContext.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { CustomContextVariable } from './customContextVariable.js'; -import type { IdOrKey } from './idOrKey.js'; -import type { JexpIssues } from './jexpIssues.js'; - -export interface JiraExpressionEvalContext { - issue?: IdOrKey; - issues?: JexpIssues; - project?: IdOrKey; - /** The ID of the sprint that is available under the `sprint` variable when evaluating the expression. */ - sprint?: number; - /** The ID of the board that is available under the `board` variable when evaluating the expression. */ - board?: number; - /** The ID of the service desk that is available under the `serviceDesk` variable when evaluating the expression. */ - serviceDesk?: number; - /** - * The ID of the customer request that is available under the `customerRequest` variable when evaluating the - * expression. This is the same as the ID of the underlying Jira issue, but the customer request context variable will - * have a different type. - */ - customerRequest?: number; - /** - * Custom context variables and their types. These variable types are available for use in a custom context: - * - * `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) - * specified as an Atlassian account ID. `issue`: An - * [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) specified by ID - * or key. All the fields of the issue object are available in the Jira expression. `json`: A JSON object containing - * custom content. `list`: A JSON list of `user`, `issue`, or `json` variable types. - */ - custom?: CustomContextVariable[]; -} diff --git a/src/version3/models/jiraExpressionEvalRequest.mts b/src/version3/models/jiraExpressionEvalRequest.mts new file mode 100644 index 000000000..79a015476 --- /dev/null +++ b/src/version3/models/jiraExpressionEvalRequest.mts @@ -0,0 +1,7 @@ +import { JiraExpressionEvalContext } from './jiraExpressionEvalContext.mjs'; + +export interface JiraExpressionEvalRequest { + /** The Jira expression to evaluate. */ + expression: string; + context?: JiraExpressionEvalContext; +} diff --git a/src/version3/models/jiraExpressionEvalRequest.ts b/src/version3/models/jiraExpressionEvalRequest.ts deleted file mode 100644 index 256e07ed4..000000000 --- a/src/version3/models/jiraExpressionEvalRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { JiraExpressionEvalContext } from './jiraExpressionEvalContext.js'; - -export interface JiraExpressionEvalRequest { - /** The Jira expression to evaluate. */ - expression: string; - context?: JiraExpressionEvalContext; -} diff --git a/src/version3/models/jiraExpressionEvaluationMetaData.mts b/src/version3/models/jiraExpressionEvaluationMetaData.mts new file mode 100644 index 000000000..4cb3c424d --- /dev/null +++ b/src/version3/models/jiraExpressionEvaluationMetaData.mts @@ -0,0 +1,7 @@ +import { IssuesMeta } from './issuesMeta.mjs'; +import { JiraExpressionsComplexity } from './jiraExpressionsComplexity.mjs'; + +export interface JiraExpressionEvaluationMetaData { + complexity?: JiraExpressionsComplexity; + issues?: IssuesMeta; +} diff --git a/src/version3/models/jiraExpressionEvaluationMetaData.ts b/src/version3/models/jiraExpressionEvaluationMetaData.ts deleted file mode 100644 index 1a406e308..000000000 --- a/src/version3/models/jiraExpressionEvaluationMetaData.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { IssuesMeta } from './issuesMeta.js'; -import type { JiraExpressionsComplexity } from './jiraExpressionsComplexity.js'; - -export interface JiraExpressionEvaluationMetaData { - complexity?: JiraExpressionsComplexity; - issues?: IssuesMeta; -} diff --git a/src/version3/models/jiraExpressionForAnalysis.ts b/src/version3/models/jiraExpressionForAnalysis.mts similarity index 100% rename from src/version3/models/jiraExpressionForAnalysis.ts rename to src/version3/models/jiraExpressionForAnalysis.mts diff --git a/src/version3/models/jiraExpressionResult.mts b/src/version3/models/jiraExpressionResult.mts new file mode 100644 index 000000000..4b5806a0a --- /dev/null +++ b/src/version3/models/jiraExpressionResult.mts @@ -0,0 +1,13 @@ +import { JiraExpressionEvaluationMetaData } from './jiraExpressionEvaluationMetaData.mjs'; + +/** The result of evaluating a Jira expression. */ +export interface JiraExpressionResult { + /** + * The value of the evaluated expression. It may be a primitive JSON value or a Jira REST API object. (Some + * expressions do not produce any meaningful results—for example, an expression that returns a lambda function—if + * that's the case a simple string representation is returned. These string representations should not be relied upon + * and may change without notice.) + */ + value: any; + meta?: JiraExpressionEvaluationMetaData; +} diff --git a/src/version3/models/jiraExpressionResult.ts b/src/version3/models/jiraExpressionResult.ts deleted file mode 100644 index 57cf26961..000000000 --- a/src/version3/models/jiraExpressionResult.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { JiraExpressionEvaluationMetaData } from './jiraExpressionEvaluationMetaData.js'; - -/** The result of evaluating a Jira expression. */ -export interface JiraExpressionResult { - /** - * The value of the evaluated expression. It may be a primitive JSON value or a Jira REST API object. (Some - * expressions do not produce any meaningful results—for example, an expression that returns a lambda function—if - * that's the case a simple string representation is returned. These string representations should not be relied upon - * and may change without notice.) - */ - value: any; - meta?: JiraExpressionEvaluationMetaData; -} diff --git a/src/version3/models/jiraExpressionValidationError.ts b/src/version3/models/jiraExpressionValidationError.mts similarity index 100% rename from src/version3/models/jiraExpressionValidationError.ts rename to src/version3/models/jiraExpressionValidationError.mts diff --git a/src/version3/models/jiraExpressionsAnalysis.mts b/src/version3/models/jiraExpressionsAnalysis.mts new file mode 100644 index 000000000..2cd80ae44 --- /dev/null +++ b/src/version3/models/jiraExpressionsAnalysis.mts @@ -0,0 +1,7 @@ +import { JiraExpressionAnalysis } from './jiraExpressionAnalysis.mjs'; + +/** Details about the analysed Jira expression. */ +export interface JiraExpressionsAnalysis { + /** The results of Jira expressions analysis. */ + results: JiraExpressionAnalysis[]; +} diff --git a/src/version3/models/jiraExpressionsAnalysis.ts b/src/version3/models/jiraExpressionsAnalysis.ts deleted file mode 100644 index 9e1486df9..000000000 --- a/src/version3/models/jiraExpressionsAnalysis.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { JiraExpressionAnalysis } from './jiraExpressionAnalysis.js'; - -/** Details about the analysed Jira expression. */ -export interface JiraExpressionsAnalysis { - /** The results of Jira expressions analysis. */ - results: JiraExpressionAnalysis[]; -} diff --git a/src/version3/models/jiraExpressionsComplexity.mts b/src/version3/models/jiraExpressionsComplexity.mts new file mode 100644 index 000000000..cf53e8b69 --- /dev/null +++ b/src/version3/models/jiraExpressionsComplexity.mts @@ -0,0 +1,8 @@ +import { JiraExpressionsComplexityValue } from './jiraExpressionsComplexityValue.mjs'; + +export interface JiraExpressionsComplexity { + steps?: JiraExpressionsComplexityValue; + expensiveOperations?: JiraExpressionsComplexityValue; + beans?: JiraExpressionsComplexityValue; + primitiveValues?: JiraExpressionsComplexityValue; +} diff --git a/src/version3/models/jiraExpressionsComplexity.ts b/src/version3/models/jiraExpressionsComplexity.ts deleted file mode 100644 index 2e9aad253..000000000 --- a/src/version3/models/jiraExpressionsComplexity.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { JiraExpressionsComplexityValue } from './jiraExpressionsComplexityValue.js'; - -export interface JiraExpressionsComplexity { - steps?: JiraExpressionsComplexityValue; - expensiveOperations?: JiraExpressionsComplexityValue; - beans?: JiraExpressionsComplexityValue; - primitiveValues?: JiraExpressionsComplexityValue; -} diff --git a/src/version3/models/jiraExpressionsComplexityValue.ts b/src/version3/models/jiraExpressionsComplexityValue.mts similarity index 100% rename from src/version3/models/jiraExpressionsComplexityValue.ts rename to src/version3/models/jiraExpressionsComplexityValue.mts diff --git a/src/version3/models/jiraStatus.mts b/src/version3/models/jiraStatus.mts new file mode 100644 index 000000000..73715e1b5 --- /dev/null +++ b/src/version3/models/jiraStatus.mts @@ -0,0 +1,17 @@ +import { ProjectIssueTypes } from './projectIssueTypes.mjs'; +import type { StatusScope } from './statusScope.mjs'; + +/** Details of a status. */ +export interface JiraStatus { + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; + /** The category of the status. */ + statusCategory?: string; + scope?: StatusScope; + /** The description of the status. */ + description?: string; + /** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ + usages?: ProjectIssueTypes[]; +} diff --git a/src/version3/models/jiraStatus.ts b/src/version3/models/jiraStatus.ts deleted file mode 100644 index 52af69e1d..000000000 --- a/src/version3/models/jiraStatus.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { ProjectIssueTypes } from './projectIssueTypes.js'; -import type { StatusScope } from './statusScope.js'; - -/** Details of a status. */ -export interface JiraStatus { - /** The ID of the status. */ - id?: string; - /** The name of the status. */ - name?: string; - /** The category of the status. */ - statusCategory?: string; - scope?: StatusScope; - /** The description of the status. */ - description?: string; - /** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ - usages?: ProjectIssueTypes[]; -} diff --git a/src/version3/models/jqlFunctionPrecomputation.ts b/src/version3/models/jqlFunctionPrecomputation.mts similarity index 100% rename from src/version3/models/jqlFunctionPrecomputation.ts rename to src/version3/models/jqlFunctionPrecomputation.mts diff --git a/src/version3/models/jqlFunctionPrecomputationUpdate.ts b/src/version3/models/jqlFunctionPrecomputationUpdate.mts similarity index 100% rename from src/version3/models/jqlFunctionPrecomputationUpdate.ts rename to src/version3/models/jqlFunctionPrecomputationUpdate.mts diff --git a/src/version3/models/jqlFunctionPrecomputationUpdateRequest.mts b/src/version3/models/jqlFunctionPrecomputationUpdateRequest.mts new file mode 100644 index 000000000..1661fb320 --- /dev/null +++ b/src/version3/models/jqlFunctionPrecomputationUpdateRequest.mts @@ -0,0 +1,6 @@ +import { JqlFunctionPrecomputationUpdate } from './jqlFunctionPrecomputationUpdate.mjs'; + +/** List of pairs (id and value) for precomputation updates. */ +export interface JqlFunctionPrecomputationUpdateRequest { + values?: JqlFunctionPrecomputationUpdate[]; +} diff --git a/src/version3/models/jqlFunctionPrecomputationUpdateRequest.ts b/src/version3/models/jqlFunctionPrecomputationUpdateRequest.ts deleted file mode 100644 index 3c78b15d1..000000000 --- a/src/version3/models/jqlFunctionPrecomputationUpdateRequest.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { JqlFunctionPrecomputationUpdate } from './jqlFunctionPrecomputationUpdate.js'; - -/** List of pairs (id and value) for precomputation updates. */ -export interface JqlFunctionPrecomputationUpdateRequest { - values?: JqlFunctionPrecomputationUpdate[]; -} diff --git a/src/version3/models/jqlQueriesToParse.mts b/src/version3/models/jqlQueriesToParse.mts new file mode 100644 index 000000000..9bb4f6ad1 --- /dev/null +++ b/src/version3/models/jqlQueriesToParse.mts @@ -0,0 +1,5 @@ +/** A list of Jql queries to parse. */ +export interface JqlQueriesToParse { + /** A list of queries to parse. */ + queries: string[]; +} diff --git a/src/version3/models/jqlQueriesToParse.ts b/src/version3/models/jqlQueriesToParse.ts deleted file mode 100644 index 69990243f..000000000 --- a/src/version3/models/jqlQueriesToParse.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** A list of JQL queries to parse. */ -export interface JqlQueriesToParse { - /** A list of queries to parse. */ - queries: string[]; -} diff --git a/src/version3/models/jqlQueriesToSanitize.mts b/src/version3/models/jqlQueriesToSanitize.mts new file mode 100644 index 000000000..9200763ff --- /dev/null +++ b/src/version3/models/jqlQueriesToSanitize.mts @@ -0,0 +1,7 @@ +import { JqlQueryToSanitize } from './jqlQueryToSanitize.mjs'; + +/** The list of Jql queries to sanitize for the given account IDs. */ +export interface JqlQueriesToSanitize { + /** The list of Jql queries to sanitize. Must contain unique values. Maximum of 20 queries. */ + queries: JqlQueryToSanitize[]; +} diff --git a/src/version3/models/jqlQueriesToSanitize.ts b/src/version3/models/jqlQueriesToSanitize.ts deleted file mode 100644 index bb86b4d9f..000000000 --- a/src/version3/models/jqlQueriesToSanitize.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { JqlQueryToSanitize } from './jqlQueryToSanitize.js'; - -/** The list of JQL queries to sanitize for the given account IDs. */ -export interface JqlQueriesToSanitize { - /** The list of JQL queries to sanitize. Must contain unique values. Maximum of 20 queries. */ - queries: JqlQueryToSanitize[]; -} diff --git a/src/version3/models/jqlQuery.mts b/src/version3/models/jqlQuery.mts new file mode 100644 index 000000000..f325fe5b5 --- /dev/null +++ b/src/version3/models/jqlQuery.mts @@ -0,0 +1,8 @@ +import { JqlQueryClause } from './jqlQueryClause.mjs'; +import { JqlQueryOrderByClause } from './jqlQueryOrderByClause.mjs'; + +/** A parsed Jql query. */ +export interface JqlQuery { + where?: JqlQueryClause; + orderBy?: JqlQueryOrderByClause; +} diff --git a/src/version3/models/jqlQuery.ts b/src/version3/models/jqlQuery.ts deleted file mode 100644 index eeb47524e..000000000 --- a/src/version3/models/jqlQuery.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { JqlQueryClause } from './jqlQueryClause.js'; -import type { JqlQueryOrderByClause } from './jqlQueryOrderByClause.js'; - -/** A parsed JQL query. */ -export interface JqlQuery { - where?: JqlQueryClause; - orderBy?: JqlQueryOrderByClause; -} diff --git a/src/version3/models/jqlQueryClause.mts b/src/version3/models/jqlQueryClause.mts new file mode 100644 index 000000000..359f6a2af --- /dev/null +++ b/src/version3/models/jqlQueryClause.mts @@ -0,0 +1,2 @@ +/** A Jql query clause. */ +export interface JqlQueryClause {} diff --git a/src/version3/models/jqlQueryClause.ts b/src/version3/models/jqlQueryClause.ts deleted file mode 100644 index 15c1a05c5..000000000 --- a/src/version3/models/jqlQueryClause.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** A JQL query clause. */ -export interface JqlQueryClause {} diff --git a/src/version3/models/jqlQueryField.mts b/src/version3/models/jqlQueryField.mts new file mode 100644 index 000000000..87c8fb440 --- /dev/null +++ b/src/version3/models/jqlQueryField.mts @@ -0,0 +1,12 @@ +import { JqlQueryFieldEntityProperty } from './jqlQueryFieldEntityProperty.mjs'; + +/** + * A field used in a Jql query. See [Advanced searching - fields reference](https://confluence.atlassian.com/x/dAiiLQ) + * for more information about fields in Jql queries. + */ +export interface JqlQueryField { + /** The name of the field. */ + name: string; + /** When the field refers to a value in an entity property, details of the entity property value. */ + property?: JqlQueryFieldEntityProperty[]; +} diff --git a/src/version3/models/jqlQueryField.ts b/src/version3/models/jqlQueryField.ts deleted file mode 100644 index cf6554db6..000000000 --- a/src/version3/models/jqlQueryField.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { JqlQueryFieldEntityProperty } from './jqlQueryFieldEntityProperty.js'; - -/** - * A field used in a JQL query. See [Advanced searching - fields reference](https://confluence.atlassian.com/x/dAiiLQ) - * for more information about fields in JQL queries. - */ -export interface JqlQueryField { - /** The name of the field. */ - name: string; - /** When the field refers to a value in an entity property, details of the entity property value. */ - property?: JqlQueryFieldEntityProperty[]; -} diff --git a/src/version3/models/jqlQueryFieldEntityProperty.ts b/src/version3/models/jqlQueryFieldEntityProperty.mts similarity index 100% rename from src/version3/models/jqlQueryFieldEntityProperty.ts rename to src/version3/models/jqlQueryFieldEntityProperty.mts diff --git a/src/version3/models/jqlQueryOrderByClause.mts b/src/version3/models/jqlQueryOrderByClause.mts new file mode 100644 index 000000000..dbf27a467 --- /dev/null +++ b/src/version3/models/jqlQueryOrderByClause.mts @@ -0,0 +1,7 @@ +import { JqlQueryOrderByClauseElement } from './jqlQueryOrderByClauseElement.mjs'; + +/** Details of the order-by Jql clause. */ +export interface JqlQueryOrderByClause { + /** The list of order-by clause fields and their ordering directives. */ + fields: JqlQueryOrderByClauseElement[]; +} diff --git a/src/version3/models/jqlQueryOrderByClause.ts b/src/version3/models/jqlQueryOrderByClause.ts deleted file mode 100644 index 878b10024..000000000 --- a/src/version3/models/jqlQueryOrderByClause.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { JqlQueryOrderByClauseElement } from './jqlQueryOrderByClauseElement.js'; - -/** Details of the order-by JQL clause. */ -export interface JqlQueryOrderByClause { - /** The list of order-by clause fields and their ordering directives. */ - fields: JqlQueryOrderByClauseElement[]; -} diff --git a/src/version3/models/jqlQueryOrderByClauseElement.mts b/src/version3/models/jqlQueryOrderByClauseElement.mts new file mode 100644 index 000000000..8be5d5f22 --- /dev/null +++ b/src/version3/models/jqlQueryOrderByClauseElement.mts @@ -0,0 +1,8 @@ +import { JqlQueryField } from './jqlQueryField.mjs'; + +/** An element of the order-by Jql clause. */ +export interface JqlQueryOrderByClauseElement { + field: JqlQueryField; + /** The direction in which to order the results. */ + direction?: string; +} diff --git a/src/version3/models/jqlQueryOrderByClauseElement.ts b/src/version3/models/jqlQueryOrderByClauseElement.ts deleted file mode 100644 index e4bc14bb4..000000000 --- a/src/version3/models/jqlQueryOrderByClauseElement.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { JqlQueryField } from './jqlQueryField.js'; - -/** An element of the order-by JQL clause. */ -export interface JqlQueryOrderByClauseElement { - field: JqlQueryField; - /** The direction in which to order the results. */ - direction?: string; -} diff --git a/src/version3/models/jqlQueryToSanitize.mts b/src/version3/models/jqlQueryToSanitize.mts new file mode 100644 index 000000000..93ae518e5 --- /dev/null +++ b/src/version3/models/jqlQueryToSanitize.mts @@ -0,0 +1,13 @@ +/** + * The Jql query to sanitize for the account ID. If the account ID is null, sanitizing is performed for an anonymous + * user. + */ +export interface JqlQueryToSanitize { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** The query to sanitize. */ + query: string; +} diff --git a/src/version3/models/jqlQueryToSanitize.ts b/src/version3/models/jqlQueryToSanitize.ts deleted file mode 100644 index e774eaf2a..000000000 --- a/src/version3/models/jqlQueryToSanitize.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The JQL query to sanitize for the account ID. If the account ID is null, sanitizing is performed for an anonymous - * user. - */ -export interface JqlQueryToSanitize { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** The query to sanitize. */ - query: string; -} diff --git a/src/version3/models/jsonType.ts b/src/version3/models/jsonType.mts similarity index 100% rename from src/version3/models/jsonType.ts rename to src/version3/models/jsonType.mts diff --git a/src/version3/models/license.mts b/src/version3/models/license.mts new file mode 100644 index 000000000..70db44801 --- /dev/null +++ b/src/version3/models/license.mts @@ -0,0 +1,7 @@ +import { LicensedApplication } from './licensedApplication.mjs'; + +/** Details about a license for the Jira instance. */ +export interface License { + /** The applications under this license. */ + applications: LicensedApplication[]; +} diff --git a/src/version3/models/license.ts b/src/version3/models/license.ts deleted file mode 100644 index 717ba9b9e..000000000 --- a/src/version3/models/license.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { LicensedApplication } from './licensedApplication.js'; - -/** Details about a license for the Jira instance. */ -export interface License { - /** The applications under this license. */ - applications: LicensedApplication[]; -} diff --git a/src/version3/models/licenseMetric.ts b/src/version3/models/licenseMetric.mts similarity index 100% rename from src/version3/models/licenseMetric.ts rename to src/version3/models/licenseMetric.mts diff --git a/src/version3/models/licensedApplication.ts b/src/version3/models/licensedApplication.mts similarity index 100% rename from src/version3/models/licensedApplication.ts rename to src/version3/models/licensedApplication.mts diff --git a/src/version3/models/linkGroup.mts b/src/version3/models/linkGroup.mts new file mode 100644 index 000000000..592d094e0 --- /dev/null +++ b/src/version3/models/linkGroup.mts @@ -0,0 +1,11 @@ +import type { SimpleLink } from './simpleLink.mjs'; + +/** Details a link group, which defines issue operations. */ +export interface LinkGroup { + id?: string; + styleClass?: string; + header?: SimpleLink; + weight?: number; + links?: SimpleLink[]; + groups?: LinkGroup[]; +} diff --git a/src/version3/models/linkGroup.ts b/src/version3/models/linkGroup.ts deleted file mode 100644 index e5223a94d..000000000 --- a/src/version3/models/linkGroup.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { SimpleLink } from './simpleLink.js'; - -/** Details a link group, which defines issue operations. */ -export interface LinkGroup { - id?: string; - styleClass?: string; - header?: SimpleLink; - weight?: number; - links?: SimpleLink[]; - groups?: LinkGroup[]; -} diff --git a/src/version3/models/linkIssueRequestJson.mts b/src/version3/models/linkIssueRequestJson.mts new file mode 100644 index 000000000..b7ad004e5 --- /dev/null +++ b/src/version3/models/linkIssueRequestJson.mts @@ -0,0 +1,10 @@ +import type { Comment } from './comment.mjs'; +import { IssueLinkType } from './issueLinkType.mjs'; +import { LinkedIssue } from './linkedIssue.mjs'; + +export interface LinkIssueRequestJson { + type: IssueLinkType; + inwardIssue: LinkedIssue; + outwardIssue: LinkedIssue; + comment?: Comment; +} diff --git a/src/version3/models/linkIssueRequestJson.ts b/src/version3/models/linkIssueRequestJson.ts deleted file mode 100644 index 5713ca0cb..000000000 --- a/src/version3/models/linkIssueRequestJson.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Comment } from './comment.js'; -import type { IssueLinkType } from './issueLinkType.js'; -import type { LinkedIssue } from './linkedIssue.js'; - -export interface LinkIssueRequestJson { - type: IssueLinkType; - inwardIssue: LinkedIssue; - outwardIssue: LinkedIssue; - comment?: Comment; -} diff --git a/src/version3/models/linkedIssue.mts b/src/version3/models/linkedIssue.mts new file mode 100644 index 000000000..7ac7651e5 --- /dev/null +++ b/src/version3/models/linkedIssue.mts @@ -0,0 +1,12 @@ +import { Fields } from './fields.mjs'; + +/** The ID or key of a linked issue. */ +export interface LinkedIssue { + /** The ID of an issue. Required if `key` isn't provided. */ + id?: string; + /** The key of an issue. Required if `id` isn't provided. */ + key?: string; + /** The URL of the issue. */ + self?: string; + fields?: Fields; +} diff --git a/src/version3/models/linkedIssue.ts b/src/version3/models/linkedIssue.ts deleted file mode 100644 index 3f91ec521..000000000 --- a/src/version3/models/linkedIssue.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Fields } from './fields.js'; - -/** The ID or key of a linked issue. */ -export interface LinkedIssue { - /** The ID of an issue. Required if `key` isn't provided. */ - id?: string; - /** The key of an issue. Required if `id` isn't provided. */ - key?: string; - /** The URL of the issue. */ - self?: string; - fields?: Fields; -} diff --git a/src/version3/models/listWrapperCallbackApplicationRole.ts b/src/version3/models/listWrapperCallbackApplicationRole.mts similarity index 100% rename from src/version3/models/listWrapperCallbackApplicationRole.ts rename to src/version3/models/listWrapperCallbackApplicationRole.mts diff --git a/src/version3/models/listWrapperCallbackGroupName.ts b/src/version3/models/listWrapperCallbackGroupName.mts similarity index 100% rename from src/version3/models/listWrapperCallbackGroupName.ts rename to src/version3/models/listWrapperCallbackGroupName.mts diff --git a/src/version3/models/locale.ts b/src/version3/models/locale.mts similarity index 100% rename from src/version3/models/locale.ts rename to src/version3/models/locale.mts diff --git a/src/version3/models/mark.ts b/src/version3/models/mark.mts similarity index 100% rename from src/version3/models/mark.ts rename to src/version3/models/mark.mts diff --git a/src/version3/models/moveField.ts b/src/version3/models/moveField.mts similarity index 100% rename from src/version3/models/moveField.ts rename to src/version3/models/moveField.mts diff --git a/src/version3/models/multiIssueEntityProperties.mts b/src/version3/models/multiIssueEntityProperties.mts new file mode 100644 index 000000000..6b7c919a8 --- /dev/null +++ b/src/version3/models/multiIssueEntityProperties.mts @@ -0,0 +1,10 @@ +import { IssueEntityPropertiesForMultiUpdate } from './issueEntityPropertiesForMultiUpdate.mjs'; + +/** + * A list of issues and their respective properties to set or update. See [Entity + * properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. + */ +export interface MultiIssueEntityProperties { + /** A list of issue IDs and their respective properties. */ + issues?: IssueEntityPropertiesForMultiUpdate[]; +} diff --git a/src/version3/models/multiIssueEntityProperties.ts b/src/version3/models/multiIssueEntityProperties.ts deleted file mode 100644 index f343f8735..000000000 --- a/src/version3/models/multiIssueEntityProperties.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { IssueEntityPropertiesForMultiUpdate } from './issueEntityPropertiesForMultiUpdate.js'; - -/** - * A list of issues and their respective properties to set or update. See [Entity - * properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. - */ -export interface MultiIssueEntityProperties { - /** A list of issue IDs and their respective properties. */ - issues?: IssueEntityPropertiesForMultiUpdate[]; -} diff --git a/src/version3/models/multipleCustomFieldValuesUpdate.ts b/src/version3/models/multipleCustomFieldValuesUpdate.mts similarity index 100% rename from src/version3/models/multipleCustomFieldValuesUpdate.ts rename to src/version3/models/multipleCustomFieldValuesUpdate.mts diff --git a/src/version3/models/multipleCustomFieldValuesUpdateDetails.mts b/src/version3/models/multipleCustomFieldValuesUpdateDetails.mts new file mode 100644 index 000000000..c15e9e08d --- /dev/null +++ b/src/version3/models/multipleCustomFieldValuesUpdateDetails.mts @@ -0,0 +1,6 @@ +import { MultipleCustomFieldValuesUpdate } from './multipleCustomFieldValuesUpdate.mjs'; + +/** List of updates for a custom fields. */ +export interface MultipleCustomFieldValuesUpdateDetails { + updates?: MultipleCustomFieldValuesUpdate[]; +} diff --git a/src/version3/models/multipleCustomFieldValuesUpdateDetails.ts b/src/version3/models/multipleCustomFieldValuesUpdateDetails.ts deleted file mode 100644 index 29ed2e5e1..000000000 --- a/src/version3/models/multipleCustomFieldValuesUpdateDetails.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { MultipleCustomFieldValuesUpdate } from './multipleCustomFieldValuesUpdate.js'; - -/** List of updates for a custom fields. */ -export interface MultipleCustomFieldValuesUpdateDetails { - updates?: MultipleCustomFieldValuesUpdate[]; -} diff --git a/src/version3/models/nestedResponse.mts b/src/version3/models/nestedResponse.mts new file mode 100644 index 000000000..704158d3e --- /dev/null +++ b/src/version3/models/nestedResponse.mts @@ -0,0 +1,6 @@ +import type { ErrorCollection } from './errorCollection.mjs'; + +export interface NestedResponse { + status?: number; + errorCollection?: ErrorCollection; +} diff --git a/src/version3/models/nestedResponse.ts b/src/version3/models/nestedResponse.ts deleted file mode 100644 index 5f61bb9f8..000000000 --- a/src/version3/models/nestedResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ErrorCollection } from './errorCollection.js'; - -export interface NestedResponse { - status?: number; - errorCollection?: ErrorCollection; -} diff --git a/src/version3/models/newUserDetails.ts b/src/version3/models/newUserDetails.mts similarity index 100% rename from src/version3/models/newUserDetails.ts rename to src/version3/models/newUserDetails.mts diff --git a/src/version3/models/notification.mts b/src/version3/models/notification.mts new file mode 100644 index 000000000..8c816841e --- /dev/null +++ b/src/version3/models/notification.mts @@ -0,0 +1,17 @@ +import { NotificationRecipients } from './notificationRecipients.mjs'; +import { NotificationRecipientsRestrictions } from './notificationRecipientsRestrictions.mjs'; + +/** Details about a notification. */ +export interface Notification { + /** + * The subject of the email notification for the issue. If this is not specified, then the subject is set to the issue + * key and summary. + */ + subject?: string; + /** The plain text body of the email notification for the issue. */ + textBody?: string; + /** The HTML body of the email notification for the issue. */ + htmlBody?: string; + to?: NotificationRecipients; + restrict?: NotificationRecipientsRestrictions; +} diff --git a/src/version3/models/notification.ts b/src/version3/models/notification.ts deleted file mode 100644 index c3b10c29f..000000000 --- a/src/version3/models/notification.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { NotificationRecipients } from './notificationRecipients.js'; -import type { NotificationRecipientsRestrictions } from './notificationRecipientsRestrictions.js'; - -/** Details about a notification. */ -export interface Notification { - /** - * The subject of the email notification for the issue. If this is not specified, then the subject is set to the issue - * key and summary. - */ - subject?: string; - /** The plain text body of the email notification for the issue. */ - textBody?: string; - /** The HTML body of the email notification for the issue. */ - htmlBody?: string; - to?: NotificationRecipients; - restrict?: NotificationRecipientsRestrictions; -} diff --git a/src/version3/models/notificationEvent.ts b/src/version3/models/notificationEvent.mts similarity index 100% rename from src/version3/models/notificationEvent.ts rename to src/version3/models/notificationEvent.mts diff --git a/src/version3/models/notificationRecipients.mts b/src/version3/models/notificationRecipients.mts new file mode 100644 index 000000000..970aed49e --- /dev/null +++ b/src/version3/models/notificationRecipients.mts @@ -0,0 +1,20 @@ +import type { GroupName } from './groupName.mjs'; +import { UserDetails } from './userDetails.mjs'; + +/** Details of the users and groups to receive the notification. */ +export interface NotificationRecipients { + /** Whether the notification should be sent to the issue's reporter. */ + reporter?: boolean; + /** Whether the notification should be sent to the issue's assignees. */ + assignee?: boolean; + /** Whether the notification should be sent to the issue's watchers. */ + watchers?: boolean; + /** Whether the notification should be sent to the issue's voters. */ + voters?: boolean; + /** List of users to receive the notification. */ + users?: UserDetails[]; + /** List of groups to receive the notification. */ + groups?: GroupName[]; + /** List of groupIds to receive the notification. */ + groupIds?: string[]; +} diff --git a/src/version3/models/notificationRecipients.ts b/src/version3/models/notificationRecipients.ts deleted file mode 100644 index 2bc3c2204..000000000 --- a/src/version3/models/notificationRecipients.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { GroupName } from './groupName.js'; -import type { UserDetails } from './userDetails.js'; - -/** Details of the users and groups to receive the notification. */ -export interface NotificationRecipients { - /** Whether the notification should be sent to the issue's reporter. */ - reporter?: boolean; - /** Whether the notification should be sent to the issue's assignees. */ - assignee?: boolean; - /** Whether the notification should be sent to the issue's watchers. */ - watchers?: boolean; - /** Whether the notification should be sent to the issue's voters. */ - voters?: boolean; - /** List of users to receive the notification. */ - users?: UserDetails[]; - /** List of groups to receive the notification. */ - groups?: GroupName[]; - /** List of groupIds to receive the notification. */ - groupIds?: string[]; -} diff --git a/src/version3/models/notificationRecipientsRestrictions.mts b/src/version3/models/notificationRecipientsRestrictions.mts new file mode 100644 index 000000000..7c183c383 --- /dev/null +++ b/src/version3/models/notificationRecipientsRestrictions.mts @@ -0,0 +1,12 @@ +import type { GroupName } from './groupName.mjs'; +import { RestrictedPermission } from './restrictedPermission.mjs'; + +/** Details of the group membership or permissions needed to receive the notification. */ +export interface NotificationRecipientsRestrictions { + /** List of group memberships required to receive the notification. */ + groups?: GroupName[]; + /** List of groupId memberships required to receive the notification. */ + groupIds?: string[]; + /** List of permissions required to receive the notification. */ + permissions?: RestrictedPermission[]; +} diff --git a/src/version3/models/notificationRecipientsRestrictions.ts b/src/version3/models/notificationRecipientsRestrictions.ts deleted file mode 100644 index 1e99bb116..000000000 --- a/src/version3/models/notificationRecipientsRestrictions.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { GroupName } from './groupName.js'; -import type { RestrictedPermission } from './restrictedPermission.js'; - -/** Details of the group membership or permissions needed to receive the notification. */ -export interface NotificationRecipientsRestrictions { - /** List of group memberships required to receive the notification. */ - groups?: GroupName[]; - /** List of groupId memberships required to receive the notification. */ - groupIds?: string[]; - /** List of permissions required to receive the notification. */ - permissions?: RestrictedPermission[]; -} diff --git a/src/version3/models/notificationScheme.mts b/src/version3/models/notificationScheme.mts new file mode 100644 index 000000000..242a08c3f --- /dev/null +++ b/src/version3/models/notificationScheme.mts @@ -0,0 +1,18 @@ +import { NotificationSchemeEvent } from './notificationSchemeEvent.mjs'; +import type { Scope } from './scope.mjs'; + +/** Details about a notification scheme. */ +export interface NotificationScheme { + /** Expand options that include additional notification scheme details in the response. */ + expand?: string; + /** The ID of the notification scheme. */ + id?: number; + self?: string; + /** The name of the notification scheme. */ + name?: string; + /** The description of the notification scheme. */ + description?: string; + /** The notification events and associated recipients. */ + notificationSchemeEvents?: NotificationSchemeEvent[]; + scope?: Scope; +} diff --git a/src/version3/models/notificationScheme.ts b/src/version3/models/notificationScheme.ts deleted file mode 100644 index c98384afd..000000000 --- a/src/version3/models/notificationScheme.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { NotificationSchemeEvent } from './notificationSchemeEvent.js'; -import type { Scope } from './scope.js'; - -/** Details about a notification scheme. */ -export interface NotificationScheme { - /** Expand options that include additional notification scheme details in the response. */ - expand?: string; - /** The ID of the notification scheme. */ - id?: number; - self?: string; - /** The name of the notification scheme. */ - name?: string; - /** The description of the notification scheme. */ - description?: string; - /** The notification events and associated recipients. */ - notificationSchemeEvents?: NotificationSchemeEvent[]; - scope?: Scope; -} diff --git a/src/version3/models/notificationSchemeAndProjectMapping.ts b/src/version3/models/notificationSchemeAndProjectMapping.mts similarity index 100% rename from src/version3/models/notificationSchemeAndProjectMapping.ts rename to src/version3/models/notificationSchemeAndProjectMapping.mts diff --git a/src/version3/models/notificationSchemeAndProjectMappingPage.mts b/src/version3/models/notificationSchemeAndProjectMappingPage.mts new file mode 100644 index 000000000..c8278b5b3 --- /dev/null +++ b/src/version3/models/notificationSchemeAndProjectMappingPage.mts @@ -0,0 +1,19 @@ +import { NotificationSchemeAndProjectMapping } from './notificationSchemeAndProjectMapping.mjs'; + +/** A page of items. */ +export interface NotificationSchemeAndProjectMappingPage { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: NotificationSchemeAndProjectMapping[]; +} diff --git a/src/version3/models/notificationSchemeAndProjectMappingPage.ts b/src/version3/models/notificationSchemeAndProjectMappingPage.ts deleted file mode 100644 index 272131b30..000000000 --- a/src/version3/models/notificationSchemeAndProjectMappingPage.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { NotificationSchemeAndProjectMapping } from './notificationSchemeAndProjectMapping.js'; - -/** A page of items. */ -export interface NotificationSchemeAndProjectMappingPage { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: NotificationSchemeAndProjectMapping[]; -} diff --git a/src/version3/models/notificationSchemeEvent.mts b/src/version3/models/notificationSchemeEvent.mts new file mode 100644 index 000000000..f135060a6 --- /dev/null +++ b/src/version3/models/notificationSchemeEvent.mts @@ -0,0 +1,8 @@ +import { EventNotification } from './eventNotification.mjs'; +import { NotificationEvent } from './notificationEvent.mjs'; + +/** Details about a notification scheme event. */ +export interface NotificationSchemeEvent { + event?: NotificationEvent; + notifications?: EventNotification[]; +} diff --git a/src/version3/models/notificationSchemeEvent.ts b/src/version3/models/notificationSchemeEvent.ts deleted file mode 100644 index edf809239..000000000 --- a/src/version3/models/notificationSchemeEvent.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { EventNotification } from './eventNotification.js'; -import type { NotificationEvent } from './notificationEvent.js'; - -/** Details about a notification scheme event. */ -export interface NotificationSchemeEvent { - event?: NotificationEvent; - notifications?: EventNotification[]; -} diff --git a/src/version3/models/notificationSchemeEventDetails.mts b/src/version3/models/notificationSchemeEventDetails.mts new file mode 100644 index 000000000..1bc5e86fb --- /dev/null +++ b/src/version3/models/notificationSchemeEventDetails.mts @@ -0,0 +1,9 @@ +import { NotificationSchemeEventTypeId } from './notificationSchemeEventTypeId.mjs'; +import { NotificationSchemeNotificationDetails } from './notificationSchemeNotificationDetails.mjs'; + +/** Details of a notification scheme event. */ +export interface NotificationSchemeEventDetails { + event?: NotificationSchemeEventTypeId; + /** The list of notifications mapped to a specified event. */ + notifications: NotificationSchemeNotificationDetails[]; +} diff --git a/src/version3/models/notificationSchemeEventDetails.ts b/src/version3/models/notificationSchemeEventDetails.ts deleted file mode 100644 index 5ba1caa9f..000000000 --- a/src/version3/models/notificationSchemeEventDetails.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { NotificationSchemeEventTypeId } from './notificationSchemeEventTypeId.js'; -import type { NotificationSchemeNotificationDetails } from './notificationSchemeNotificationDetails.js'; - -/** Details of a notification scheme event. */ -export interface NotificationSchemeEventDetails { - event?: NotificationSchemeEventTypeId; - /** The list of notifications mapped to a specified event. */ - notifications: NotificationSchemeNotificationDetails[]; -} diff --git a/src/version3/models/notificationSchemeEventTypeId.ts b/src/version3/models/notificationSchemeEventTypeId.mts similarity index 100% rename from src/version3/models/notificationSchemeEventTypeId.ts rename to src/version3/models/notificationSchemeEventTypeId.mts diff --git a/src/version3/models/notificationSchemeId.ts b/src/version3/models/notificationSchemeId.mts similarity index 100% rename from src/version3/models/notificationSchemeId.ts rename to src/version3/models/notificationSchemeId.mts diff --git a/src/version3/models/notificationSchemeNotificationDetails.ts b/src/version3/models/notificationSchemeNotificationDetails.mts similarity index 100% rename from src/version3/models/notificationSchemeNotificationDetails.ts rename to src/version3/models/notificationSchemeNotificationDetails.mts diff --git a/src/version3/models/oldToNewSecurityLevelMappings.ts b/src/version3/models/oldToNewSecurityLevelMappings.mts similarity index 100% rename from src/version3/models/oldToNewSecurityLevelMappings.ts rename to src/version3/models/oldToNewSecurityLevelMappings.mts diff --git a/src/version3/models/operationMessage.ts b/src/version3/models/operationMessage.mts similarity index 100% rename from src/version3/models/operationMessage.ts rename to src/version3/models/operationMessage.mts diff --git a/src/version3/models/operations.mts b/src/version3/models/operations.mts new file mode 100644 index 000000000..abc4e9bf0 --- /dev/null +++ b/src/version3/models/operations.mts @@ -0,0 +1,7 @@ +import { LinkGroup } from './linkGroup.mjs'; + +/** Details of the operations that can be performed on the issue. */ +export interface Operations { + /** Details of the link groups defining issue operations. */ + linkGroups?: LinkGroup[]; +} diff --git a/src/version3/models/operations.ts b/src/version3/models/operations.ts deleted file mode 100644 index 8102a00ec..000000000 --- a/src/version3/models/operations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { LinkGroup } from './linkGroup.js'; - -/** Details of the operations that can be performed on the issue. */ -export interface Operations { - /** Details of the link groups defining issue operations. */ - linkGroups?: LinkGroup[]; -} diff --git a/src/version3/models/orderOfCustomFieldOptions.ts b/src/version3/models/orderOfCustomFieldOptions.mts similarity index 100% rename from src/version3/models/orderOfCustomFieldOptions.ts rename to src/version3/models/orderOfCustomFieldOptions.mts diff --git a/src/version3/models/orderOfIssueTypes.ts b/src/version3/models/orderOfIssueTypes.mts similarity index 100% rename from src/version3/models/orderOfIssueTypes.ts rename to src/version3/models/orderOfIssueTypes.mts diff --git a/src/version3/models/pageBeanFieldConfigurationDetails.mts b/src/version3/models/pageBeanFieldConfigurationDetails.mts new file mode 100644 index 000000000..0ac6e017c --- /dev/null +++ b/src/version3/models/pageBeanFieldConfigurationDetails.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationDetails } from './fieldConfigurationDetails.mjs'; + +/** A page of items. */ +export interface PageBeanFieldConfigurationDetails { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: FieldConfigurationDetails[]; +} diff --git a/src/version3/models/pageBeanFieldConfigurationDetails.ts b/src/version3/models/pageBeanFieldConfigurationDetails.ts deleted file mode 100644 index 80636a2de..000000000 --- a/src/version3/models/pageBeanFieldConfigurationDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FieldConfigurationDetails } from './fieldConfigurationDetails.js'; - -/** A page of items. */ -export interface PageBeanFieldConfigurationDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: FieldConfigurationDetails[]; -} diff --git a/src/version3/models/pageChangelog.mts b/src/version3/models/pageChangelog.mts new file mode 100644 index 000000000..236b9f4e5 --- /dev/null +++ b/src/version3/models/pageChangelog.mts @@ -0,0 +1,19 @@ +import type { Changelog } from './changelog.mjs'; + +/** A page of items. */ +export interface PageChangelog { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: Changelog[]; +} diff --git a/src/version3/models/pageChangelog.ts b/src/version3/models/pageChangelog.ts deleted file mode 100644 index 2d6c4f2f1..000000000 --- a/src/version3/models/pageChangelog.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Changelog } from './changelog.js'; - -/** A page of items. */ -export interface PageChangelog { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: Changelog[]; -} diff --git a/src/version3/models/pageComment.mts b/src/version3/models/pageComment.mts new file mode 100644 index 000000000..4dfbfec3e --- /dev/null +++ b/src/version3/models/pageComment.mts @@ -0,0 +1,19 @@ +import type { Comment } from './comment.mjs'; + +/** A page of items. */ +export interface PageComment { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: Comment[]; +} diff --git a/src/version3/models/pageComment.ts b/src/version3/models/pageComment.ts deleted file mode 100644 index c7e3d4ad0..000000000 --- a/src/version3/models/pageComment.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Comment } from './comment.js'; - -/** A page of items. */ -export interface PageComment { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: Comment[]; -} diff --git a/src/version3/models/pageComponentWithIssueCount.mts b/src/version3/models/pageComponentWithIssueCount.mts new file mode 100644 index 000000000..d1ad1deb3 --- /dev/null +++ b/src/version3/models/pageComponentWithIssueCount.mts @@ -0,0 +1,19 @@ +import { ComponentWithIssueCount } from './componentWithIssueCount.mjs'; + +/** A page of items. */ +export interface PageComponentWithIssueCount { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: ComponentWithIssueCount[]; +} diff --git a/src/version3/models/pageComponentWithIssueCount.ts b/src/version3/models/pageComponentWithIssueCount.ts deleted file mode 100644 index 1e3f242eb..000000000 --- a/src/version3/models/pageComponentWithIssueCount.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ComponentWithIssueCount } from './componentWithIssueCount.js'; - -/** A page of items. */ -export interface PageComponentWithIssueCount { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: ComponentWithIssueCount[]; -} diff --git a/src/version3/models/pageContextForProjectAndIssueType.mts b/src/version3/models/pageContextForProjectAndIssueType.mts new file mode 100644 index 000000000..6f5fbb666 --- /dev/null +++ b/src/version3/models/pageContextForProjectAndIssueType.mts @@ -0,0 +1,19 @@ +import { ContextForProjectAndIssueType } from './contextForProjectAndIssueType.mjs'; + +/** A page of items. */ +export interface PageContextForProjectAndIssueType { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: ContextForProjectAndIssueType[]; +} diff --git a/src/version3/models/pageContextForProjectAndIssueType.ts b/src/version3/models/pageContextForProjectAndIssueType.ts deleted file mode 100644 index d39384313..000000000 --- a/src/version3/models/pageContextForProjectAndIssueType.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ContextForProjectAndIssueType } from './contextForProjectAndIssueType.js'; - -/** A page of items. */ -export interface PageContextForProjectAndIssueType { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: ContextForProjectAndIssueType[]; -} diff --git a/src/version3/models/pageContextualConfiguration.mts b/src/version3/models/pageContextualConfiguration.mts new file mode 100644 index 000000000..40edfda5f --- /dev/null +++ b/src/version3/models/pageContextualConfiguration.mts @@ -0,0 +1,19 @@ +import { ContextualConfiguration } from './contextualConfiguration.mjs'; + +/** A page of items. */ +export interface PageContextualConfiguration { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: ContextualConfiguration[]; +} diff --git a/src/version3/models/pageContextualConfiguration.ts b/src/version3/models/pageContextualConfiguration.ts deleted file mode 100644 index 0416f74ab..000000000 --- a/src/version3/models/pageContextualConfiguration.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ContextualConfiguration } from './contextualConfiguration.js'; - -/** A page of items. */ -export interface PageContextualConfiguration { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: ContextualConfiguration[]; -} diff --git a/src/version3/models/pageCustomFieldContext.mts b/src/version3/models/pageCustomFieldContext.mts new file mode 100644 index 000000000..132dfbee5 --- /dev/null +++ b/src/version3/models/pageCustomFieldContext.mts @@ -0,0 +1,19 @@ +import { CustomFieldContext } from './customFieldContext.mjs'; + +/** A page of items. */ +export interface PageCustomFieldContext { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: CustomFieldContext[]; +} diff --git a/src/version3/models/pageCustomFieldContext.ts b/src/version3/models/pageCustomFieldContext.ts deleted file mode 100644 index 9d50370d1..000000000 --- a/src/version3/models/pageCustomFieldContext.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { CustomFieldContext } from './customFieldContext.js'; - -/** A page of items. */ -export interface PageCustomFieldContext { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: CustomFieldContext[]; -} diff --git a/src/version3/models/pageCustomFieldContextDefaultValue.mts b/src/version3/models/pageCustomFieldContextDefaultValue.mts new file mode 100644 index 000000000..f7bb1379e --- /dev/null +++ b/src/version3/models/pageCustomFieldContextDefaultValue.mts @@ -0,0 +1,19 @@ +import { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue.mjs'; + +/** A page of items. */ +export interface PageCustomFieldContextDefaultValue { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: CustomFieldContextDefaultValue[]; +} diff --git a/src/version3/models/pageCustomFieldContextDefaultValue.ts b/src/version3/models/pageCustomFieldContextDefaultValue.ts deleted file mode 100644 index 321b6fe0c..000000000 --- a/src/version3/models/pageCustomFieldContextDefaultValue.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue.js'; - -/** A page of items. */ -export interface PageCustomFieldContextDefaultValue { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: CustomFieldContextDefaultValue[]; -} diff --git a/src/version3/models/pageCustomFieldContextOption.mts b/src/version3/models/pageCustomFieldContextOption.mts new file mode 100644 index 000000000..10f820f98 --- /dev/null +++ b/src/version3/models/pageCustomFieldContextOption.mts @@ -0,0 +1,19 @@ +import { CustomFieldContextOption } from './customFieldContextOption.mjs'; + +/** A page of items. */ +export interface PageCustomFieldContextOption { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: CustomFieldContextOption[]; +} diff --git a/src/version3/models/pageCustomFieldContextOption.ts b/src/version3/models/pageCustomFieldContextOption.ts deleted file mode 100644 index 09b4fb6b8..000000000 --- a/src/version3/models/pageCustomFieldContextOption.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { CustomFieldContextOption } from './customFieldContextOption.js'; - -/** A page of items. */ -export interface PageCustomFieldContextOption { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: CustomFieldContextOption[]; -} diff --git a/src/version3/models/pageCustomFieldContextProjectMapping.mts b/src/version3/models/pageCustomFieldContextProjectMapping.mts new file mode 100644 index 000000000..64ca191fa --- /dev/null +++ b/src/version3/models/pageCustomFieldContextProjectMapping.mts @@ -0,0 +1,19 @@ +import { CustomFieldContextProjectMapping } from './customFieldContextProjectMapping.mjs'; + +/** A page of items. */ +export interface PageCustomFieldContextProjectMapping { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: CustomFieldContextProjectMapping[]; +} diff --git a/src/version3/models/pageCustomFieldContextProjectMapping.ts b/src/version3/models/pageCustomFieldContextProjectMapping.ts deleted file mode 100644 index fd950ae82..000000000 --- a/src/version3/models/pageCustomFieldContextProjectMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { CustomFieldContextProjectMapping } from './customFieldContextProjectMapping.js'; - -/** A page of items. */ -export interface PageCustomFieldContextProjectMapping { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: CustomFieldContextProjectMapping[]; -} diff --git a/src/version3/models/pageDashboard.mts b/src/version3/models/pageDashboard.mts new file mode 100644 index 000000000..79095bfd4 --- /dev/null +++ b/src/version3/models/pageDashboard.mts @@ -0,0 +1,19 @@ +import type { Dashboard } from './dashboard.mjs'; + +/** A page of items. */ +export interface PageDashboard { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: Dashboard[]; +} diff --git a/src/version3/models/pageDashboard.ts b/src/version3/models/pageDashboard.ts deleted file mode 100644 index 2f99c17d5..000000000 --- a/src/version3/models/pageDashboard.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Dashboard } from './dashboard.js'; - -/** A page of items. */ -export interface PageDashboard { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: Dashboard[]; -} diff --git a/src/version3/models/pageField.mts b/src/version3/models/pageField.mts new file mode 100644 index 000000000..8db861bd9 --- /dev/null +++ b/src/version3/models/pageField.mts @@ -0,0 +1,19 @@ +import { Field } from './field.mjs'; + +/** A page of items. */ +export interface PageField { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: Field[]; +} diff --git a/src/version3/models/pageField.ts b/src/version3/models/pageField.ts deleted file mode 100644 index 09d0a06e8..000000000 --- a/src/version3/models/pageField.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Field } from './field.js'; - -/** A page of items. */ -export interface PageField { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: Field[]; -} diff --git a/src/version3/models/pageFieldConfigurationIssueTypeItem.mts b/src/version3/models/pageFieldConfigurationIssueTypeItem.mts new file mode 100644 index 000000000..417998ed1 --- /dev/null +++ b/src/version3/models/pageFieldConfigurationIssueTypeItem.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationIssueTypeItem } from './fieldConfigurationIssueTypeItem.mjs'; + +/** A page of items. */ +export interface PageFieldConfigurationIssueTypeItem { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: FieldConfigurationIssueTypeItem[]; +} diff --git a/src/version3/models/pageFieldConfigurationIssueTypeItem.ts b/src/version3/models/pageFieldConfigurationIssueTypeItem.ts deleted file mode 100644 index f3a47d2af..000000000 --- a/src/version3/models/pageFieldConfigurationIssueTypeItem.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FieldConfigurationIssueTypeItem } from './fieldConfigurationIssueTypeItem.js'; - -/** A page of items. */ -export interface PageFieldConfigurationIssueTypeItem { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: FieldConfigurationIssueTypeItem[]; -} diff --git a/src/version3/models/pageFieldConfigurationItem.mts b/src/version3/models/pageFieldConfigurationItem.mts new file mode 100644 index 000000000..848e99508 --- /dev/null +++ b/src/version3/models/pageFieldConfigurationItem.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationItem } from './fieldConfigurationItem.mjs'; + +/** A page of items. */ +export interface PageFieldConfigurationItem { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: FieldConfigurationItem[]; +} diff --git a/src/version3/models/pageFieldConfigurationItem.ts b/src/version3/models/pageFieldConfigurationItem.ts deleted file mode 100644 index bca41d8dc..000000000 --- a/src/version3/models/pageFieldConfigurationItem.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FieldConfigurationItem } from './fieldConfigurationItem.js'; - -/** A page of items. */ -export interface PageFieldConfigurationItem { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: FieldConfigurationItem[]; -} diff --git a/src/version3/models/pageFieldConfigurationScheme.mts b/src/version3/models/pageFieldConfigurationScheme.mts new file mode 100644 index 000000000..e275f5d0d --- /dev/null +++ b/src/version3/models/pageFieldConfigurationScheme.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationScheme } from './fieldConfigurationScheme.mjs'; + +/** A page of items. */ +export interface PageFieldConfigurationScheme { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: FieldConfigurationScheme[]; +} diff --git a/src/version3/models/pageFieldConfigurationScheme.ts b/src/version3/models/pageFieldConfigurationScheme.ts deleted file mode 100644 index 61f16b526..000000000 --- a/src/version3/models/pageFieldConfigurationScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FieldConfigurationScheme } from './fieldConfigurationScheme.js'; - -/** A page of items. */ -export interface PageFieldConfigurationScheme { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: FieldConfigurationScheme[]; -} diff --git a/src/version3/models/pageFieldConfigurationSchemeProjects.mts b/src/version3/models/pageFieldConfigurationSchemeProjects.mts new file mode 100644 index 000000000..d16c46222 --- /dev/null +++ b/src/version3/models/pageFieldConfigurationSchemeProjects.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationSchemeProjects } from './fieldConfigurationSchemeProjects.mjs'; + +/** A page of items. */ +export interface PageFieldConfigurationSchemeProjects { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: FieldConfigurationSchemeProjects[]; +} diff --git a/src/version3/models/pageFieldConfigurationSchemeProjects.ts b/src/version3/models/pageFieldConfigurationSchemeProjects.ts deleted file mode 100644 index 8ded5f064..000000000 --- a/src/version3/models/pageFieldConfigurationSchemeProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FieldConfigurationSchemeProjects } from './fieldConfigurationSchemeProjects.js'; - -/** A page of items. */ -export interface PageFieldConfigurationSchemeProjects { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: FieldConfigurationSchemeProjects[]; -} diff --git a/src/version3/models/pageFilterDetails.mts b/src/version3/models/pageFilterDetails.mts new file mode 100644 index 000000000..b8fbf3007 --- /dev/null +++ b/src/version3/models/pageFilterDetails.mts @@ -0,0 +1,19 @@ +import { FilterDetails } from './filterDetails.mjs'; + +/** A page of items. */ +export interface PageFilterDetails { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: FilterDetails[]; +} diff --git a/src/version3/models/pageFilterDetails.ts b/src/version3/models/pageFilterDetails.ts deleted file mode 100644 index f4861be7b..000000000 --- a/src/version3/models/pageFilterDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FilterDetails } from './filterDetails.js'; - -/** A page of items. */ -export interface PageFilterDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: FilterDetails[]; -} diff --git a/src/version3/models/pageGroupDetails.mts b/src/version3/models/pageGroupDetails.mts new file mode 100644 index 000000000..d29a0db1b --- /dev/null +++ b/src/version3/models/pageGroupDetails.mts @@ -0,0 +1,19 @@ +import { GroupDetails } from './groupDetails.mjs'; + +/** A page of items. */ +export interface PageGroupDetails { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: GroupDetails[]; +} diff --git a/src/version3/models/pageGroupDetails.ts b/src/version3/models/pageGroupDetails.ts deleted file mode 100644 index 1a31c45f6..000000000 --- a/src/version3/models/pageGroupDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { GroupDetails } from './groupDetails.js'; - -/** A page of items. */ -export interface PageGroupDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: GroupDetails[]; -} diff --git a/src/version3/models/pageIssueFieldOption.mts b/src/version3/models/pageIssueFieldOption.mts new file mode 100644 index 000000000..1ca952997 --- /dev/null +++ b/src/version3/models/pageIssueFieldOption.mts @@ -0,0 +1,19 @@ +import { IssueFieldOption } from './issueFieldOption.mjs'; + +/** A page of items. */ +export interface PageIssueFieldOption { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: IssueFieldOption[]; +} diff --git a/src/version3/models/pageIssueFieldOption.ts b/src/version3/models/pageIssueFieldOption.ts deleted file mode 100644 index d60699ac9..000000000 --- a/src/version3/models/pageIssueFieldOption.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueFieldOption } from './issueFieldOption.js'; - -/** A page of items. */ -export interface PageIssueFieldOption { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: IssueFieldOption[]; -} diff --git a/src/version3/models/pageIssueSecurityLevelMember.mts b/src/version3/models/pageIssueSecurityLevelMember.mts new file mode 100644 index 000000000..22aa0ae31 --- /dev/null +++ b/src/version3/models/pageIssueSecurityLevelMember.mts @@ -0,0 +1,19 @@ +import { IssueSecurityLevelMember } from './issueSecurityLevelMember.mjs'; + +/** A page of items. */ +export interface PageIssueSecurityLevelMember { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: IssueSecurityLevelMember[]; +} diff --git a/src/version3/models/pageIssueSecurityLevelMember.ts b/src/version3/models/pageIssueSecurityLevelMember.ts deleted file mode 100644 index 3324911bd..000000000 --- a/src/version3/models/pageIssueSecurityLevelMember.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueSecurityLevelMember } from './issueSecurityLevelMember.js'; - -/** A page of items. */ -export interface PageIssueSecurityLevelMember { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: IssueSecurityLevelMember[]; -} diff --git a/src/version3/models/pageIssueSecuritySchemeToProjectMapping.mts b/src/version3/models/pageIssueSecuritySchemeToProjectMapping.mts new file mode 100644 index 000000000..aec4eb4ea --- /dev/null +++ b/src/version3/models/pageIssueSecuritySchemeToProjectMapping.mts @@ -0,0 +1,19 @@ +import { IssueSecuritySchemeToProjectMapping } from './issueSecuritySchemeToProjectMapping.mjs'; + +/** A page of items. */ +export interface PageIssueSecuritySchemeToProjectMapping { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: IssueSecuritySchemeToProjectMapping[]; +} diff --git a/src/version3/models/pageIssueSecuritySchemeToProjectMapping.ts b/src/version3/models/pageIssueSecuritySchemeToProjectMapping.ts deleted file mode 100644 index 0cfd706d9..000000000 --- a/src/version3/models/pageIssueSecuritySchemeToProjectMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueSecuritySchemeToProjectMapping } from './issueSecuritySchemeToProjectMapping.js'; - -/** A page of items. */ -export interface PageIssueSecuritySchemeToProjectMapping { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: IssueSecuritySchemeToProjectMapping[]; -} diff --git a/src/version3/models/pageIssueTypeScheme.mts b/src/version3/models/pageIssueTypeScheme.mts new file mode 100644 index 000000000..22428f1d8 --- /dev/null +++ b/src/version3/models/pageIssueTypeScheme.mts @@ -0,0 +1,19 @@ +import { IssueTypeScheme } from './issueTypeScheme.mjs'; + +/** A page of items. */ +export interface PageIssueTypeScheme { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: IssueTypeScheme[]; +} diff --git a/src/version3/models/pageIssueTypeScheme.ts b/src/version3/models/pageIssueTypeScheme.ts deleted file mode 100644 index 97ba2e852..000000000 --- a/src/version3/models/pageIssueTypeScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeScheme } from './issueTypeScheme.js'; - -/** A page of items. */ -export interface PageIssueTypeScheme { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: IssueTypeScheme[]; -} diff --git a/src/version3/models/pageIssueTypeSchemeMapping.mts b/src/version3/models/pageIssueTypeSchemeMapping.mts new file mode 100644 index 000000000..1c8f0fb05 --- /dev/null +++ b/src/version3/models/pageIssueTypeSchemeMapping.mts @@ -0,0 +1,19 @@ +import { IssueTypeSchemeMapping } from './issueTypeSchemeMapping.mjs'; + +/** A page of items. */ +export interface PageIssueTypeSchemeMapping { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: IssueTypeSchemeMapping[]; +} diff --git a/src/version3/models/pageIssueTypeSchemeMapping.ts b/src/version3/models/pageIssueTypeSchemeMapping.ts deleted file mode 100644 index e6be1644b..000000000 --- a/src/version3/models/pageIssueTypeSchemeMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeSchemeMapping } from './issueTypeSchemeMapping.js'; - -/** A page of items. */ -export interface PageIssueTypeSchemeMapping { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: IssueTypeSchemeMapping[]; -} diff --git a/src/version3/models/pageIssueTypeSchemeProjects.mts b/src/version3/models/pageIssueTypeSchemeProjects.mts new file mode 100644 index 000000000..7adc22e70 --- /dev/null +++ b/src/version3/models/pageIssueTypeSchemeProjects.mts @@ -0,0 +1,19 @@ +import { IssueTypeSchemeProjects } from './issueTypeSchemeProjects.mjs'; + +/** A page of items. */ +export interface PageIssueTypeSchemeProjects { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: IssueTypeSchemeProjects[]; +} diff --git a/src/version3/models/pageIssueTypeSchemeProjects.ts b/src/version3/models/pageIssueTypeSchemeProjects.ts deleted file mode 100644 index 5c1515055..000000000 --- a/src/version3/models/pageIssueTypeSchemeProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeSchemeProjects } from './issueTypeSchemeProjects.js'; - -/** A page of items. */ -export interface PageIssueTypeSchemeProjects { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: IssueTypeSchemeProjects[]; -} diff --git a/src/version3/models/pageIssueTypeScreenScheme.mts b/src/version3/models/pageIssueTypeScreenScheme.mts new file mode 100644 index 000000000..179710c7f --- /dev/null +++ b/src/version3/models/pageIssueTypeScreenScheme.mts @@ -0,0 +1,19 @@ +import { IssueTypeScreenScheme } from './issueTypeScreenScheme.mjs'; + +/** A page of items. */ +export interface PageIssueTypeScreenScheme { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: IssueTypeScreenScheme[]; +} diff --git a/src/version3/models/pageIssueTypeScreenScheme.ts b/src/version3/models/pageIssueTypeScreenScheme.ts deleted file mode 100644 index 131290da7..000000000 --- a/src/version3/models/pageIssueTypeScreenScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeScreenScheme } from './issueTypeScreenScheme.js'; - -/** A page of items. */ -export interface PageIssueTypeScreenScheme { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: IssueTypeScreenScheme[]; -} diff --git a/src/version3/models/pageIssueTypeScreenSchemeItem.mts b/src/version3/models/pageIssueTypeScreenSchemeItem.mts new file mode 100644 index 000000000..04f113447 --- /dev/null +++ b/src/version3/models/pageIssueTypeScreenSchemeItem.mts @@ -0,0 +1,19 @@ +import { IssueTypeScreenSchemeItem } from './issueTypeScreenSchemeItem.mjs'; + +/** A page of items. */ +export interface PageIssueTypeScreenSchemeItem { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: IssueTypeScreenSchemeItem[]; +} diff --git a/src/version3/models/pageIssueTypeScreenSchemeItem.ts b/src/version3/models/pageIssueTypeScreenSchemeItem.ts deleted file mode 100644 index e2ba00a70..000000000 --- a/src/version3/models/pageIssueTypeScreenSchemeItem.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeScreenSchemeItem } from './issueTypeScreenSchemeItem.js'; - -/** A page of items. */ -export interface PageIssueTypeScreenSchemeItem { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: IssueTypeScreenSchemeItem[]; -} diff --git a/src/version3/models/pageIssueTypeScreenSchemesProjects.mts b/src/version3/models/pageIssueTypeScreenSchemesProjects.mts new file mode 100644 index 000000000..838eda129 --- /dev/null +++ b/src/version3/models/pageIssueTypeScreenSchemesProjects.mts @@ -0,0 +1,19 @@ +import { IssueTypeScreenSchemesProjects } from './issueTypeScreenSchemesProjects.mjs'; + +/** A page of items. */ +export interface PageIssueTypeScreenSchemesProjects { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: IssueTypeScreenSchemesProjects[]; +} diff --git a/src/version3/models/pageIssueTypeScreenSchemesProjects.ts b/src/version3/models/pageIssueTypeScreenSchemesProjects.ts deleted file mode 100644 index 97c0d065c..000000000 --- a/src/version3/models/pageIssueTypeScreenSchemesProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeScreenSchemesProjects } from './issueTypeScreenSchemesProjects.js'; - -/** A page of items. */ -export interface PageIssueTypeScreenSchemesProjects { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: IssueTypeScreenSchemesProjects[]; -} diff --git a/src/version3/models/pageIssueTypeToContextMapping.mts b/src/version3/models/pageIssueTypeToContextMapping.mts new file mode 100644 index 000000000..2789bb54a --- /dev/null +++ b/src/version3/models/pageIssueTypeToContextMapping.mts @@ -0,0 +1,19 @@ +import { IssueTypeToContextMapping } from './issueTypeToContextMapping.mjs'; + +/** A page of items. */ +export interface PageIssueTypeToContextMapping { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: IssueTypeToContextMapping[]; +} diff --git a/src/version3/models/pageIssueTypeToContextMapping.ts b/src/version3/models/pageIssueTypeToContextMapping.ts deleted file mode 100644 index 03791c36a..000000000 --- a/src/version3/models/pageIssueTypeToContextMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { IssueTypeToContextMapping } from './issueTypeToContextMapping.js'; - -/** A page of items. */ -export interface PageIssueTypeToContextMapping { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: IssueTypeToContextMapping[]; -} diff --git a/src/version3/models/pageJqlFunctionPrecomputation.mts b/src/version3/models/pageJqlFunctionPrecomputation.mts new file mode 100644 index 000000000..3e2c315a4 --- /dev/null +++ b/src/version3/models/pageJqlFunctionPrecomputation.mts @@ -0,0 +1,19 @@ +import { JqlFunctionPrecomputation } from './jqlFunctionPrecomputation.mjs'; + +/** A page of items. */ +export interface PageJqlFunctionPrecomputation { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: JqlFunctionPrecomputation[]; +} diff --git a/src/version3/models/pageJqlFunctionPrecomputation.ts b/src/version3/models/pageJqlFunctionPrecomputation.ts deleted file mode 100644 index 0aeaad066..000000000 --- a/src/version3/models/pageJqlFunctionPrecomputation.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { JqlFunctionPrecomputation } from './jqlFunctionPrecomputation.js'; - -/** A page of items. */ -export interface PageJqlFunctionPrecomputation { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: JqlFunctionPrecomputation[]; -} diff --git a/src/version3/models/pageNotificationScheme.mts b/src/version3/models/pageNotificationScheme.mts new file mode 100644 index 000000000..7d916ade3 --- /dev/null +++ b/src/version3/models/pageNotificationScheme.mts @@ -0,0 +1,19 @@ +import { NotificationScheme } from './notificationScheme.mjs'; + +/** A page of items. */ +export interface PageNotificationScheme { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: NotificationScheme[]; +} diff --git a/src/version3/models/pageNotificationScheme.ts b/src/version3/models/pageNotificationScheme.ts deleted file mode 100644 index e4429e0fd..000000000 --- a/src/version3/models/pageNotificationScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { NotificationScheme } from './notificationScheme.js'; - -/** A page of items. */ -export interface PageNotificationScheme { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: NotificationScheme[]; -} diff --git a/src/version3/models/pageOfChangelogs.mts b/src/version3/models/pageOfChangelogs.mts new file mode 100644 index 000000000..65c39d3b3 --- /dev/null +++ b/src/version3/models/pageOfChangelogs.mts @@ -0,0 +1,13 @@ +import type { Changelog } from './changelog.mjs'; + +/** A page of changelogs. */ +export interface PageOfChangelogs { + /** The index of the first item returned on the page. */ + startAt?: number; + /** The maximum number of results that could be on the page. */ + maxResults?: number; + /** The number of results on the page. */ + total?: number; + /** The list of changelogs. */ + histories?: Changelog[]; +} diff --git a/src/version3/models/pageOfChangelogs.ts b/src/version3/models/pageOfChangelogs.ts deleted file mode 100644 index ab9a94918..000000000 --- a/src/version3/models/pageOfChangelogs.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Changelog } from './changelog.js'; - -/** A page of changelogs. */ -export interface PageOfChangelogs { - /** The index of the first item returned on the page. */ - startAt?: number; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The number of results on the page. */ - total?: number; - /** The list of changelogs. */ - histories?: Changelog[]; -} diff --git a/src/version3/models/pageOfComments.mts b/src/version3/models/pageOfComments.mts new file mode 100644 index 000000000..f86c2a245 --- /dev/null +++ b/src/version3/models/pageOfComments.mts @@ -0,0 +1,13 @@ +import type { Comment } from './comment.mjs'; + +/** A page of comments. */ +export interface PageOfComments { + /** The index of the first item returned. */ + startAt?: number; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The number of items returned. */ + total?: number; + /** The list of comments. */ + comments?: Comment[]; +} diff --git a/src/version3/models/pageOfComments.ts b/src/version3/models/pageOfComments.ts deleted file mode 100644 index 947ed717f..000000000 --- a/src/version3/models/pageOfComments.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Comment } from './comment.js'; - -/** A page of comments. */ -export interface PageOfComments { - /** The index of the first item returned. */ - startAt?: number; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The number of items returned. */ - total?: number; - /** The list of comments. */ - comments?: Comment[]; -} diff --git a/src/version3/models/pageOfDashboards.mts b/src/version3/models/pageOfDashboards.mts new file mode 100644 index 000000000..bef24d151 --- /dev/null +++ b/src/version3/models/pageOfDashboards.mts @@ -0,0 +1,17 @@ +import type { Dashboard } from './dashboard.mjs'; + +/** A page containing dashboard details. */ +export interface PageOfDashboards { + /** The index of the first item returned on the page. */ + startAt?: number; + /** The maximum number of results that could be on the page. */ + maxResults?: number; + /** The number of results on the page. */ + total?: number; + /** The URL of the previous page of results, if any. */ + prev?: string; + /** The URL of the next page of results, if any. */ + next?: string; + /** List of dashboards. */ + dashboards?: Dashboard[]; +} diff --git a/src/version3/models/pageOfDashboards.ts b/src/version3/models/pageOfDashboards.ts deleted file mode 100644 index 76a672adc..000000000 --- a/src/version3/models/pageOfDashboards.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { Dashboard } from './dashboard.js'; - -/** A page containing dashboard details. */ -export interface PageOfDashboards { - /** The index of the first item returned on the page. */ - startAt?: number; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The number of results on the page. */ - total?: number; - /** The URL of the previous page of results, if any. */ - prev?: string; - /** The URL of the next page of results, if any. */ - next?: string; - /** List of dashboards. */ - dashboards?: Dashboard[]; -} diff --git a/src/version3/models/pageOfStatuses.mts b/src/version3/models/pageOfStatuses.mts new file mode 100644 index 000000000..69b3437c8 --- /dev/null +++ b/src/version3/models/pageOfStatuses.mts @@ -0,0 +1,18 @@ +import type { JiraStatus } from './jiraStatus.mjs'; + +export interface PageOfStatuses { + /** The index of the first item returned on the page. */ + startAt?: number; + /** Number of items that satisfy the search. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The list of items. */ + values?: JiraStatus[]; + /** The URL of this page. */ + self?: string; + /** The URL of the next page of results, if any. */ + nextPage?: string; +} diff --git a/src/version3/models/pageOfStatuses.ts b/src/version3/models/pageOfStatuses.ts deleted file mode 100644 index 80699b8a4..000000000 --- a/src/version3/models/pageOfStatuses.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { JiraStatus } from './jiraStatus.js'; - -export interface PageOfStatuses { - /** The index of the first item returned on the page. */ - startAt?: number; - /** Number of items that satisfy the search. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The list of items. */ - values?: JiraStatus[]; - /** The URL of this page. */ - self?: string; - /** The URL of the next page of results, if any. */ - nextPage?: string; -} diff --git a/src/version3/models/pageOfWorklogs.mts b/src/version3/models/pageOfWorklogs.mts new file mode 100644 index 000000000..1d507308a --- /dev/null +++ b/src/version3/models/pageOfWorklogs.mts @@ -0,0 +1,13 @@ +import type { Worklog } from './worklog.mjs'; + +/** Paginated list of worklog details */ +export interface PageOfWorklogs { + /** The index of the first item returned on the page. */ + startAt: number; + /** The maximum number of results that could be on the page. */ + maxResults: number; + /** The number of results on the page. */ + total: number; + /** List of worklogs. */ + worklogs: Worklog[]; +} diff --git a/src/version3/models/pageOfWorklogs.ts b/src/version3/models/pageOfWorklogs.ts deleted file mode 100644 index 4b9181810..000000000 --- a/src/version3/models/pageOfWorklogs.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Worklog } from './worklog.js'; - -/** Paginated list of worklog details */ -export interface PageOfWorklogs { - /** The index of the first item returned on the page. */ - startAt: number; - /** The maximum number of results that could be on the page. */ - maxResults: number; - /** The number of results on the page. */ - total: number; - /** List of worklogs. */ - worklogs: Worklog[]; -} diff --git a/src/version3/models/pagePriority.mts b/src/version3/models/pagePriority.mts new file mode 100644 index 000000000..bac0150bc --- /dev/null +++ b/src/version3/models/pagePriority.mts @@ -0,0 +1,19 @@ +import type { Priority } from './priority.mjs'; + +/** A page of items. */ +export interface PagePriority { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: Priority[]; +} diff --git a/src/version3/models/pagePriority.ts b/src/version3/models/pagePriority.ts deleted file mode 100644 index a142583e0..000000000 --- a/src/version3/models/pagePriority.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Priority } from './priority.js'; - -/** A page of items. */ -export interface PagePriority { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: Priority[]; -} diff --git a/src/version3/models/pageProject.mts b/src/version3/models/pageProject.mts new file mode 100644 index 000000000..462217821 --- /dev/null +++ b/src/version3/models/pageProject.mts @@ -0,0 +1,19 @@ +import type { Project } from './project.mjs'; + +/** A page of items. */ +export interface PageProject { + /** The URL of the page. */ + self: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults: number; + /** The index of the first item returned. */ + startAt: number; + /** The number of items returned. */ + total: number; + /** Whether this is the last page. */ + isLast: boolean; + /** The list of items. */ + values: Project[]; +} diff --git a/src/version3/models/pageProject.ts b/src/version3/models/pageProject.ts deleted file mode 100644 index cbd8e26a4..000000000 --- a/src/version3/models/pageProject.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Project } from './project.js'; - -/** A page of items. */ -export interface PageProject { - /** The URL of the page. */ - self: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults: number; - /** The index of the first item returned. */ - startAt: number; - /** The number of items returned. */ - total: number; - /** Whether this is the last page. */ - isLast: boolean; - /** The list of items. */ - values: Project[]; -} diff --git a/src/version3/models/pageProjectDetails.mts b/src/version3/models/pageProjectDetails.mts new file mode 100644 index 000000000..bb6f771d7 --- /dev/null +++ b/src/version3/models/pageProjectDetails.mts @@ -0,0 +1,19 @@ +import type { ProjectDetails } from './projectDetails.mjs'; + +/** A page of items. */ +export interface PageProjectDetails { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: ProjectDetails[]; +} diff --git a/src/version3/models/pageProjectDetails.ts b/src/version3/models/pageProjectDetails.ts deleted file mode 100644 index e1830fe52..000000000 --- a/src/version3/models/pageProjectDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ProjectDetails } from './projectDetails.js'; - -/** A page of items. */ -export interface PageProjectDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: ProjectDetails[]; -} diff --git a/src/version3/models/pageResolution.mts b/src/version3/models/pageResolution.mts new file mode 100644 index 000000000..59c7355b3 --- /dev/null +++ b/src/version3/models/pageResolution.mts @@ -0,0 +1,19 @@ +import type { Resolution } from './resolution.mjs'; + +/** A page of items. */ +export interface PageResolution { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: Resolution[]; +} diff --git a/src/version3/models/pageResolution.ts b/src/version3/models/pageResolution.ts deleted file mode 100644 index 2d72eb028..000000000 --- a/src/version3/models/pageResolution.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Resolution } from './resolution.js'; - -/** A page of items. */ -export interface PageResolution { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: Resolution[]; -} diff --git a/src/version3/models/pageScreen.mts b/src/version3/models/pageScreen.mts new file mode 100644 index 000000000..a980ea516 --- /dev/null +++ b/src/version3/models/pageScreen.mts @@ -0,0 +1,19 @@ +import type { Screen } from './screen.mjs'; + +/** A page of items. */ +export interface PageScreen { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: Screen[]; +} diff --git a/src/version3/models/pageScreen.ts b/src/version3/models/pageScreen.ts deleted file mode 100644 index 5e79c6e4f..000000000 --- a/src/version3/models/pageScreen.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Screen } from './screen.js'; - -/** A page of items. */ -export interface PageScreen { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: Screen[]; -} diff --git a/src/version3/models/pageScreenScheme.mts b/src/version3/models/pageScreenScheme.mts new file mode 100644 index 000000000..a02d16b40 --- /dev/null +++ b/src/version3/models/pageScreenScheme.mts @@ -0,0 +1,19 @@ +import type { ScreenScheme } from './screenScheme.mjs'; + +/** A page of items. */ +export interface PageScreenScheme { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: ScreenScheme[]; +} diff --git a/src/version3/models/pageScreenScheme.ts b/src/version3/models/pageScreenScheme.ts deleted file mode 100644 index 457cbeb30..000000000 --- a/src/version3/models/pageScreenScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ScreenScheme } from './screenScheme.js'; - -/** A page of items. */ -export interface PageScreenScheme { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: ScreenScheme[]; -} diff --git a/src/version3/models/pageScreenWithTab.mts b/src/version3/models/pageScreenWithTab.mts new file mode 100644 index 000000000..1857917bb --- /dev/null +++ b/src/version3/models/pageScreenWithTab.mts @@ -0,0 +1,19 @@ +import type { ScreenWithTab } from './screenWithTab.mjs'; + +/** A page of items. */ +export interface PageScreenWithTab { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: ScreenWithTab[]; +} diff --git a/src/version3/models/pageScreenWithTab.ts b/src/version3/models/pageScreenWithTab.ts deleted file mode 100644 index 1d933c2db..000000000 --- a/src/version3/models/pageScreenWithTab.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { ScreenWithTab } from './screenWithTab.js'; - -/** A page of items. */ -export interface PageScreenWithTab { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: ScreenWithTab[]; -} diff --git a/src/version3/models/pageSecurityLevel.mts b/src/version3/models/pageSecurityLevel.mts new file mode 100644 index 000000000..a7fbe1dd4 --- /dev/null +++ b/src/version3/models/pageSecurityLevel.mts @@ -0,0 +1,19 @@ +import type { SecurityLevel } from './securityLevel.mjs'; + +/** A page of items. */ +export interface PageSecurityLevel { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: SecurityLevel[]; +} diff --git a/src/version3/models/pageSecurityLevel.ts b/src/version3/models/pageSecurityLevel.ts deleted file mode 100644 index 53f6cec4d..000000000 --- a/src/version3/models/pageSecurityLevel.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { SecurityLevel } from './securityLevel.js'; - -/** A page of items. */ -export interface PageSecurityLevel { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: SecurityLevel[]; -} diff --git a/src/version3/models/pageSecurityLevelMember.mts b/src/version3/models/pageSecurityLevelMember.mts new file mode 100644 index 000000000..df7be8f25 --- /dev/null +++ b/src/version3/models/pageSecurityLevelMember.mts @@ -0,0 +1,19 @@ +import type { SecurityLevelMember } from './securityLevelMember.mjs'; + +/** A page of items. */ +export interface PageSecurityLevelMember { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: SecurityLevelMember[]; +} diff --git a/src/version3/models/pageSecurityLevelMember.ts b/src/version3/models/pageSecurityLevelMember.ts deleted file mode 100644 index 13585613e..000000000 --- a/src/version3/models/pageSecurityLevelMember.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { SecurityLevelMember } from './securityLevelMember.js'; - -/** A page of items. */ -export interface PageSecurityLevelMember { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: SecurityLevelMember[]; -} diff --git a/src/version3/models/pageSecuritySchemeWithProjects.mts b/src/version3/models/pageSecuritySchemeWithProjects.mts new file mode 100644 index 000000000..c2840d1bc --- /dev/null +++ b/src/version3/models/pageSecuritySchemeWithProjects.mts @@ -0,0 +1,19 @@ +import type { SecuritySchemeWithProjects } from './securitySchemeWithProjects.mjs'; + +/** A page of items. */ +export interface PageSecuritySchemeWithProjects { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: SecuritySchemeWithProjects[]; +} diff --git a/src/version3/models/pageSecuritySchemeWithProjects.ts b/src/version3/models/pageSecuritySchemeWithProjects.ts deleted file mode 100644 index e427d7f99..000000000 --- a/src/version3/models/pageSecuritySchemeWithProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { SecuritySchemeWithProjects } from './securitySchemeWithProjects.js'; - -/** A page of items. */ -export interface PageSecuritySchemeWithProjects { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The URL of the page. */ - self?: string; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** The list of items. */ - values?: SecuritySchemeWithProjects[]; -} diff --git a/src/version3/models/pageString.ts b/src/version3/models/pageString.mts similarity index 100% rename from src/version3/models/pageString.ts rename to src/version3/models/pageString.mts diff --git a/src/version3/models/pageUiModificationDetails.mts b/src/version3/models/pageUiModificationDetails.mts new file mode 100644 index 000000000..3c85bb4b3 --- /dev/null +++ b/src/version3/models/pageUiModificationDetails.mts @@ -0,0 +1,19 @@ +import type { UiModificationDetails } from './uiModificationDetails.mjs'; + +/** A page of items. */ +export interface PageUiModificationDetails { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: UiModificationDetails[]; +} diff --git a/src/version3/models/pageUiModificationDetails.ts b/src/version3/models/pageUiModificationDetails.ts deleted file mode 100644 index c1e79d25c..000000000 --- a/src/version3/models/pageUiModificationDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { UiModificationDetails } from './uiModificationDetails.js'; - -/** A page of items. */ -export interface PageUiModificationDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: UiModificationDetails[]; -} diff --git a/src/version3/models/pageUser.mts b/src/version3/models/pageUser.mts new file mode 100644 index 000000000..482de7ed8 --- /dev/null +++ b/src/version3/models/pageUser.mts @@ -0,0 +1,19 @@ +import { User } from './user.mjs'; + +/** A page of items. */ +export interface PageUser { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: User[]; +} diff --git a/src/version3/models/pageUser.ts b/src/version3/models/pageUser.ts deleted file mode 100644 index 6983305e0..000000000 --- a/src/version3/models/pageUser.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { User } from './user.js'; - -/** A page of items. */ -export interface PageUser { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: User[]; -} diff --git a/src/version3/models/pageUserDetails.mts b/src/version3/models/pageUserDetails.mts new file mode 100644 index 000000000..48f60845a --- /dev/null +++ b/src/version3/models/pageUserDetails.mts @@ -0,0 +1,19 @@ +import { UserDetails } from './userDetails.mjs'; + +/** A page of items. */ +export interface PageUserDetails { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: UserDetails[]; +} diff --git a/src/version3/models/pageUserDetails.ts b/src/version3/models/pageUserDetails.ts deleted file mode 100644 index 977d9a4df..000000000 --- a/src/version3/models/pageUserDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { UserDetails } from './userDetails.js'; - -/** A page of items. */ -export interface PageUserDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: UserDetails[]; -} diff --git a/src/version3/models/pageUserKey.mts b/src/version3/models/pageUserKey.mts new file mode 100644 index 000000000..ec7a92d17 --- /dev/null +++ b/src/version3/models/pageUserKey.mts @@ -0,0 +1,19 @@ +import type { UserKey } from './userKey.mjs'; + +/** A page of items. */ +export interface PageUserKey { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: UserKey[]; +} diff --git a/src/version3/models/pageUserKey.ts b/src/version3/models/pageUserKey.ts deleted file mode 100644 index 98b086ccb..000000000 --- a/src/version3/models/pageUserKey.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { UserKey } from './userKey.js'; - -/** A page of items. */ -export interface PageUserKey { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: UserKey[]; -} diff --git a/src/version3/models/pageVersion.mts b/src/version3/models/pageVersion.mts new file mode 100644 index 000000000..2523d4bef --- /dev/null +++ b/src/version3/models/pageVersion.mts @@ -0,0 +1,19 @@ +import type { Version } from './version.mjs'; + +/** A page of items. */ +export interface PageVersion { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: Version[]; +} diff --git a/src/version3/models/pageVersion.ts b/src/version3/models/pageVersion.ts deleted file mode 100644 index 349c27166..000000000 --- a/src/version3/models/pageVersion.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Version } from './version.js'; - -/** A page of items. */ -export interface PageVersion { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: Version[]; -} diff --git a/src/version3/models/pageWebhook.mts b/src/version3/models/pageWebhook.mts new file mode 100644 index 000000000..c23ed7d08 --- /dev/null +++ b/src/version3/models/pageWebhook.mts @@ -0,0 +1,19 @@ +import type { Webhook } from './webhook.mjs'; + +/** A page of items. */ +export interface PageWebhook { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: Webhook[]; +} diff --git a/src/version3/models/pageWebhook.ts b/src/version3/models/pageWebhook.ts deleted file mode 100644 index 2a077174a..000000000 --- a/src/version3/models/pageWebhook.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Webhook } from './webhook.js'; - -/** A page of items. */ -export interface PageWebhook { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: Webhook[]; -} diff --git a/src/version3/models/pageWorkflow.mts b/src/version3/models/pageWorkflow.mts new file mode 100644 index 000000000..20d6adcef --- /dev/null +++ b/src/version3/models/pageWorkflow.mts @@ -0,0 +1,19 @@ +import type { Workflow } from './workflow.mjs'; + +/** A page of items. */ +export interface PageWorkflow { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: Workflow[]; +} diff --git a/src/version3/models/pageWorkflow.ts b/src/version3/models/pageWorkflow.ts deleted file mode 100644 index 549d70499..000000000 --- a/src/version3/models/pageWorkflow.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Workflow } from './workflow.js'; - -/** A page of items. */ -export interface PageWorkflow { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: Workflow[]; -} diff --git a/src/version3/models/pageWorkflowScheme.mts b/src/version3/models/pageWorkflowScheme.mts new file mode 100644 index 000000000..1ffdefb91 --- /dev/null +++ b/src/version3/models/pageWorkflowScheme.mts @@ -0,0 +1,19 @@ +import type { WorkflowScheme } from './workflowScheme.mjs'; + +/** A page of items. */ +export interface PageWorkflowScheme { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: WorkflowScheme[]; +} diff --git a/src/version3/models/pageWorkflowScheme.ts b/src/version3/models/pageWorkflowScheme.ts deleted file mode 100644 index f4765b6b7..000000000 --- a/src/version3/models/pageWorkflowScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { WorkflowScheme } from './workflowScheme.js'; - -/** A page of items. */ -export interface PageWorkflowScheme { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: WorkflowScheme[]; -} diff --git a/src/version3/models/pageWorkflowTransitionRules.mts b/src/version3/models/pageWorkflowTransitionRules.mts new file mode 100644 index 000000000..68e7be22e --- /dev/null +++ b/src/version3/models/pageWorkflowTransitionRules.mts @@ -0,0 +1,19 @@ +import type { WorkflowTransitionRules } from './workflowTransitionRules.mjs'; + +/** A page of items. */ +export interface PageWorkflowTransitionRules { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The list of items. */ + values?: WorkflowTransitionRules[]; +} diff --git a/src/version3/models/pageWorkflowTransitionRules.ts b/src/version3/models/pageWorkflowTransitionRules.ts deleted file mode 100644 index 484d2b573..000000000 --- a/src/version3/models/pageWorkflowTransitionRules.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { WorkflowTransitionRules } from './workflowTransitionRules.js'; - -/** A page of items. */ -export interface PageWorkflowTransitionRules { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The index of the first item returned. */ - startAt?: number; - /** The number of items returned. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The list of items. */ - values?: WorkflowTransitionRules[]; -} diff --git a/src/version3/models/pagedListUserDetailsApplicationUser.mts b/src/version3/models/pagedListUserDetailsApplicationUser.mts new file mode 100644 index 000000000..3afe7ecbf --- /dev/null +++ b/src/version3/models/pagedListUserDetailsApplicationUser.mts @@ -0,0 +1,18 @@ +import { UserDetails } from './userDetails.mjs'; + +/** + * A paged list. To access additional details append `[start-index:end-index]` to the expand request. For example, + * `?expand=sharedUsers[10:40]` returns a list starting at item 10 and finishing at item 40. + */ +export interface PagedListUserDetailsApplicationUser { + /** The number of items on the page. */ + size?: number; + /** The list of items. */ + items?: UserDetails[]; + /** The maximum number of results that could be on the page. */ + 'max-results'?: number; + /** The index of the first item returned on the page. */ + 'start-index'?: number; + /** The index of the last item returned on the page. */ + 'end-index'?: number; +} diff --git a/src/version3/models/pagedListUserDetailsApplicationUser.ts b/src/version3/models/pagedListUserDetailsApplicationUser.ts deleted file mode 100644 index e5ef444f1..000000000 --- a/src/version3/models/pagedListUserDetailsApplicationUser.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { UserDetails } from './userDetails.js'; - -/** - * A paged list. To access additional details append `[start-index:end-index]` to the expand request. For example, - * `?expand=sharedUsers[10:40]` returns a list starting at item 10 and finishing at item 40. - */ -export interface PagedListUserDetailsApplicationUser { - /** The number of items on the page. */ - size?: number; - /** The list of items. */ - items?: UserDetails[]; - /** The maximum number of results that could be on the page. */ - 'max-results'?: number; - /** The index of the first item returned on the page. */ - 'start-index'?: number; - /** The index of the last item returned on the page. */ - 'end-index'?: number; -} diff --git a/src/version3/models/parsedJqlQueries.mts b/src/version3/models/parsedJqlQueries.mts new file mode 100644 index 000000000..e4ae784f6 --- /dev/null +++ b/src/version3/models/parsedJqlQueries.mts @@ -0,0 +1,7 @@ +import type { ParsedJqlQuery } from './parsedJqlQuery.mjs'; + +/** A list of parsed Jql queries. */ +export interface ParsedJqlQueries { + /** A list of parsed Jql queries. */ + queries: ParsedJqlQuery[]; +} diff --git a/src/version3/models/parsedJqlQueries.ts b/src/version3/models/parsedJqlQueries.ts deleted file mode 100644 index c4b94647b..000000000 --- a/src/version3/models/parsedJqlQueries.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ParsedJqlQuery } from './parsedJqlQuery.js'; - -/** A list of parsed JQL queries. */ -export interface ParsedJqlQueries { - /** A list of parsed JQL queries. */ - queries: ParsedJqlQuery[]; -} diff --git a/src/version3/models/parsedJqlQuery.mts b/src/version3/models/parsedJqlQuery.mts new file mode 100644 index 000000000..98304c5e9 --- /dev/null +++ b/src/version3/models/parsedJqlQuery.mts @@ -0,0 +1,10 @@ +import type { JqlQuery } from './jqlQuery.mjs'; + +/** Details of a parsed Jql query. */ +export interface ParsedJqlQuery { + /** The Jql query that was parsed and validated. */ + query: string; + structure?: JqlQuery; + /** The list of syntax or validation errors. */ + errors?: string[]; +} diff --git a/src/version3/models/parsedJqlQuery.ts b/src/version3/models/parsedJqlQuery.ts deleted file mode 100644 index f2c0434fd..000000000 --- a/src/version3/models/parsedJqlQuery.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { JqlQuery } from './jqlQuery.js'; - -/** Details of a parsed JQL query. */ -export interface ParsedJqlQuery { - /** The JQL query that was parsed and validated. */ - query: string; - structure?: JqlQuery; - /** The list of syntax or validation errors. */ - errors?: string[]; -} diff --git a/src/version3/models/permissionDetails.mts b/src/version3/models/permissionDetails.mts new file mode 100644 index 000000000..14aaa79dd --- /dev/null +++ b/src/version3/models/permissionDetails.mts @@ -0,0 +1,9 @@ +import type { SharePermission } from './sharePermission.mjs'; + +/** Details for permissions of shareable entities */ +export interface PermissionDetails { + /** The edit permissions for the shareable entities. */ + editPermissions: SharePermission[]; + /** The share permissions for the shareable entities. */ + sharePermissions: SharePermission[]; +} diff --git a/src/version3/models/permissionDetails.ts b/src/version3/models/permissionDetails.ts deleted file mode 100644 index 906895dc0..000000000 --- a/src/version3/models/permissionDetails.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { SharePermission } from './sharePermission.js'; - -/** Details for permissions of shareable entities */ -export interface PermissionDetails { - /** The edit permissions for the shareable entities. */ - editPermissions: SharePermission[]; - /** The share permissions for the shareable entities. */ - sharePermissions: SharePermission[]; -} diff --git a/src/version3/models/permissionGrant.mts b/src/version3/models/permissionGrant.mts new file mode 100644 index 000000000..6a1a58e1a --- /dev/null +++ b/src/version3/models/permissionGrant.mts @@ -0,0 +1,19 @@ +import type { PermissionHolder } from './permissionHolder.mjs'; + +/** Details about a permission granted to a user or group. */ +export interface PermissionGrant { + /** The ID of the permission granted details. */ + id?: number; + /** The URL of the permission granted details. */ + self?: string; + holder?: PermissionHolder; + /** + * The permission to grant. This permission can be one of the built-in permissions or a custom permission added by an + * app. See [Built-in permissions](../api-group-permission-schemes/#built-in-permissions) in _Get all permission + * schemes_ for more information about the built-in permissions. See the [project + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation + * for more information about custom permissions. + */ + permission?: string; +} diff --git a/src/version3/models/permissionGrant.ts b/src/version3/models/permissionGrant.ts deleted file mode 100644 index 753635d28..000000000 --- a/src/version3/models/permissionGrant.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { PermissionHolder } from './permissionHolder.js'; - -/** Details about a permission granted to a user or group. */ -export interface PermissionGrant { - /** The ID of the permission granted details. */ - id?: number; - /** The URL of the permission granted details. */ - self?: string; - holder?: PermissionHolder; - /** - * The permission to grant. This permission can be one of the built-in permissions or a custom permission added by an - * app. See [Built-in permissions](../api-group-permission-schemes/#built-in-permissions) in _Get all permission - * schemes_ for more information about the built-in permissions. See the [project - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation - * for more information about custom permissions. - */ - permission?: string; -} diff --git a/src/version3/models/permissionGrants.mts b/src/version3/models/permissionGrants.mts new file mode 100644 index 000000000..c47ba064f --- /dev/null +++ b/src/version3/models/permissionGrants.mts @@ -0,0 +1,9 @@ +import type { PermissionGrant } from './permissionGrant.mjs'; + +/** List of permission grants. */ +export interface PermissionGrants { + /** Permission grants list. */ + permissions?: PermissionGrant[]; + /** Expand options that include additional permission grant details in the response. */ + expand?: string; +} diff --git a/src/version3/models/permissionGrants.ts b/src/version3/models/permissionGrants.ts deleted file mode 100644 index a2b3d7a5f..000000000 --- a/src/version3/models/permissionGrants.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { PermissionGrant } from './permissionGrant.js'; - -/** List of permission grants. */ -export interface PermissionGrants { - /** Permission grants list. */ - permissions?: PermissionGrant[]; - /** Expand options that include additional permission grant details in the response. */ - expand?: string; -} diff --git a/src/version3/models/permissionHolder.ts b/src/version3/models/permissionHolder.mts similarity index 100% rename from src/version3/models/permissionHolder.ts rename to src/version3/models/permissionHolder.mts diff --git a/src/version3/models/permissionScheme.mts b/src/version3/models/permissionScheme.mts new file mode 100644 index 000000000..8ad4000e6 --- /dev/null +++ b/src/version3/models/permissionScheme.mts @@ -0,0 +1,22 @@ +import type { PermissionGrant } from './permissionGrant.mjs'; +import type { Scope } from './scope.mjs'; + +/** Details of a permission scheme. */ +export interface PermissionScheme { + /** The expand options available for the permission scheme. */ + expand?: string; + /** The ID of the permission scheme. */ + id?: number; + /** The URL of the permission scheme. */ + self?: string; + /** The name of the permission scheme. Must be unique. */ + name: string; + /** A description for the permission scheme. */ + description?: string; + scope?: Scope; + /** + * The permission scheme to create or update. See [About permission schemes and + * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more information. + */ + permissions?: PermissionGrant[]; +} diff --git a/src/version3/models/permissionScheme.ts b/src/version3/models/permissionScheme.ts deleted file mode 100644 index a87d3f0b9..000000000 --- a/src/version3/models/permissionScheme.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { PermissionGrant } from './permissionGrant.js'; -import type { Scope } from './scope.js'; - -/** Details of a permission scheme. */ -export interface PermissionScheme { - /** The expand options available for the permission scheme. */ - expand?: string; - /** The ID of the permission scheme. */ - id?: number; - /** The URL of the permission scheme. */ - self?: string; - /** The name of the permission scheme. Must be unique. */ - name: string; - /** A description for the permission scheme. */ - description?: string; - scope?: Scope; - /** - * The permission scheme to create or update. See [About permission schemes and - * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more information. - */ - permissions?: PermissionGrant[]; -} diff --git a/src/version3/models/permissionSchemes.mts b/src/version3/models/permissionSchemes.mts new file mode 100644 index 000000000..2ac1a132e --- /dev/null +++ b/src/version3/models/permissionSchemes.mts @@ -0,0 +1,7 @@ +import type { PermissionScheme } from './permissionScheme.mjs'; + +/** List of all permission schemes. */ +export interface PermissionSchemes { + /** Permission schemes list. */ + permissionSchemes?: PermissionScheme[]; +} diff --git a/src/version3/models/permissionSchemes.ts b/src/version3/models/permissionSchemes.ts deleted file mode 100644 index 6590857de..000000000 --- a/src/version3/models/permissionSchemes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PermissionScheme } from './permissionScheme.js'; - -/** List of all permission schemes. */ -export interface PermissionSchemes { - /** Permission schemes list. */ - permissionSchemes?: PermissionScheme[]; -} diff --git a/src/version3/models/permissions.ts b/src/version3/models/permissions.mts similarity index 100% rename from src/version3/models/permissions.ts rename to src/version3/models/permissions.mts diff --git a/src/version3/models/permissionsKeys.ts b/src/version3/models/permissionsKeys.mts similarity index 100% rename from src/version3/models/permissionsKeys.ts rename to src/version3/models/permissionsKeys.mts diff --git a/src/version3/models/permittedProjects.mts b/src/version3/models/permittedProjects.mts new file mode 100644 index 000000000..3b1dad5f7 --- /dev/null +++ b/src/version3/models/permittedProjects.mts @@ -0,0 +1,7 @@ +import type { ProjectIdentifier } from './projectIdentifier.mjs'; + +/** A list of projects in which a user is granted permissions. */ +export interface PermittedProjects { + /** A list of projects. */ + projects?: ProjectIdentifier[]; +} diff --git a/src/version3/models/permittedProjects.ts b/src/version3/models/permittedProjects.ts deleted file mode 100644 index c59be1713..000000000 --- a/src/version3/models/permittedProjects.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ProjectIdentifier } from './projectIdentifier.js'; - -/** A list of projects in which a user is granted permissions. */ -export interface PermittedProjects { - /** A list of projects. */ - projects?: ProjectIdentifier[]; -} diff --git a/src/version3/models/priority.ts b/src/version3/models/priority.mts similarity index 100% rename from src/version3/models/priority.ts rename to src/version3/models/priority.mts diff --git a/src/version3/models/priorityId.ts b/src/version3/models/priorityId.mts similarity index 100% rename from src/version3/models/priorityId.ts rename to src/version3/models/priorityId.mts diff --git a/src/version3/models/project.mts b/src/version3/models/project.mts new file mode 100644 index 000000000..460fb1930 --- /dev/null +++ b/src/version3/models/project.mts @@ -0,0 +1,88 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; +import type { Hierarchy } from './hierarchy.mjs'; +import type { IssueTypeDetails } from './issueTypeDetails.mjs'; +import type { ProjectCategory } from './projectCategory.mjs'; +import type { ProjectComponent } from './projectComponent.mjs'; +import type { ProjectInsight } from './projectInsight.mjs'; +import type { ProjectLandingPageInfo } from './projectLandingPageInfo.mjs'; +import type { ProjectPermissions } from './projectPermissions.mjs'; +import type { User } from './user.mjs'; +import type { Version } from './version.mjs'; + +/** Details about a project. */ +export interface Project { + /** Expand options that include additional project details in the response. */ + expand?: + | 'description' + | 'issueTypes' + | 'lead' + | 'projectKeys' + | 'issueTypeHierarchy' + | ('description' | 'issueTypes' | 'lead' | 'projectKeys' | 'issueTypeHierarchy')[] + | string + | string[]; + /** The URL of the project details. */ + self?: string; + /** The ID of the project. */ + id: string; + /** The key of the project. */ + key: string; + /** A brief description of the project. */ + description?: string; + lead: User; + /** List of the components contained in the project. */ + components?: ProjectComponent[]; + /** List of the issue types available in the project. */ + issueTypes?: IssueTypeDetails[]; + /** A link to information about this project, such as project documentation. */ + url?: string; + /** An email address associated with the project. */ + email?: string; + /** The default assignee when creating issues for this project. */ + assigneeType?: string; + /** The versions defined in the project. For more information, see [Create version](#api-rest-api-3-version-post). */ + versions?: Version[]; + /** The name of the project. */ + name: string; + /** + * The name and self URL for each role defined in the project. For more information, see [Create project + * role](#api-rest-api-3-role-post). + */ + roles?: {}; + avatarUrls?: AvatarUrls; + projectCategory?: ProjectCategory; + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the + * project. + */ + projectTypeKey?: string; + /** Whether the project is simplified. */ + simplified?: boolean; + /** The type of the project. */ + style?: string; + /** Whether the project is selected as a favorite. */ + favourite?: boolean; + /** Whether the project is private. */ + isPrivate?: boolean; + issueTypeHierarchy?: Hierarchy; + permissions?: ProjectPermissions; + /** Map of project properties */ + properties?: {}; + /** Unique ID for next-gen projects. */ + uuid?: string; + insight?: ProjectInsight; + /** Whether the project is marked as deleted. */ + deleted?: boolean; + /** The date when the project is deleted permanently. */ + retentionTillDate?: string; + /** The date when the project was marked as deleted. */ + deletedDate?: string; + deletedBy?: User; + /** Whether the project is archived. */ + archived?: boolean; + /** The date when the project was archived. */ + archivedDate?: string; + archivedBy?: User; + landingPageInfo?: ProjectLandingPageInfo; +} diff --git a/src/version3/models/project.ts b/src/version3/models/project.ts deleted file mode 100644 index cc4c4478d..000000000 --- a/src/version3/models/project.ts +++ /dev/null @@ -1,88 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; -import type { Hierarchy } from './hierarchy.js'; -import type { IssueTypeDetails } from './issueTypeDetails.js'; -import type { ProjectCategory } from './projectCategory.js'; -import type { ProjectComponent } from './projectComponent.js'; -import type { ProjectInsight } from './projectInsight.js'; -import type { ProjectLandingPageInfo } from './projectLandingPageInfo.js'; -import type { ProjectPermissions } from './projectPermissions.js'; -import type { User } from './user.js'; -import type { Version } from './version.js'; - -/** Details about a project. */ -export interface Project { - /** Expand options that include additional project details in the response. */ - expand?: - | 'description' - | 'issueTypes' - | 'lead' - | 'projectKeys' - | 'issueTypeHierarchy' - | ('description' | 'issueTypes' | 'lead' | 'projectKeys' | 'issueTypeHierarchy')[] - | string - | string[]; - /** The URL of the project details. */ - self?: string; - /** The ID of the project. */ - id: string; - /** The key of the project. */ - key: string; - /** A brief description of the project. */ - description?: string; - lead: User; - /** List of the components contained in the project. */ - components?: ProjectComponent[]; - /** List of the issue types available in the project. */ - issueTypes?: IssueTypeDetails[]; - /** A link to information about this project, such as project documentation. */ - url?: string; - /** An email address associated with the project. */ - email?: string; - /** The default assignee when creating issues for this project. */ - assigneeType?: string; - /** The versions defined in the project. For more information, see [Create version](#api-rest-api-3-version-post). */ - versions?: Version[]; - /** The name of the project. */ - name: string; - /** - * The name and self URL for each role defined in the project. For more information, see [Create project - * role](#api-rest-api-3-role-post). - */ - roles?: {}; - avatarUrls?: AvatarUrls; - projectCategory?: ProjectCategory; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the - * project. - */ - projectTypeKey?: string; - /** Whether the project is simplified. */ - simplified?: boolean; - /** The type of the project. */ - style?: string; - /** Whether the project is selected as a favorite. */ - favourite?: boolean; - /** Whether the project is private. */ - isPrivate?: boolean; - issueTypeHierarchy?: Hierarchy; - permissions?: ProjectPermissions; - /** Map of project properties */ - properties?: {}; - /** Unique ID for next-gen projects. */ - uuid?: string; - insight?: ProjectInsight; - /** Whether the project is marked as deleted. */ - deleted?: boolean; - /** The date when the project is deleted permanently. */ - retentionTillDate?: string; - /** The date when the project was marked as deleted. */ - deletedDate?: string; - deletedBy?: User; - /** Whether the project is archived. */ - archived?: boolean; - /** The date when the project was archived. */ - archivedDate?: string; - archivedBy?: User; - landingPageInfo?: ProjectLandingPageInfo; -} diff --git a/src/version3/models/projectAvatars.mts b/src/version3/models/projectAvatars.mts new file mode 100644 index 000000000..8928a953a --- /dev/null +++ b/src/version3/models/projectAvatars.mts @@ -0,0 +1,9 @@ +import type { Avatar } from './avatar.mjs'; + +/** List of project avatars. */ +export interface ProjectAvatars { + /** List of avatars included with Jira. These avatars cannot be deleted. */ + system?: Avatar[]; + /** List of avatars added to Jira. These avatars may be deleted. */ + custom?: Avatar[]; +} diff --git a/src/version3/models/projectAvatars.ts b/src/version3/models/projectAvatars.ts deleted file mode 100644 index b6b5b14c4..000000000 --- a/src/version3/models/projectAvatars.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Avatar } from './avatar.js'; - -/** List of project avatars. */ -export interface ProjectAvatars { - /** List of avatars included with Jira. These avatars cannot be deleted. */ - system?: Avatar[]; - /** List of avatars added to Jira. These avatars may be deleted. */ - custom?: Avatar[]; -} diff --git a/src/version3/models/projectCategory.ts b/src/version3/models/projectCategory.mts similarity index 100% rename from src/version3/models/projectCategory.ts rename to src/version3/models/projectCategory.mts diff --git a/src/version3/models/projectComponent.mts b/src/version3/models/projectComponent.mts new file mode 100644 index 000000000..543822642 --- /dev/null +++ b/src/version3/models/projectComponent.mts @@ -0,0 +1,66 @@ +import { User } from './user.mjs'; + +/** Details about a project component. */ +export interface ProjectComponent { + assignee?: User; + /** + * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` + * for details on how the type of the user, and hence the user, assigned to issues is determined. Can take the + * following values: + * + * `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the + * component is in. `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for + * the component. `UNASSIGNED` an assignee is not set for issues created with this component. `PROJECT_DEFAULT` the + * assignee to any issues created with this component is nominally the default assignee for the project that the + * component is in. + * + * Default value: `PROJECT_DEFAULT`. + * Optional when creating or updating a component. + */ + assigneeType?: string; + /** The description for the component. Optional when creating or updating a component. */ + description?: string; + /** The unique identifier for the component. */ + id?: string; + /** + * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but + * the component lead is not set, then `false` is returned. + */ + isAssigneeTypeValid?: boolean; + lead?: User; + /** + * The accountId of the component's lead user. The accountId uniquely identifies the user across all Atlassian + * products. For example, _5b10ac8d82e05b22cc7d4ef5_. + */ + leadAccountId?: string; + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + leadUserName?: string; + /** + * The unique name for the component in the project. Required when creating a component. Optional when updating a + * component. The maximum length is 255 characters. + */ + name?: string; + /** The key of the project the component is assigned to. Required when creating a component. Can't be updated. */ + project?: string; + /** The ID of the project the component is assigned to. */ + projectId?: number; + realAssignee?: User; + /** + * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set + * from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This + * property is set to one of the following values: + * + * `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in + * the project that the component is in. `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component + * lead has permission to be assigned issues in the project that the component is in. `UNASSIGNED` when `assigneeType` + * is `UNASSIGNED` and Jira is configured to allow unassigned issues. `PROJECT_DEFAULT` when none of the preceding + * cases are true. + */ + realAssigneeType?: string; + /** The URL of the component. */ + self?: string; +} diff --git a/src/version3/models/projectComponent.ts b/src/version3/models/projectComponent.ts deleted file mode 100644 index cd4726e83..000000000 --- a/src/version3/models/projectComponent.ts +++ /dev/null @@ -1,66 +0,0 @@ -import type { User } from './user.js'; - -/** Details about a project component. */ -export interface ProjectComponent { - assignee?: User; - /** - * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` - * for details on how the type of the user, and hence the user, assigned to issues is determined. Can take the - * following values: - * - * `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the - * component is in. `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for - * the component. `UNASSIGNED` an assignee is not set for issues created with this component. `PROJECT_DEFAULT` the - * assignee to any issues created with this component is nominally the default assignee for the project that the - * component is in. - * - * Default value: `PROJECT_DEFAULT`. - * Optional when creating or updating a component. - */ - assigneeType?: string; - /** The description for the component. Optional when creating or updating a component. */ - description?: string; - /** The unique identifier for the component. */ - id?: string; - /** - * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but - * the component lead is not set, then `false` is returned. - */ - isAssigneeTypeValid?: boolean; - lead?: User; - /** - * The accountId of the component's lead user. The accountId uniquely identifies the user across all Atlassian - * products. For example, _5b10ac8d82e05b22cc7d4ef5_. - */ - leadAccountId?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - leadUserName?: string; - /** - * The unique name for the component in the project. Required when creating a component. Optional when updating a - * component. The maximum length is 255 characters. - */ - name?: string; - /** The key of the project the component is assigned to. Required when creating a component. Can't be updated. */ - project?: string; - /** The ID of the project the component is assigned to. */ - projectId?: number; - realAssignee?: User; - /** - * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set - * from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This - * property is set to one of the following values: - * - * `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in - * the project that the component is in. `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component - * lead has permission to be assigned issues in the project that the component is in. `UNASSIGNED` when `assigneeType` - * is `UNASSIGNED` and Jira is configured to allow unassigned issues. `PROJECT_DEFAULT` when none of the preceding - * cases are true. - */ - realAssigneeType?: string; - /** The URL of the component. */ - self?: string; -} diff --git a/src/version3/models/projectDetails.mts b/src/version3/models/projectDetails.mts new file mode 100644 index 000000000..642e2cad4 --- /dev/null +++ b/src/version3/models/projectDetails.mts @@ -0,0 +1,24 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; +import type { UpdatedProjectCategory } from './updatedProjectCategory.mjs'; + +/** Details about a project. */ +export interface ProjectDetails { + /** The URL of the project details. */ + self?: string; + /** The ID of the project. */ + id?: string; + /** The key of the project. */ + key?: string; + /** The name of the project. */ + name?: string; + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the + * project. + */ + projectTypeKey?: string; + /** Whether or not the project is simplified. */ + simplified?: boolean; + avatarUrls?: AvatarUrls; + projectCategory?: UpdatedProjectCategory; +} diff --git a/src/version3/models/projectDetails.ts b/src/version3/models/projectDetails.ts deleted file mode 100644 index 832633c35..000000000 --- a/src/version3/models/projectDetails.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; -import type { UpdatedProjectCategory } from './updatedProjectCategory.js'; - -/** Details about a project. */ -export interface ProjectDetails { - /** The URL of the project details. */ - self?: string; - /** The ID of the project. */ - id?: string; - /** The key of the project. */ - key?: string; - /** The name of the project. */ - name?: string; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the - * project. - */ - projectTypeKey?: string; - /** Whether or not the project is simplified. */ - simplified?: boolean; - avatarUrls?: AvatarUrls; - projectCategory?: UpdatedProjectCategory; -} diff --git a/src/version3/models/projectEmailAddress.ts b/src/version3/models/projectEmailAddress.mts similarity index 100% rename from src/version3/models/projectEmailAddress.ts rename to src/version3/models/projectEmailAddress.mts diff --git a/src/version3/models/projectFeature.ts b/src/version3/models/projectFeature.mts similarity index 100% rename from src/version3/models/projectFeature.ts rename to src/version3/models/projectFeature.mts diff --git a/src/version3/models/projectFeatureToggleRequest.ts b/src/version3/models/projectFeatureToggleRequest.mts similarity index 100% rename from src/version3/models/projectFeatureToggleRequest.ts rename to src/version3/models/projectFeatureToggleRequest.mts diff --git a/src/version3/models/projectId.ts b/src/version3/models/projectId.mts similarity index 100% rename from src/version3/models/projectId.ts rename to src/version3/models/projectId.mts diff --git a/src/version3/models/projectIdentifier.ts b/src/version3/models/projectIdentifier.mts similarity index 100% rename from src/version3/models/projectIdentifier.ts rename to src/version3/models/projectIdentifier.mts diff --git a/src/version3/models/projectIdentifiers.ts b/src/version3/models/projectIdentifiers.mts similarity index 100% rename from src/version3/models/projectIdentifiers.ts rename to src/version3/models/projectIdentifiers.mts diff --git a/src/version3/models/projectIds.ts b/src/version3/models/projectIds.mts similarity index 100% rename from src/version3/models/projectIds.ts rename to src/version3/models/projectIds.mts diff --git a/src/version3/models/projectInsight.ts b/src/version3/models/projectInsight.mts similarity index 100% rename from src/version3/models/projectInsight.ts rename to src/version3/models/projectInsight.mts diff --git a/src/version3/models/projectIssueCreateMetadata.mts b/src/version3/models/projectIssueCreateMetadata.mts new file mode 100644 index 000000000..73366ba4e --- /dev/null +++ b/src/version3/models/projectIssueCreateMetadata.mts @@ -0,0 +1,19 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; +import type { IssueTypeIssueCreateMetadata } from './issueTypeIssueCreateMetadata.mjs'; + +/** Details of the issue creation metadata for a project. */ +export interface ProjectIssueCreateMetadata { + /** Expand options that include additional project issue create metadata details in the response. */ + expand?: string; + /** The URL of the project. */ + self?: string; + /** The ID of the project. */ + id?: string; + /** The key of the project. */ + key?: string; + /** The name of the project. */ + name?: string; + avatarUrls?: AvatarUrls; + /** List of the issue types supported by the project. */ + issuetypes?: IssueTypeIssueCreateMetadata[]; +} diff --git a/src/version3/models/projectIssueCreateMetadata.ts b/src/version3/models/projectIssueCreateMetadata.ts deleted file mode 100644 index feba91ace..000000000 --- a/src/version3/models/projectIssueCreateMetadata.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; -import type { IssueTypeIssueCreateMetadata } from './issueTypeIssueCreateMetadata.js'; - -/** Details of the issue creation metadata for a project. */ -export interface ProjectIssueCreateMetadata { - /** Expand options that include additional project issue create metadata details in the response. */ - expand?: string; - /** The URL of the project. */ - self?: string; - /** The ID of the project. */ - id?: string; - /** The key of the project. */ - key?: string; - /** The name of the project. */ - name?: string; - avatarUrls?: AvatarUrls; - /** List of the issue types supported by the project. */ - issuetypes?: IssueTypeIssueCreateMetadata[]; -} diff --git a/src/version3/models/projectIssueSecurityLevels.mts b/src/version3/models/projectIssueSecurityLevels.mts new file mode 100644 index 000000000..f8a3d01fb --- /dev/null +++ b/src/version3/models/projectIssueSecurityLevels.mts @@ -0,0 +1,7 @@ +import type { SecurityLevel } from './securityLevel.mjs'; + +/** List of issue level security items in a project. */ +export interface ProjectIssueSecurityLevels { + /** Issue level security items list. */ + levels: SecurityLevel[]; +} diff --git a/src/version3/models/projectIssueSecurityLevels.ts b/src/version3/models/projectIssueSecurityLevels.ts deleted file mode 100644 index eff8bfc31..000000000 --- a/src/version3/models/projectIssueSecurityLevels.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SecurityLevel } from './securityLevel.js'; - -/** List of issue level security items in a project. */ -export interface ProjectIssueSecurityLevels { - /** Issue level security items list. */ - levels: SecurityLevel[]; -} diff --git a/src/version3/models/projectIssueTypeHierarchy.mts b/src/version3/models/projectIssueTypeHierarchy.mts new file mode 100644 index 000000000..cccc5fd71 --- /dev/null +++ b/src/version3/models/projectIssueTypeHierarchy.mts @@ -0,0 +1,9 @@ +import type { ProjectIssueTypesHierarchyLevel } from './projectIssueTypesHierarchyLevel.mjs'; + +/** The hierarchy of issue types within a project. */ +export interface ProjectIssueTypeHierarchy { + /** The ID of the project. */ + projectId?: number; + /** Details of an issue type hierarchy level. */ + hierarchy?: ProjectIssueTypesHierarchyLevel[]; +} diff --git a/src/version3/models/projectIssueTypeHierarchy.ts b/src/version3/models/projectIssueTypeHierarchy.ts deleted file mode 100644 index edde23187..000000000 --- a/src/version3/models/projectIssueTypeHierarchy.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ProjectIssueTypesHierarchyLevel } from './projectIssueTypesHierarchyLevel.js'; - -/** The hierarchy of issue types within a project. */ -export interface ProjectIssueTypeHierarchy { - /** The ID of the project. */ - projectId?: number; - /** Details of an issue type hierarchy level. */ - hierarchy?: ProjectIssueTypesHierarchyLevel[]; -} diff --git a/src/version3/models/projectIssueTypeMapping.ts b/src/version3/models/projectIssueTypeMapping.mts similarity index 100% rename from src/version3/models/projectIssueTypeMapping.ts rename to src/version3/models/projectIssueTypeMapping.mts diff --git a/src/version3/models/projectIssueTypeMappings.mts b/src/version3/models/projectIssueTypeMappings.mts new file mode 100644 index 000000000..81055b4eb --- /dev/null +++ b/src/version3/models/projectIssueTypeMappings.mts @@ -0,0 +1,7 @@ +import type { ProjectIssueTypeMapping } from './projectIssueTypeMapping.mjs'; + +/** The project and issue type mappings. */ +export interface ProjectIssueTypeMappings { + /** The project and issue type mappings. */ + mappings: ProjectIssueTypeMapping[]; +} diff --git a/src/version3/models/projectIssueTypeMappings.ts b/src/version3/models/projectIssueTypeMappings.ts deleted file mode 100644 index 6fe583521..000000000 --- a/src/version3/models/projectIssueTypeMappings.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ProjectIssueTypeMapping } from './projectIssueTypeMapping.js'; - -/** The project and issue type mappings. */ -export interface ProjectIssueTypeMappings { - /** The project and issue type mappings. */ - mappings: ProjectIssueTypeMapping[]; -} diff --git a/src/version3/models/projectIssueTypes.mts b/src/version3/models/projectIssueTypes.mts new file mode 100644 index 000000000..fd9d812d5 --- /dev/null +++ b/src/version3/models/projectIssueTypes.mts @@ -0,0 +1,8 @@ +import type { ProjectId } from './projectId.mjs'; + +/** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ +export interface ProjectIssueTypes { + project?: ProjectId; + /** IDs of the issue types */ + issueTypes?: string[]; +} diff --git a/src/version3/models/projectIssueTypes.ts b/src/version3/models/projectIssueTypes.ts deleted file mode 100644 index 978978958..000000000 --- a/src/version3/models/projectIssueTypes.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectId } from './projectId.js'; - -/** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ -export interface ProjectIssueTypes { - project?: ProjectId; - /** IDs of the issue types */ - issueTypes?: string[]; -} diff --git a/src/version3/models/projectIssueTypesHierarchyLevel.mts b/src/version3/models/projectIssueTypesHierarchyLevel.mts new file mode 100644 index 000000000..a1dabec65 --- /dev/null +++ b/src/version3/models/projectIssueTypesHierarchyLevel.mts @@ -0,0 +1,11 @@ +import type { IssueTypeInfo } from './issueTypeInfo.mjs'; + +/** Details of an issue type hierarchy level. */ +export interface ProjectIssueTypesHierarchyLevel { + /** The level of the issue type hierarchy level. */ + level?: number; + /** The name of the issue type hierarchy level. */ + name?: string; + /** The list of issue types in the hierarchy level. */ + issueTypes?: IssueTypeInfo[]; +} diff --git a/src/version3/models/projectIssueTypesHierarchyLevel.ts b/src/version3/models/projectIssueTypesHierarchyLevel.ts deleted file mode 100644 index 2a036dd7a..000000000 --- a/src/version3/models/projectIssueTypesHierarchyLevel.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { IssueTypeInfo } from './issueTypeInfo.js'; - -/** Details of an issue type hierarchy level. */ -export interface ProjectIssueTypesHierarchyLevel { - /** The level of the issue type hierarchy level. */ - level?: number; - /** The name of the issue type hierarchy level. */ - name?: string; - /** The list of issue types in the hierarchy level. */ - issueTypes?: IssueTypeInfo[]; -} diff --git a/src/version3/models/projectLandingPageInfo.ts b/src/version3/models/projectLandingPageInfo.mts similarity index 100% rename from src/version3/models/projectLandingPageInfo.ts rename to src/version3/models/projectLandingPageInfo.mts diff --git a/src/version3/models/projectPermissions.ts b/src/version3/models/projectPermissions.mts similarity index 100% rename from src/version3/models/projectPermissions.ts rename to src/version3/models/projectPermissions.mts diff --git a/src/version3/models/projectRole.mts b/src/version3/models/projectRole.mts new file mode 100644 index 000000000..d6dfeb185 --- /dev/null +++ b/src/version3/models/projectRole.mts @@ -0,0 +1,27 @@ +import type { RoleActor } from './roleActor.mjs'; +import type { Scope } from './scope.mjs'; + +/** Details about the roles in a project. */ +export interface ProjectRole { + /** The URL the project role details. */ + self?: string; + /** The name of the project role. */ + name?: string; + /** The ID of the project role. */ + id?: number; + /** The description of the project role. */ + description?: string; + /** The list of users who act in this role. */ + actors?: RoleActor[]; + scope?: Scope; + /** The translated name of the project role. */ + translatedName?: string; + /** Whether the calling user is part of this role. */ + currentUserRole?: boolean; + /** Whether this role is the admin role for the project. */ + admin?: boolean; + /** Whether the roles are configurable for this project. */ + roleConfigurable?: boolean; + /** Whether this role is the default role for the project */ + default?: boolean; +} diff --git a/src/version3/models/projectRole.ts b/src/version3/models/projectRole.ts deleted file mode 100644 index 836a7b2bc..000000000 --- a/src/version3/models/projectRole.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { RoleActor } from './roleActor.js'; -import type { Scope } from './scope.js'; - -/** Details about the roles in a project. */ -export interface ProjectRole { - /** The URL the project role details. */ - self?: string; - /** The name of the project role. */ - name?: string; - /** The ID of the project role. */ - id?: number; - /** The description of the project role. */ - description?: string; - /** The list of users who act in this role. */ - actors?: RoleActor[]; - scope?: Scope; - /** The translated name of the project role. */ - translatedName?: string; - /** Whether the calling user is part of this role. */ - currentUserRole?: boolean; - /** Whether this role is the admin role for the project. */ - admin?: boolean; - /** Whether the roles are configurable for this project. */ - roleConfigurable?: boolean; - /** Whether this role is the default role for the project */ - default?: boolean; -} diff --git a/src/version3/models/projectRoleActorsUpdate.ts b/src/version3/models/projectRoleActorsUpdate.mts similarity index 100% rename from src/version3/models/projectRoleActorsUpdate.ts rename to src/version3/models/projectRoleActorsUpdate.mts diff --git a/src/version3/models/projectRoleDetails.mts b/src/version3/models/projectRoleDetails.mts new file mode 100644 index 000000000..66e584e46 --- /dev/null +++ b/src/version3/models/projectRoleDetails.mts @@ -0,0 +1,22 @@ +import type { Scope } from './scope.mjs'; + +/** Details about a project role. */ +export interface ProjectRoleDetails { + /** The URL the project role details. */ + self?: string; + /** The name of the project role. */ + name?: string; + /** The ID of the project role. */ + id?: number; + /** The description of the project role. */ + description?: string; + /** Whether this role is the admin role for the project. */ + admin?: boolean; + scope?: Scope; + /** Whether the roles are configurable for this project. */ + roleConfigurable?: boolean; + /** The translated name of the project role. */ + translatedName?: string; + /** Whether this role is the default role for the project. */ + default?: boolean; +} diff --git a/src/version3/models/projectRoleDetails.ts b/src/version3/models/projectRoleDetails.ts deleted file mode 100644 index 7057bc715..000000000 --- a/src/version3/models/projectRoleDetails.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { Scope } from './scope.js'; - -/** Details about a project role. */ -export interface ProjectRoleDetails { - /** The URL the project role details. */ - self?: string; - /** The name of the project role. */ - name?: string; - /** The ID of the project role. */ - id?: number; - /** The description of the project role. */ - description?: string; - /** Whether this role is the admin role for the project. */ - admin?: boolean; - scope?: Scope; - /** Whether the roles are configurable for this project. */ - roleConfigurable?: boolean; - /** The translated name of the project role. */ - translatedName?: string; - /** Whether this role is the default role for the project. */ - default?: boolean; -} diff --git a/src/version3/models/projectRoleGroup.ts b/src/version3/models/projectRoleGroup.mts similarity index 100% rename from src/version3/models/projectRoleGroup.ts rename to src/version3/models/projectRoleGroup.mts diff --git a/src/version3/models/projectRoleUser.ts b/src/version3/models/projectRoleUser.mts similarity index 100% rename from src/version3/models/projectRoleUser.ts rename to src/version3/models/projectRoleUser.mts diff --git a/src/version3/models/projectScope.ts b/src/version3/models/projectScope.mts similarity index 100% rename from src/version3/models/projectScope.ts rename to src/version3/models/projectScope.mts diff --git a/src/version3/models/projectType.ts b/src/version3/models/projectType.mts similarity index 100% rename from src/version3/models/projectType.ts rename to src/version3/models/projectType.mts diff --git a/src/version3/models/propertyKey.ts b/src/version3/models/propertyKey.mts similarity index 100% rename from src/version3/models/propertyKey.ts rename to src/version3/models/propertyKey.mts diff --git a/src/version3/models/propertyKeys.mts b/src/version3/models/propertyKeys.mts new file mode 100644 index 000000000..3db8a9493 --- /dev/null +++ b/src/version3/models/propertyKeys.mts @@ -0,0 +1,7 @@ +import type { PropertyKey } from './propertyKey.mjs'; + +/** List of property keys. */ +export interface PropertyKeys { + /** Property key details. */ + keys?: PropertyKey[]; +} diff --git a/src/version3/models/propertyKeys.ts b/src/version3/models/propertyKeys.ts deleted file mode 100644 index 79e6474d8..000000000 --- a/src/version3/models/propertyKeys.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { PropertyKey } from './propertyKey.js'; - -/** List of property keys. */ -export interface PropertyKeys { - /** Property key details. */ - keys?: PropertyKey[]; -} diff --git a/src/version3/models/publishedWorkflowId.ts b/src/version3/models/publishedWorkflowId.mts similarity index 100% rename from src/version3/models/publishedWorkflowId.ts rename to src/version3/models/publishedWorkflowId.mts diff --git a/src/version3/models/registeredWebhook.ts b/src/version3/models/registeredWebhook.mts similarity index 100% rename from src/version3/models/registeredWebhook.ts rename to src/version3/models/registeredWebhook.mts diff --git a/src/version3/models/remoteIssueLink.mts b/src/version3/models/remoteIssueLink.mts new file mode 100644 index 000000000..89a472ec1 --- /dev/null +++ b/src/version3/models/remoteIssueLink.mts @@ -0,0 +1,16 @@ +import type { Application } from './application.mjs'; +import type { RemoteObject } from './remoteObject.mjs'; + +/** Details of an issue remote link. */ +export interface RemoteIssueLink { + /** The ID of the link. */ + id?: number; + /** The URL of the link. */ + self?: string; + /** The global ID of the link, such as the ID of the item on the remote system. */ + globalId?: string; + application?: Application; + /** Description of the relationship between the issue and the linked item. */ + relationship?: string; + object?: RemoteObject; +} diff --git a/src/version3/models/remoteIssueLink.ts b/src/version3/models/remoteIssueLink.ts deleted file mode 100644 index 8e32f6279..000000000 --- a/src/version3/models/remoteIssueLink.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Application } from './application.js'; -import type { RemoteObject } from './remoteObject.js'; - -/** Details of an issue remote link. */ -export interface RemoteIssueLink { - /** The ID of the link. */ - id?: number; - /** The URL of the link. */ - self?: string; - /** The global ID of the link, such as the ID of the item on the remote system. */ - globalId?: string; - application?: Application; - /** Description of the relationship between the issue and the linked item. */ - relationship?: string; - object?: RemoteObject; -} diff --git a/src/version3/models/remoteIssueLinkIdentifies.ts b/src/version3/models/remoteIssueLinkIdentifies.mts similarity index 100% rename from src/version3/models/remoteIssueLinkIdentifies.ts rename to src/version3/models/remoteIssueLinkIdentifies.mts diff --git a/src/version3/models/remoteIssueLinkRequest.mts b/src/version3/models/remoteIssueLinkRequest.mts new file mode 100644 index 000000000..c12f620dd --- /dev/null +++ b/src/version3/models/remoteIssueLinkRequest.mts @@ -0,0 +1,23 @@ +import type { Application } from './application.mjs'; +import type { RemoteObject } from './remoteObject.mjs'; + +/** Details of a remote issue link. */ +export interface RemoteIssueLinkRequest { + /** + * An identifier for the remote item in the remote system. For example, the global ID for a remote item in Confluence + * would consist of the app ID and page ID, like this: `appId=456&pageId=123`. + * + * Setting this field enables the remote issue link details to be updated or deleted using remote system and item + * details as the record identifier, rather than using the record's Jira ID. + * + * The maximum length is 255 characters. + */ + globalId?: string; + application?: Application; + /** + * Description of the relationship between the issue and the linked item. If not set, the relationship description + * "links to" is used in Jira. + */ + relationship?: string; + object?: RemoteObject; +} diff --git a/src/version3/models/remoteIssueLinkRequest.ts b/src/version3/models/remoteIssueLinkRequest.ts deleted file mode 100644 index 4957c40da..000000000 --- a/src/version3/models/remoteIssueLinkRequest.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { Application } from './application.js'; -import type { RemoteObject } from './remoteObject.js'; - -/** Details of a remote issue link. */ -export interface RemoteIssueLinkRequest { - /** - * An identifier for the remote item in the remote system. For example, the global ID for a remote item in Confluence - * would consist of the app ID and page ID, like this: `appId=456&pageId=123`. - * - * Setting this field enables the remote issue link details to be updated or deleted using remote system and item - * details as the record identifier, rather than using the record's Jira ID. - * - * The maximum length is 255 characters. - */ - globalId?: string; - application?: Application; - /** - * Description of the relationship between the issue and the linked item. If not set, the relationship description - * "links to" is used in Jira. - */ - relationship?: string; - object?: RemoteObject; -} diff --git a/src/version3/models/remoteObject.mts b/src/version3/models/remoteObject.mts new file mode 100644 index 000000000..c2a49b94a --- /dev/null +++ b/src/version3/models/remoteObject.mts @@ -0,0 +1,14 @@ +import type { Icon } from './icon.mjs'; +import type { Status } from './status.mjs'; + +/** The linked item. */ +export interface RemoteObject { + /** The URL of the item. */ + url: string; + /** The title of the item. */ + title: string; + /** The summary details of the item. */ + summary?: string; + icon?: Icon; + status?: Status; +} diff --git a/src/version3/models/remoteObject.ts b/src/version3/models/remoteObject.ts deleted file mode 100644 index 2c4532765..000000000 --- a/src/version3/models/remoteObject.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Icon } from './icon.js'; -import type { Status } from './status.js'; - -/** The linked item. */ -export interface RemoteObject { - /** The URL of the item. */ - url: string; - /** The title of the item. */ - title: string; - /** The summary details of the item. */ - summary?: string; - icon?: Icon; - status?: Status; -} diff --git a/src/version3/models/removeOptionFromIssuesResult.mts b/src/version3/models/removeOptionFromIssuesResult.mts new file mode 100644 index 000000000..e2f22f459 --- /dev/null +++ b/src/version3/models/removeOptionFromIssuesResult.mts @@ -0,0 +1,9 @@ +import type { SimpleErrorCollection } from './simpleErrorCollection.mjs'; + +export interface RemoveOptionFromIssuesResult { + /** The IDs of the modified issues. */ + modifiedIssues?: number[]; + /** The IDs of the unchanged issues, those issues where errors prevent modification. */ + unmodifiedIssues?: number[]; + errors?: SimpleErrorCollection; +} diff --git a/src/version3/models/removeOptionFromIssuesResult.ts b/src/version3/models/removeOptionFromIssuesResult.ts deleted file mode 100644 index b2a5bef55..000000000 --- a/src/version3/models/removeOptionFromIssuesResult.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { SimpleErrorCollection } from './simpleErrorCollection.js'; - -export interface RemoveOptionFromIssuesResult { - /** The IDs of the modified issues. */ - modifiedIssues?: number[]; - /** The IDs of the unchanged issues, those issues where errors prevent modification. */ - unmodifiedIssues?: number[]; - errors?: SimpleErrorCollection; -} diff --git a/src/version3/models/reorderIssuePriorities.ts b/src/version3/models/reorderIssuePriorities.mts similarity index 100% rename from src/version3/models/reorderIssuePriorities.ts rename to src/version3/models/reorderIssuePriorities.mts diff --git a/src/version3/models/reorderIssueResolutionsRequest.ts b/src/version3/models/reorderIssueResolutionsRequest.mts similarity index 100% rename from src/version3/models/reorderIssueResolutionsRequest.ts rename to src/version3/models/reorderIssueResolutionsRequest.mts diff --git a/src/version3/models/resolution.ts b/src/version3/models/resolution.mts similarity index 100% rename from src/version3/models/resolution.ts rename to src/version3/models/resolution.mts diff --git a/src/version3/models/resolutionId.ts b/src/version3/models/resolutionId.mts similarity index 100% rename from src/version3/models/resolutionId.ts rename to src/version3/models/resolutionId.mts diff --git a/src/version3/models/restrictedPermission.ts b/src/version3/models/restrictedPermission.mts similarity index 100% rename from src/version3/models/restrictedPermission.ts rename to src/version3/models/restrictedPermission.mts diff --git a/src/version3/models/richText.ts b/src/version3/models/richText.mts similarity index 100% rename from src/version3/models/richText.ts rename to src/version3/models/richText.mts diff --git a/src/version3/models/roleActor.mts b/src/version3/models/roleActor.mts new file mode 100644 index 000000000..84f2abbfb --- /dev/null +++ b/src/version3/models/roleActor.mts @@ -0,0 +1,25 @@ +import type { ProjectRoleGroup } from './projectRoleGroup.mjs'; +import type { ProjectRoleUser } from './projectRoleUser.mjs'; + +/** Details about a user assigned to a project role. */ +export interface RoleActor { + /** The ID of the role actor. */ + id?: number; + /** + * The display name of the role actor. For users, depending on the user’s privacy setting, this may return an + * alternative value for the user's name. + */ + displayName?: string; + /** The type of role actor. */ + type?: string; + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + name?: string; + /** The avatar of the role actor. */ + avatarUrl?: string; + actorUser?: ProjectRoleUser; + actorGroup?: ProjectRoleGroup; +} diff --git a/src/version3/models/roleActor.ts b/src/version3/models/roleActor.ts deleted file mode 100644 index 108145bfc..000000000 --- a/src/version3/models/roleActor.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { ProjectRoleGroup } from './projectRoleGroup.js'; -import type { ProjectRoleUser } from './projectRoleUser.js'; - -/** Details about a user assigned to a project role. */ -export interface RoleActor { - /** The ID of the role actor. */ - id?: number; - /** - * The display name of the role actor. For users, depending on the user’s privacy setting, this may return an - * alternative value for the user's name. - */ - displayName?: string; - /** The type of role actor. */ - type?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - name?: string; - /** The avatar of the role actor. */ - avatarUrl?: string; - actorUser?: ProjectRoleUser; - actorGroup?: ProjectRoleGroup; -} diff --git a/src/version3/models/ruleConfiguration.ts b/src/version3/models/ruleConfiguration.mts similarity index 100% rename from src/version3/models/ruleConfiguration.ts rename to src/version3/models/ruleConfiguration.mts diff --git a/src/version3/models/sanitizedJqlQueries.mts b/src/version3/models/sanitizedJqlQueries.mts new file mode 100644 index 000000000..462913b18 --- /dev/null +++ b/src/version3/models/sanitizedJqlQueries.mts @@ -0,0 +1,7 @@ +import type { SanitizedJqlQuery } from './sanitizedJqlQuery.mjs'; + +/** The sanitized Jql queries for the given account IDs. */ +export interface SanitizedJqlQueries { + /** The list of sanitized Jql queries. */ + queries?: SanitizedJqlQuery[]; +} diff --git a/src/version3/models/sanitizedJqlQueries.ts b/src/version3/models/sanitizedJqlQueries.ts deleted file mode 100644 index d6ab7f52b..000000000 --- a/src/version3/models/sanitizedJqlQueries.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SanitizedJqlQuery } from './sanitizedJqlQuery.js'; - -/** The sanitized JQL queries for the given account IDs. */ -export interface SanitizedJqlQueries { - /** The list of sanitized JQL queries. */ - queries?: SanitizedJqlQuery[]; -} diff --git a/src/version3/models/sanitizedJqlQuery.mts b/src/version3/models/sanitizedJqlQuery.mts new file mode 100644 index 000000000..70d6121d3 --- /dev/null +++ b/src/version3/models/sanitizedJqlQuery.mts @@ -0,0 +1,12 @@ +import type { ErrorCollection } from './errorCollection.mjs'; + +/** Details of the sanitized Jql query. */ +export interface SanitizedJqlQuery { + /** The initial query. */ + initialQuery?: string; + /** The sanitized query, if there were no errors. */ + sanitizedQuery?: string; + errors?: ErrorCollection; + /** The account ID of the user for whom sanitization was performed. */ + accountId?: string; +} diff --git a/src/version3/models/sanitizedJqlQuery.ts b/src/version3/models/sanitizedJqlQuery.ts deleted file mode 100644 index b571e6a1b..000000000 --- a/src/version3/models/sanitizedJqlQuery.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { ErrorCollection } from './errorCollection.js'; - -/** Details of the sanitized JQL query. */ -export interface SanitizedJqlQuery { - /** The initial query. */ - initialQuery?: string; - /** The sanitized query, if there were no errors. */ - sanitizedQuery?: string; - errors?: ErrorCollection; - /** The account ID of the user for whom sanitization was performed. */ - accountId?: string; -} diff --git a/src/version3/models/scope.mts b/src/version3/models/scope.mts new file mode 100644 index 000000000..3f7e248a8 --- /dev/null +++ b/src/version3/models/scope.mts @@ -0,0 +1,11 @@ +import type { ProjectDetails } from './projectDetails.mjs'; + +/** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ +export interface Scope { + /** The type of scope. */ + type?: string; + project?: ProjectDetails; +} diff --git a/src/version3/models/scope.ts b/src/version3/models/scope.ts deleted file mode 100644 index c686f2562..000000000 --- a/src/version3/models/scope.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ProjectDetails } from './projectDetails.js'; - -/** - * The projects the item is associated with. Indicated for items associated with [next-gen - * projects](https://confluence.atlassian.com/x/loMyO). - */ -export interface Scope { - /** The type of scope. */ - type?: string; - project?: ProjectDetails; -} diff --git a/src/version3/models/screen.mts b/src/version3/models/screen.mts new file mode 100644 index 000000000..3544aa4c7 --- /dev/null +++ b/src/version3/models/screen.mts @@ -0,0 +1,12 @@ +import type { Scope } from './scope.mjs'; + +/** A screen. */ +export interface Screen { + /** The ID of the screen. */ + id?: number; + /** The name of the screen. */ + name?: string; + /** The description of the screen. */ + description?: string; + scope?: Scope; +} diff --git a/src/version3/models/screen.ts b/src/version3/models/screen.ts deleted file mode 100644 index 2a68bb91c..000000000 --- a/src/version3/models/screen.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Scope } from './scope.js'; - -/** A screen. */ -export interface Screen { - /** The ID of the screen. */ - id?: number; - /** The name of the screen. */ - name?: string; - /** The description of the screen. */ - description?: string; - scope?: Scope; -} diff --git a/src/version3/models/screenDetails.ts b/src/version3/models/screenDetails.mts similarity index 100% rename from src/version3/models/screenDetails.ts rename to src/version3/models/screenDetails.mts diff --git a/src/version3/models/screenID.ts b/src/version3/models/screenID.mts similarity index 100% rename from src/version3/models/screenID.ts rename to src/version3/models/screenID.mts diff --git a/src/version3/models/screenScheme.mts b/src/version3/models/screenScheme.mts new file mode 100644 index 000000000..7cc890a47 --- /dev/null +++ b/src/version3/models/screenScheme.mts @@ -0,0 +1,14 @@ +import type { PageIssueTypeScreenScheme } from './pageIssueTypeScreenScheme.mjs'; +import type { ScreenTypes } from './screenTypes.mjs'; + +/** A screen scheme. */ +export interface ScreenScheme { + /** The ID of the screen scheme. */ + id?: number; + /** The name of the screen scheme. */ + name?: string; + /** The description of the screen scheme. */ + description?: string; + screens?: ScreenTypes; + issueTypeScreenSchemes?: PageIssueTypeScreenScheme; +} diff --git a/src/version3/models/screenScheme.ts b/src/version3/models/screenScheme.ts deleted file mode 100644 index df7b5df65..000000000 --- a/src/version3/models/screenScheme.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { PageIssueTypeScreenScheme } from './pageIssueTypeScreenScheme.js'; -import type { ScreenTypes } from './screenTypes.js'; - -/** A screen scheme. */ -export interface ScreenScheme { - /** The ID of the screen scheme. */ - id?: number; - /** The name of the screen scheme. */ - name?: string; - /** The description of the screen scheme. */ - description?: string; - screens?: ScreenTypes; - issueTypeScreenSchemes?: PageIssueTypeScreenScheme; -} diff --git a/src/version3/models/screenSchemeDetails.mts b/src/version3/models/screenSchemeDetails.mts new file mode 100644 index 000000000..4497b0d2f --- /dev/null +++ b/src/version3/models/screenSchemeDetails.mts @@ -0,0 +1,10 @@ +import type { ScreenTypes } from './screenTypes.mjs'; + +/** Details of a screen scheme. */ +export interface ScreenSchemeDetails { + /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: string; + /** The description of the screen scheme. The maximum length is 255 characters. */ + description?: string; + screens?: ScreenTypes; +} diff --git a/src/version3/models/screenSchemeDetails.ts b/src/version3/models/screenSchemeDetails.ts deleted file mode 100644 index 736407eb3..000000000 --- a/src/version3/models/screenSchemeDetails.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ScreenTypes } from './screenTypes.js'; - -/** Details of a screen scheme. */ -export interface ScreenSchemeDetails { - /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ - name: string; - /** The description of the screen scheme. The maximum length is 255 characters. */ - description?: string; - screens?: ScreenTypes; -} diff --git a/src/version3/models/screenSchemeId.ts b/src/version3/models/screenSchemeId.mts similarity index 100% rename from src/version3/models/screenSchemeId.ts rename to src/version3/models/screenSchemeId.mts diff --git a/src/version3/models/screenTypes.ts b/src/version3/models/screenTypes.mts similarity index 100% rename from src/version3/models/screenTypes.ts rename to src/version3/models/screenTypes.mts diff --git a/src/version3/models/screenWithTab.mts b/src/version3/models/screenWithTab.mts new file mode 100644 index 000000000..a274e5ae7 --- /dev/null +++ b/src/version3/models/screenWithTab.mts @@ -0,0 +1,14 @@ +import type { Scope } from './scope.mjs'; +import type { ScreenableTab } from './screenableTab.mjs'; + +/** A screen with tab details. */ +export interface ScreenWithTab { + /** The ID of the screen. */ + id?: number; + /** The name of the screen. */ + name?: string; + /** The description of the screen. */ + description?: string; + scope?: Scope; + tab?: ScreenableTab; +} diff --git a/src/version3/models/screenWithTab.ts b/src/version3/models/screenWithTab.ts deleted file mode 100644 index dfa696b31..000000000 --- a/src/version3/models/screenWithTab.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Scope } from './scope.js'; -import type { ScreenableTab } from './screenableTab.js'; - -/** A screen with tab details. */ -export interface ScreenWithTab { - /** The ID of the screen. */ - id?: number; - /** The name of the screen. */ - name?: string; - /** The description of the screen. */ - description?: string; - scope?: Scope; - tab?: ScreenableTab; -} diff --git a/src/version3/models/screenableField.ts b/src/version3/models/screenableField.mts similarity index 100% rename from src/version3/models/screenableField.ts rename to src/version3/models/screenableField.mts diff --git a/src/version3/models/screenableTab.ts b/src/version3/models/screenableTab.mts similarity index 100% rename from src/version3/models/screenableTab.ts rename to src/version3/models/screenableTab.mts diff --git a/src/version3/models/searchAutoCompleteFilter.ts b/src/version3/models/searchAutoCompleteFilter.mts similarity index 100% rename from src/version3/models/searchAutoCompleteFilter.ts rename to src/version3/models/searchAutoCompleteFilter.mts diff --git a/src/version3/models/searchRequest.mts b/src/version3/models/searchRequest.mts new file mode 100644 index 000000000..56ce441ad --- /dev/null +++ b/src/version3/models/searchRequest.mts @@ -0,0 +1,80 @@ +export interface SearchRequest { + /** A [Jql](https://confluence.atlassian.com/x/egORLQ) expression. */ + jql?: string; + /** The index of the first item to return in the page of results (page offset). The base index is `0`. */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** + * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a + * comma-separated list. Expand options include: + * + * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to + * exclude. + * + * The default is `*navigable`. + * + * Examples: + * + * `summary,comment` Returns the summary and comments fields only. `-description` Returns all navigable (default) + * fields except description. `*all,-comment` Returns all fields except comments. + * + * Multiple `fields` parameters can be included in a request. + * + * Note: All navigable fields are returned by default. This differs from [GET + * issue](#api-rest-api-3-issue-issueIdOrKey-get) where the default is all fields. + */ + fields?: string[]; + /** + * Determines how to validate the Jql query and treat the validation results. Supported values: + * + * `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). + * `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for + * `strict`. `false` _Deprecated_ A legacy synonym for `warn`. + * + * The default is `strict`. + * + * Note: If the Jql is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. + */ + validateQuery?: string; + /** + * Use [expand](em>#expansion) to include additional information about issues in the response. Note that, unlike the + * majority of instances where `expand` is specified, `expand` is defined as a list of values. The expand options + * are: + * + * - `renderedFields` Returns field values rendered in HTML format. + * - `names` Returns the display name of each field. + * - `schema` Returns the schema describing a field type. + * - `transitions` Returns all possible transitions for the issue. + * - `operations` Returns all possible operations for the issue. + * - `editmeta` Returns information about how each field can be edited. + * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each + * version of a field's value, with the highest numbered item representing the most recent version. + */ + expand?: + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | ( + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + )[] + | string + | string[]; + /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ + properties?: string[]; + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys?: boolean; +} diff --git a/src/version3/models/searchRequest.ts b/src/version3/models/searchRequest.ts deleted file mode 100644 index fd3fcf0e6..000000000 --- a/src/version3/models/searchRequest.ts +++ /dev/null @@ -1,80 +0,0 @@ -export interface SearchRequest { - /** A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. */ - jql?: string; - /** The index of the first item to return in the page of results (page offset). The base index is `0`. */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a - * comma-separated list. Expand options include: - * - * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to - * exclude. - * - * The default is `*navigable`. - * - * Examples: - * - * `summary,comment` Returns the summary and comments fields only. `-description` Returns all navigable (default) - * fields except description. `*all,-comment` Returns all fields except comments. - * - * Multiple `fields` parameters can be included in a request. - * - * Note: All navigable fields are returned by default. This differs from [GET - * issue](#api-rest-api-3-issue-issueIdOrKey-get) where the default is all fields. - */ - fields?: string[]; - /** - * Determines how to validate the JQL query and treat the validation results. Supported values: - * - * `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). - * `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for - * `strict`. `false` _Deprecated_ A legacy synonym for `warn`. - * - * The default is `strict`. - * - * Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. - */ - validateQuery?: string; - /** - * Use [expand](em>#expansion) to include additional information about issues in the response. Note that, unlike the - * majority of instances where `expand` is specified, `expand` is defined as a list of values. The expand options - * are: - * - * - `renderedFields` Returns field values rendered in HTML format. - * - `names` Returns the display name of each field. - * - `schema` Returns the schema describing a field type. - * - `transitions` Returns all possible transitions for the issue. - * - `operations` Returns all possible operations for the issue. - * - `editmeta` Returns information about how each field can be edited. - * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. - * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each - * version of a field's value, with the highest numbered item representing the most recent version. - */ - expand?: - | 'renderedFields' - | 'names' - | 'schema' - | 'transitions' - | 'operations' - | 'editmeta' - | 'changelog' - | 'versionedRepresentations' - | ( - | 'renderedFields' - | 'names' - | 'schema' - | 'transitions' - | 'operations' - | 'editmeta' - | 'changelog' - | 'versionedRepresentations' - )[] - | string - | string[]; - /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ - properties?: string[]; - /** Reference fields by their key (rather than ID). The default is `false`. */ - fieldsByKeys?: boolean; -} diff --git a/src/version3/models/searchResults.mts b/src/version3/models/searchResults.mts new file mode 100644 index 000000000..54552e372 --- /dev/null +++ b/src/version3/models/searchResults.mts @@ -0,0 +1,21 @@ +import type { Issue } from './issue.mjs'; + +/** The result of a Jql search. */ +export interface SearchResults { + /** Expand options that include additional search result details in the response. */ + expand?: string; + /** The index of the first item returned on the page. */ + startAt?: number; + /** The maximum number of results that could be on the page. */ + maxResults?: number; + /** The number of results on the page. */ + total?: number; + /** The list of issues found by the search. */ + issues?: Issue[]; + /** Any warnings related to the Jql query. */ + warningMessages?: string[]; + /** The ID and name of each field in the search results. */ + names?: {}; + /** The schema describing the field types in the search results. */ + schema?: {}; +} diff --git a/src/version3/models/searchResults.ts b/src/version3/models/searchResults.ts deleted file mode 100644 index a516c90f9..000000000 --- a/src/version3/models/searchResults.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Issue } from './issue.js'; - -/** The result of a JQL search. */ -export interface SearchResults { - /** Expand options that include additional search result details in the response. */ - expand?: string; - /** The index of the first item returned on the page. */ - startAt?: number; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The number of results on the page. */ - total?: number; - /** The list of issues found by the search. */ - issues?: Issue[]; - /** Any warnings related to the JQL query. */ - warningMessages?: string[]; - /** The ID and name of each field in the search results. */ - names?: {}; - /** The schema describing the field types in the search results. */ - schema?: {}; -} diff --git a/src/version3/models/securityLevel.ts b/src/version3/models/securityLevel.mts similarity index 100% rename from src/version3/models/securityLevel.ts rename to src/version3/models/securityLevel.mts diff --git a/src/version3/models/securityLevelMember.mts b/src/version3/models/securityLevelMember.mts new file mode 100644 index 000000000..f9723fbfb --- /dev/null +++ b/src/version3/models/securityLevelMember.mts @@ -0,0 +1,12 @@ +import type { PermissionHolder } from './permissionHolder.mjs'; + +/** Issue security level member. */ +export interface SecurityLevelMember { + holder?: PermissionHolder; + /** The ID of the issue security level member. */ + id: string; + /** The ID of the issue security level. */ + issueSecurityLevelId: string; + /** The ID of the issue security scheme. */ + issueSecuritySchemeId: string; +} diff --git a/src/version3/models/securityLevelMember.ts b/src/version3/models/securityLevelMember.ts deleted file mode 100644 index 311d8f5d6..000000000 --- a/src/version3/models/securityLevelMember.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { PermissionHolder } from './permissionHolder.js'; - -/** Issue security level member. */ -export interface SecurityLevelMember { - holder?: PermissionHolder; - /** The ID of the issue security level member. */ - id: string; - /** The ID of the issue security level. */ - issueSecurityLevelId: string; - /** The ID of the issue security scheme. */ - issueSecuritySchemeId: string; -} diff --git a/src/version3/models/securityScheme.mts b/src/version3/models/securityScheme.mts new file mode 100644 index 000000000..1b77931ee --- /dev/null +++ b/src/version3/models/securityScheme.mts @@ -0,0 +1,16 @@ +import type { SecurityLevel } from './securityLevel.mjs'; + +/** Details about a security scheme. */ +export interface SecurityScheme { + /** The URL of the issue security scheme. */ + self?: string; + /** The ID of the issue security scheme. */ + id?: number; + /** The name of the issue security scheme. */ + name?: string; + /** The description of the issue security scheme. */ + description?: string; + /** The ID of the default security level. */ + defaultSecurityLevelId?: number; + levels?: SecurityLevel[]; +} diff --git a/src/version3/models/securityScheme.ts b/src/version3/models/securityScheme.ts deleted file mode 100644 index 06afdb90a..000000000 --- a/src/version3/models/securityScheme.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { SecurityLevel } from './securityLevel.js'; - -/** Details about a security scheme. */ -export interface SecurityScheme { - /** The URL of the issue security scheme. */ - self?: string; - /** The ID of the issue security scheme. */ - id?: number; - /** The name of the issue security scheme. */ - name?: string; - /** The description of the issue security scheme. */ - description?: string; - /** The ID of the default security level. */ - defaultSecurityLevelId?: number; - levels?: SecurityLevel[]; -} diff --git a/src/version3/models/securitySchemeId.ts b/src/version3/models/securitySchemeId.mts similarity index 100% rename from src/version3/models/securitySchemeId.ts rename to src/version3/models/securitySchemeId.mts diff --git a/src/version3/models/securitySchemeLevel.mts b/src/version3/models/securitySchemeLevel.mts new file mode 100644 index 000000000..55f650528 --- /dev/null +++ b/src/version3/models/securitySchemeLevel.mts @@ -0,0 +1,12 @@ +import type { SecuritySchemeLevelMember } from './securitySchemeLevelMember.mjs'; + +export interface SecuritySchemeLevel { + /** The description of the issue security scheme level. */ + description?: string; + /** Specifies whether the level is the default level. False by default. */ + isDefault?: boolean; + /** The list of level members which should be added to the issue security scheme level. */ + members?: SecuritySchemeLevelMember[]; + /** The name of the issue security scheme level. Must be unique. */ + name: string; +} diff --git a/src/version3/models/securitySchemeLevel.ts b/src/version3/models/securitySchemeLevel.ts deleted file mode 100644 index 9fa72eced..000000000 --- a/src/version3/models/securitySchemeLevel.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { SecuritySchemeLevelMember } from './securitySchemeLevelMember.js'; - -export interface SecuritySchemeLevel { - /** The description of the issue security scheme level. */ - description?: string; - /** Specifies whether the level is the default level. False by default. */ - isDefault?: boolean; - /** The list of level members which should be added to the issue security scheme level. */ - members?: SecuritySchemeLevelMember[]; - /** The name of the issue security scheme level. Must be unique. */ - name: string; -} diff --git a/src/version3/models/securitySchemeLevelMember.ts b/src/version3/models/securitySchemeLevelMember.mts similarity index 100% rename from src/version3/models/securitySchemeLevelMember.ts rename to src/version3/models/securitySchemeLevelMember.mts diff --git a/src/version3/models/securitySchemeMembersRequest.mts b/src/version3/models/securitySchemeMembersRequest.mts new file mode 100644 index 000000000..d2ff6a141 --- /dev/null +++ b/src/version3/models/securitySchemeMembersRequest.mts @@ -0,0 +1,7 @@ +import type { SecuritySchemeLevelMember } from './securitySchemeLevelMember.mjs'; + +/** Details of issue security scheme level new members. */ +export interface SecuritySchemeMembersRequest { + /** The list of level members which should be added to the issue security scheme level. */ + members?: SecuritySchemeLevelMember[]; +} diff --git a/src/version3/models/securitySchemeMembersRequest.ts b/src/version3/models/securitySchemeMembersRequest.ts deleted file mode 100644 index 62aa61adc..000000000 --- a/src/version3/models/securitySchemeMembersRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SecuritySchemeLevelMember } from './securitySchemeLevelMember.js'; - -/** Details of issue security scheme level new members. */ -export interface SecuritySchemeMembersRequest { - /** The list of level members which should be added to the issue security scheme level. */ - members?: SecuritySchemeLevelMember[]; -} diff --git a/src/version3/models/securitySchemeWithProjects.ts b/src/version3/models/securitySchemeWithProjects.mts similarity index 100% rename from src/version3/models/securitySchemeWithProjects.ts rename to src/version3/models/securitySchemeWithProjects.mts diff --git a/src/version3/models/securitySchemes.mts b/src/version3/models/securitySchemes.mts new file mode 100644 index 000000000..cc5c5d77a --- /dev/null +++ b/src/version3/models/securitySchemes.mts @@ -0,0 +1,7 @@ +import type { SecurityScheme } from './securityScheme.mjs'; + +/** List of security schemes. */ +export interface SecuritySchemes { + /** List of security schemes. */ + issueSecuritySchemes?: SecurityScheme[]; +} diff --git a/src/version3/models/securitySchemes.ts b/src/version3/models/securitySchemes.ts deleted file mode 100644 index 78f585d65..000000000 --- a/src/version3/models/securitySchemes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SecurityScheme } from './securityScheme.js'; - -/** List of security schemes. */ -export interface SecuritySchemes { - /** List of security schemes. */ - issueSecuritySchemes?: SecurityScheme[]; -} diff --git a/src/version3/models/serverInformation.ts b/src/version3/models/serverInformation.mts similarity index 100% rename from src/version3/models/serverInformation.ts rename to src/version3/models/serverInformation.mts diff --git a/src/version3/models/setDefaultLevelsRequest.mts b/src/version3/models/setDefaultLevelsRequest.mts new file mode 100644 index 000000000..9aeece50e --- /dev/null +++ b/src/version3/models/setDefaultLevelsRequest.mts @@ -0,0 +1,7 @@ +import type { DefaultLevelValue } from './defaultLevelValue.mjs'; + +/** Details of new default levels. */ +export interface SetDefaultLevelsRequest { + /** List of objects with issue security scheme ID and new default level ID. */ + defaultValues: DefaultLevelValue[]; +} diff --git a/src/version3/models/setDefaultLevelsRequest.ts b/src/version3/models/setDefaultLevelsRequest.ts deleted file mode 100644 index ce205a786..000000000 --- a/src/version3/models/setDefaultLevelsRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { DefaultLevelValue } from './defaultLevelValue.js'; - -/** Details of new default levels. */ -export interface SetDefaultLevelsRequest { - /** List of objects with issue security scheme ID and new default level ID. */ - defaultValues: DefaultLevelValue[]; -} diff --git a/src/version3/models/setDefaultPriorityRequest.ts b/src/version3/models/setDefaultPriorityRequest.mts similarity index 100% rename from src/version3/models/setDefaultPriorityRequest.ts rename to src/version3/models/setDefaultPriorityRequest.mts diff --git a/src/version3/models/setDefaultResolutionRequest.ts b/src/version3/models/setDefaultResolutionRequest.mts similarity index 100% rename from src/version3/models/setDefaultResolutionRequest.ts rename to src/version3/models/setDefaultResolutionRequest.mts diff --git a/src/version3/models/sharePermission.mts b/src/version3/models/sharePermission.mts new file mode 100644 index 000000000..07aae3a6f --- /dev/null +++ b/src/version3/models/sharePermission.mts @@ -0,0 +1,28 @@ +import type { DashboardUser } from './dashboardUser.mjs'; +import type { GroupName } from './groupName.mjs'; +import type { Project } from './project.mjs'; +import type { ProjectRole } from './projectRole.mjs'; + +/** Details of a share permission for the filter. */ +export interface SharePermission { + /** The unique identifier of the share permission. */ + id?: number; + /** + * The type of share permission: + * + * - `user` Shared with a user. + * - `group` Shared with a group. If set in a request, then specify `sharePermission.group` as well. + * - `project` Shared with a project. If set in a request, then specify `sharePermission.project` as well. + * - `projectRole` Share with a project role in a project. This value is not returned in responses. It is used in + * requests, where it needs to be specify with `projectId` and `projectRoleId`. + * - `global` Shared globally. If set in a request, no other `sharePermission` properties need to be specified. + * - `loggedin` Shared with all logged-in users. Note: This value is set in a request by specifying `authenticated` as + * the `type`. + * - `project-unknown` Shared with a project that the user does not have access to. Cannot be set in a request. + */ + type: 'user' | 'group' | 'project' | 'projectRole' | 'global' | 'loggedin' | 'project-unknown' | string; + project?: Project; + role?: ProjectRole; + group?: GroupName; + user?: DashboardUser; +} diff --git a/src/version3/models/sharePermission.ts b/src/version3/models/sharePermission.ts deleted file mode 100644 index 26b862846..000000000 --- a/src/version3/models/sharePermission.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { DashboardUser } from './dashboardUser.js'; -import type { GroupName } from './groupName.js'; -import type { Project } from './project.js'; -import type { ProjectRole } from './projectRole.js'; - -/** Details of a share permission for the filter. */ -export interface SharePermission { - /** The unique identifier of the share permission. */ - id?: number; - /** - * The type of share permission: - * - * - `user` Shared with a user. - * - `group` Shared with a group. If set in a request, then specify `sharePermission.group` as well. - * - `project` Shared with a project. If set in a request, then specify `sharePermission.project` as well. - * - `projectRole` Share with a project role in a project. This value is not returned in responses. It is used in - * requests, where it needs to be specify with `projectId` and `projectRoleId`. - * - `global` Shared globally. If set in a request, no other `sharePermission` properties need to be specified. - * - `loggedin` Shared with all logged-in users. Note: This value is set in a request by specifying `authenticated` as - * the `type`. - * - `project-unknown` Shared with a project that the user does not have access to. Cannot be set in a request. - */ - type: 'user' | 'group' | 'project' | 'projectRole' | 'global' | 'loggedin' | 'project-unknown' | string; - project?: Project; - role?: ProjectRole; - group?: GroupName; - user?: DashboardUser; -} diff --git a/src/version3/models/sharePermissionInput.ts b/src/version3/models/sharePermissionInput.mts similarity index 100% rename from src/version3/models/sharePermissionInput.ts rename to src/version3/models/sharePermissionInput.mts diff --git a/src/version3/models/simpleApplicationProperty.ts b/src/version3/models/simpleApplicationProperty.mts similarity index 100% rename from src/version3/models/simpleApplicationProperty.ts rename to src/version3/models/simpleApplicationProperty.mts diff --git a/src/version3/models/simpleErrorCollection.ts b/src/version3/models/simpleErrorCollection.mts similarity index 100% rename from src/version3/models/simpleErrorCollection.ts rename to src/version3/models/simpleErrorCollection.mts diff --git a/src/version3/models/simpleLink.ts b/src/version3/models/simpleLink.mts similarity index 100% rename from src/version3/models/simpleLink.ts rename to src/version3/models/simpleLink.mts diff --git a/src/version3/models/simpleListWrapperApplicationRole.mts b/src/version3/models/simpleListWrapperApplicationRole.mts new file mode 100644 index 000000000..4a7c24ae2 --- /dev/null +++ b/src/version3/models/simpleListWrapperApplicationRole.mts @@ -0,0 +1,10 @@ +import type { ApplicationRole } from './applicationRole.mjs'; +import type { ListWrapperCallbackApplicationRole } from './listWrapperCallbackApplicationRole.mjs'; + +export interface SimpleListWrapperApplicationRole { + size?: number; + items?: ApplicationRole[]; + pagingCallback?: ListWrapperCallbackApplicationRole; + callback?: ListWrapperCallbackApplicationRole; + 'max-results'?: number; +} diff --git a/src/version3/models/simpleListWrapperApplicationRole.ts b/src/version3/models/simpleListWrapperApplicationRole.ts deleted file mode 100644 index d7bd9a3f1..000000000 --- a/src/version3/models/simpleListWrapperApplicationRole.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ApplicationRole } from './applicationRole.js'; -import type { ListWrapperCallbackApplicationRole } from './listWrapperCallbackApplicationRole.js'; - -export interface SimpleListWrapperApplicationRole { - size?: number; - items?: ApplicationRole[]; - pagingCallback?: ListWrapperCallbackApplicationRole; - callback?: ListWrapperCallbackApplicationRole; - 'max-results'?: number; -} diff --git a/src/version3/models/simpleListWrapperGroupName.mts b/src/version3/models/simpleListWrapperGroupName.mts new file mode 100644 index 000000000..8da5e4eda --- /dev/null +++ b/src/version3/models/simpleListWrapperGroupName.mts @@ -0,0 +1,10 @@ +import type { GroupName } from './groupName.mjs'; +import type { ListWrapperCallbackGroupName } from './listWrapperCallbackGroupName.mjs'; + +export interface SimpleListWrapperGroupName { + size?: number; + items?: GroupName[]; + pagingCallback?: ListWrapperCallbackGroupName; + callback?: ListWrapperCallbackGroupName; + 'max-results'?: number; +} diff --git a/src/version3/models/simpleListWrapperGroupName.ts b/src/version3/models/simpleListWrapperGroupName.ts deleted file mode 100644 index 48cc82976..000000000 --- a/src/version3/models/simpleListWrapperGroupName.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { GroupName } from './groupName.js'; -import type { ListWrapperCallbackGroupName } from './listWrapperCallbackGroupName.js'; - -export interface SimpleListWrapperGroupName { - size?: number; - items?: GroupName[]; - pagingCallback?: ListWrapperCallbackGroupName; - callback?: ListWrapperCallbackGroupName; - 'max-results'?: number; -} diff --git a/src/version3/models/status.mts b/src/version3/models/status.mts new file mode 100644 index 000000000..8e0abfcbc --- /dev/null +++ b/src/version3/models/status.mts @@ -0,0 +1,11 @@ +import type { Icon } from './icon.mjs'; + +/** The status of the item. */ +export interface Status { + /** + * Whether the item is resolved. If set to "true", the link to the issue is displayed in a strikethrough font, + * otherwise the link displays in normal font. + */ + resolved?: boolean; + icon?: Icon; +} diff --git a/src/version3/models/status.ts b/src/version3/models/status.ts deleted file mode 100644 index b461d5183..000000000 --- a/src/version3/models/status.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Icon } from './icon.js'; - -/** The status of the item. */ -export interface Status { - /** - * Whether the item is resolved. If set to "true", the link to the issue is displayed in a strikethrough font, - * otherwise the link displays in normal font. - */ - resolved?: boolean; - icon?: Icon; -} diff --git a/src/version3/models/statusCategory.ts b/src/version3/models/statusCategory.mts similarity index 100% rename from src/version3/models/statusCategory.ts rename to src/version3/models/statusCategory.mts diff --git a/src/version3/models/statusCreate.ts b/src/version3/models/statusCreate.mts similarity index 100% rename from src/version3/models/statusCreate.ts rename to src/version3/models/statusCreate.mts diff --git a/src/version3/models/statusCreateRequest.mts b/src/version3/models/statusCreateRequest.mts new file mode 100644 index 000000000..c4418f561 --- /dev/null +++ b/src/version3/models/statusCreateRequest.mts @@ -0,0 +1,9 @@ +import type { StatusCreate } from './statusCreate.mjs'; +import type { StatusScope } from './statusScope.mjs'; + +/** Details of the statuses being created and their scope. */ +export interface StatusCreateRequest { + /** Details of the statuses being created. */ + statuses: StatusCreate[]; + scope: StatusScope; +} diff --git a/src/version3/models/statusCreateRequest.ts b/src/version3/models/statusCreateRequest.ts deleted file mode 100644 index 00c4fed36..000000000 --- a/src/version3/models/statusCreateRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { StatusCreate } from './statusCreate.js'; -import type { StatusScope } from './statusScope.js'; - -/** Details of the statuses being created and their scope. */ -export interface StatusCreateRequest { - /** Details of the statuses being created. */ - statuses: StatusCreate[]; - scope: StatusScope; -} diff --git a/src/version3/models/statusDetails.mts b/src/version3/models/statusDetails.mts new file mode 100644 index 000000000..affd80d61 --- /dev/null +++ b/src/version3/models/statusDetails.mts @@ -0,0 +1,16 @@ +import type { StatusCategory } from './statusCategory.mjs'; + +/** A status. */ +export interface StatusDetails { + /** The URL of the status. */ + self?: string; + /** The description of the status. */ + description?: string; + /** The URL of the icon used to represent the status. */ + iconUrl?: string; + /** The name of the status. */ + name?: string; + /** The ID of the status. */ + id?: string; + statusCategory?: StatusCategory; +} diff --git a/src/version3/models/statusDetails.ts b/src/version3/models/statusDetails.ts deleted file mode 100644 index f36b5169b..000000000 --- a/src/version3/models/statusDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { StatusCategory } from './statusCategory.js'; - -/** A status. */ -export interface StatusDetails { - /** The URL of the status. */ - self?: string; - /** The description of the status. */ - description?: string; - /** The URL of the icon used to represent the status. */ - iconUrl?: string; - /** The name of the status. */ - name?: string; - /** The ID of the status. */ - id?: string; - statusCategory?: StatusCategory; -} diff --git a/src/version3/models/statusMapping.ts b/src/version3/models/statusMapping.mts similarity index 100% rename from src/version3/models/statusMapping.ts rename to src/version3/models/statusMapping.mts diff --git a/src/version3/models/statusScope.mts b/src/version3/models/statusScope.mts new file mode 100644 index 000000000..8b1eca664 --- /dev/null +++ b/src/version3/models/statusScope.mts @@ -0,0 +1,8 @@ +import type { ProjectId } from './projectId.mjs'; + +/** The scope of the status. */ +export interface StatusScope { + /** The scope of the status. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects. */ + type: string; + project?: ProjectId; +} diff --git a/src/version3/models/statusScope.ts b/src/version3/models/statusScope.ts deleted file mode 100644 index cf85f7314..000000000 --- a/src/version3/models/statusScope.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectId } from './projectId.js'; - -/** The scope of the status. */ -export interface StatusScope { - /** The scope of the status. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects. */ - type: string; - project?: ProjectId; -} diff --git a/src/version3/models/statusUpdate.ts b/src/version3/models/statusUpdate.mts similarity index 100% rename from src/version3/models/statusUpdate.ts rename to src/version3/models/statusUpdate.mts diff --git a/src/version3/models/statusUpdateRequest.mts b/src/version3/models/statusUpdateRequest.mts new file mode 100644 index 000000000..2ae0c2697 --- /dev/null +++ b/src/version3/models/statusUpdateRequest.mts @@ -0,0 +1,7 @@ +import type { StatusUpdate } from './statusUpdate.mjs'; + +/** The list of statuses that will be updated. */ +export interface StatusUpdateRequest { + /** The list of statuses that will be updated. */ + statuses?: StatusUpdate[]; +} diff --git a/src/version3/models/statusUpdateRequest.ts b/src/version3/models/statusUpdateRequest.ts deleted file mode 100644 index be4da347d..000000000 --- a/src/version3/models/statusUpdateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { StatusUpdate } from './statusUpdate.js'; - -/** The list of statuses that will be updated. */ -export interface StatusUpdateRequest { - /** The list of statuses that will be updated. */ - statuses?: StatusUpdate[]; -} diff --git a/src/version3/models/suggestedIssue.ts b/src/version3/models/suggestedIssue.mts similarity index 100% rename from src/version3/models/suggestedIssue.ts rename to src/version3/models/suggestedIssue.mts diff --git a/src/version3/models/systemAvatars.mts b/src/version3/models/systemAvatars.mts new file mode 100644 index 000000000..7984cb58a --- /dev/null +++ b/src/version3/models/systemAvatars.mts @@ -0,0 +1,7 @@ +import type { Avatar } from './avatar.mjs'; + +/** List of system avatars. */ +export interface SystemAvatars { + /** A list of avatar details. */ + system?: Avatar[]; +} diff --git a/src/version3/models/systemAvatars.ts b/src/version3/models/systemAvatars.ts deleted file mode 100644 index e698d2613..000000000 --- a/src/version3/models/systemAvatars.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Avatar } from './avatar.js'; - -/** List of system avatars. */ -export interface SystemAvatars { - /** A list of avatar details. */ - system?: Avatar[]; -} diff --git a/src/version3/models/taskProgressObject.ts b/src/version3/models/taskProgressObject.mts similarity index 100% rename from src/version3/models/taskProgressObject.ts rename to src/version3/models/taskProgressObject.mts diff --git a/src/version3/models/taskProgressRemoveOptionFromIssuesResult.mts b/src/version3/models/taskProgressRemoveOptionFromIssuesResult.mts new file mode 100644 index 000000000..72fe897ff --- /dev/null +++ b/src/version3/models/taskProgressRemoveOptionFromIssuesResult.mts @@ -0,0 +1,30 @@ +import type { RemoveOptionFromIssuesResult } from './removeOptionFromIssuesResult.mjs'; + +/** Details about a task. */ +export interface TaskProgressRemoveOptionFromIssuesResult { + /** The URL of the task. */ + self: string; + /** The ID of the task. */ + id: string; + /** The description of the task. */ + description?: string; + /** The status of the task. */ + status: string; + /** Information about the progress of the task. */ + message?: string; + result?: RemoveOptionFromIssuesResult; + /** The ID of the user who submitted the task. */ + submittedBy: number; + /** The progress of the task, as a percentage complete. */ + progress: number; + /** The execution time of the task, in milliseconds. */ + elapsedRuntime: number; + /** A timestamp recording when the task was submitted. */ + submitted: number; + /** A timestamp recording when the task was started. */ + started?: number; + /** A timestamp recording when the task was finished. */ + finished?: number; + /** A timestamp recording when the task progress was last updated. */ + lastUpdate: number; +} diff --git a/src/version3/models/taskProgressRemoveOptionFromIssuesResult.ts b/src/version3/models/taskProgressRemoveOptionFromIssuesResult.ts deleted file mode 100644 index 801d7fb9e..000000000 --- a/src/version3/models/taskProgressRemoveOptionFromIssuesResult.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { RemoveOptionFromIssuesResult } from './removeOptionFromIssuesResult.js'; - -/** Details about a task. */ -export interface TaskProgressRemoveOptionFromIssuesResult { - /** The URL of the task. */ - self: string; - /** The ID of the task. */ - id: string; - /** The description of the task. */ - description?: string; - /** The status of the task. */ - status: string; - /** Information about the progress of the task. */ - message?: string; - result?: RemoveOptionFromIssuesResult; - /** The ID of the user who submitted the task. */ - submittedBy: number; - /** The progress of the task, as a percentage complete. */ - progress: number; - /** The execution time of the task, in milliseconds. */ - elapsedRuntime: number; - /** A timestamp recording when the task was submitted. */ - submitted: number; - /** A timestamp recording when the task was started. */ - started?: number; - /** A timestamp recording when the task was finished. */ - finished?: number; - /** A timestamp recording when the task progress was last updated. */ - lastUpdate: number; -} diff --git a/src/version3/models/timeTrackingConfiguration.ts b/src/version3/models/timeTrackingConfiguration.mts similarity index 100% rename from src/version3/models/timeTrackingConfiguration.ts rename to src/version3/models/timeTrackingConfiguration.mts diff --git a/src/version3/models/timeTrackingDetails.ts b/src/version3/models/timeTrackingDetails.mts similarity index 100% rename from src/version3/models/timeTrackingDetails.ts rename to src/version3/models/timeTrackingDetails.mts diff --git a/src/version3/models/timeTrackingProvider.ts b/src/version3/models/timeTrackingProvider.mts similarity index 100% rename from src/version3/models/timeTrackingProvider.ts rename to src/version3/models/timeTrackingProvider.mts diff --git a/src/version3/models/transition.mts b/src/version3/models/transition.mts new file mode 100644 index 000000000..a8215dcaa --- /dev/null +++ b/src/version3/models/transition.mts @@ -0,0 +1,22 @@ +import { ScreenID } from './screenID.mjs'; +import type { WorkflowRules } from './workflowRules.mjs'; + +/** Details of a workflow transition. */ +export interface Transition { + /** The ID of the transition. */ + id: string; + /** The name of the transition. */ + name: string; + /** The description of the transition. */ + description: string; + /** The statuses the transition can start from. */ + from: string[]; + /** The status the transition goes to. */ + to: string; + /** The type of the transition. */ + type: string; + screen?: ScreenID; + rules?: WorkflowRules; + /** The properties of the transition. */ + properties?: {}; +} diff --git a/src/version3/models/transition.ts b/src/version3/models/transition.ts deleted file mode 100644 index 37d4b63c9..000000000 --- a/src/version3/models/transition.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { ScreenID } from './screenID.js'; -import type { WorkflowRules } from './workflowRules.js'; - -/** Details of a workflow transition. */ -export interface Transition { - /** The ID of the transition. */ - id: string; - /** The name of the transition. */ - name: string; - /** The description of the transition. */ - description: string; - /** The statuses the transition can start from. */ - from: string[]; - /** The status the transition goes to. */ - to: string; - /** The type of the transition. */ - type: string; - screen?: ScreenID; - rules?: WorkflowRules; - /** The properties of the transition. */ - properties?: {}; -} diff --git a/src/version3/models/transitions.mts b/src/version3/models/transitions.mts new file mode 100644 index 000000000..58362e776 --- /dev/null +++ b/src/version3/models/transitions.mts @@ -0,0 +1,9 @@ +import type { IssueTransition } from './issueTransition.mjs'; + +/** List of issue transitions. */ +export interface Transitions { + /** Expand options that include additional transitions details in the response. */ + expand?: string; + /** List of issue transitions. */ + transitions?: IssueTransition[]; +} diff --git a/src/version3/models/transitions.ts b/src/version3/models/transitions.ts deleted file mode 100644 index bc6d52a1b..000000000 --- a/src/version3/models/transitions.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { IssueTransition } from './issueTransition.js'; - -/** List of issue transitions. */ -export interface Transitions { - /** Expand options that include additional transitions details in the response. */ - expand?: string; - /** List of issue transitions. */ - transitions?: IssueTransition[]; -} diff --git a/src/version3/models/uiModificationContextDetails.ts b/src/version3/models/uiModificationContextDetails.mts similarity index 100% rename from src/version3/models/uiModificationContextDetails.ts rename to src/version3/models/uiModificationContextDetails.mts diff --git a/src/version3/models/uiModificationDetails.mts b/src/version3/models/uiModificationDetails.mts new file mode 100644 index 000000000..f422718c9 --- /dev/null +++ b/src/version3/models/uiModificationDetails.mts @@ -0,0 +1,17 @@ +import type { UiModificationContextDetails } from './uiModificationContextDetails.mjs'; + +/** The details of a UI modification. */ +export interface UiModificationDetails { + /** The ID of the UI modification. */ + id: string; + /** The name of the UI modification. The maximum length is 255 characters. */ + name: string; + /** The description of the UI modification. The maximum length is 255 characters. */ + description?: string; + /** The URL of the UI modification. */ + self: string; + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data?: string; + /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ + contexts?: UiModificationContextDetails[]; +} diff --git a/src/version3/models/uiModificationDetails.ts b/src/version3/models/uiModificationDetails.ts deleted file mode 100644 index aacb5a79d..000000000 --- a/src/version3/models/uiModificationDetails.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { UiModificationContextDetails } from './uiModificationContextDetails.js'; - -/** The details of a UI modification. */ -export interface UiModificationDetails { - /** The ID of the UI modification. */ - id: string; - /** The name of the UI modification. The maximum length is 255 characters. */ - name: string; - /** The description of the UI modification. The maximum length is 255 characters. */ - description?: string; - /** The URL of the UI modification. */ - self: string; - /** The data of the UI modification. The maximum size of the data is 50000 characters. */ - data?: string; - /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ - contexts?: UiModificationContextDetails[]; -} diff --git a/src/version3/models/uiModificationIdentifiers.ts b/src/version3/models/uiModificationIdentifiers.mts similarity index 100% rename from src/version3/models/uiModificationIdentifiers.ts rename to src/version3/models/uiModificationIdentifiers.mts diff --git a/src/version3/models/unrestrictedUserEmail.ts b/src/version3/models/unrestrictedUserEmail.mts similarity index 100% rename from src/version3/models/unrestrictedUserEmail.ts rename to src/version3/models/unrestrictedUserEmail.mts diff --git a/src/version3/models/updateCustomFieldDetails.ts b/src/version3/models/updateCustomFieldDetails.mts similarity index 100% rename from src/version3/models/updateCustomFieldDetails.ts rename to src/version3/models/updateCustomFieldDetails.mts diff --git a/src/version3/models/updateFieldConfigurationSchemeDetails.ts b/src/version3/models/updateFieldConfigurationSchemeDetails.mts similarity index 100% rename from src/version3/models/updateFieldConfigurationSchemeDetails.ts rename to src/version3/models/updateFieldConfigurationSchemeDetails.mts diff --git a/src/version3/models/updateIssueSecurityLevelDetails.ts b/src/version3/models/updateIssueSecurityLevelDetails.mts similarity index 100% rename from src/version3/models/updateIssueSecurityLevelDetails.ts rename to src/version3/models/updateIssueSecurityLevelDetails.mts diff --git a/src/version3/models/updateIssueSecuritySchemeRequest.ts b/src/version3/models/updateIssueSecuritySchemeRequest.mts similarity index 100% rename from src/version3/models/updateIssueSecuritySchemeRequest.ts rename to src/version3/models/updateIssueSecuritySchemeRequest.mts diff --git a/src/version3/models/updateNotificationSchemeDetails.ts b/src/version3/models/updateNotificationSchemeDetails.mts similarity index 100% rename from src/version3/models/updateNotificationSchemeDetails.ts rename to src/version3/models/updateNotificationSchemeDetails.mts diff --git a/src/version3/models/updatePriorityDetails.ts b/src/version3/models/updatePriorityDetails.mts similarity index 100% rename from src/version3/models/updatePriorityDetails.ts rename to src/version3/models/updatePriorityDetails.mts diff --git a/src/version3/models/updateProjectDetails.ts b/src/version3/models/updateProjectDetails.mts similarity index 100% rename from src/version3/models/updateProjectDetails.ts rename to src/version3/models/updateProjectDetails.mts diff --git a/src/version3/models/updateResolutionDetails.ts b/src/version3/models/updateResolutionDetails.mts similarity index 100% rename from src/version3/models/updateResolutionDetails.ts rename to src/version3/models/updateResolutionDetails.mts diff --git a/src/version3/models/updateScreenDetails.ts b/src/version3/models/updateScreenDetails.mts similarity index 100% rename from src/version3/models/updateScreenDetails.ts rename to src/version3/models/updateScreenDetails.mts diff --git a/src/version3/models/updateScreenSchemeDetails.mts b/src/version3/models/updateScreenSchemeDetails.mts new file mode 100644 index 000000000..336d94fb7 --- /dev/null +++ b/src/version3/models/updateScreenSchemeDetails.mts @@ -0,0 +1,10 @@ +import type { UpdateScreenTypes } from './updateScreenTypes.mjs'; + +/** Details of a screen scheme. */ +export interface UpdateScreenSchemeDetails { + /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ + name?: string; + /** The description of the screen scheme. The maximum length is 255 characters. */ + description?: string; + screens?: UpdateScreenTypes; +} diff --git a/src/version3/models/updateScreenSchemeDetails.ts b/src/version3/models/updateScreenSchemeDetails.ts deleted file mode 100644 index 99c6ba62f..000000000 --- a/src/version3/models/updateScreenSchemeDetails.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { UpdateScreenTypes } from './updateScreenTypes.js'; - -/** Details of a screen scheme. */ -export interface UpdateScreenSchemeDetails { - /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ - name?: string; - /** The description of the screen scheme. The maximum length is 255 characters. */ - description?: string; - screens?: UpdateScreenTypes; -} diff --git a/src/version3/models/updateScreenTypes.ts b/src/version3/models/updateScreenTypes.mts similarity index 100% rename from src/version3/models/updateScreenTypes.ts rename to src/version3/models/updateScreenTypes.mts diff --git a/src/version3/models/updateUiModificationDetails.mts b/src/version3/models/updateUiModificationDetails.mts new file mode 100644 index 000000000..1ea7cc590 --- /dev/null +++ b/src/version3/models/updateUiModificationDetails.mts @@ -0,0 +1,16 @@ +import type { UiModificationContextDetails } from './uiModificationContextDetails.mjs'; + +/** The details of a UI modification. */ +export interface UpdateUiModificationDetails { + /** The name of the UI modification. The maximum length is 255 characters. */ + name?: string; + /** The description of the UI modification. The maximum length is 255 characters. */ + description?: string; + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data?: string; + /** + * List of contexts of the UI modification. The maximum number of contexts is 1000. If provided, replaces all existing + * contexts. + */ + contexts?: UiModificationContextDetails[]; +} diff --git a/src/version3/models/updateUiModificationDetails.ts b/src/version3/models/updateUiModificationDetails.ts deleted file mode 100644 index 85ec8670b..000000000 --- a/src/version3/models/updateUiModificationDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { UiModificationContextDetails } from './uiModificationContextDetails.js'; - -/** The details of a UI modification. */ -export interface UpdateUiModificationDetails { - /** The name of the UI modification. The maximum length is 255 characters. */ - name?: string; - /** The description of the UI modification. The maximum length is 255 characters. */ - description?: string; - /** The data of the UI modification. The maximum size of the data is 50000 characters. */ - data?: string; - /** - * List of contexts of the UI modification. The maximum number of contexts is 1000. If provided, replaces all existing - * contexts. - */ - contexts?: UiModificationContextDetails[]; -} diff --git a/src/version3/models/updateUserToGroup.ts b/src/version3/models/updateUserToGroup.mts similarity index 100% rename from src/version3/models/updateUserToGroup.ts rename to src/version3/models/updateUserToGroup.mts diff --git a/src/version3/models/updatedProjectCategory.ts b/src/version3/models/updatedProjectCategory.mts similarity index 100% rename from src/version3/models/updatedProjectCategory.ts rename to src/version3/models/updatedProjectCategory.mts diff --git a/src/version3/models/user.mts b/src/version3/models/user.mts new file mode 100644 index 000000000..8bbbe22b5 --- /dev/null +++ b/src/version3/models/user.mts @@ -0,0 +1,62 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; +import type { SimpleListWrapperApplicationRole } from './simpleListWrapperApplicationRole.mjs'; +import type { SimpleListWrapperGroupName } from './simpleListWrapperGroupName.mjs'; + +/** + * A user with details as permitted by the user's Atlassian Account privacy settings. However, be aware of these + * exceptions:* + * + * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, + * `displayName` provides an indication and other parameters have default values or are blank (for example, email is + * blank). + * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted + * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. + * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have + * fallback values. + */ +export interface User { + /** The URL of the user. */ + self?: string; + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + key?: string; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. Required in requests. + */ + accountId: string; + /** + * The user account type. Can take the following values: + * + * `atlassian` regular Atlassian user account `app` system account used for Connect applications and OAuth to + * represent external systems `customer` Jira Service Desk account representing an external service desk + */ + accountType?: string; + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + name?: string; + /** The email address of the user. Depending on the user’s privacy setting, this may be returned as null. */ + emailAddress?: string; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** Whether the user is active. */ + active: boolean; + /** + * The time zone specified in the user's profile. Depending on the user’s privacy setting, this may be returned as + * null. + */ + timeZone?: string; + /** The locale of the user. Depending on the user’s privacy setting, this may be returned as null. */ + locale?: string; + groups?: SimpleListWrapperGroupName; + applicationRoles?: SimpleListWrapperApplicationRole; + /** Expand options that include additional user details in the response. */ + expand?: string; +} diff --git a/src/version3/models/user.ts b/src/version3/models/user.ts deleted file mode 100644 index 71a14c50a..000000000 --- a/src/version3/models/user.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; -import type { SimpleListWrapperApplicationRole } from './simpleListWrapperApplicationRole.js'; -import type { SimpleListWrapperGroupName } from './simpleListWrapperGroupName.js'; - -/** - * A user with details as permitted by the user's Atlassian Account privacy settings. However, be aware of these - * exceptions:* - * - * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, - * `displayName` provides an indication and other parameters have default values or are blank (for example, email is - * blank). - * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted - * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. - * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have - * fallback values. - */ -export interface User { - /** The URL of the user. */ - self?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - key?: string; - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. Required in requests. - */ - accountId: string; - /** - * The user account type. Can take the following values: - * - * `atlassian` regular Atlassian user account `app` system account used for Connect applications and OAuth to - * represent external systems `customer` Jira Service Desk account representing an external service desk - */ - accountType?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - name?: string; - /** The email address of the user. Depending on the user’s privacy setting, this may be returned as null. */ - emailAddress?: string; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active: boolean; - /** - * The time zone specified in the user's profile. Depending on the user’s privacy setting, this may be returned as - * null. - */ - timeZone?: string; - /** The locale of the user. Depending on the user’s privacy setting, this may be returned as null. */ - locale?: string; - groups?: SimpleListWrapperGroupName; - applicationRoles?: SimpleListWrapperApplicationRole; - /** Expand options that include additional user details in the response. */ - expand?: string; -} diff --git a/src/version3/models/userAvatarUrls.ts b/src/version3/models/userAvatarUrls.mts similarity index 100% rename from src/version3/models/userAvatarUrls.ts rename to src/version3/models/userAvatarUrls.mts diff --git a/src/version3/models/userDetails.mts b/src/version3/models/userDetails.mts new file mode 100644 index 000000000..5537a8b92 --- /dev/null +++ b/src/version3/models/userDetails.mts @@ -0,0 +1,51 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; + +/** + * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* + * + * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, + * `displayName` provides an indication and other parameters have default values or are blank (for example, email is + * blank). + * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted + * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. + * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have + * fallback values. + */ +export interface UserDetails { + /** The URL of the user. */ + self?: string; + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + name?: string; + /** + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. + */ + key?: string; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ + emailAddress?: string; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ + displayName?: string; + /** Whether the user is active. */ + active?: boolean; + /** + * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as + * null. + */ + timeZone?: string; + /** + * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application + * user) or 'customer' (Jira Service Desk customer user) + */ + accountType?: string; +} diff --git a/src/version3/models/userDetails.ts b/src/version3/models/userDetails.ts deleted file mode 100644 index 6e698170e..000000000 --- a/src/version3/models/userDetails.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { AvatarUrls } from './avatarUrls.js'; - -/** - * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* - * - * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, - * `displayName` provides an indication and other parameters have default values or are blank (for example, email is - * blank). - * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted - * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. - * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have - * fallback values. - */ -export interface UserDetails { - /** The URL of the user. */ - self?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - name?: string; - /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. - */ - key?: string; - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ - emailAddress?: string; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active?: boolean; - /** - * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as - * null. - */ - timeZone?: string; - /** - * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application - * user) or 'customer' (Jira Service Desk customer user) - */ - accountType?: string; -} diff --git a/src/version3/models/userKey.ts b/src/version3/models/userKey.mts similarity index 100% rename from src/version3/models/userKey.ts rename to src/version3/models/userKey.mts diff --git a/src/version3/models/userList.mts b/src/version3/models/userList.mts new file mode 100644 index 000000000..43771e38b --- /dev/null +++ b/src/version3/models/userList.mts @@ -0,0 +1,18 @@ +import { User } from './user.mjs'; + +/** + * A paginated list of users sharing the filter. This includes users that are members of the groups or can browse the + * projects that the filter is shared with. + */ +export interface UserList { + /** The number of items on the page. */ + size?: number; + /** The list of items. */ + items?: User[]; + /** The maximum number of results that could be on the page. */ + 'max-results'?: number; + /** The index of the first item returned on the page. */ + 'start-index'?: number; + /** The index of the last item returned on the page. */ + 'end-index'?: number; +} diff --git a/src/version3/models/userList.ts b/src/version3/models/userList.ts deleted file mode 100644 index 6cc67d8c2..000000000 --- a/src/version3/models/userList.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { User } from './user.js'; - -/** - * A paginated list of users sharing the filter. This includes users that are members of the groups or can browse the - * projects that the filter is shared with. - */ -export interface UserList { - /** The number of items on the page. */ - size?: number; - /** The list of items. */ - items?: User[]; - /** The maximum number of results that could be on the page. */ - 'max-results'?: number; - /** The index of the first item returned on the page. */ - 'start-index'?: number; - /** The index of the last item returned on the page. */ - 'end-index'?: number; -} diff --git a/src/version3/models/userMigration.ts b/src/version3/models/userMigration.mts similarity index 100% rename from src/version3/models/userMigration.ts rename to src/version3/models/userMigration.mts diff --git a/src/version3/models/userPickerUser.ts b/src/version3/models/userPickerUser.mts similarity index 100% rename from src/version3/models/userPickerUser.ts rename to src/version3/models/userPickerUser.mts diff --git a/src/version3/models/version.mts b/src/version3/models/version.mts new file mode 100644 index 000000000..51a35835b --- /dev/null +++ b/src/version3/models/version.mts @@ -0,0 +1,70 @@ +import type { SimpleLink } from './simpleLink.mjs'; +import type { VersionIssuesStatus } from './versionIssuesStatus.mjs'; + +/** Details about a project version. */ +export interface Version { + /** + * Use [expand](em>#expansion) to include additional information about version in the response. This parameter accepts + * a comma-separated list. Expand options include: + * + * `operations` Returns the list of operations available for this version. `issuesstatus` Returns the count of issues + * in this version for each of the status categories _to do_, _in progress_, _done_, and _unmapped_. The _unmapped_ + * property contains a count of issues with a status other than _to do_, _in progress_, and _done_. + * + * Optional for create and update. + */ + expand?: string; + /** The URL of the version. */ + self?: string; + /** The ID of the version. */ + id?: string; + /** The description of the version. Optional when creating or updating a version. */ + description?: string; + /** + * The unique name of the version. Required when creating a version. Optional when updating a version. The maximum + * length is 255 characters. + */ + name?: string; + /** Indicates that the version is archived. Optional when creating or updating a version. */ + archived?: boolean; + /** + * Indicates that the version is released. If the version is released a request to release again is ignored. Not + * applicable when creating a version. Optional when updating a version. + */ + released?: boolean; + /** + * The start date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a + * version. + */ + startDate?: string; + /** + * The release date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a + * version. + */ + releaseDate?: string; + /** Indicates that the version is overdue. */ + overdue?: boolean; + /** + * The date on which work on this version is expected to start, expressed in the instance's _Day/Month/Year Format_ + * date format. + */ + userStartDate?: string; + /** + * The date on which work on this version is expected to finish, expressed in the instance's _Day/Month/Year Format_ + * date format. + */ + userReleaseDate?: string; + /** + * The ID of the project to which this version is attached. Required when creating a version. Not applicable when + * updating a version. + */ + projectId?: number; + /** + * The URL of the self link to the version to which all unfixed issues are moved when a version is released. Not + * applicable when creating a version. Optional when updating a version. + */ + moveUnfixedIssuesTo?: string; + /** If the expand option `operations` is used, returns the list of operations available for this version. */ + operations?: SimpleLink[]; + issuesStatusForFixVersion?: VersionIssuesStatus; +} diff --git a/src/version3/models/version.ts b/src/version3/models/version.ts deleted file mode 100644 index c803c8f38..000000000 --- a/src/version3/models/version.ts +++ /dev/null @@ -1,70 +0,0 @@ -import type { SimpleLink } from './simpleLink.js'; -import type { VersionIssuesStatus } from './versionIssuesStatus.js'; - -/** Details about a project version. */ -export interface Version { - /** - * Use [expand](em>#expansion) to include additional information about version in the response. This parameter accepts - * a comma-separated list. Expand options include: - * - * `operations` Returns the list of operations available for this version. `issuesstatus` Returns the count of issues - * in this version for each of the status categories _to do_, _in progress_, _done_, and _unmapped_. The _unmapped_ - * property contains a count of issues with a status other than _to do_, _in progress_, and _done_. - * - * Optional for create and update. - */ - expand?: string; - /** The URL of the version. */ - self?: string; - /** The ID of the version. */ - id?: string; - /** The description of the version. Optional when creating or updating a version. */ - description?: string; - /** - * The unique name of the version. Required when creating a version. Optional when updating a version. The maximum - * length is 255 characters. - */ - name?: string; - /** Indicates that the version is archived. Optional when creating or updating a version. */ - archived?: boolean; - /** - * Indicates that the version is released. If the version is released a request to release again is ignored. Not - * applicable when creating a version. Optional when updating a version. - */ - released?: boolean; - /** - * The start date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a - * version. - */ - startDate?: string; - /** - * The release date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a - * version. - */ - releaseDate?: string; - /** Indicates that the version is overdue. */ - overdue?: boolean; - /** - * The date on which work on this version is expected to start, expressed in the instance's _Day/Month/Year Format_ - * date format. - */ - userStartDate?: string; - /** - * The date on which work on this version is expected to finish, expressed in the instance's _Day/Month/Year Format_ - * date format. - */ - userReleaseDate?: string; - /** - * The ID of the project to which this version is attached. Required when creating a version. Not applicable when - * updating a version. - */ - projectId?: number; - /** - * The URL of the self link to the version to which all unfixed issues are moved when a version is released. Not - * applicable when creating a version. Optional when updating a version. - */ - moveUnfixedIssuesTo?: string; - /** If the expand option `operations` is used, returns the list of operations available for this version. */ - operations?: SimpleLink[]; - issuesStatusForFixVersion?: VersionIssuesStatus; -} diff --git a/src/version3/models/versionIssueCounts.mts b/src/version3/models/versionIssueCounts.mts new file mode 100644 index 000000000..1dfc89f95 --- /dev/null +++ b/src/version3/models/versionIssueCounts.mts @@ -0,0 +1,15 @@ +import { VersionUsageInCustomField } from './versionUsageInCustomField.mjs'; + +/** Various counts of issues within a version. */ +export interface VersionIssueCounts { + /** The URL of these count details. */ + self?: string; + /** Count of issues where the `fixVersion` is set to the version. */ + issuesFixedCount?: number; + /** Count of issues where the `affectedVersion` is set to the version. */ + issuesAffectedCount?: number; + /** Count of issues where a version custom field is set to the version. */ + issueCountWithCustomFieldsShowingVersion?: number; + /** List of custom fields using the version. */ + customFieldUsage?: VersionUsageInCustomField[]; +} diff --git a/src/version3/models/versionIssueCounts.ts b/src/version3/models/versionIssueCounts.ts deleted file mode 100644 index 56454aed6..000000000 --- a/src/version3/models/versionIssueCounts.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { VersionUsageInCustomField } from './versionUsageInCustomField.js'; - -/** Various counts of issues within a version. */ -export interface VersionIssueCounts { - /** The URL of these count details. */ - self?: string; - /** Count of issues where the `fixVersion` is set to the version. */ - issuesFixedCount?: number; - /** Count of issues where the `affectedVersion` is set to the version. */ - issuesAffectedCount?: number; - /** Count of issues where a version custom field is set to the version. */ - issueCountWithCustomFieldsShowingVersion?: number; - /** List of custom fields using the version. */ - customFieldUsage?: VersionUsageInCustomField[]; -} diff --git a/src/version3/models/versionIssuesStatus.ts b/src/version3/models/versionIssuesStatus.mts similarity index 100% rename from src/version3/models/versionIssuesStatus.ts rename to src/version3/models/versionIssuesStatus.mts diff --git a/src/version3/models/versionMove.ts b/src/version3/models/versionMove.mts similarity index 100% rename from src/version3/models/versionMove.ts rename to src/version3/models/versionMove.mts diff --git a/src/version3/models/versionUnresolvedIssuesCount.ts b/src/version3/models/versionUnresolvedIssuesCount.mts similarity index 100% rename from src/version3/models/versionUnresolvedIssuesCount.ts rename to src/version3/models/versionUnresolvedIssuesCount.mts diff --git a/src/version3/models/versionUsageInCustomField.ts b/src/version3/models/versionUsageInCustomField.mts similarity index 100% rename from src/version3/models/versionUsageInCustomField.ts rename to src/version3/models/versionUsageInCustomField.mts diff --git a/src/version3/models/visibility.ts b/src/version3/models/visibility.mts similarity index 100% rename from src/version3/models/visibility.ts rename to src/version3/models/visibility.mts diff --git a/src/version3/models/votes.mts b/src/version3/models/votes.mts new file mode 100644 index 000000000..f371f1135 --- /dev/null +++ b/src/version3/models/votes.mts @@ -0,0 +1,16 @@ +import { User } from './user.mjs'; + +/** The details of votes on an issue. */ +export interface Votes { + /** The URL of these issue vote details. */ + self: string; + /** The number of votes on the issue. */ + votes: number; + /** Whether the user making this request has voted on the issue. */ + hasVoted: boolean; + /** + * List of the users who have voted on this issue. An empty list is returned when the calling user doesn't have the + * _View voters and watchers_ project permission. + */ + voters: User[]; +} diff --git a/src/version3/models/votes.ts b/src/version3/models/votes.ts deleted file mode 100644 index 301e12ea3..000000000 --- a/src/version3/models/votes.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { User } from './user.js'; - -/** The details of votes on an issue. */ -export interface Votes { - /** The URL of these issue vote details. */ - self: string; - /** The number of votes on the issue. */ - votes: number; - /** Whether the user making this request has voted on the issue. */ - hasVoted: boolean; - /** - * List of the users who have voted on this issue. An empty list is returned when the calling user doesn't have the - * _View voters and watchers_ project permission. - */ - voters: User[]; -} diff --git a/src/version3/models/watchers.mts b/src/version3/models/watchers.mts new file mode 100644 index 000000000..7c6c137de --- /dev/null +++ b/src/version3/models/watchers.mts @@ -0,0 +1,13 @@ +import { UserDetails } from './userDetails.mjs'; + +/** The details of watchers on an issue. */ +export interface Watchers { + /** The URL of these issue watcher details. */ + self?: string; + /** Whether the calling user is watching this issue. */ + isWatching?: boolean; + /** The number of users watching this issue. */ + watchCount?: number; + /** Details of the users watching this issue. */ + watchers?: UserDetails[]; +} diff --git a/src/version3/models/watchers.ts b/src/version3/models/watchers.ts deleted file mode 100644 index 47f1c0992..000000000 --- a/src/version3/models/watchers.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { UserDetails } from './userDetails.js'; - -/** The details of watchers on an issue. */ -export interface Watchers { - /** The URL of these issue watcher details. */ - self?: string; - /** Whether the calling user is watching this issue. */ - isWatching?: boolean; - /** The number of users watching this issue. */ - watchCount?: number; - /** Details of the users watching this issue. */ - watchers?: UserDetails[]; -} diff --git a/src/version3/models/webhook.mts b/src/version3/models/webhook.mts new file mode 100644 index 000000000..1f4380f3d --- /dev/null +++ b/src/version3/models/webhook.mts @@ -0,0 +1,26 @@ +/** A webhook. */ +export interface Webhook { + /** The ID of the webhook. */ + id: number; + /** The Jql filter that specifies which issues the webhook is sent for. */ + jqlFilter: string; + /** + * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. + * If this parameter is not present, the app is notified about all field updates. + */ + fieldIdsFilter?: string[]; + /** + * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or + * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property + * updates. + */ + issuePropertyKeysFilter?: string[]; + /** The Jira events that trigger the webhook. */ + events: string[]; + /** + * The date after which the webhook is no longer sent. Use [Extend webhook + * life](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-webhooks/#api-rest-api-3-webhook-refresh-put) + * to extend the date. + */ + expirationDate?: number; +} diff --git a/src/version3/models/webhook.ts b/src/version3/models/webhook.ts deleted file mode 100644 index 68bcbcfd1..000000000 --- a/src/version3/models/webhook.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** A webhook. */ -export interface Webhook { - /** The ID of the webhook. */ - id: number; - /** The JQL filter that specifies which issues the webhook is sent for. */ - jqlFilter: string; - /** - * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. - * If this parameter is not present, the app is notified about all field updates. - */ - fieldIdsFilter?: string[]; - /** - * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or - * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property - * updates. - */ - issuePropertyKeysFilter?: string[]; - /** The Jira events that trigger the webhook. */ - events: string[]; - /** - * The date after which the webhook is no longer sent. Use [Extend webhook - * life](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-webhooks/#api-rest-api-3-webhook-refresh-put) - * to extend the date. - */ - expirationDate?: number; -} diff --git a/src/version3/models/webhookDetails.mts b/src/version3/models/webhookDetails.mts new file mode 100644 index 000000000..78ffca009 --- /dev/null +++ b/src/version3/models/webhookDetails.mts @@ -0,0 +1,25 @@ +/** A list of webhooks. */ +export interface WebhookDetails { + /** + * The Jql filter that specifies which issues the webhook is sent for. Only a subset of Jql can be used. The supported + * elements are: + * + * Fields: `issueKey`, `project`, `issuetype`, `status`, `assignee`, `reporter`, `issue.property`, and `cf[id]`. For + * custom fields (`cf[id]`), only the epic label custom field is supported.". Operators: `=`, `!=`, `IN`, and `NOT + * IN`. + */ + jqlFilter: string; + /** + * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. + * If this parameter is not present, the app is notified about all field updates. + */ + fieldIdsFilter?: string[]; + /** + * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or + * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property + * updates. + */ + issuePropertyKeysFilter?: string[]; + /** The Jira events that trigger the webhook. */ + events: string[]; +} diff --git a/src/version3/models/webhookDetails.ts b/src/version3/models/webhookDetails.ts deleted file mode 100644 index 651f7d4f2..000000000 --- a/src/version3/models/webhookDetails.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** A list of webhooks. */ -export interface WebhookDetails { - /** - * The JQL filter that specifies which issues the webhook is sent for. Only a subset of JQL can be used. The supported - * elements are: - * - * Fields: `issueKey`, `project`, `issuetype`, `status`, `assignee`, `reporter`, `issue.property`, and `cf[id]`. For - * custom fields (`cf[id]`), only the epic label custom field is supported.". Operators: `=`, `!=`, `IN`, and `NOT - * IN`. - */ - jqlFilter: string; - /** - * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. - * If this parameter is not present, the app is notified about all field updates. - */ - fieldIdsFilter?: string[]; - /** - * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or - * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property - * updates. - */ - issuePropertyKeysFilter?: string[]; - /** The Jira events that trigger the webhook. */ - events: string[]; -} diff --git a/src/version3/models/webhookRegistrationDetails.mts b/src/version3/models/webhookRegistrationDetails.mts new file mode 100644 index 000000000..a0f186fa6 --- /dev/null +++ b/src/version3/models/webhookRegistrationDetails.mts @@ -0,0 +1,12 @@ +import { WebhookDetails } from './webhookDetails.mjs'; + +/** Details of webhooks to register. */ +export interface WebhookRegistrationDetails { + /** A list of webhooks. */ + webhooks: WebhookDetails[]; + /** + * The URL that specifies where to send the webhooks. This URL must use the same base URL as the Connect app. Only a + * single URL per app is allowed to be registered. + */ + url: string; +} diff --git a/src/version3/models/webhookRegistrationDetails.ts b/src/version3/models/webhookRegistrationDetails.ts deleted file mode 100644 index 418da7ce0..000000000 --- a/src/version3/models/webhookRegistrationDetails.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { WebhookDetails } from './webhookDetails.js'; - -/** Details of webhooks to register. */ -export interface WebhookRegistrationDetails { - /** A list of webhooks. */ - webhooks: WebhookDetails[]; - /** - * The URL that specifies where to send the webhooks. This URL must use the same base URL as the Connect app. Only a - * single URL per app is allowed to be registered. - */ - url: string; -} diff --git a/src/version3/models/webhooksExpirationDate.ts b/src/version3/models/webhooksExpirationDate.mts similarity index 100% rename from src/version3/models/webhooksExpirationDate.ts rename to src/version3/models/webhooksExpirationDate.mts diff --git a/src/version3/models/workflow.mts b/src/version3/models/workflow.mts new file mode 100644 index 000000000..c1c331599 --- /dev/null +++ b/src/version3/models/workflow.mts @@ -0,0 +1,30 @@ +import type { ProjectDetails } from './projectDetails.mjs'; +import type { PublishedWorkflowId } from './publishedWorkflowId.mjs'; +import type { Transition } from './transition.mjs'; +import type { WorkflowOperations } from './workflowOperations.mjs'; +import type { WorkflowSchemeIdName } from './workflowSchemeIdName.mjs'; +import type { WorkflowStatus } from './workflowStatus.mjs'; + +/** Details about a workflow. */ +export interface Workflow { + id: PublishedWorkflowId; + /** The description of the workflow. */ + description: string; + /** The transitions of the workflow. */ + transitions?: Transition[]; + /** The statuses of the workflow. */ + statuses?: WorkflowStatus[]; + /** Whether this is the default workflow. */ + isDefault?: boolean; + /** The workflow schemes the workflow is assigned to. */ + schemes?: WorkflowSchemeIdName[]; + /** The projects the workflow is assigned to, through workflow schemes. */ + projects?: ProjectDetails[]; + /** Whether the workflow has a draft version. */ + hasDraftWorkflow?: boolean; + operations?: WorkflowOperations; + /** The creation date of the workflow. */ + created?: string; + /** The last edited date of the workflow. */ + updated?: string; +} diff --git a/src/version3/models/workflow.ts b/src/version3/models/workflow.ts deleted file mode 100644 index ebfacea9d..000000000 --- a/src/version3/models/workflow.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { ProjectDetails } from './projectDetails.js'; -import type { PublishedWorkflowId } from './publishedWorkflowId.js'; -import type { Transition } from './transition.js'; -import type { WorkflowOperations } from './workflowOperations.js'; -import type { WorkflowSchemeIdName } from './workflowSchemeIdName.js'; -import type { WorkflowStatus } from './workflowStatus.js'; - -/** Details about a workflow. */ -export interface Workflow { - id: PublishedWorkflowId; - /** The description of the workflow. */ - description: string; - /** The transitions of the workflow. */ - transitions?: Transition[]; - /** The statuses of the workflow. */ - statuses?: WorkflowStatus[]; - /** Whether this is the default workflow. */ - isDefault?: boolean; - /** The workflow schemes the workflow is assigned to. */ - schemes?: WorkflowSchemeIdName[]; - /** The projects the workflow is assigned to, through workflow schemes. */ - projects?: ProjectDetails[]; - /** Whether the workflow has a draft version. */ - hasDraftWorkflow?: boolean; - operations?: WorkflowOperations; - /** The creation date of the workflow. */ - created?: string; - /** The last edited date of the workflow. */ - updated?: string; -} diff --git a/src/version3/models/workflowCondition.ts b/src/version3/models/workflowCondition.mts similarity index 100% rename from src/version3/models/workflowCondition.ts rename to src/version3/models/workflowCondition.mts diff --git a/src/version3/models/workflowId.ts b/src/version3/models/workflowId.mts similarity index 100% rename from src/version3/models/workflowId.ts rename to src/version3/models/workflowId.mts diff --git a/src/version3/models/workflowOperations.ts b/src/version3/models/workflowOperations.mts similarity index 100% rename from src/version3/models/workflowOperations.ts rename to src/version3/models/workflowOperations.mts diff --git a/src/version3/models/workflowRules.mts b/src/version3/models/workflowRules.mts new file mode 100644 index 000000000..14e3c31ff --- /dev/null +++ b/src/version3/models/workflowRules.mts @@ -0,0 +1,11 @@ +import type { WorkflowCondition } from './workflowCondition.mjs'; +import type { WorkflowTransitionRule } from './workflowTransitionRule.mjs'; + +/** A collection of transition rules. */ +export interface WorkflowRules { + conditionsTree?: WorkflowCondition; + /** The workflow validators. */ + validators?: WorkflowTransitionRule[]; + /** The workflow post functions. */ + postFunctions?: WorkflowTransitionRule[]; +} diff --git a/src/version3/models/workflowRules.ts b/src/version3/models/workflowRules.ts deleted file mode 100644 index de7acb106..000000000 --- a/src/version3/models/workflowRules.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { WorkflowCondition } from './workflowCondition.js'; -import type { WorkflowTransitionRule } from './workflowTransitionRule.js'; - -/** A collection of transition rules. */ -export interface WorkflowRules { - conditionsTree?: WorkflowCondition; - /** The workflow validators. */ - validators?: WorkflowTransitionRule[]; - /** The workflow post functions. */ - postFunctions?: WorkflowTransitionRule[]; -} diff --git a/src/version3/models/workflowRulesSearch.ts b/src/version3/models/workflowRulesSearch.mts similarity index 100% rename from src/version3/models/workflowRulesSearch.ts rename to src/version3/models/workflowRulesSearch.mts diff --git a/src/version3/models/workflowRulesSearchDetails.mts b/src/version3/models/workflowRulesSearchDetails.mts new file mode 100644 index 000000000..9f7047a95 --- /dev/null +++ b/src/version3/models/workflowRulesSearchDetails.mts @@ -0,0 +1,11 @@ +import type { WorkflowTransitionRules } from './workflowTransitionRules.mjs'; + +/** Details of workflow transition rules. */ +export interface WorkflowRulesSearchDetails { + /** The workflow ID. */ + workflowEntityId?: string; + /** List of workflow rule IDs that do not belong to the workflow or can not be found. */ + invalidRules?: string[]; + /** List of valid workflow transition rules. */ + validRules?: WorkflowTransitionRules[]; +} diff --git a/src/version3/models/workflowRulesSearchDetails.ts b/src/version3/models/workflowRulesSearchDetails.ts deleted file mode 100644 index 5a474f3a9..000000000 --- a/src/version3/models/workflowRulesSearchDetails.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { WorkflowTransitionRules } from './workflowTransitionRules.js'; - -/** Details of workflow transition rules. */ -export interface WorkflowRulesSearchDetails { - /** The workflow ID. */ - workflowEntityId?: string; - /** List of workflow rule IDs that do not belong to the workflow or can not be found. */ - invalidRules?: string[]; - /** List of valid workflow transition rules. */ - validRules?: WorkflowTransitionRules[]; -} diff --git a/src/version3/models/workflowScheme.mts b/src/version3/models/workflowScheme.mts new file mode 100644 index 000000000..e85842d67 --- /dev/null +++ b/src/version3/models/workflowScheme.mts @@ -0,0 +1,61 @@ +import type { User } from './user.mjs'; + +/** Details about a workflow scheme. */ +export interface WorkflowScheme { + /** The ID of the workflow scheme. */ + id?: number; + /** + * The name of the workflow scheme. The name must be unique. The maximum length is 255 characters. Required when + * creating a workflow scheme. + */ + name?: string; + /** The description of the workflow scheme. */ + description?: string; + /** + * The name of the default workflow for the workflow scheme. The default workflow has _All Unassigned Issue Types_ + * assigned to it in Jira. If `defaultWorkflow` is not specified when creating a workflow scheme, it is set to _Jira + * Workflow (jira)_. + */ + defaultWorkflow?: string; + /** + * The issue type to workflow mappings, where each mapping is an issue type ID and workflow name pair. Note that an + * issue type can only be mapped to one workflow in a workflow scheme. + */ + issueTypeMappings?: {}; + /** + * For draft workflow schemes, this property is the name of the default workflow for the original workflow scheme. The + * default workflow has _All Unassigned Issue Types_ assigned to it in Jira. + */ + originalDefaultWorkflow?: string; + /** + * For draft workflow schemes, this property is the issue type to workflow mappings for the original workflow scheme, + * where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one + * workflow in a workflow scheme. + */ + originalIssueTypeMappings?: {}; + /** Whether the workflow scheme is a draft or not. */ + draft?: boolean; + lastModifiedUser?: User; + /** + * The date-time that the draft workflow scheme was last modified. A modification is a change to the issue + * type-project mappings only. This property does not apply to non-draft workflows. + */ + lastModified?: string; + self?: string; + /** + * Whether to create or update a draft workflow scheme when updating an active workflow scheme. An active workflow + * scheme is a workflow scheme that is used by at least one project. The following examples show how this property + * works: + * + * Update an active workflow scheme with `updateDraftIfNeeded` set to `true`: If a draft workflow scheme exists, it is + * updated. Otherwise, a draft workflow scheme is created. Update an active workflow scheme with `updateDraftIfNeeded` + * set to `false`: An error is returned, as active workflow schemes cannot be updated. Update an inactive workflow + * scheme with `updateDraftIfNeeded` set to `true`: The workflow scheme is updated, as inactive workflow schemes do + * not require drafts to update. + * + * Defaults to `false`. + */ + updateDraftIfNeeded?: boolean; + /** The issue types available in Jira. */ + issueTypes?: {}; +} diff --git a/src/version3/models/workflowScheme.ts b/src/version3/models/workflowScheme.ts deleted file mode 100644 index d0c12808d..000000000 --- a/src/version3/models/workflowScheme.ts +++ /dev/null @@ -1,61 +0,0 @@ -import type { User } from './user.js'; - -/** Details about a workflow scheme. */ -export interface WorkflowScheme { - /** The ID of the workflow scheme. */ - id?: number; - /** - * The name of the workflow scheme. The name must be unique. The maximum length is 255 characters. Required when - * creating a workflow scheme. - */ - name?: string; - /** The description of the workflow scheme. */ - description?: string; - /** - * The name of the default workflow for the workflow scheme. The default workflow has _All Unassigned Issue Types_ - * assigned to it in Jira. If `defaultWorkflow` is not specified when creating a workflow scheme, it is set to _Jira - * Workflow (jira)_. - */ - defaultWorkflow?: string; - /** - * The issue type to workflow mappings, where each mapping is an issue type ID and workflow name pair. Note that an - * issue type can only be mapped to one workflow in a workflow scheme. - */ - issueTypeMappings?: {}; - /** - * For draft workflow schemes, this property is the name of the default workflow for the original workflow scheme. The - * default workflow has _All Unassigned Issue Types_ assigned to it in Jira. - */ - originalDefaultWorkflow?: string; - /** - * For draft workflow schemes, this property is the issue type to workflow mappings for the original workflow scheme, - * where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one - * workflow in a workflow scheme. - */ - originalIssueTypeMappings?: {}; - /** Whether the workflow scheme is a draft or not. */ - draft?: boolean; - lastModifiedUser?: User; - /** - * The date-time that the draft workflow scheme was last modified. A modification is a change to the issue - * type-project mappings only. This property does not apply to non-draft workflows. - */ - lastModified?: string; - self?: string; - /** - * Whether to create or update a draft workflow scheme when updating an active workflow scheme. An active workflow - * scheme is a workflow scheme that is used by at least one project. The following examples show how this property - * works: - * - * Update an active workflow scheme with `updateDraftIfNeeded` set to `true`: If a draft workflow scheme exists, it is - * updated. Otherwise, a draft workflow scheme is created. Update an active workflow scheme with `updateDraftIfNeeded` - * set to `false`: An error is returned, as active workflow schemes cannot be updated. Update an inactive workflow - * scheme with `updateDraftIfNeeded` set to `true`: The workflow scheme is updated, as inactive workflow schemes do - * not require drafts to update. - * - * Defaults to `false`. - */ - updateDraftIfNeeded?: boolean; - /** The issue types available in Jira. */ - issueTypes?: {}; -} diff --git a/src/version3/models/workflowSchemeAssociations.mts b/src/version3/models/workflowSchemeAssociations.mts new file mode 100644 index 000000000..b14453a23 --- /dev/null +++ b/src/version3/models/workflowSchemeAssociations.mts @@ -0,0 +1,8 @@ +import type { WorkflowScheme } from './workflowScheme.mjs'; + +/** A workflow scheme along with a list of projects that use it. */ +export interface WorkflowSchemeAssociations { + /** The list of projects that use the workflow scheme. */ + projectIds: string[]; + workflowScheme?: WorkflowScheme; +} diff --git a/src/version3/models/workflowSchemeAssociations.ts b/src/version3/models/workflowSchemeAssociations.ts deleted file mode 100644 index ceef0974d..000000000 --- a/src/version3/models/workflowSchemeAssociations.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { WorkflowScheme } from './workflowScheme.js'; - -/** A workflow scheme along with a list of projects that use it. */ -export interface WorkflowSchemeAssociations { - /** The list of projects that use the workflow scheme. */ - projectIds: string[]; - workflowScheme?: WorkflowScheme; -} diff --git a/src/version3/models/workflowSchemeIdName.ts b/src/version3/models/workflowSchemeIdName.mts similarity index 100% rename from src/version3/models/workflowSchemeIdName.ts rename to src/version3/models/workflowSchemeIdName.mts diff --git a/src/version3/models/workflowSchemeProjectAssociation.ts b/src/version3/models/workflowSchemeProjectAssociation.mts similarity index 100% rename from src/version3/models/workflowSchemeProjectAssociation.ts rename to src/version3/models/workflowSchemeProjectAssociation.mts diff --git a/src/version3/models/workflowStatus.mts b/src/version3/models/workflowStatus.mts new file mode 100644 index 000000000..7fb2acdc1 --- /dev/null +++ b/src/version3/models/workflowStatus.mts @@ -0,0 +1,14 @@ +import type { WorkflowStatusProperties } from './workflowStatusProperties.mjs'; + +/** Details of a workflow status. */ +export interface WorkflowStatus { + /** The ID of the issue status. */ + id: string; + /** The name of the status in the workflow. */ + name: string; + /** + * Additional properties that modify the behavior of issues in this status. Supports the properties + * `jira.issue.editable` and `issueEditable` (deprecated) that indicate whether issues are editable. + */ + properties?: WorkflowStatusProperties; +} diff --git a/src/version3/models/workflowStatus.ts b/src/version3/models/workflowStatus.ts deleted file mode 100644 index 77019f86d..000000000 --- a/src/version3/models/workflowStatus.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { WorkflowStatusProperties } from './workflowStatusProperties.js'; - -/** Details of a workflow status. */ -export interface WorkflowStatus { - /** The ID of the issue status. */ - id: string; - /** The name of the status in the workflow. */ - name: string; - /** - * Additional properties that modify the behavior of issues in this status. Supports the properties - * `jira.issue.editable` and `issueEditable` (deprecated) that indicate whether issues are editable. - */ - properties?: WorkflowStatusProperties; -} diff --git a/src/version3/models/workflowStatusProperties.ts b/src/version3/models/workflowStatusProperties.mts similarity index 100% rename from src/version3/models/workflowStatusProperties.ts rename to src/version3/models/workflowStatusProperties.mts diff --git a/src/version3/models/workflowTransition.ts b/src/version3/models/workflowTransition.mts similarity index 100% rename from src/version3/models/workflowTransition.ts rename to src/version3/models/workflowTransition.mts diff --git a/src/version3/models/workflowTransitionProperty.ts b/src/version3/models/workflowTransitionProperty.mts similarity index 100% rename from src/version3/models/workflowTransitionProperty.ts rename to src/version3/models/workflowTransitionProperty.mts diff --git a/src/version3/models/workflowTransitionRule.ts b/src/version3/models/workflowTransitionRule.mts similarity index 100% rename from src/version3/models/workflowTransitionRule.ts rename to src/version3/models/workflowTransitionRule.mts diff --git a/src/version3/models/workflowTransitionRules.mts b/src/version3/models/workflowTransitionRules.mts new file mode 100644 index 000000000..c5b98f0ed --- /dev/null +++ b/src/version3/models/workflowTransitionRules.mts @@ -0,0 +1,13 @@ +import type { ConnectWorkflowTransitionRule } from './connectWorkflowTransitionRule.mjs'; +import type { WorkflowId } from './workflowId.mjs'; + +/** A workflow with transition rules. */ +export interface WorkflowTransitionRules { + workflowId: WorkflowId; + /** The list of post functions within the workflow. */ + postFunctions: ConnectWorkflowTransitionRule[]; + /** The list of conditions within the workflow. */ + conditions: ConnectWorkflowTransitionRule[]; + /** The list of validators within the workflow. */ + validators: ConnectWorkflowTransitionRule[]; +} diff --git a/src/version3/models/workflowTransitionRules.ts b/src/version3/models/workflowTransitionRules.ts deleted file mode 100644 index 0d52e688b..000000000 --- a/src/version3/models/workflowTransitionRules.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { ConnectWorkflowTransitionRule } from './connectWorkflowTransitionRule.js'; -import type { WorkflowId } from './workflowId.js'; - -/** A workflow with transition rules. */ -export interface WorkflowTransitionRules { - workflowId: WorkflowId; - /** The list of post functions within the workflow. */ - postFunctions: ConnectWorkflowTransitionRule[]; - /** The list of conditions within the workflow. */ - conditions: ConnectWorkflowTransitionRule[]; - /** The list of validators within the workflow. */ - validators: ConnectWorkflowTransitionRule[]; -} diff --git a/src/version3/models/workflowTransitionRulesDetails.mts b/src/version3/models/workflowTransitionRulesDetails.mts new file mode 100644 index 000000000..c92a7dc6b --- /dev/null +++ b/src/version3/models/workflowTransitionRulesDetails.mts @@ -0,0 +1,8 @@ +import type { WorkflowId } from './workflowId.mjs'; + +/** Details about a workflow configuration update request. */ +export interface WorkflowTransitionRulesDetails { + workflowId: WorkflowId; + /** The list of connect workflow rule IDs. */ + workflowRuleIds: string[]; +} diff --git a/src/version3/models/workflowTransitionRulesDetails.ts b/src/version3/models/workflowTransitionRulesDetails.ts deleted file mode 100644 index 0b4422004..000000000 --- a/src/version3/models/workflowTransitionRulesDetails.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { WorkflowId } from './workflowId.js'; - -/** Details about a workflow configuration update request. */ -export interface WorkflowTransitionRulesDetails { - workflowId: WorkflowId; - /** The list of connect workflow rule IDs. */ - workflowRuleIds: string[]; -} diff --git a/src/version3/models/workflowTransitionRulesUpdate.mts b/src/version3/models/workflowTransitionRulesUpdate.mts new file mode 100644 index 000000000..882da8d8a --- /dev/null +++ b/src/version3/models/workflowTransitionRulesUpdate.mts @@ -0,0 +1,7 @@ +import type { WorkflowTransitionRules } from './workflowTransitionRules.mjs'; + +/** Details about a workflow configuration update request. */ +export interface WorkflowTransitionRulesUpdate { + /** The list of workflows with transition rules to update. */ + workflows: WorkflowTransitionRules[]; +} diff --git a/src/version3/models/workflowTransitionRulesUpdate.ts b/src/version3/models/workflowTransitionRulesUpdate.ts deleted file mode 100644 index 2e35aef39..000000000 --- a/src/version3/models/workflowTransitionRulesUpdate.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { WorkflowTransitionRules } from './workflowTransitionRules.js'; - -/** Details about a workflow configuration update request. */ -export interface WorkflowTransitionRulesUpdate { - /** The list of workflows with transition rules to update. */ - workflows: WorkflowTransitionRules[]; -} diff --git a/src/version3/models/workflowTransitionRulesUpdateErrorDetails.mts b/src/version3/models/workflowTransitionRulesUpdateErrorDetails.mts new file mode 100644 index 000000000..c08db0576 --- /dev/null +++ b/src/version3/models/workflowTransitionRulesUpdateErrorDetails.mts @@ -0,0 +1,16 @@ +import type { WorkflowId } from './workflowId.mjs'; + +/** Details of any errors encountered while updating workflow transition rules for a workflow. */ +export interface WorkflowTransitionRulesUpdateErrorDetails { + workflowId: WorkflowId; + /** + * A list of transition rule update errors, indexed by the transition rule ID. Any transition rule that appears here + * wasn't updated. + */ + ruleUpdateErrors: {}; + /** + * The list of errors that specify why the workflow update failed. The workflow was not updated if the list contains + * any entries. + */ + updateErrors: string[]; +} diff --git a/src/version3/models/workflowTransitionRulesUpdateErrorDetails.ts b/src/version3/models/workflowTransitionRulesUpdateErrorDetails.ts deleted file mode 100644 index 707604138..000000000 --- a/src/version3/models/workflowTransitionRulesUpdateErrorDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { WorkflowId } from './workflowId.js'; - -/** Details of any errors encountered while updating workflow transition rules for a workflow. */ -export interface WorkflowTransitionRulesUpdateErrorDetails { - workflowId: WorkflowId; - /** - * A list of transition rule update errors, indexed by the transition rule ID. Any transition rule that appears here - * wasn't updated. - */ - ruleUpdateErrors: {}; - /** - * The list of errors that specify why the workflow update failed. The workflow was not updated if the list contains - * any entries. - */ - updateErrors: string[]; -} diff --git a/src/version3/models/workflowTransitionRulesUpdateErrors.mts b/src/version3/models/workflowTransitionRulesUpdateErrors.mts new file mode 100644 index 000000000..e4e188dcd --- /dev/null +++ b/src/version3/models/workflowTransitionRulesUpdateErrors.mts @@ -0,0 +1,7 @@ +import type { WorkflowTransitionRulesUpdateErrorDetails } from './workflowTransitionRulesUpdateErrorDetails.mjs'; + +/** Details of any errors encountered while updating workflow transition rules. */ +export interface WorkflowTransitionRulesUpdateErrors { + /** A list of workflows. */ + updateResults: WorkflowTransitionRulesUpdateErrorDetails[]; +} diff --git a/src/version3/models/workflowTransitionRulesUpdateErrors.ts b/src/version3/models/workflowTransitionRulesUpdateErrors.ts deleted file mode 100644 index 4409c9b7a..000000000 --- a/src/version3/models/workflowTransitionRulesUpdateErrors.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { WorkflowTransitionRulesUpdateErrorDetails } from './workflowTransitionRulesUpdateErrorDetails.js'; - -/** Details of any errors encountered while updating workflow transition rules. */ -export interface WorkflowTransitionRulesUpdateErrors { - /** A list of workflows. */ - updateResults: WorkflowTransitionRulesUpdateErrorDetails[]; -} diff --git a/src/version3/models/workflowsWithTransitionRulesDetails.mts b/src/version3/models/workflowsWithTransitionRulesDetails.mts new file mode 100644 index 000000000..2cded9b47 --- /dev/null +++ b/src/version3/models/workflowsWithTransitionRulesDetails.mts @@ -0,0 +1,7 @@ +import type { WorkflowTransitionRulesDetails } from './workflowTransitionRulesDetails.mjs'; + +/** Details of workflows and their transition rules to delete. */ +export interface WorkflowsWithTransitionRulesDetails { + /** The list of workflows with transition rules to delete. */ + workflows: WorkflowTransitionRulesDetails[]; +} diff --git a/src/version3/models/workflowsWithTransitionRulesDetails.ts b/src/version3/models/workflowsWithTransitionRulesDetails.ts deleted file mode 100644 index fb1b5197c..000000000 --- a/src/version3/models/workflowsWithTransitionRulesDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { WorkflowTransitionRulesDetails } from './workflowTransitionRulesDetails.js'; - -/** Details of workflows and their transition rules to delete. */ -export interface WorkflowsWithTransitionRulesDetails { - /** The list of workflows with transition rules to delete. */ - workflows: WorkflowTransitionRulesDetails[]; -} diff --git a/src/version3/models/worklog.mts b/src/version3/models/worklog.mts new file mode 100644 index 000000000..3a2eae681 --- /dev/null +++ b/src/version3/models/worklog.mts @@ -0,0 +1,45 @@ +import type { Document } from './document.mjs'; +import type { EntityProperty } from './entityProperty.mjs'; +import type { UserDetails } from './userDetails.mjs'; +import type { Visibility } from './visibility.mjs'; + +/** Details of a worklog. */ +export interface Worklog { + /** The URL of the worklog item. */ + self?: string; + author?: UserDetails; + updateAuthor?: UserDetails; + /** + * A comment about the worklog in [Atlassian Document + * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). Optional when creating or + * updating a worklog. + */ + comment?: Document; + /** The datetime on which the worklog was created. */ + created?: string; + /** The datetime on which the worklog was last updated. */ + updated?: string; + visibility?: Visibility; + /** + * The datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a + * worklog. + */ + started?: string; + /** + * The time spent working on the issue as days (#d), hours (#h), or minutes (#m or #). Required when creating a + * worklog if `timeSpentSeconds` isn't provided. Optional when updating a worklog. Cannot be provided if + * `timeSpentSecond` is provided. + */ + timeSpent?: string; + /** + * The time in seconds spent working on the issue. Required when creating a worklog if `timeSpent` isn't provided. + * Optional when updating a worklog. Cannot be provided if `timeSpent` is provided. + */ + timeSpentSeconds?: number; + /** The ID of the worklog record. */ + id?: string; + /** The ID of the issue this worklog is for. */ + issueId?: string; + /** Details of properties for the worklog. Optional when creating or updating a worklog. */ + properties?: EntityProperty[]; +} diff --git a/src/version3/models/worklog.ts b/src/version3/models/worklog.ts deleted file mode 100644 index 1ef55ee70..000000000 --- a/src/version3/models/worklog.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { Document } from './document.js'; -import type { EntityProperty } from './entityProperty.js'; -import type { UserDetails } from './userDetails.js'; -import type { Visibility } from './visibility.js'; - -/** Details of a worklog. */ -export interface Worklog { - /** The URL of the worklog item. */ - self?: string; - author?: UserDetails; - updateAuthor?: UserDetails; - /** - * A comment about the worklog in [Atlassian Document - * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). Optional when creating or - * updating a worklog. - */ - comment?: Document; - /** The datetime on which the worklog was created. */ - created?: string; - /** The datetime on which the worklog was last updated. */ - updated?: string; - visibility?: Visibility; - /** - * The datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a - * worklog. - */ - started?: string; - /** - * The time spent working on the issue as days (#d), hours (#h), or minutes (#m or #). Required when creating a - * worklog if `timeSpentSeconds` isn't provided. Optional when updating a worklog. Cannot be provided if - * `timeSpentSecond` is provided. - */ - timeSpent?: string; - /** - * The time in seconds spent working on the issue. Required when creating a worklog if `timeSpent` isn't provided. - * Optional when updating a worklog. Cannot be provided if `timeSpent` is provided. - */ - timeSpentSeconds?: number; - /** The ID of the worklog record. */ - id?: string; - /** The ID of the issue this worklog is for. */ - issueId?: string; - /** Details of properties for the worklog. Optional when creating or updating a worklog. */ - properties?: EntityProperty[]; -} diff --git a/src/version3/models/worklogIdsRequest.ts b/src/version3/models/worklogIdsRequest.mts similarity index 100% rename from src/version3/models/worklogIdsRequest.ts rename to src/version3/models/worklogIdsRequest.mts diff --git a/src/version3/myself.mts b/src/version3/myself.mts new file mode 100644 index 000000000..4f2d1412b --- /dev/null +++ b/src/version3/myself.mts @@ -0,0 +1,230 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Myself { + constructor(private client: Client) {} + + /** + * Returns the value of a preference of the current user. + * + * Note that these keys are deprecated: + * + * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the + * instance. + * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the + * instance. + * + * Use [ Update a user + * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) + * from the user management REST API to manage timezone and locale instead. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPreference(parameters: Parameters.GetPreference, callback: Callback): Promise; + /** + * Returns the value of a preference of the current user. + * + * Note that these keys are deprecated: + * + * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the + * instance. + * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the + * instance. + * + * Use [ Update a user + * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) + * from the user management REST API to manage timezone and locale instead. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPreference(parameters: Parameters.GetPreference, callback?: never): Promise; + async getPreference(parameters: Parameters.GetPreference, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/mypreferences', + method: 'GET', + params: { + key: parameters.key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, + * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the + * following keys define system preferences that can be set or created: + * + * - _user.notifications.mimetype_ The mime type used in notifications sent to the user. Defaults to `html`. + * - _user.notify.own.changes_ Whether the user gets notified of their own changes. Defaults to `false`. + * - _user.default.share.private_ Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. + * Defaults to `true`. + * - _user.keyboard.shortcuts.disabled_ Whether keyboard shortcuts are disabled. Defaults to `false`. + * - _user.autowatch.disabled_ Whether the user automatically watches issues they create or add a comment to. By + * default, not set: the user takes the instance autowatch setting. + * + * Note that these keys are deprecated: + * + * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. + * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. + * + * Use [ Update a user + * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) + * from the user management REST API to manage timezone and locale instead. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async setPreference(parameters: Parameters.SetPreference, callback: Callback): Promise; + /** + * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, + * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the + * following keys define system preferences that can be set or created: + * + * - _user.notifications.mimetype_ The mime type used in notifications sent to the user. Defaults to `html`. + * - _user.notify.own.changes_ Whether the user gets notified of their own changes. Defaults to `false`. + * - _user.default.share.private_ Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. + * Defaults to `true`. + * - _user.keyboard.shortcuts.disabled_ Whether keyboard shortcuts are disabled. Defaults to `false`. + * - _user.autowatch.disabled_ Whether the user automatically watches issues they create or add a comment to. By + * default, not set: the user takes the instance autowatch setting. + * + * Note that these keys are deprecated: + * + * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. + * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. + * + * Use [ Update a user + * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) + * from the user management REST API to manage timezone and locale instead. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async setPreference(parameters: Parameters.SetPreference, callback?: never): Promise; + async setPreference(parameters: Parameters.SetPreference, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/mypreferences', + method: 'PUT', + params: { + key: parameters.key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a preference of the user, which restores the default value of system defined settings. + * + * Note that these keys are deprecated: + * + * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. + * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. + * + * Use [ Update a user + * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) + * from the user management REST API to manage timezone and locale instead. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async removePreference(parameters: Parameters.RemovePreference, callback: Callback): Promise; + /** + * Deletes a preference of the user, which restores the default value of system defined settings. + * + * Note that these keys are deprecated: + * + * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. + * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. + * + * Use [ Update a user + * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) + * from the user management REST API to manage timezone and locale instead. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async removePreference(parameters: Parameters.RemovePreference, callback?: never): Promise; + async removePreference(parameters: Parameters.RemovePreference, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/mypreferences', + method: 'DELETE', + params: { + key: parameters.key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the locale for the user. + * + * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, + * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header + * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getLocale(callback: Callback): Promise; + /** + * Returns the locale for the user. + * + * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, + * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header + * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getLocale(callback?: never): Promise; + async getLocale(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/mypreferences/locale', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns details for the current user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getCurrentUser( + parameters: Parameters.GetCurrentUser | undefined, + callback: Callback, + ): Promise; + /** + * Returns details for the current user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getCurrentUser(parameters?: Parameters.GetCurrentUser, callback?: never): Promise; + async getCurrentUser( + parameters?: Parameters.GetCurrentUser, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/myself', + method: 'GET', + params: { + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/myself.ts b/src/version3/myself.ts deleted file mode 100644 index a21cb5b16..000000000 --- a/src/version3/myself.ts +++ /dev/null @@ -1,230 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Myself { - constructor(private client: Client) {} - - /** - * Returns the value of a preference of the current user. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the - * instance. - * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the - * instance. - * - * Use [ Update a user - * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) - * from the user management REST API to manage timezone and locale instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPreference(parameters: Parameters.GetPreference, callback: Callback): Promise; - /** - * Returns the value of a preference of the current user. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the - * instance. - * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the - * instance. - * - * Use [ Update a user - * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) - * from the user management REST API to manage timezone and locale instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPreference(parameters: Parameters.GetPreference, callback?: never): Promise; - async getPreference(parameters: Parameters.GetPreference, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/mypreferences', - method: 'GET', - params: { - key: parameters.key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, - * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the - * following keys define system preferences that can be set or created: - * - * - _user.notifications.mimetype_ The mime type used in notifications sent to the user. Defaults to `html`. - * - _user.notify.own.changes_ Whether the user gets notified of their own changes. Defaults to `false`. - * - _user.default.share.private_ Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. - * Defaults to `true`. - * - _user.keyboard.shortcuts.disabled_ Whether keyboard shortcuts are disabled. Defaults to `false`. - * - _user.autowatch.disabled_ Whether the user automatically watches issues they create or add a comment to. By - * default, not set: the user takes the instance autowatch setting. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. - * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. - * - * Use [ Update a user - * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) - * from the user management REST API to manage timezone and locale instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async setPreference(parameters: Parameters.SetPreference, callback: Callback): Promise; - /** - * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, - * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the - * following keys define system preferences that can be set or created: - * - * - _user.notifications.mimetype_ The mime type used in notifications sent to the user. Defaults to `html`. - * - _user.notify.own.changes_ Whether the user gets notified of their own changes. Defaults to `false`. - * - _user.default.share.private_ Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. - * Defaults to `true`. - * - _user.keyboard.shortcuts.disabled_ Whether keyboard shortcuts are disabled. Defaults to `false`. - * - _user.autowatch.disabled_ Whether the user automatically watches issues they create or add a comment to. By - * default, not set: the user takes the instance autowatch setting. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. - * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. - * - * Use [ Update a user - * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) - * from the user management REST API to manage timezone and locale instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async setPreference(parameters: Parameters.SetPreference, callback?: never): Promise; - async setPreference(parameters: Parameters.SetPreference, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/mypreferences', - method: 'PUT', - params: { - key: parameters.key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a preference of the user, which restores the default value of system defined settings. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. - * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. - * - * Use [ Update a user - * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) - * from the user management REST API to manage timezone and locale instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async removePreference(parameters: Parameters.RemovePreference, callback: Callback): Promise; - /** - * Deletes a preference of the user, which restores the default value of system defined settings. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. - * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. - * - * Use [ Update a user - * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) - * from the user management REST API to manage timezone and locale instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async removePreference(parameters: Parameters.RemovePreference, callback?: never): Promise; - async removePreference(parameters: Parameters.RemovePreference, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/mypreferences', - method: 'DELETE', - params: { - key: parameters.key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the locale for the user. - * - * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, - * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header - * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getLocale(callback: Callback): Promise; - /** - * Returns the locale for the user. - * - * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, - * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header - * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getLocale(callback?: never): Promise; - async getLocale(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/mypreferences/locale', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns details for the current user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getCurrentUser( - parameters: Parameters.GetCurrentUser | undefined, - callback: Callback, - ): Promise; - /** - * Returns details for the current user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getCurrentUser(parameters?: Parameters.GetCurrentUser, callback?: never): Promise; - async getCurrentUser( - parameters?: Parameters.GetCurrentUser, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/myself', - method: 'GET', - params: { - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/parameters/addActorUsers.mts b/src/version3/parameters/addActorUsers.mts new file mode 100644 index 000000000..7b8d3ff68 --- /dev/null +++ b/src/version3/parameters/addActorUsers.mts @@ -0,0 +1,11 @@ +import { ActorsMap } from '../models/index.mjs'; + +export interface AddActorUsers extends ActorsMap { + /** The project ID or project key (case sensitive). */ + projectIdOrKey: string; + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role + * IDs. + */ + id: number; +} diff --git a/src/version3/parameters/addActorUsers.ts b/src/version3/parameters/addActorUsers.ts deleted file mode 100644 index b54b50332..000000000 --- a/src/version3/parameters/addActorUsers.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ActorsMap } from '../models/index.js'; - -export interface AddActorUsers extends ActorsMap { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version3/parameters/addAttachment.ts b/src/version3/parameters/addAttachment.mts similarity index 100% rename from src/version3/parameters/addAttachment.ts rename to src/version3/parameters/addAttachment.mts diff --git a/src/version3/parameters/addComment.mts b/src/version3/parameters/addComment.mts new file mode 100644 index 000000000..7bda4f15d --- /dev/null +++ b/src/version3/parameters/addComment.mts @@ -0,0 +1,17 @@ +import { Comment, Document } from '../models/index.mjs'; + +export interface AddComment extends Omit { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body + * rendered in HTML. + */ + expand?: string; + /** + * The comment text in [Atlassian Document + * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). + */ + comment?: string | Document; +} diff --git a/src/version3/parameters/addComment.ts b/src/version3/parameters/addComment.ts deleted file mode 100644 index d780af3b9..000000000 --- a/src/version3/parameters/addComment.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { Comment, Document } from '../models/index.js'; - -export interface AddComment extends Omit { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body - * rendered in HTML. - */ - expand?: string; - /** - * The comment text in [Atlassian Document - * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). - */ - comment?: string | Document; -} diff --git a/src/version3/parameters/addFieldToDefaultScreen.ts b/src/version3/parameters/addFieldToDefaultScreen.mts similarity index 100% rename from src/version3/parameters/addFieldToDefaultScreen.ts rename to src/version3/parameters/addFieldToDefaultScreen.mts diff --git a/src/version3/parameters/addGadget.mts b/src/version3/parameters/addGadget.mts new file mode 100644 index 000000000..52cfa03f8 --- /dev/null +++ b/src/version3/parameters/addGadget.mts @@ -0,0 +1,6 @@ +import { DashboardGadgetSettings } from '../models/index.mjs'; + +export interface AddGadget extends DashboardGadgetSettings { + /** The ID of the dashboard. */ + dashboardId: number; +} diff --git a/src/version3/parameters/addGadget.ts b/src/version3/parameters/addGadget.ts deleted file mode 100644 index 4181f8fec..000000000 --- a/src/version3/parameters/addGadget.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DashboardGadgetSettings } from '../models/index.js'; - -export interface AddGadget extends DashboardGadgetSettings { - /** The ID of the dashboard. */ - dashboardId: number; -} diff --git a/src/version3/parameters/addIssueTypesToContext.mts b/src/version3/parameters/addIssueTypesToContext.mts new file mode 100644 index 000000000..973ad9e1b --- /dev/null +++ b/src/version3/parameters/addIssueTypesToContext.mts @@ -0,0 +1,8 @@ +import { IssueTypeIds } from '../models/index.mjs'; + +export interface AddIssueTypesToContext extends IssueTypeIds { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/addIssueTypesToContext.ts b/src/version3/parameters/addIssueTypesToContext.ts deleted file mode 100644 index cb71755b9..000000000 --- a/src/version3/parameters/addIssueTypesToContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypeIds } from '../models/index.js'; - -export interface AddIssueTypesToContext extends IssueTypeIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version3/parameters/addIssueTypesToIssueTypeScheme.mts b/src/version3/parameters/addIssueTypesToIssueTypeScheme.mts new file mode 100644 index 000000000..e8768623b --- /dev/null +++ b/src/version3/parameters/addIssueTypesToIssueTypeScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeIds } from '../models/index.mjs'; + +export interface AddIssueTypesToIssueTypeScheme extends IssueTypeIds { + /** The ID of the issue type scheme. */ + issueTypeSchemeId: number; +} diff --git a/src/version3/parameters/addIssueTypesToIssueTypeScheme.ts b/src/version3/parameters/addIssueTypesToIssueTypeScheme.ts deleted file mode 100644 index a64a18724..000000000 --- a/src/version3/parameters/addIssueTypesToIssueTypeScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeIds } from '../models/index.js'; - -export interface AddIssueTypesToIssueTypeScheme extends IssueTypeIds { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; -} diff --git a/src/version3/parameters/addProjectRoleActorsToRole.mts b/src/version3/parameters/addProjectRoleActorsToRole.mts new file mode 100644 index 000000000..81945100a --- /dev/null +++ b/src/version3/parameters/addProjectRoleActorsToRole.mts @@ -0,0 +1,9 @@ +import { ActorInput } from '../models/index.mjs'; + +export interface AddProjectRoleActorsToRole extends ActorInput { + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role + * IDs. + */ + id: number; +} diff --git a/src/version3/parameters/addProjectRoleActorsToRole.ts b/src/version3/parameters/addProjectRoleActorsToRole.ts deleted file mode 100644 index 7a4f7c95e..000000000 --- a/src/version3/parameters/addProjectRoleActorsToRole.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ActorInput } from '../models/index.js'; - -export interface AddProjectRoleActorsToRole extends ActorInput { - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version3/parameters/addScreenTab.mts b/src/version3/parameters/addScreenTab.mts new file mode 100644 index 000000000..3ce2f3a87 --- /dev/null +++ b/src/version3/parameters/addScreenTab.mts @@ -0,0 +1,6 @@ +import { ScreenableTab } from '../models/index.mjs'; + +export interface AddScreenTab extends ScreenableTab { + /** The ID of the screen. */ + screenId: number; +} diff --git a/src/version3/parameters/addScreenTab.ts b/src/version3/parameters/addScreenTab.ts deleted file mode 100644 index 4b6ceee0e..000000000 --- a/src/version3/parameters/addScreenTab.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ScreenableTab } from '../models/index.js'; - -export interface AddScreenTab extends ScreenableTab { - /** The ID of the screen. */ - screenId: number; -} diff --git a/src/version3/parameters/addScreenTabField.mts b/src/version3/parameters/addScreenTabField.mts new file mode 100644 index 000000000..5bff26210 --- /dev/null +++ b/src/version3/parameters/addScreenTabField.mts @@ -0,0 +1,8 @@ +import { AddField } from '../models/index.mjs'; + +export interface AddScreenTabField extends AddField { + /** The ID of the screen. */ + screenId: number; + /** The ID of the screen tab. */ + tabId: number; +} diff --git a/src/version3/parameters/addScreenTabField.ts b/src/version3/parameters/addScreenTabField.ts deleted file mode 100644 index ddbb186ec..000000000 --- a/src/version3/parameters/addScreenTabField.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { AddField } from '../models/index.js'; - -export interface AddScreenTabField extends AddField { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; -} diff --git a/src/version3/parameters/addSecurityLevel.mts b/src/version3/parameters/addSecurityLevel.mts new file mode 100644 index 000000000..689187427 --- /dev/null +++ b/src/version3/parameters/addSecurityLevel.mts @@ -0,0 +1,6 @@ +import { AddSecuritySchemeLevelsRequest } from '../models/index.mjs'; + +export interface AddSecurityLevel extends AddSecuritySchemeLevelsRequest { + /** The ID of the issue security scheme. */ + schemeId: string; +} diff --git a/src/version3/parameters/addSecurityLevel.ts b/src/version3/parameters/addSecurityLevel.ts deleted file mode 100644 index d44c0103b..000000000 --- a/src/version3/parameters/addSecurityLevel.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AddSecuritySchemeLevelsRequest } from '../models/index.js'; - -export interface AddSecurityLevel extends AddSecuritySchemeLevelsRequest { - /** The ID of the issue security scheme. */ - schemeId: string; -} diff --git a/src/version3/parameters/addSecurityLevelMembers.mts b/src/version3/parameters/addSecurityLevelMembers.mts new file mode 100644 index 000000000..3ed3b0a6f --- /dev/null +++ b/src/version3/parameters/addSecurityLevelMembers.mts @@ -0,0 +1,8 @@ +import { SecuritySchemeMembersRequest } from '../models/index.mjs'; + +export interface AddSecurityLevelMembers extends SecuritySchemeMembersRequest { + /** The ID of the issue security scheme. */ + schemeId: string; + /** The ID of the issue security level. */ + levelId: string; +} diff --git a/src/version3/parameters/addSecurityLevelMembers.ts b/src/version3/parameters/addSecurityLevelMembers.ts deleted file mode 100644 index 6e3bffed9..000000000 --- a/src/version3/parameters/addSecurityLevelMembers.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { SecuritySchemeMembersRequest } from '../models/index.js'; - -export interface AddSecurityLevelMembers extends SecuritySchemeMembersRequest { - /** The ID of the issue security scheme. */ - schemeId: string; - /** The ID of the issue security level. */ - levelId: string; -} diff --git a/src/version3/parameters/addSharePermission.mts b/src/version3/parameters/addSharePermission.mts new file mode 100644 index 000000000..a55798ad1 --- /dev/null +++ b/src/version3/parameters/addSharePermission.mts @@ -0,0 +1,6 @@ +import { SharePermissionInput } from '../models/index.mjs'; + +export interface AddSharePermission extends SharePermissionInput { + /** The ID of the filter. */ + id: number; +} diff --git a/src/version3/parameters/addSharePermission.ts b/src/version3/parameters/addSharePermission.ts deleted file mode 100644 index 22aeee6cc..000000000 --- a/src/version3/parameters/addSharePermission.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { SharePermissionInput } from '../models/index.js'; - -export interface AddSharePermission extends SharePermissionInput { - /** The ID of the filter. */ - id: number; -} diff --git a/src/version3/parameters/addUserToGroup.mts b/src/version3/parameters/addUserToGroup.mts new file mode 100644 index 000000000..0507e8af8 --- /dev/null +++ b/src/version3/parameters/addUserToGroup.mts @@ -0,0 +1,11 @@ +import { UpdateUserToGroup } from '../models/index.mjs'; + +export interface AddUserToGroup extends UpdateUserToGroup { + /** + * As a group's name can change, use of `groupId` is recommended to identify a group. The name of the group. This + * parameter cannot be used with the `groupId` parameter. + */ + groupname?: string; + /** The ID of the group. This parameter cannot be used with the `groupName` parameter. */ + groupId?: string; +} diff --git a/src/version3/parameters/addUserToGroup.ts b/src/version3/parameters/addUserToGroup.ts deleted file mode 100644 index fe57635ad..000000000 --- a/src/version3/parameters/addUserToGroup.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { UpdateUserToGroup } from '../models/index.js'; - -export interface AddUserToGroup extends UpdateUserToGroup { - /** - * As a group's name can change, use of `groupId` is recommended to identify a group. The name of the group. This - * parameter cannot be used with the `groupId` parameter. - */ - groupname?: string; - /** The ID of the group. This parameter cannot be used with the `groupName` parameter. */ - groupId?: string; -} diff --git a/src/version3/parameters/addVote.ts b/src/version3/parameters/addVote.mts similarity index 100% rename from src/version3/parameters/addVote.ts rename to src/version3/parameters/addVote.mts diff --git a/src/version3/parameters/addWatcher.ts b/src/version3/parameters/addWatcher.mts similarity index 100% rename from src/version3/parameters/addWatcher.ts rename to src/version3/parameters/addWatcher.mts diff --git a/src/version3/parameters/addWorklog.mts b/src/version3/parameters/addWorklog.mts new file mode 100644 index 000000000..85209f55c --- /dev/null +++ b/src/version3/parameters/addWorklog.mts @@ -0,0 +1,45 @@ +import { Document, Worklog } from '../models/index.mjs'; + +export interface AddWorklog extends Omit { + /** The ID or key the issue. */ + issueIdOrKey: string; + /** Whether users watching the issue are notified by email. */ + notifyUsers?: boolean; + /** + * Defines how to update the issue's time estimate, the options are: + * + * - `new` Sets the estimate to a specific value, defined in `newEstimate`. + * - `leave` Leaves the estimate unchanged. + * - `manual` Reduces the estimate by amount specified in `reduceBy`. + * - `auto` Reduces the estimate by the value of `timeSpent` in the worklog. + */ + adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; + /** + * A comment about the worklog in [Atlassian Document + * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). Optional when creating or + * updating a worklog. + */ + comment?: string | Document; + /** + * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For + * example, _2d_. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * The amount to reduce the issue's remaining estimate by, as days (#d), hours (#h), or minutes (#m). For example, + * _2d_. Required when `adjustEstimate` is `manual`. + */ + reduceBy?: string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about work logs in the response. This parameter accepts `properties`, which returns worklog + * properties. + */ + expand?: 'properties' | 'properties'[] | string | string[]; + /** + * Whether the worklog entry should be added to the issue even if the issue is not editable, because + * jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + */ + overrideEditableFlag?: boolean; +} diff --git a/src/version3/parameters/addWorklog.ts b/src/version3/parameters/addWorklog.ts deleted file mode 100644 index 6ac48e8ca..000000000 --- a/src/version3/parameters/addWorklog.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { Document, Worklog } from '../models/index.js'; - -export interface AddWorklog extends Omit { - /** The ID or key the issue. */ - issueIdOrKey: string; - /** Whether users watching the issue are notified by email. */ - notifyUsers?: boolean; - /** - * Defines how to update the issue's time estimate, the options are: - * - * - `new` Sets the estimate to a specific value, defined in `newEstimate`. - * - `leave` Leaves the estimate unchanged. - * - `manual` Reduces the estimate by amount specified in `reduceBy`. - * - `auto` Reduces the estimate by the value of `timeSpent` in the worklog. - */ - adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; - /** - * A comment about the worklog in [Atlassian Document - * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). Optional when creating or - * updating a worklog. - */ - comment?: string | Document; - /** - * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For - * example, _2d_. Required when `adjustEstimate` is `new`. - */ - newEstimate?: string; - /** - * The amount to reduce the issue's remaining estimate by, as days (#d), hours (#h), or minutes (#m). For example, - * _2d_. Required when `adjustEstimate` is `manual`. - */ - reduceBy?: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about work logs in the response. This parameter accepts `properties`, which returns worklog - * properties. - */ - expand?: 'properties' | 'properties'[] | string | string[]; - /** - * Whether the worklog entry should be added to the issue even if the issue is not editable, because - * jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. - */ - overrideEditableFlag?: boolean; -} diff --git a/src/version3/parameters/analyseExpression.mts b/src/version3/parameters/analyseExpression.mts new file mode 100644 index 000000000..8802ab65d --- /dev/null +++ b/src/version3/parameters/analyseExpression.mts @@ -0,0 +1,17 @@ +import { JiraExpressionForAnalysis } from '../models/index.mjs'; + +export interface AnalyseExpression extends JiraExpressionForAnalysis { + /** + * The check to perform: + * + * - `syntax` Each expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are + * validated. For example, the expression's length. + * - `type` EXPERIMENTAL. Each expression is type checked and the final type of the expression inferred. Any type errors + * that would result in the expression failure at runtime are reported. For example, accessing properties that don't + * exist or passing the wrong number of arguments to functions. Also performs the syntax check. + * - `complexity` EXPERIMENTAL. Determines the formulae for how many [expensive + * operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) each + * expression may execute. + */ + check?: 'syntax' | 'type' | 'complexity' | string; +} diff --git a/src/version3/parameters/analyseExpression.ts b/src/version3/parameters/analyseExpression.ts deleted file mode 100644 index 06f47b3c5..000000000 --- a/src/version3/parameters/analyseExpression.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { JiraExpressionForAnalysis } from '../models/index.js'; - -export interface AnalyseExpression extends JiraExpressionForAnalysis { - /** - * The check to perform: - * - * - `syntax` Each expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are - * validated. For example, the expression's length. - * - `type` EXPERIMENTAL. Each expression is type checked and the final type of the expression inferred. Any type errors - * that would result in the expression failure at runtime are reported. For example, accessing properties that don't - * exist or passing the wrong number of arguments to functions. Also performs the syntax check. - * - `complexity` EXPERIMENTAL. Determines the formulae for how many [expensive - * operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) each - * expression may execute. - */ - check?: 'syntax' | 'type' | 'complexity' | string; -} diff --git a/src/version3/parameters/appendMappingsForIssueTypeScreenScheme.mts b/src/version3/parameters/appendMappingsForIssueTypeScreenScheme.mts new file mode 100644 index 000000000..99bbd0dbc --- /dev/null +++ b/src/version3/parameters/appendMappingsForIssueTypeScreenScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeScreenSchemeMappingDetails } from '../models/index.mjs'; + +export interface AppendMappingsForIssueTypeScreenScheme extends IssueTypeScreenSchemeMappingDetails { + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: string; +} diff --git a/src/version3/parameters/appendMappingsForIssueTypeScreenScheme.ts b/src/version3/parameters/appendMappingsForIssueTypeScreenScheme.ts deleted file mode 100644 index ce746393e..000000000 --- a/src/version3/parameters/appendMappingsForIssueTypeScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeScreenSchemeMappingDetails } from '../models/index.js'; - -export interface AppendMappingsForIssueTypeScreenScheme extends IssueTypeScreenSchemeMappingDetails { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; -} diff --git a/src/version3/parameters/archiveIssues.mts b/src/version3/parameters/archiveIssues.mts new file mode 100644 index 000000000..79ec0f51a --- /dev/null +++ b/src/version3/parameters/archiveIssues.mts @@ -0,0 +1,3 @@ +import { IssueArchivalSyncRequest } from '../models/index.mjs'; + +export interface ArchiveIssues extends IssueArchivalSyncRequest {} diff --git a/src/version3/parameters/archiveIssues.ts b/src/version3/parameters/archiveIssues.ts deleted file mode 100644 index 529a7e492..000000000 --- a/src/version3/parameters/archiveIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueArchivalSyncRequest } from '../models/index.js'; - -export interface ArchiveIssues extends IssueArchivalSyncRequest {} diff --git a/src/version3/parameters/archiveIssuesAsync.mts b/src/version3/parameters/archiveIssuesAsync.mts new file mode 100644 index 000000000..7eede8817 --- /dev/null +++ b/src/version3/parameters/archiveIssuesAsync.mts @@ -0,0 +1,3 @@ +import { ArchiveIssueAsyncRequest } from '../models/index.mjs'; + +export interface ArchiveIssuesAsync extends ArchiveIssueAsyncRequest {} diff --git a/src/version3/parameters/archiveIssuesAsync.ts b/src/version3/parameters/archiveIssuesAsync.ts deleted file mode 100644 index e8d51846e..000000000 --- a/src/version3/parameters/archiveIssuesAsync.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ArchiveIssueAsyncRequest } from '../models/index.js'; - -export interface ArchiveIssuesAsync extends ArchiveIssueAsyncRequest {} diff --git a/src/version3/parameters/archiveProject.ts b/src/version3/parameters/archiveProject.mts similarity index 100% rename from src/version3/parameters/archiveProject.ts rename to src/version3/parameters/archiveProject.mts diff --git a/src/version3/parameters/assignFieldConfigurationSchemeToProject.mts b/src/version3/parameters/assignFieldConfigurationSchemeToProject.mts new file mode 100644 index 000000000..93d716314 --- /dev/null +++ b/src/version3/parameters/assignFieldConfigurationSchemeToProject.mts @@ -0,0 +1,3 @@ +import { FieldConfigurationSchemeProjectAssociation } from '../models/index.mjs'; + +export interface AssignFieldConfigurationSchemeToProject extends FieldConfigurationSchemeProjectAssociation {} diff --git a/src/version3/parameters/assignFieldConfigurationSchemeToProject.ts b/src/version3/parameters/assignFieldConfigurationSchemeToProject.ts deleted file mode 100644 index 104a2fcec..000000000 --- a/src/version3/parameters/assignFieldConfigurationSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FieldConfigurationSchemeProjectAssociation } from '../models/index.js'; - -export interface AssignFieldConfigurationSchemeToProject extends FieldConfigurationSchemeProjectAssociation {} diff --git a/src/version3/parameters/assignIssue.mts b/src/version3/parameters/assignIssue.mts new file mode 100644 index 000000000..dd52f8b27 --- /dev/null +++ b/src/version3/parameters/assignIssue.mts @@ -0,0 +1,15 @@ +import { User } from '../models/index.mjs'; + +export interface AssignIssue extends Omit { + /** The ID or key of the issue to be assigned. */ + issueIdOrKey: string; + + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. If passed `null` it will unassigned issue. + */ + accountId: string | null; + + /** Whether the user is active. */ + active?: boolean; +} diff --git a/src/version3/parameters/assignIssue.ts b/src/version3/parameters/assignIssue.ts deleted file mode 100644 index 03d836298..000000000 --- a/src/version3/parameters/assignIssue.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { User } from '../models/index.js'; - -export interface AssignIssue extends Omit { - /** The ID or key of the issue to be assigned. */ - issueIdOrKey: string; - - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. If passed `null` it will unassigned issue. - */ - accountId: string | null; - - /** Whether the user is active. */ - active?: boolean; -} diff --git a/src/version3/parameters/assignIssueTypeSchemeToProject.mts b/src/version3/parameters/assignIssueTypeSchemeToProject.mts new file mode 100644 index 000000000..2984b6cc1 --- /dev/null +++ b/src/version3/parameters/assignIssueTypeSchemeToProject.mts @@ -0,0 +1,3 @@ +import { IssueTypeSchemeProjectAssociation } from '../models/index.mjs'; + +export interface AssignIssueTypeSchemeToProject extends IssueTypeSchemeProjectAssociation {} diff --git a/src/version3/parameters/assignIssueTypeSchemeToProject.ts b/src/version3/parameters/assignIssueTypeSchemeToProject.ts deleted file mode 100644 index 5feb00474..000000000 --- a/src/version3/parameters/assignIssueTypeSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueTypeSchemeProjectAssociation } from '../models/index.js'; - -export interface AssignIssueTypeSchemeToProject extends IssueTypeSchemeProjectAssociation {} diff --git a/src/version3/parameters/assignIssueTypeScreenSchemeToProject.mts b/src/version3/parameters/assignIssueTypeScreenSchemeToProject.mts new file mode 100644 index 000000000..3a209ea08 --- /dev/null +++ b/src/version3/parameters/assignIssueTypeScreenSchemeToProject.mts @@ -0,0 +1,3 @@ +import { IssueTypeScreenSchemeProjectAssociation } from '../models/index.mjs'; + +export interface AssignIssueTypeScreenSchemeToProject extends IssueTypeScreenSchemeProjectAssociation {} diff --git a/src/version3/parameters/assignIssueTypeScreenSchemeToProject.ts b/src/version3/parameters/assignIssueTypeScreenSchemeToProject.ts deleted file mode 100644 index 4b73b93d7..000000000 --- a/src/version3/parameters/assignIssueTypeScreenSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueTypeScreenSchemeProjectAssociation } from '../models/index.js'; - -export interface AssignIssueTypeScreenSchemeToProject extends IssueTypeScreenSchemeProjectAssociation {} diff --git a/src/version3/parameters/assignPermissionScheme.mts b/src/version3/parameters/assignPermissionScheme.mts new file mode 100644 index 000000000..c75c78628 --- /dev/null +++ b/src/version3/parameters/assignPermissionScheme.mts @@ -0,0 +1,28 @@ +import { Id } from '../models/index.mjs'; + +export interface AssignPermissionScheme extends Id { + /** The project ID or project key (case sensitive). */ + projectKeyOrId: string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Note that permissions are included when + * you specify any value. Expand options include: + * + * - `all` Returns all expandable information. + * - `field` Returns information about the custom field granted the permission. + * - `group` Returns information about the group that is granted the permission. + * - `permissions` Returns all permission grants for each permission scheme. + * - `projectRole` Returns information about the project role granted the permission. + * - `user` Returns information about the user who is granted the permission. + */ + expand?: + | 'all' + | 'field' + | 'group' + | 'permissions' + | 'projectRole' + | 'user' + | ('all' | 'field' | 'group' | 'permissions' | 'projectRole' | 'user')[] + | string + | string[]; +} diff --git a/src/version3/parameters/assignPermissionScheme.ts b/src/version3/parameters/assignPermissionScheme.ts deleted file mode 100644 index afeadf502..000000000 --- a/src/version3/parameters/assignPermissionScheme.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { Id } from '../models/index.js'; - -export interface AssignPermissionScheme extends Id { - /** The project ID or project key (case sensitive). */ - projectKeyOrId: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Note that permissions are included when - * you specify any value. Expand options include: - * - * - `all` Returns all expandable information. - * - `field` Returns information about the custom field granted the permission. - * - `group` Returns information about the group that is granted the permission. - * - `permissions` Returns all permission grants for each permission scheme. - * - `projectRole` Returns information about the project role granted the permission. - * - `user` Returns information about the user who is granted the permission. - */ - expand?: - | 'all' - | 'field' - | 'group' - | 'permissions' - | 'projectRole' - | 'user' - | ('all' | 'field' | 'group' | 'permissions' | 'projectRole' | 'user')[] - | string - | string[]; -} diff --git a/src/version3/parameters/assignProjectsToCustomFieldContext.mts b/src/version3/parameters/assignProjectsToCustomFieldContext.mts new file mode 100644 index 000000000..d8b4b090a --- /dev/null +++ b/src/version3/parameters/assignProjectsToCustomFieldContext.mts @@ -0,0 +1,8 @@ +import { ProjectIds } from '../models/index.mjs'; + +export interface AssignProjectsToCustomFieldContext extends ProjectIds { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/assignProjectsToCustomFieldContext.ts b/src/version3/parameters/assignProjectsToCustomFieldContext.ts deleted file mode 100644 index b64937d11..000000000 --- a/src/version3/parameters/assignProjectsToCustomFieldContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectIds } from '../models/index.js'; - -export interface AssignProjectsToCustomFieldContext extends ProjectIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version3/parameters/assignSchemeToProject.mts b/src/version3/parameters/assignSchemeToProject.mts new file mode 100644 index 000000000..31f221013 --- /dev/null +++ b/src/version3/parameters/assignSchemeToProject.mts @@ -0,0 +1,3 @@ +import { WorkflowSchemeProjectAssociation } from '../models/index.mjs'; + +export interface AssignSchemeToProject extends WorkflowSchemeProjectAssociation {} diff --git a/src/version3/parameters/assignSchemeToProject.ts b/src/version3/parameters/assignSchemeToProject.ts deleted file mode 100644 index ce9bc2b4c..000000000 --- a/src/version3/parameters/assignSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WorkflowSchemeProjectAssociation } from '../models/index.js'; - -export interface AssignSchemeToProject extends WorkflowSchemeProjectAssociation {} diff --git a/src/version3/parameters/associateSchemesToProjects.mts b/src/version3/parameters/associateSchemesToProjects.mts new file mode 100644 index 000000000..14345db44 --- /dev/null +++ b/src/version3/parameters/associateSchemesToProjects.mts @@ -0,0 +1,11 @@ +import { OldToNewSecurityLevelMappings } from '../models/index.mjs'; + +/** Issue security scheme, project, and remapping details. */ +export interface AssociateSchemesToProjects { + /** The list of scheme levels which should be remapped to new levels of the issue security scheme. */ + oldToNewSecurityLevelMappings?: OldToNewSecurityLevelMappings[]; + /** The ID of the project. */ + projectId: string; + /** The ID of the issue security scheme. Providing null will clear the association with the issue security scheme. */ + schemeId: string; +} diff --git a/src/version3/parameters/associateSchemesToProjects.ts b/src/version3/parameters/associateSchemesToProjects.ts deleted file mode 100644 index a5a2a0622..000000000 --- a/src/version3/parameters/associateSchemesToProjects.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { OldToNewSecurityLevelMappings } from '../models/index.js'; - -/** Issue security scheme, project, and remapping details. */ -export interface AssociateSchemesToProjects { - /** The list of scheme levels which should be remapped to new levels of the issue security scheme. */ - oldToNewSecurityLevelMappings?: OldToNewSecurityLevelMappings[]; - /** The ID of the project. */ - projectId: string; - /** The ID of the issue security scheme. Providing null will clear the association with the issue security scheme. */ - schemeId: string; -} diff --git a/src/version3/parameters/bulkDeleteIssueProperty.mts b/src/version3/parameters/bulkDeleteIssueProperty.mts new file mode 100644 index 000000000..bfc78d867 --- /dev/null +++ b/src/version3/parameters/bulkDeleteIssueProperty.mts @@ -0,0 +1,6 @@ +import { IssueFilterForBulkPropertyDelete } from '../models/index.mjs'; + +export interface BulkDeleteIssueProperty extends IssueFilterForBulkPropertyDelete { + /** The key of the property. */ + propertyKey: string; +} diff --git a/src/version3/parameters/bulkDeleteIssueProperty.ts b/src/version3/parameters/bulkDeleteIssueProperty.ts deleted file mode 100644 index 7668bddf8..000000000 --- a/src/version3/parameters/bulkDeleteIssueProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueFilterForBulkPropertyDelete } from '../models/index.js'; - -export interface BulkDeleteIssueProperty extends IssueFilterForBulkPropertyDelete { - /** The key of the property. */ - propertyKey: string; -} diff --git a/src/version3/parameters/bulkEditDashboards.mts b/src/version3/parameters/bulkEditDashboards.mts new file mode 100644 index 000000000..086014cee --- /dev/null +++ b/src/version3/parameters/bulkEditDashboards.mts @@ -0,0 +1,13 @@ +import { BulkChangeOwnerDetails, PermissionDetails } from '../models/index.mjs'; + +/** Details of a request to bulk edit shareable entity. */ +export interface BulkEditDashboards { + /** Allowed action for bulk edit shareable entity */ + action: string; + changeOwnerDetails?: BulkChangeOwnerDetails; + /** The id list of shareable entities to be changed. */ + entityIds: number[]; + /** Whether the actions are executed by users with Administer Jira global permission. */ + extendAdminPermissions?: boolean; + permissionDetails?: PermissionDetails; +} diff --git a/src/version3/parameters/bulkEditDashboards.ts b/src/version3/parameters/bulkEditDashboards.ts deleted file mode 100644 index f9c7283e1..000000000 --- a/src/version3/parameters/bulkEditDashboards.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { BulkChangeOwnerDetails, PermissionDetails } from '../models/index.js'; - -/** Details of a request to bulk edit shareable entity. */ -export interface BulkEditDashboards { - /** Allowed action for bulk edit shareable entity */ - action: string; - changeOwnerDetails?: BulkChangeOwnerDetails; - /** The id list of shareable entities to be changed. */ - entityIds: number[]; - /** Whether the actions are executed by users with Administer Jira global permission. */ - extendAdminPermissions?: boolean; - permissionDetails?: PermissionDetails; -} diff --git a/src/version3/parameters/bulkGetGroups.ts b/src/version3/parameters/bulkGetGroups.mts similarity index 100% rename from src/version3/parameters/bulkGetGroups.ts rename to src/version3/parameters/bulkGetGroups.mts diff --git a/src/version3/parameters/bulkGetUsers.ts b/src/version3/parameters/bulkGetUsers.mts similarity index 100% rename from src/version3/parameters/bulkGetUsers.ts rename to src/version3/parameters/bulkGetUsers.mts diff --git a/src/version3/parameters/bulkGetUsersMigration.ts b/src/version3/parameters/bulkGetUsersMigration.mts similarity index 100% rename from src/version3/parameters/bulkGetUsersMigration.ts rename to src/version3/parameters/bulkGetUsersMigration.mts diff --git a/src/version3/parameters/bulkSetIssuePropertiesByIssue.mts b/src/version3/parameters/bulkSetIssuePropertiesByIssue.mts new file mode 100644 index 000000000..b96e5308d --- /dev/null +++ b/src/version3/parameters/bulkSetIssuePropertiesByIssue.mts @@ -0,0 +1,3 @@ +import { MultiIssueEntityProperties } from '../models/index.mjs'; + +export interface BulkSetIssuePropertiesByIssue extends MultiIssueEntityProperties {} diff --git a/src/version3/parameters/bulkSetIssuePropertiesByIssue.ts b/src/version3/parameters/bulkSetIssuePropertiesByIssue.ts deleted file mode 100644 index 38c08c7ba..000000000 --- a/src/version3/parameters/bulkSetIssuePropertiesByIssue.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { MultiIssueEntityProperties } from '../models/index.js'; - -export interface BulkSetIssuePropertiesByIssue extends MultiIssueEntityProperties {} diff --git a/src/version3/parameters/bulkSetIssueProperty.mts b/src/version3/parameters/bulkSetIssueProperty.mts new file mode 100644 index 000000000..457f8d21b --- /dev/null +++ b/src/version3/parameters/bulkSetIssueProperty.mts @@ -0,0 +1,6 @@ +import { BulkIssuePropertyUpdateRequest } from '../models/index.mjs'; + +export interface BulkSetIssueProperty extends BulkIssuePropertyUpdateRequest { + /** The key of the property. The maximum length is 255 characters. */ + propertyKey: string; +} diff --git a/src/version3/parameters/bulkSetIssueProperty.ts b/src/version3/parameters/bulkSetIssueProperty.ts deleted file mode 100644 index 199013c62..000000000 --- a/src/version3/parameters/bulkSetIssueProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { BulkIssuePropertyUpdateRequest } from '../models/index.js'; - -export interface BulkSetIssueProperty extends BulkIssuePropertyUpdateRequest { - /** The key of the property. The maximum length is 255 characters. */ - propertyKey: string; -} diff --git a/src/version3/parameters/bulkSetIssuesProperties.mts b/src/version3/parameters/bulkSetIssuesProperties.mts new file mode 100644 index 000000000..f6df48500 --- /dev/null +++ b/src/version3/parameters/bulkSetIssuesProperties.mts @@ -0,0 +1,3 @@ +import { IssueEntityProperties } from '../models/index.mjs'; + +export interface BulkSetIssuesProperties extends IssueEntityProperties {} diff --git a/src/version3/parameters/bulkSetIssuesProperties.ts b/src/version3/parameters/bulkSetIssuesProperties.ts deleted file mode 100644 index 66b8a3b9f..000000000 --- a/src/version3/parameters/bulkSetIssuesProperties.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueEntityProperties } from '../models/index.js'; - -export interface BulkSetIssuesProperties extends IssueEntityProperties {} diff --git a/src/version3/parameters/cancelTask.ts b/src/version3/parameters/cancelTask.mts similarity index 100% rename from src/version3/parameters/cancelTask.ts rename to src/version3/parameters/cancelTask.mts diff --git a/src/version3/parameters/changeFilterOwner.ts b/src/version3/parameters/changeFilterOwner.mts similarity index 100% rename from src/version3/parameters/changeFilterOwner.ts rename to src/version3/parameters/changeFilterOwner.mts diff --git a/src/version3/parameters/copyDashboard.mts b/src/version3/parameters/copyDashboard.mts new file mode 100644 index 000000000..823362922 --- /dev/null +++ b/src/version3/parameters/copyDashboard.mts @@ -0,0 +1,5 @@ +import { DashboardDetails } from '../models/index.mjs'; + +export interface CopyDashboard extends DashboardDetails { + id: string; +} diff --git a/src/version3/parameters/copyDashboard.ts b/src/version3/parameters/copyDashboard.ts deleted file mode 100644 index 42352f534..000000000 --- a/src/version3/parameters/copyDashboard.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { DashboardDetails } from '../models/index.js'; - -export interface CopyDashboard extends DashboardDetails { - id: string; -} diff --git a/src/version3/parameters/createComponent.mts b/src/version3/parameters/createComponent.mts new file mode 100644 index 000000000..82765b579 --- /dev/null +++ b/src/version3/parameters/createComponent.mts @@ -0,0 +1,3 @@ +import { ProjectComponent } from '../models/index.mjs'; + +export interface CreateComponent extends ProjectComponent {} diff --git a/src/version3/parameters/createComponent.ts b/src/version3/parameters/createComponent.ts deleted file mode 100644 index 38f3d035c..000000000 --- a/src/version3/parameters/createComponent.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ProjectComponent } from '../models/index.js'; - -export interface CreateComponent extends ProjectComponent {} diff --git a/src/version3/parameters/createCustomField.mts b/src/version3/parameters/createCustomField.mts new file mode 100644 index 000000000..409f21d32 --- /dev/null +++ b/src/version3/parameters/createCustomField.mts @@ -0,0 +1,3 @@ +import { CustomFieldDefinitionJson } from '../models/index.mjs'; + +export interface CreateCustomField extends CustomFieldDefinitionJson {} diff --git a/src/version3/parameters/createCustomField.ts b/src/version3/parameters/createCustomField.ts deleted file mode 100644 index 7d5ccdd84..000000000 --- a/src/version3/parameters/createCustomField.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CustomFieldDefinitionJson } from '../models/index.js'; - -export interface CreateCustomField extends CustomFieldDefinitionJson {} diff --git a/src/version3/parameters/createCustomFieldContext.ts b/src/version3/parameters/createCustomFieldContext.mts similarity index 100% rename from src/version3/parameters/createCustomFieldContext.ts rename to src/version3/parameters/createCustomFieldContext.mts diff --git a/src/version3/parameters/createCustomFieldOption.mts b/src/version3/parameters/createCustomFieldOption.mts new file mode 100644 index 000000000..67c684ab5 --- /dev/null +++ b/src/version3/parameters/createCustomFieldOption.mts @@ -0,0 +1,8 @@ +import { BulkCustomFieldOptionCreateRequest } from '../models/index.mjs'; + +export interface CreateCustomFieldOption extends BulkCustomFieldOptionCreateRequest { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/createCustomFieldOption.ts b/src/version3/parameters/createCustomFieldOption.ts deleted file mode 100644 index 523002b53..000000000 --- a/src/version3/parameters/createCustomFieldOption.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { BulkCustomFieldOptionCreateRequest } from '../models/index.js'; - -export interface CreateCustomFieldOption extends BulkCustomFieldOptionCreateRequest { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version3/parameters/createDashboard.mts b/src/version3/parameters/createDashboard.mts new file mode 100644 index 000000000..08358b794 --- /dev/null +++ b/src/version3/parameters/createDashboard.mts @@ -0,0 +1,6 @@ +import { DashboardDetails, SharePermission } from '../models/index.mjs'; + +export interface CreateDashboard extends Omit { + /** The edit permissions for the dashboard. */ + editPermissions?: SharePermission[]; +} diff --git a/src/version3/parameters/createDashboard.ts b/src/version3/parameters/createDashboard.ts deleted file mode 100644 index 440a75e89..000000000 --- a/src/version3/parameters/createDashboard.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DashboardDetails, SharePermission } from '../models/index.js'; - -export interface CreateDashboard extends Omit { - /** The edit permissions for the dashboard. */ - editPermissions?: SharePermission[]; -} diff --git a/src/version3/parameters/createFieldConfiguration.mts b/src/version3/parameters/createFieldConfiguration.mts new file mode 100644 index 000000000..fafce9fb0 --- /dev/null +++ b/src/version3/parameters/createFieldConfiguration.mts @@ -0,0 +1,3 @@ +import { FieldConfigurationDetails } from '../models/index.mjs'; + +export interface CreateFieldConfiguration extends FieldConfigurationDetails {} diff --git a/src/version3/parameters/createFieldConfiguration.ts b/src/version3/parameters/createFieldConfiguration.ts deleted file mode 100644 index a10298777..000000000 --- a/src/version3/parameters/createFieldConfiguration.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FieldConfigurationDetails } from '../models/index.js'; - -export interface CreateFieldConfiguration extends FieldConfigurationDetails {} diff --git a/src/version3/parameters/createFieldConfigurationScheme.mts b/src/version3/parameters/createFieldConfigurationScheme.mts new file mode 100644 index 000000000..9383fe66d --- /dev/null +++ b/src/version3/parameters/createFieldConfigurationScheme.mts @@ -0,0 +1,3 @@ +import { UpdateFieldConfigurationSchemeDetails } from '../models/index.mjs'; + +export interface CreateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails {} diff --git a/src/version3/parameters/createFieldConfigurationScheme.ts b/src/version3/parameters/createFieldConfigurationScheme.ts deleted file mode 100644 index 4aa9d0c83..000000000 --- a/src/version3/parameters/createFieldConfigurationScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { UpdateFieldConfigurationSchemeDetails } from '../models/index.js'; - -export interface CreateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails {} diff --git a/src/version3/parameters/createFilter.mts b/src/version3/parameters/createFilter.mts new file mode 100644 index 000000000..dd8e7dcd0 --- /dev/null +++ b/src/version3/parameters/createFilter.mts @@ -0,0 +1,23 @@ +import { Filter } from '../models/index.mjs'; + +export interface CreateFilter extends Filter { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that + * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it + * doesn't list any users. The list of users returned is limited to 1000, to access additional users append + * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use + * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't + * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of + * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to + * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be created. + * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; +} diff --git a/src/version3/parameters/createFilter.ts b/src/version3/parameters/createFilter.ts deleted file mode 100644 index d2e6bc0ef..000000000 --- a/src/version3/parameters/createFilter.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { Filter } from '../models/index.js'; - -export interface CreateFilter extends Filter { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that - * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it - * doesn't list any users. The list of users returned is limited to 1000, to access additional users append - * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use - * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't - * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of - * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to - * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. - */ - expand?: string; - /** - * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be created. - * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideSharePermissions?: boolean; -} diff --git a/src/version3/parameters/createGroup.mts b/src/version3/parameters/createGroup.mts new file mode 100644 index 000000000..fcd378a1b --- /dev/null +++ b/src/version3/parameters/createGroup.mts @@ -0,0 +1,5 @@ +import { AddGroup } from '../models/index.mjs'; + +export interface CreateGroup extends AddGroup { + [key: string]: any; +} diff --git a/src/version3/parameters/createGroup.ts b/src/version3/parameters/createGroup.ts deleted file mode 100644 index a927114f0..000000000 --- a/src/version3/parameters/createGroup.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AddGroup } from '../models/index.js'; - -export interface CreateGroup extends AddGroup { - [key: string]: any; -} diff --git a/src/version3/parameters/createIssue.mts b/src/version3/parameters/createIssue.mts new file mode 100644 index 000000000..d3ede65cb --- /dev/null +++ b/src/version3/parameters/createIssue.mts @@ -0,0 +1,64 @@ +import { + Document, IssueUpdateDetails, Project, TimeTrackingDetails, +} from '../models/index.mjs'; + +export interface CreateIssue extends Omit { + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown + * under **Projects** in Jira. When provided, the issue type and request type are added to the user's history for a + * project. These values are then used to provide defaults on the issue create screen. + */ + updateHistory?: boolean; + + /** + * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field + * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are + * required, use `update`. Fields included in here cannot be included in `update`. + */ + fields: { + [key: string]: any; + summary: string; + project: Partial; + issuetype: { + id?: string | number; + name?: string; + }; + parent?: { + [key: string]: any; + key?: string; + }; + components?: Array<{ + [key: string]: any; + id?: string | number; + }>; + description?: string | Document; + reporter?: { + [key: string]: any; + id?: string | number; + }; + fixVersions?: Array<{ + [key: string]: any; + id?: string | number; + }>; + priority?: { + [key: string]: any; + id?: string | number; + }; + labels?: string[]; + timetracking?: TimeTrackingDetails; + security?: { + [key: string]: any; + id?: string | number; + }; + environment?: any; + versions?: Array<{ + [key: string]: any; + id?: string | number; + }>; + duedate?: string; + assignee?: { + [key: string]: any; + id?: string | number; + }; + }; +} diff --git a/src/version3/parameters/createIssue.ts b/src/version3/parameters/createIssue.ts deleted file mode 100644 index c5f4252dd..000000000 --- a/src/version3/parameters/createIssue.ts +++ /dev/null @@ -1,64 +0,0 @@ -import type { - Document, IssueUpdateDetails, Project, TimeTrackingDetails, -} from '../models/index.js'; - -export interface CreateIssue extends Omit { - /** - * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown - * under **Projects** in Jira. When provided, the issue type and request type are added to the user's history for a - * project. These values are then used to provide defaults on the issue create screen. - */ - updateHistory?: boolean; - - /** - * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field - * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are - * required, use `update`. Fields included in here cannot be included in `update`. - */ - fields: { - [key: string]: any; - summary: string; - project: Partial; - issuetype: { - id?: string | number; - name?: string; - }; - parent?: { - [key: string]: any; - key?: string; - }; - components?: Array<{ - [key: string]: any; - id?: string | number; - }>; - description?: string | Document; - reporter?: { - [key: string]: any; - id?: string | number; - }; - fixVersions?: Array<{ - [key: string]: any; - id?: string | number; - }>; - priority?: { - [key: string]: any; - id?: string | number; - }; - labels?: string[]; - timetracking?: TimeTrackingDetails; - security?: { - [key: string]: any; - id?: string | number; - }; - environment?: any; - versions?: Array<{ - [key: string]: any; - id?: string | number; - }>; - duedate?: string; - assignee?: { - [key: string]: any; - id?: string | number; - }; - }; -} diff --git a/src/version3/parameters/createIssueFieldOption.mts b/src/version3/parameters/createIssueFieldOption.mts new file mode 100644 index 000000000..77e4cc00f --- /dev/null +++ b/src/version3/parameters/createIssueFieldOption.mts @@ -0,0 +1,14 @@ +import { IssueFieldOptionCreate } from '../models/index.mjs'; + +export interface CreateIssueFieldOption extends IssueFieldOptionCreate { + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For + * example, `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: string; +} diff --git a/src/version3/parameters/createIssueFieldOption.ts b/src/version3/parameters/createIssueFieldOption.ts deleted file mode 100644 index 5e0c27002..000000000 --- a/src/version3/parameters/createIssueFieldOption.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { IssueFieldOptionCreate } from '../models/index.js'; - -export interface CreateIssueFieldOption extends IssueFieldOptionCreate { - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; -} diff --git a/src/version3/parameters/createIssueLinkType.mts b/src/version3/parameters/createIssueLinkType.mts new file mode 100644 index 000000000..e51df2f5e --- /dev/null +++ b/src/version3/parameters/createIssueLinkType.mts @@ -0,0 +1,3 @@ +import { IssueLinkType } from '../models/index.mjs'; + +export interface CreateIssueLinkType extends IssueLinkType {} diff --git a/src/version3/parameters/createIssueLinkType.ts b/src/version3/parameters/createIssueLinkType.ts deleted file mode 100644 index 664b24d7d..000000000 --- a/src/version3/parameters/createIssueLinkType.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueLinkType } from '../models/index.js'; - -export interface CreateIssueLinkType extends IssueLinkType {} diff --git a/src/version3/parameters/createIssueSecurityScheme.mts b/src/version3/parameters/createIssueSecurityScheme.mts new file mode 100644 index 000000000..20cbb444a --- /dev/null +++ b/src/version3/parameters/createIssueSecurityScheme.mts @@ -0,0 +1,3 @@ +import { CreateIssueSecuritySchemeDetails } from '../models/index.mjs'; + +export interface CreateIssueSecurityScheme extends CreateIssueSecuritySchemeDetails {} diff --git a/src/version3/parameters/createIssueSecurityScheme.ts b/src/version3/parameters/createIssueSecurityScheme.ts deleted file mode 100644 index bd2355565..000000000 --- a/src/version3/parameters/createIssueSecurityScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateIssueSecuritySchemeDetails } from '../models/index.js'; - -export interface CreateIssueSecurityScheme extends CreateIssueSecuritySchemeDetails {} diff --git a/src/version3/parameters/createIssueType.mts b/src/version3/parameters/createIssueType.mts new file mode 100644 index 000000000..6181ab8fd --- /dev/null +++ b/src/version3/parameters/createIssueType.mts @@ -0,0 +1,3 @@ +import { IssueTypeCreate } from '../models/index.mjs'; + +export interface CreateIssueType extends IssueTypeCreate {} diff --git a/src/version3/parameters/createIssueType.ts b/src/version3/parameters/createIssueType.ts deleted file mode 100644 index d8eed240e..000000000 --- a/src/version3/parameters/createIssueType.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueTypeCreate } from '../models/index.js'; - -export interface CreateIssueType extends IssueTypeCreate {} diff --git a/src/version3/parameters/createIssueTypeAvatar.ts b/src/version3/parameters/createIssueTypeAvatar.mts similarity index 100% rename from src/version3/parameters/createIssueTypeAvatar.ts rename to src/version3/parameters/createIssueTypeAvatar.mts diff --git a/src/version3/parameters/createIssueTypeScheme.mts b/src/version3/parameters/createIssueTypeScheme.mts new file mode 100644 index 000000000..79cd33aab --- /dev/null +++ b/src/version3/parameters/createIssueTypeScheme.mts @@ -0,0 +1,3 @@ +import { IssueTypeSchemeDetails } from '../models/index.mjs'; + +export interface CreateIssueTypeScheme extends IssueTypeSchemeDetails {} diff --git a/src/version3/parameters/createIssueTypeScheme.ts b/src/version3/parameters/createIssueTypeScheme.ts deleted file mode 100644 index 643fdb4ad..000000000 --- a/src/version3/parameters/createIssueTypeScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueTypeSchemeDetails } from '../models/index.js'; - -export interface CreateIssueTypeScheme extends IssueTypeSchemeDetails {} diff --git a/src/version3/parameters/createIssueTypeScreenScheme.mts b/src/version3/parameters/createIssueTypeScreenScheme.mts new file mode 100644 index 000000000..65857ffb9 --- /dev/null +++ b/src/version3/parameters/createIssueTypeScreenScheme.mts @@ -0,0 +1,3 @@ +import { IssueTypeScreenSchemeDetails } from '../models/index.mjs'; + +export interface CreateIssueTypeScreenScheme extends IssueTypeScreenSchemeDetails {} diff --git a/src/version3/parameters/createIssueTypeScreenScheme.ts b/src/version3/parameters/createIssueTypeScreenScheme.ts deleted file mode 100644 index 776830e37..000000000 --- a/src/version3/parameters/createIssueTypeScreenScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueTypeScreenSchemeDetails } from '../models/index.js'; - -export interface CreateIssueTypeScreenScheme extends IssueTypeScreenSchemeDetails {} diff --git a/src/version3/parameters/createIssues.mts b/src/version3/parameters/createIssues.mts new file mode 100644 index 000000000..556e0719f --- /dev/null +++ b/src/version3/parameters/createIssues.mts @@ -0,0 +1,3 @@ +import { IssuesUpdate } from '../models/index.mjs'; + +export interface CreateIssues extends IssuesUpdate {} diff --git a/src/version3/parameters/createIssues.ts b/src/version3/parameters/createIssues.ts deleted file mode 100644 index f86696a2a..000000000 --- a/src/version3/parameters/createIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssuesUpdate } from '../models/index.js'; - -export interface CreateIssues extends IssuesUpdate {} diff --git a/src/version3/parameters/createNotificationScheme.mts b/src/version3/parameters/createNotificationScheme.mts new file mode 100644 index 000000000..adb278e8d --- /dev/null +++ b/src/version3/parameters/createNotificationScheme.mts @@ -0,0 +1,3 @@ +import { CreateNotificationSchemeDetails } from '../models/index.mjs'; + +export interface CreateNotificationScheme extends CreateNotificationSchemeDetails {} diff --git a/src/version3/parameters/createNotificationScheme.ts b/src/version3/parameters/createNotificationScheme.ts deleted file mode 100644 index c7b6be674..000000000 --- a/src/version3/parameters/createNotificationScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateNotificationSchemeDetails } from '../models/index.js'; - -export interface CreateNotificationScheme extends CreateNotificationSchemeDetails {} diff --git a/src/version3/parameters/createOrUpdateRemoteIssueLink.mts b/src/version3/parameters/createOrUpdateRemoteIssueLink.mts new file mode 100644 index 000000000..db8e7d203 --- /dev/null +++ b/src/version3/parameters/createOrUpdateRemoteIssueLink.mts @@ -0,0 +1,6 @@ +import { RemoteIssueLinkRequest } from '../models/index.mjs'; + +export interface CreateOrUpdateRemoteIssueLink extends RemoteIssueLinkRequest { + /** The ID or key of the issue. */ + issueIdOrKey: string; +} diff --git a/src/version3/parameters/createOrUpdateRemoteIssueLink.ts b/src/version3/parameters/createOrUpdateRemoteIssueLink.ts deleted file mode 100644 index 7a4e299c5..000000000 --- a/src/version3/parameters/createOrUpdateRemoteIssueLink.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { RemoteIssueLinkRequest } from '../models/index.js'; - -export interface CreateOrUpdateRemoteIssueLink extends RemoteIssueLinkRequest { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version3/parameters/createPermissionGrant.mts b/src/version3/parameters/createPermissionGrant.mts new file mode 100644 index 000000000..97c105cb6 --- /dev/null +++ b/src/version3/parameters/createPermissionGrant.mts @@ -0,0 +1,16 @@ +import { PermissionGrant } from '../models/index.mjs'; + +export interface CreatePermissionGrant extends PermissionGrant { + /** The ID of the permission scheme in which to create a new permission grant. */ + schemeId: number; + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * `permissions` Returns all permission grants for each permission scheme. `user` Returns information about the user + * who is granted the permission. `group` Returns information about the group that is granted the permission. + * `projectRole` Returns information about the project role granted the permission. `field` Returns information about + * the custom field granted the permission. `all` Returns all expandable information. + */ + expand?: string; +} diff --git a/src/version3/parameters/createPermissionGrant.ts b/src/version3/parameters/createPermissionGrant.ts deleted file mode 100644 index c9190819d..000000000 --- a/src/version3/parameters/createPermissionGrant.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { PermissionGrant } from '../models/index.js'; - -export interface CreatePermissionGrant extends PermissionGrant { - /** The ID of the permission scheme in which to create a new permission grant. */ - schemeId: number; - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * `permissions` Returns all permission grants for each permission scheme. `user` Returns information about the user - * who is granted the permission. `group` Returns information about the group that is granted the permission. - * `projectRole` Returns information about the project role granted the permission. `field` Returns information about - * the custom field granted the permission. `all` Returns all expandable information. - */ - expand?: string; -} diff --git a/src/version3/parameters/createPermissionScheme.mts b/src/version3/parameters/createPermissionScheme.mts new file mode 100644 index 000000000..493da6a32 --- /dev/null +++ b/src/version3/parameters/createPermissionScheme.mts @@ -0,0 +1,14 @@ +import { PermissionScheme } from '../models/index.mjs'; + +export interface CreatePermissionScheme extends PermissionScheme { + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * `all` Returns all expandable information. `field` Returns information about the custom field granted the + * permission. `group` Returns information about the group that is granted the permission. `permissions` Returns all + * permission grants for each permission scheme. `projectRole` Returns information about the project role granted the + * permission. `user` Returns information about the user who is granted the permission. + */ + expand?: string; +} diff --git a/src/version3/parameters/createPermissionScheme.ts b/src/version3/parameters/createPermissionScheme.ts deleted file mode 100644 index 4d0a67eeb..000000000 --- a/src/version3/parameters/createPermissionScheme.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { PermissionScheme } from '../models/index.js'; - -export interface CreatePermissionScheme extends PermissionScheme { - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * `all` Returns all expandable information. `field` Returns information about the custom field granted the - * permission. `group` Returns information about the group that is granted the permission. `permissions` Returns all - * permission grants for each permission scheme. `projectRole` Returns information about the project role granted the - * permission. `user` Returns information about the user who is granted the permission. - */ - expand?: string; -} diff --git a/src/version3/parameters/createPriority.mts b/src/version3/parameters/createPriority.mts new file mode 100644 index 000000000..118720599 --- /dev/null +++ b/src/version3/parameters/createPriority.mts @@ -0,0 +1,3 @@ +import { CreatePriorityDetails } from '../models/index.mjs'; + +export interface CreatePriority extends CreatePriorityDetails {} diff --git a/src/version3/parameters/createPriority.ts b/src/version3/parameters/createPriority.ts deleted file mode 100644 index d9df2d764..000000000 --- a/src/version3/parameters/createPriority.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreatePriorityDetails } from '../models/index.js'; - -export interface CreatePriority extends CreatePriorityDetails {} diff --git a/src/version3/parameters/createProject.mts b/src/version3/parameters/createProject.mts new file mode 100644 index 000000000..d9a484ab8 --- /dev/null +++ b/src/version3/parameters/createProject.mts @@ -0,0 +1,3 @@ +import { CreateProjectDetails } from '../models/index.mjs'; + +export interface CreateProject extends CreateProjectDetails {} diff --git a/src/version3/parameters/createProject.ts b/src/version3/parameters/createProject.ts deleted file mode 100644 index da72e8b06..000000000 --- a/src/version3/parameters/createProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateProjectDetails } from '../models/index.js'; - -export interface CreateProject extends CreateProjectDetails {} diff --git a/src/version3/parameters/createProjectAvatar.ts b/src/version3/parameters/createProjectAvatar.mts similarity index 100% rename from src/version3/parameters/createProjectAvatar.ts rename to src/version3/parameters/createProjectAvatar.mts diff --git a/src/version3/parameters/createProjectCategory.mts b/src/version3/parameters/createProjectCategory.mts new file mode 100644 index 000000000..4f9bf350f --- /dev/null +++ b/src/version3/parameters/createProjectCategory.mts @@ -0,0 +1,3 @@ +import { ProjectCategory } from '../models/index.mjs'; + +export interface CreateProjectCategory extends ProjectCategory {} diff --git a/src/version3/parameters/createProjectCategory.ts b/src/version3/parameters/createProjectCategory.ts deleted file mode 100644 index 5a4d73ce1..000000000 --- a/src/version3/parameters/createProjectCategory.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ProjectCategory } from '../models/index.js'; - -export interface CreateProjectCategory extends ProjectCategory {} diff --git a/src/version3/parameters/createProjectRole.mts b/src/version3/parameters/createProjectRole.mts new file mode 100644 index 000000000..96e800bad --- /dev/null +++ b/src/version3/parameters/createProjectRole.mts @@ -0,0 +1,3 @@ +import { CreateUpdateRoleRequest } from '../models/index.mjs'; + +export interface CreateProjectRole extends CreateUpdateRoleRequest {} diff --git a/src/version3/parameters/createProjectRole.ts b/src/version3/parameters/createProjectRole.ts deleted file mode 100644 index bc1129ad2..000000000 --- a/src/version3/parameters/createProjectRole.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateUpdateRoleRequest } from '../models/index.js'; - -export interface CreateProjectRole extends CreateUpdateRoleRequest {} diff --git a/src/version3/parameters/createResolution.mts b/src/version3/parameters/createResolution.mts new file mode 100644 index 000000000..5027d7a38 --- /dev/null +++ b/src/version3/parameters/createResolution.mts @@ -0,0 +1,5 @@ +import { CreateResolutionDetails } from '../models/index.mjs'; + +export interface CreateResolution extends CreateResolutionDetails { + [key: string]: any; +} diff --git a/src/version3/parameters/createResolution.ts b/src/version3/parameters/createResolution.ts deleted file mode 100644 index 409a33510..000000000 --- a/src/version3/parameters/createResolution.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CreateResolutionDetails } from '../models/index.js'; - -export interface CreateResolution extends CreateResolutionDetails { - [key: string]: any; -} diff --git a/src/version3/parameters/createScreen.mts b/src/version3/parameters/createScreen.mts new file mode 100644 index 000000000..eb6da4bf2 --- /dev/null +++ b/src/version3/parameters/createScreen.mts @@ -0,0 +1,3 @@ +import { ScreenDetails } from '../models/index.mjs'; + +export interface CreateScreen extends ScreenDetails {} diff --git a/src/version3/parameters/createScreen.ts b/src/version3/parameters/createScreen.ts deleted file mode 100644 index 8c8a16a98..000000000 --- a/src/version3/parameters/createScreen.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ScreenDetails } from '../models/index.js'; - -export interface CreateScreen extends ScreenDetails {} diff --git a/src/version3/parameters/createScreenScheme.mts b/src/version3/parameters/createScreenScheme.mts new file mode 100644 index 000000000..8bf3d2df0 --- /dev/null +++ b/src/version3/parameters/createScreenScheme.mts @@ -0,0 +1,3 @@ +import { ScreenSchemeDetails } from '../models/index.mjs'; + +export interface CreateScreenScheme extends ScreenSchemeDetails {} diff --git a/src/version3/parameters/createScreenScheme.ts b/src/version3/parameters/createScreenScheme.ts deleted file mode 100644 index dcca7d96b..000000000 --- a/src/version3/parameters/createScreenScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ScreenSchemeDetails } from '../models/index.js'; - -export interface CreateScreenScheme extends ScreenSchemeDetails {} diff --git a/src/version3/parameters/createStatuses.mts b/src/version3/parameters/createStatuses.mts new file mode 100644 index 000000000..062949a39 --- /dev/null +++ b/src/version3/parameters/createStatuses.mts @@ -0,0 +1,3 @@ +import { StatusCreateRequest } from '../models/index.mjs'; + +export interface CreateStatuses extends StatusCreateRequest {} diff --git a/src/version3/parameters/createStatuses.ts b/src/version3/parameters/createStatuses.ts deleted file mode 100644 index 0eb765f17..000000000 --- a/src/version3/parameters/createStatuses.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { StatusCreateRequest } from '../models/index.js'; - -export interface CreateStatuses extends StatusCreateRequest {} diff --git a/src/version3/parameters/createUiModification.mts b/src/version3/parameters/createUiModification.mts new file mode 100644 index 000000000..410d9e327 --- /dev/null +++ b/src/version3/parameters/createUiModification.mts @@ -0,0 +1,3 @@ +import { CreateUiModificationDetails } from '../models/index.mjs'; + +export interface CreateUiModification extends CreateUiModificationDetails {} diff --git a/src/version3/parameters/createUiModification.ts b/src/version3/parameters/createUiModification.ts deleted file mode 100644 index b6efaba78..000000000 --- a/src/version3/parameters/createUiModification.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateUiModificationDetails } from '../models/index.js'; - -export interface CreateUiModification extends CreateUiModificationDetails {} diff --git a/src/version3/parameters/createUser.mts b/src/version3/parameters/createUser.mts new file mode 100644 index 000000000..f76f95c89 --- /dev/null +++ b/src/version3/parameters/createUser.mts @@ -0,0 +1,3 @@ +import { NewUserDetails } from '../models/index.mjs'; + +export interface CreateUser extends NewUserDetails {} diff --git a/src/version3/parameters/createUser.ts b/src/version3/parameters/createUser.ts deleted file mode 100644 index 34e04a5a7..000000000 --- a/src/version3/parameters/createUser.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { NewUserDetails } from '../models/index.js'; - -export interface CreateUser extends NewUserDetails {} diff --git a/src/version3/parameters/createVersion.mts b/src/version3/parameters/createVersion.mts new file mode 100644 index 000000000..44e2c9cbb --- /dev/null +++ b/src/version3/parameters/createVersion.mts @@ -0,0 +1,3 @@ +import { Version } from '../models/index.mjs'; + +export interface CreateVersion extends Version {} diff --git a/src/version3/parameters/createVersion.ts b/src/version3/parameters/createVersion.ts deleted file mode 100644 index f95e77627..000000000 --- a/src/version3/parameters/createVersion.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Version } from '../models/index.js'; - -export interface CreateVersion extends Version {} diff --git a/src/version3/parameters/createWorkflow.mts b/src/version3/parameters/createWorkflow.mts new file mode 100644 index 000000000..e1be64396 --- /dev/null +++ b/src/version3/parameters/createWorkflow.mts @@ -0,0 +1,3 @@ +import { CreateWorkflowDetails } from '../models/index.mjs'; + +export interface CreateWorkflow extends CreateWorkflowDetails {} diff --git a/src/version3/parameters/createWorkflow.ts b/src/version3/parameters/createWorkflow.ts deleted file mode 100644 index 957d08df8..000000000 --- a/src/version3/parameters/createWorkflow.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CreateWorkflowDetails } from '../models/index.js'; - -export interface CreateWorkflow extends CreateWorkflowDetails {} diff --git a/src/version3/parameters/createWorkflowScheme.mts b/src/version3/parameters/createWorkflowScheme.mts new file mode 100644 index 000000000..432890465 --- /dev/null +++ b/src/version3/parameters/createWorkflowScheme.mts @@ -0,0 +1,3 @@ +import { WorkflowScheme } from '../models/index.mjs'; + +export interface CreateWorkflowScheme extends WorkflowScheme {} diff --git a/src/version3/parameters/createWorkflowScheme.ts b/src/version3/parameters/createWorkflowScheme.ts deleted file mode 100644 index 4a147a312..000000000 --- a/src/version3/parameters/createWorkflowScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WorkflowScheme } from '../models/index.js'; - -export interface CreateWorkflowScheme extends WorkflowScheme {} diff --git a/src/version3/parameters/createWorkflowSchemeDraftFromParent.ts b/src/version3/parameters/createWorkflowSchemeDraftFromParent.mts similarity index 100% rename from src/version3/parameters/createWorkflowSchemeDraftFromParent.ts rename to src/version3/parameters/createWorkflowSchemeDraftFromParent.mts diff --git a/src/version3/parameters/createWorkflowTransitionProperty.mts b/src/version3/parameters/createWorkflowTransitionProperty.mts new file mode 100644 index 000000000..3c700f25f --- /dev/null +++ b/src/version3/parameters/createWorkflowTransitionProperty.mts @@ -0,0 +1,21 @@ +import { WorkflowTransitionProperty } from '../models/index.mjs'; + +export interface CreateWorkflowTransitionProperty extends WorkflowTransitionProperty { + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown + * next to the transition. + */ + transitionId: number; + /** + * The key of the property being added, also known as the name of the property. Set this to the same value as the + * `key` defined in the request body. + */ + key: string; + /** The name of the workflow that the transition belongs to. */ + workflowName: string; + /** + * The workflow status. Set to _live_ for inactive workflows or _draft_ for draft workflows. Active workflows cannot + * be edited. + */ + workflowMode?: 'live' | 'draft' | string; +} diff --git a/src/version3/parameters/createWorkflowTransitionProperty.ts b/src/version3/parameters/createWorkflowTransitionProperty.ts deleted file mode 100644 index ea92fa565..000000000 --- a/src/version3/parameters/createWorkflowTransitionProperty.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { WorkflowTransitionProperty } from '../models/index.js'; - -export interface CreateWorkflowTransitionProperty extends WorkflowTransitionProperty { - /** - * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown - * next to the transition. - */ - transitionId: number; - /** - * The key of the property being added, also known as the name of the property. Set this to the same value as the - * `key` defined in the request body. - */ - key: string; - /** The name of the workflow that the transition belongs to. */ - workflowName: string; - /** - * The workflow status. Set to _live_ for inactive workflows or _draft_ for draft workflows. Active workflows cannot - * be edited. - */ - workflowMode?: 'live' | 'draft' | string; -} diff --git a/src/version3/parameters/deleteActor.ts b/src/version3/parameters/deleteActor.mts similarity index 100% rename from src/version3/parameters/deleteActor.ts rename to src/version3/parameters/deleteActor.mts diff --git a/src/version3/parameters/deleteAddonProperty.ts b/src/version3/parameters/deleteAddonProperty.mts similarity index 100% rename from src/version3/parameters/deleteAddonProperty.ts rename to src/version3/parameters/deleteAddonProperty.mts diff --git a/src/version3/parameters/deleteAndReplaceVersion.mts b/src/version3/parameters/deleteAndReplaceVersion.mts new file mode 100644 index 000000000..f935515ba --- /dev/null +++ b/src/version3/parameters/deleteAndReplaceVersion.mts @@ -0,0 +1,6 @@ +import { DeleteAndReplaceVersion as DeleteAndReplaceVersionModel } from '../models/index.mjs'; + +export interface DeleteAndReplaceVersion extends DeleteAndReplaceVersionModel { + /** The ID of the version. */ + id: string; +} diff --git a/src/version3/parameters/deleteAndReplaceVersion.ts b/src/version3/parameters/deleteAndReplaceVersion.ts deleted file mode 100644 index 72f0cf1bb..000000000 --- a/src/version3/parameters/deleteAndReplaceVersion.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DeleteAndReplaceVersion as DeleteAndReplaceVersionModel } from '../models/index.js'; - -export interface DeleteAndReplaceVersion extends DeleteAndReplaceVersionModel { - /** The ID of the version. */ - id: string; -} diff --git a/src/version3/parameters/deleteAppProperty.ts b/src/version3/parameters/deleteAppProperty.mts similarity index 100% rename from src/version3/parameters/deleteAppProperty.ts rename to src/version3/parameters/deleteAppProperty.mts diff --git a/src/version3/parameters/deleteAvatar.ts b/src/version3/parameters/deleteAvatar.mts similarity index 100% rename from src/version3/parameters/deleteAvatar.ts rename to src/version3/parameters/deleteAvatar.mts diff --git a/src/version3/parameters/deleteComment.ts b/src/version3/parameters/deleteComment.mts similarity index 100% rename from src/version3/parameters/deleteComment.ts rename to src/version3/parameters/deleteComment.mts diff --git a/src/version3/parameters/deleteCommentProperty.ts b/src/version3/parameters/deleteCommentProperty.mts similarity index 100% rename from src/version3/parameters/deleteCommentProperty.ts rename to src/version3/parameters/deleteCommentProperty.mts diff --git a/src/version3/parameters/deleteComponent.ts b/src/version3/parameters/deleteComponent.mts similarity index 100% rename from src/version3/parameters/deleteComponent.ts rename to src/version3/parameters/deleteComponent.mts diff --git a/src/version3/parameters/deleteCustomField.ts b/src/version3/parameters/deleteCustomField.mts similarity index 100% rename from src/version3/parameters/deleteCustomField.ts rename to src/version3/parameters/deleteCustomField.mts diff --git a/src/version3/parameters/deleteCustomFieldContext.ts b/src/version3/parameters/deleteCustomFieldContext.mts similarity index 100% rename from src/version3/parameters/deleteCustomFieldContext.ts rename to src/version3/parameters/deleteCustomFieldContext.mts diff --git a/src/version3/parameters/deleteCustomFieldOption.ts b/src/version3/parameters/deleteCustomFieldOption.mts similarity index 100% rename from src/version3/parameters/deleteCustomFieldOption.ts rename to src/version3/parameters/deleteCustomFieldOption.mts diff --git a/src/version3/parameters/deleteDashboard.ts b/src/version3/parameters/deleteDashboard.mts similarity index 100% rename from src/version3/parameters/deleteDashboard.ts rename to src/version3/parameters/deleteDashboard.mts diff --git a/src/version3/parameters/deleteDashboardItemProperty.ts b/src/version3/parameters/deleteDashboardItemProperty.mts similarity index 100% rename from src/version3/parameters/deleteDashboardItemProperty.ts rename to src/version3/parameters/deleteDashboardItemProperty.mts diff --git a/src/version3/parameters/deleteDefaultWorkflow.ts b/src/version3/parameters/deleteDefaultWorkflow.mts similarity index 100% rename from src/version3/parameters/deleteDefaultWorkflow.ts rename to src/version3/parameters/deleteDefaultWorkflow.mts diff --git a/src/version3/parameters/deleteDraftDefaultWorkflow.ts b/src/version3/parameters/deleteDraftDefaultWorkflow.mts similarity index 100% rename from src/version3/parameters/deleteDraftDefaultWorkflow.ts rename to src/version3/parameters/deleteDraftDefaultWorkflow.mts diff --git a/src/version3/parameters/deleteDraftWorkflowMapping.ts b/src/version3/parameters/deleteDraftWorkflowMapping.mts similarity index 100% rename from src/version3/parameters/deleteDraftWorkflowMapping.ts rename to src/version3/parameters/deleteDraftWorkflowMapping.mts diff --git a/src/version3/parameters/deleteFavouriteForFilter.ts b/src/version3/parameters/deleteFavouriteForFilter.mts similarity index 100% rename from src/version3/parameters/deleteFavouriteForFilter.ts rename to src/version3/parameters/deleteFavouriteForFilter.mts diff --git a/src/version3/parameters/deleteFieldConfiguration.ts b/src/version3/parameters/deleteFieldConfiguration.mts similarity index 100% rename from src/version3/parameters/deleteFieldConfiguration.ts rename to src/version3/parameters/deleteFieldConfiguration.mts diff --git a/src/version3/parameters/deleteFieldConfigurationScheme.ts b/src/version3/parameters/deleteFieldConfigurationScheme.mts similarity index 100% rename from src/version3/parameters/deleteFieldConfigurationScheme.ts rename to src/version3/parameters/deleteFieldConfigurationScheme.mts diff --git a/src/version3/parameters/deleteFilter.ts b/src/version3/parameters/deleteFilter.mts similarity index 100% rename from src/version3/parameters/deleteFilter.ts rename to src/version3/parameters/deleteFilter.mts diff --git a/src/version3/parameters/deleteInactiveWorkflow.ts b/src/version3/parameters/deleteInactiveWorkflow.mts similarity index 100% rename from src/version3/parameters/deleteInactiveWorkflow.ts rename to src/version3/parameters/deleteInactiveWorkflow.mts diff --git a/src/version3/parameters/deleteIssue.ts b/src/version3/parameters/deleteIssue.mts similarity index 100% rename from src/version3/parameters/deleteIssue.ts rename to src/version3/parameters/deleteIssue.mts diff --git a/src/version3/parameters/deleteIssueFieldOption.ts b/src/version3/parameters/deleteIssueFieldOption.mts similarity index 100% rename from src/version3/parameters/deleteIssueFieldOption.ts rename to src/version3/parameters/deleteIssueFieldOption.mts diff --git a/src/version3/parameters/deleteIssueLink.ts b/src/version3/parameters/deleteIssueLink.mts similarity index 100% rename from src/version3/parameters/deleteIssueLink.ts rename to src/version3/parameters/deleteIssueLink.mts diff --git a/src/version3/parameters/deleteIssueLinkType.ts b/src/version3/parameters/deleteIssueLinkType.mts similarity index 100% rename from src/version3/parameters/deleteIssueLinkType.ts rename to src/version3/parameters/deleteIssueLinkType.mts diff --git a/src/version3/parameters/deleteIssueProperty.ts b/src/version3/parameters/deleteIssueProperty.mts similarity index 100% rename from src/version3/parameters/deleteIssueProperty.ts rename to src/version3/parameters/deleteIssueProperty.mts diff --git a/src/version3/parameters/deleteIssueType.ts b/src/version3/parameters/deleteIssueType.mts similarity index 100% rename from src/version3/parameters/deleteIssueType.ts rename to src/version3/parameters/deleteIssueType.mts diff --git a/src/version3/parameters/deleteIssueTypeProperty.ts b/src/version3/parameters/deleteIssueTypeProperty.mts similarity index 100% rename from src/version3/parameters/deleteIssueTypeProperty.ts rename to src/version3/parameters/deleteIssueTypeProperty.mts diff --git a/src/version3/parameters/deleteIssueTypeScheme.ts b/src/version3/parameters/deleteIssueTypeScheme.mts similarity index 100% rename from src/version3/parameters/deleteIssueTypeScheme.ts rename to src/version3/parameters/deleteIssueTypeScheme.mts diff --git a/src/version3/parameters/deleteIssueTypeScreenScheme.ts b/src/version3/parameters/deleteIssueTypeScreenScheme.mts similarity index 100% rename from src/version3/parameters/deleteIssueTypeScreenScheme.ts rename to src/version3/parameters/deleteIssueTypeScreenScheme.mts diff --git a/src/version3/parameters/deleteNotificationScheme.ts b/src/version3/parameters/deleteNotificationScheme.mts similarity index 100% rename from src/version3/parameters/deleteNotificationScheme.ts rename to src/version3/parameters/deleteNotificationScheme.mts diff --git a/src/version3/parameters/deletePermissionScheme.ts b/src/version3/parameters/deletePermissionScheme.mts similarity index 100% rename from src/version3/parameters/deletePermissionScheme.ts rename to src/version3/parameters/deletePermissionScheme.mts diff --git a/src/version3/parameters/deletePermissionSchemeEntity.ts b/src/version3/parameters/deletePermissionSchemeEntity.mts similarity index 100% rename from src/version3/parameters/deletePermissionSchemeEntity.ts rename to src/version3/parameters/deletePermissionSchemeEntity.mts diff --git a/src/version3/parameters/deleteProject.ts b/src/version3/parameters/deleteProject.mts similarity index 100% rename from src/version3/parameters/deleteProject.ts rename to src/version3/parameters/deleteProject.mts diff --git a/src/version3/parameters/deleteProjectAsynchronously.ts b/src/version3/parameters/deleteProjectAsynchronously.mts similarity index 100% rename from src/version3/parameters/deleteProjectAsynchronously.ts rename to src/version3/parameters/deleteProjectAsynchronously.mts diff --git a/src/version3/parameters/deleteProjectAvatar.ts b/src/version3/parameters/deleteProjectAvatar.mts similarity index 100% rename from src/version3/parameters/deleteProjectAvatar.ts rename to src/version3/parameters/deleteProjectAvatar.mts diff --git a/src/version3/parameters/deleteProjectProperty.ts b/src/version3/parameters/deleteProjectProperty.mts similarity index 100% rename from src/version3/parameters/deleteProjectProperty.ts rename to src/version3/parameters/deleteProjectProperty.mts diff --git a/src/version3/parameters/deleteProjectRole.ts b/src/version3/parameters/deleteProjectRole.mts similarity index 100% rename from src/version3/parameters/deleteProjectRole.ts rename to src/version3/parameters/deleteProjectRole.mts diff --git a/src/version3/parameters/deleteProjectRoleActorsFromRole.ts b/src/version3/parameters/deleteProjectRoleActorsFromRole.mts similarity index 100% rename from src/version3/parameters/deleteProjectRoleActorsFromRole.ts rename to src/version3/parameters/deleteProjectRoleActorsFromRole.mts diff --git a/src/version3/parameters/deleteRemoteIssueLinkByGlobalId.ts b/src/version3/parameters/deleteRemoteIssueLinkByGlobalId.mts similarity index 100% rename from src/version3/parameters/deleteRemoteIssueLinkByGlobalId.ts rename to src/version3/parameters/deleteRemoteIssueLinkByGlobalId.mts diff --git a/src/version3/parameters/deleteRemoteIssueLinkById.ts b/src/version3/parameters/deleteRemoteIssueLinkById.mts similarity index 100% rename from src/version3/parameters/deleteRemoteIssueLinkById.ts rename to src/version3/parameters/deleteRemoteIssueLinkById.mts diff --git a/src/version3/parameters/deleteResolution.ts b/src/version3/parameters/deleteResolution.mts similarity index 100% rename from src/version3/parameters/deleteResolution.ts rename to src/version3/parameters/deleteResolution.mts diff --git a/src/version3/parameters/deleteScreen.ts b/src/version3/parameters/deleteScreen.mts similarity index 100% rename from src/version3/parameters/deleteScreen.ts rename to src/version3/parameters/deleteScreen.mts diff --git a/src/version3/parameters/deleteScreenScheme.ts b/src/version3/parameters/deleteScreenScheme.mts similarity index 100% rename from src/version3/parameters/deleteScreenScheme.ts rename to src/version3/parameters/deleteScreenScheme.mts diff --git a/src/version3/parameters/deleteScreenTab.ts b/src/version3/parameters/deleteScreenTab.mts similarity index 100% rename from src/version3/parameters/deleteScreenTab.ts rename to src/version3/parameters/deleteScreenTab.mts diff --git a/src/version3/parameters/deleteSecurityScheme.ts b/src/version3/parameters/deleteSecurityScheme.mts similarity index 100% rename from src/version3/parameters/deleteSecurityScheme.ts rename to src/version3/parameters/deleteSecurityScheme.mts diff --git a/src/version3/parameters/deleteSharePermission.ts b/src/version3/parameters/deleteSharePermission.mts similarity index 100% rename from src/version3/parameters/deleteSharePermission.ts rename to src/version3/parameters/deleteSharePermission.mts diff --git a/src/version3/parameters/deleteStatusesById.ts b/src/version3/parameters/deleteStatusesById.mts similarity index 100% rename from src/version3/parameters/deleteStatusesById.ts rename to src/version3/parameters/deleteStatusesById.mts diff --git a/src/version3/parameters/deleteUiModification.ts b/src/version3/parameters/deleteUiModification.mts similarity index 100% rename from src/version3/parameters/deleteUiModification.ts rename to src/version3/parameters/deleteUiModification.mts diff --git a/src/version3/parameters/deleteUserProperty.ts b/src/version3/parameters/deleteUserProperty.mts similarity index 100% rename from src/version3/parameters/deleteUserProperty.ts rename to src/version3/parameters/deleteUserProperty.mts diff --git a/src/version3/parameters/deleteWebhookById.mts b/src/version3/parameters/deleteWebhookById.mts new file mode 100644 index 000000000..56e014fe8 --- /dev/null +++ b/src/version3/parameters/deleteWebhookById.mts @@ -0,0 +1,3 @@ +import { ContainerForWebhookIDs } from '../models/index.mjs'; + +export interface DeleteWebhookById extends ContainerForWebhookIDs {} diff --git a/src/version3/parameters/deleteWebhookById.ts b/src/version3/parameters/deleteWebhookById.ts deleted file mode 100644 index 9d3a99a1b..000000000 --- a/src/version3/parameters/deleteWebhookById.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ContainerForWebhookIDs } from '../models/index.js'; - -export interface DeleteWebhookById extends ContainerForWebhookIDs {} diff --git a/src/version3/parameters/deleteWorkflowMapping.ts b/src/version3/parameters/deleteWorkflowMapping.mts similarity index 100% rename from src/version3/parameters/deleteWorkflowMapping.ts rename to src/version3/parameters/deleteWorkflowMapping.mts diff --git a/src/version3/parameters/deleteWorkflowScheme.ts b/src/version3/parameters/deleteWorkflowScheme.mts similarity index 100% rename from src/version3/parameters/deleteWorkflowScheme.ts rename to src/version3/parameters/deleteWorkflowScheme.mts diff --git a/src/version3/parameters/deleteWorkflowSchemeDraft.ts b/src/version3/parameters/deleteWorkflowSchemeDraft.mts similarity index 100% rename from src/version3/parameters/deleteWorkflowSchemeDraft.ts rename to src/version3/parameters/deleteWorkflowSchemeDraft.mts diff --git a/src/version3/parameters/deleteWorkflowSchemeDraftIssueType.ts b/src/version3/parameters/deleteWorkflowSchemeDraftIssueType.mts similarity index 100% rename from src/version3/parameters/deleteWorkflowSchemeDraftIssueType.ts rename to src/version3/parameters/deleteWorkflowSchemeDraftIssueType.mts diff --git a/src/version3/parameters/deleteWorkflowSchemeIssueType.ts b/src/version3/parameters/deleteWorkflowSchemeIssueType.mts similarity index 100% rename from src/version3/parameters/deleteWorkflowSchemeIssueType.ts rename to src/version3/parameters/deleteWorkflowSchemeIssueType.mts diff --git a/src/version3/parameters/deleteWorkflowTransitionProperty.ts b/src/version3/parameters/deleteWorkflowTransitionProperty.mts similarity index 100% rename from src/version3/parameters/deleteWorkflowTransitionProperty.ts rename to src/version3/parameters/deleteWorkflowTransitionProperty.mts diff --git a/src/version3/parameters/deleteWorkflowTransitionRuleConfigurations.mts b/src/version3/parameters/deleteWorkflowTransitionRuleConfigurations.mts new file mode 100644 index 000000000..39f535d51 --- /dev/null +++ b/src/version3/parameters/deleteWorkflowTransitionRuleConfigurations.mts @@ -0,0 +1,3 @@ +import type { WorkflowsWithTransitionRulesDetails } from '../models/index.mjs'; + +export interface DeleteWorkflowTransitionRuleConfigurations extends WorkflowsWithTransitionRulesDetails {} diff --git a/src/version3/parameters/deleteWorkflowTransitionRuleConfigurations.ts b/src/version3/parameters/deleteWorkflowTransitionRuleConfigurations.ts deleted file mode 100644 index 1bde9fa1b..000000000 --- a/src/version3/parameters/deleteWorkflowTransitionRuleConfigurations.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WorkflowsWithTransitionRulesDetails } from '../models/index.js'; - -export interface DeleteWorkflowTransitionRuleConfigurations extends WorkflowsWithTransitionRulesDetails {} diff --git a/src/version3/parameters/deleteWorklog.ts b/src/version3/parameters/deleteWorklog.mts similarity index 100% rename from src/version3/parameters/deleteWorklog.ts rename to src/version3/parameters/deleteWorklog.mts diff --git a/src/version3/parameters/deleteWorklogProperty.ts b/src/version3/parameters/deleteWorklogProperty.mts similarity index 100% rename from src/version3/parameters/deleteWorklogProperty.ts rename to src/version3/parameters/deleteWorklogProperty.mts diff --git a/src/version3/parameters/doTransition.mts b/src/version3/parameters/doTransition.mts new file mode 100644 index 000000000..4c396774d --- /dev/null +++ b/src/version3/parameters/doTransition.mts @@ -0,0 +1,6 @@ +import { IssueUpdateDetails } from '../models/index.mjs'; + +export interface DoTransition extends IssueUpdateDetails { + /** The ID or key of the issue. */ + issueIdOrKey: string; +} diff --git a/src/version3/parameters/doTransition.ts b/src/version3/parameters/doTransition.ts deleted file mode 100644 index df7599edb..000000000 --- a/src/version3/parameters/doTransition.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueUpdateDetails } from '../models/index.js'; - -export interface DoTransition extends IssueUpdateDetails { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version3/parameters/editIssue.mts b/src/version3/parameters/editIssue.mts new file mode 100644 index 000000000..ef0429137 --- /dev/null +++ b/src/version3/parameters/editIssue.mts @@ -0,0 +1,31 @@ +import { IssueUpdateDetails } from '../models/index.mjs'; + +export interface EditIssue extends IssueUpdateDetails { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** + * Whether a notification email about the issue update is sent to all watchers. To disable the notification, + * administer Jira or administer project permissions are required. If the user doesn't have the necessary permission + * the request is ignored. + */ + notifyUsers?: boolean; + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect app users with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of + * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideScreenSecurity?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of + * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + /** + * Whether the response should contain the issue with fields edited in this request. The returned issue will have the + * same format as in the [Get issue API](#api-rest-api-3-issue-issueidorkey-get). + */ + returnIssue?: boolean; + /** The Get issue API expand parameter to use in the response if the `returnIssue` parameter is `true`. */ + expand?: string; +} diff --git a/src/version3/parameters/editIssue.ts b/src/version3/parameters/editIssue.ts deleted file mode 100644 index 267930c4d..000000000 --- a/src/version3/parameters/editIssue.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { IssueUpdateDetails } from '../models/index.js'; - -export interface EditIssue extends IssueUpdateDetails { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * Whether a notification email about the issue update is sent to all watchers. To disable the notification, - * administer Jira or administer project permissions are required. If the user doesn't have the necessary permission - * the request is ignored. - */ - notifyUsers?: boolean; - /** - * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect app users with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of - * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideScreenSecurity?: boolean; - /** - * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of - * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideEditableFlag?: boolean; - /** - * Whether the response should contain the issue with fields edited in this request. The returned issue will have the - * same format as in the [Get issue API](#api-rest-api-3-issue-issueidorkey-get). - */ - returnIssue?: boolean; - /** The Get issue API expand parameter to use in the response if the `returnIssue` parameter is `true`. */ - expand?: string; -} diff --git a/src/version3/parameters/evaluateJiraExpression.mts b/src/version3/parameters/evaluateJiraExpression.mts new file mode 100644 index 000000000..a882cc23a --- /dev/null +++ b/src/version3/parameters/evaluateJiraExpression.mts @@ -0,0 +1,13 @@ +import { JiraExpressionEvalRequest } from '../models/index.mjs'; + +export interface EvaluateJiraExpression extends JiraExpressionEvalRequest { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information in the response. This parameter accepts `meta.complexity` that returns information about the expression + * complexity. For example, the number of expensive operations used by the expression and how close the expression is + * to reaching the [complexity + * limit](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions). Useful when designing + * and debugging your expressions. + */ + expand?: string; +} diff --git a/src/version3/parameters/evaluateJiraExpression.ts b/src/version3/parameters/evaluateJiraExpression.ts deleted file mode 100644 index 25cc2c35b..000000000 --- a/src/version3/parameters/evaluateJiraExpression.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { JiraExpressionEvalRequest } from '../models/index.js'; - -export interface EvaluateJiraExpression extends JiraExpressionEvalRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information in the response. This parameter accepts `meta.complexity` that returns information about the expression - * complexity. For example, the number of expensive operations used by the expression and how close the expression is - * to reaching the [complexity - * limit](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions). Useful when designing - * and debugging your expressions. - */ - expand?: string; -} diff --git a/src/version3/parameters/expandAttachmentForHumans.ts b/src/version3/parameters/expandAttachmentForHumans.mts similarity index 100% rename from src/version3/parameters/expandAttachmentForHumans.ts rename to src/version3/parameters/expandAttachmentForHumans.mts diff --git a/src/version3/parameters/expandAttachmentForMachines.ts b/src/version3/parameters/expandAttachmentForMachines.mts similarity index 100% rename from src/version3/parameters/expandAttachmentForMachines.ts rename to src/version3/parameters/expandAttachmentForMachines.mts diff --git a/src/version3/parameters/exportArchivedIssues.mts b/src/version3/parameters/exportArchivedIssues.mts new file mode 100644 index 000000000..819cb4343 --- /dev/null +++ b/src/version3/parameters/exportArchivedIssues.mts @@ -0,0 +1,14 @@ +import { DateRangeFilter } from '../models/index.mjs'; + +/** Details of a filter for exporting archived issues. */ +export interface ExportArchivedIssues { + /** List archived issues archived by a specified account ID. */ + archivedBy?: string[]; + archivedDateRange?: DateRangeFilter; + /** List archived issues with a specified issue type ID. */ + issueTypes?: string[]; + /** List archived issues with a specified project key. */ + projects?: string[]; + /** List archived issues where the reporter is a specified account ID. */ + reporters?: string[]; +} diff --git a/src/version3/parameters/exportArchivedIssues.ts b/src/version3/parameters/exportArchivedIssues.ts deleted file mode 100644 index aec263c5a..000000000 --- a/src/version3/parameters/exportArchivedIssues.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { DateRangeFilter } from '../models/index.js'; - -/** Details of a filter for exporting archived issues. */ -export interface ExportArchivedIssues { - /** List archived issues archived by a specified account ID. */ - archivedBy?: string[]; - archivedDateRange?: DateRangeFilter; - /** List archived issues with a specified issue type ID. */ - issueTypes?: string[]; - /** List archived issues with a specified project key. */ - projects?: string[]; - /** List archived issues where the reporter is a specified account ID. */ - reporters?: string[]; -} diff --git a/src/version3/parameters/findAssignableUsers.ts b/src/version3/parameters/findAssignableUsers.mts similarity index 100% rename from src/version3/parameters/findAssignableUsers.ts rename to src/version3/parameters/findAssignableUsers.mts diff --git a/src/version3/parameters/findBulkAssignableUsers.ts b/src/version3/parameters/findBulkAssignableUsers.mts similarity index 100% rename from src/version3/parameters/findBulkAssignableUsers.ts rename to src/version3/parameters/findBulkAssignableUsers.mts diff --git a/src/version3/parameters/findGroups.ts b/src/version3/parameters/findGroups.mts similarity index 100% rename from src/version3/parameters/findGroups.ts rename to src/version3/parameters/findGroups.mts diff --git a/src/version3/parameters/findUserKeysByQuery.ts b/src/version3/parameters/findUserKeysByQuery.mts similarity index 100% rename from src/version3/parameters/findUserKeysByQuery.ts rename to src/version3/parameters/findUserKeysByQuery.mts diff --git a/src/version3/parameters/findUsers.ts b/src/version3/parameters/findUsers.mts similarity index 100% rename from src/version3/parameters/findUsers.ts rename to src/version3/parameters/findUsers.mts diff --git a/src/version3/parameters/findUsersAndGroups.ts b/src/version3/parameters/findUsersAndGroups.mts similarity index 100% rename from src/version3/parameters/findUsersAndGroups.ts rename to src/version3/parameters/findUsersAndGroups.mts diff --git a/src/version3/parameters/findUsersByQuery.ts b/src/version3/parameters/findUsersByQuery.mts similarity index 100% rename from src/version3/parameters/findUsersByQuery.ts rename to src/version3/parameters/findUsersByQuery.mts diff --git a/src/version3/parameters/findUsersForPicker.ts b/src/version3/parameters/findUsersForPicker.mts similarity index 100% rename from src/version3/parameters/findUsersForPicker.ts rename to src/version3/parameters/findUsersForPicker.mts diff --git a/src/version3/parameters/findUsersWithAllPermissions.ts b/src/version3/parameters/findUsersWithAllPermissions.mts similarity index 100% rename from src/version3/parameters/findUsersWithAllPermissions.ts rename to src/version3/parameters/findUsersWithAllPermissions.mts diff --git a/src/version3/parameters/findUsersWithBrowsePermission.ts b/src/version3/parameters/findUsersWithBrowsePermission.mts similarity index 100% rename from src/version3/parameters/findUsersWithBrowsePermission.ts rename to src/version3/parameters/findUsersWithBrowsePermission.mts diff --git a/src/version3/parameters/fullyUpdateProjectRole.mts b/src/version3/parameters/fullyUpdateProjectRole.mts new file mode 100644 index 000000000..1d79e7c5f --- /dev/null +++ b/src/version3/parameters/fullyUpdateProjectRole.mts @@ -0,0 +1,9 @@ +import { CreateUpdateRoleRequest } from '../models/index.mjs'; + +export interface FullyUpdateProjectRole extends CreateUpdateRoleRequest { + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role + * IDs. + */ + id: number; +} diff --git a/src/version3/parameters/fullyUpdateProjectRole.ts b/src/version3/parameters/fullyUpdateProjectRole.ts deleted file mode 100644 index 860c96110..000000000 --- a/src/version3/parameters/fullyUpdateProjectRole.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { CreateUpdateRoleRequest } from '../models/index.js'; - -export interface FullyUpdateProjectRole extends CreateUpdateRoleRequest { - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version3/parameters/getAccessibleProjectTypeByKey.ts b/src/version3/parameters/getAccessibleProjectTypeByKey.mts similarity index 100% rename from src/version3/parameters/getAccessibleProjectTypeByKey.ts rename to src/version3/parameters/getAccessibleProjectTypeByKey.mts diff --git a/src/version3/parameters/getAddonProperties.ts b/src/version3/parameters/getAddonProperties.mts similarity index 100% rename from src/version3/parameters/getAddonProperties.ts rename to src/version3/parameters/getAddonProperties.mts diff --git a/src/version3/parameters/getAddonProperty.ts b/src/version3/parameters/getAddonProperty.mts similarity index 100% rename from src/version3/parameters/getAddonProperty.ts rename to src/version3/parameters/getAddonProperty.mts diff --git a/src/version3/parameters/getAllDashboards.ts b/src/version3/parameters/getAllDashboards.mts similarity index 100% rename from src/version3/parameters/getAllDashboards.ts rename to src/version3/parameters/getAllDashboards.mts diff --git a/src/version3/parameters/getAllFieldConfigurationSchemes.ts b/src/version3/parameters/getAllFieldConfigurationSchemes.mts similarity index 100% rename from src/version3/parameters/getAllFieldConfigurationSchemes.ts rename to src/version3/parameters/getAllFieldConfigurationSchemes.mts diff --git a/src/version3/parameters/getAllFieldConfigurations.ts b/src/version3/parameters/getAllFieldConfigurations.mts similarity index 100% rename from src/version3/parameters/getAllFieldConfigurations.ts rename to src/version3/parameters/getAllFieldConfigurations.mts diff --git a/src/version3/parameters/getAllGadgets.ts b/src/version3/parameters/getAllGadgets.mts similarity index 100% rename from src/version3/parameters/getAllGadgets.ts rename to src/version3/parameters/getAllGadgets.mts diff --git a/src/version3/parameters/getAllIssueFieldOptions.ts b/src/version3/parameters/getAllIssueFieldOptions.mts similarity index 100% rename from src/version3/parameters/getAllIssueFieldOptions.ts rename to src/version3/parameters/getAllIssueFieldOptions.mts diff --git a/src/version3/parameters/getAllIssueTypeSchemes.ts b/src/version3/parameters/getAllIssueTypeSchemes.mts similarity index 100% rename from src/version3/parameters/getAllIssueTypeSchemes.ts rename to src/version3/parameters/getAllIssueTypeSchemes.mts diff --git a/src/version3/parameters/getAllLabels.ts b/src/version3/parameters/getAllLabels.mts similarity index 100% rename from src/version3/parameters/getAllLabels.ts rename to src/version3/parameters/getAllLabels.mts diff --git a/src/version3/parameters/getAllPermissionSchemes.ts b/src/version3/parameters/getAllPermissionSchemes.mts similarity index 100% rename from src/version3/parameters/getAllPermissionSchemes.ts rename to src/version3/parameters/getAllPermissionSchemes.mts diff --git a/src/version3/parameters/getAllProjectAvatars.ts b/src/version3/parameters/getAllProjectAvatars.mts similarity index 100% rename from src/version3/parameters/getAllProjectAvatars.ts rename to src/version3/parameters/getAllProjectAvatars.mts diff --git a/src/version3/parameters/getAllScreenTabFields.ts b/src/version3/parameters/getAllScreenTabFields.mts similarity index 100% rename from src/version3/parameters/getAllScreenTabFields.ts rename to src/version3/parameters/getAllScreenTabFields.mts diff --git a/src/version3/parameters/getAllScreenTabs.ts b/src/version3/parameters/getAllScreenTabs.mts similarity index 100% rename from src/version3/parameters/getAllScreenTabs.ts rename to src/version3/parameters/getAllScreenTabs.mts diff --git a/src/version3/parameters/getAllStatuses.ts b/src/version3/parameters/getAllStatuses.mts similarity index 100% rename from src/version3/parameters/getAllStatuses.ts rename to src/version3/parameters/getAllStatuses.mts diff --git a/src/version3/parameters/getAllSystemAvatars.ts b/src/version3/parameters/getAllSystemAvatars.mts similarity index 100% rename from src/version3/parameters/getAllSystemAvatars.ts rename to src/version3/parameters/getAllSystemAvatars.mts diff --git a/src/version3/parameters/getAllUsers.ts b/src/version3/parameters/getAllUsers.mts similarity index 100% rename from src/version3/parameters/getAllUsers.ts rename to src/version3/parameters/getAllUsers.mts diff --git a/src/version3/parameters/getAllUsersDefault.ts b/src/version3/parameters/getAllUsersDefault.mts similarity index 100% rename from src/version3/parameters/getAllUsersDefault.ts rename to src/version3/parameters/getAllUsersDefault.mts diff --git a/src/version3/parameters/getAllWorkflowSchemes.ts b/src/version3/parameters/getAllWorkflowSchemes.mts similarity index 100% rename from src/version3/parameters/getAllWorkflowSchemes.ts rename to src/version3/parameters/getAllWorkflowSchemes.mts diff --git a/src/version3/parameters/getAlternativeIssueTypes.ts b/src/version3/parameters/getAlternativeIssueTypes.mts similarity index 100% rename from src/version3/parameters/getAlternativeIssueTypes.ts rename to src/version3/parameters/getAlternativeIssueTypes.mts diff --git a/src/version3/parameters/getApplicationProperty.ts b/src/version3/parameters/getApplicationProperty.mts similarity index 100% rename from src/version3/parameters/getApplicationProperty.ts rename to src/version3/parameters/getApplicationProperty.mts diff --git a/src/version3/parameters/getApplicationRole.ts b/src/version3/parameters/getApplicationRole.mts similarity index 100% rename from src/version3/parameters/getApplicationRole.ts rename to src/version3/parameters/getApplicationRole.mts diff --git a/src/version3/parameters/getAssignedPermissionScheme.ts b/src/version3/parameters/getAssignedPermissionScheme.mts similarity index 100% rename from src/version3/parameters/getAssignedPermissionScheme.ts rename to src/version3/parameters/getAssignedPermissionScheme.mts diff --git a/src/version3/parameters/getAttachment.ts b/src/version3/parameters/getAttachment.mts similarity index 100% rename from src/version3/parameters/getAttachment.ts rename to src/version3/parameters/getAttachment.mts diff --git a/src/version3/parameters/getAttachmentContent.ts b/src/version3/parameters/getAttachmentContent.mts similarity index 100% rename from src/version3/parameters/getAttachmentContent.ts rename to src/version3/parameters/getAttachmentContent.mts diff --git a/src/version3/parameters/getAttachmentThumbnail.ts b/src/version3/parameters/getAttachmentThumbnail.mts similarity index 100% rename from src/version3/parameters/getAttachmentThumbnail.ts rename to src/version3/parameters/getAttachmentThumbnail.mts diff --git a/src/version3/parameters/getAuditRecords.ts b/src/version3/parameters/getAuditRecords.mts similarity index 100% rename from src/version3/parameters/getAuditRecords.ts rename to src/version3/parameters/getAuditRecords.mts diff --git a/src/version3/parameters/getAutoCompletePost.mts b/src/version3/parameters/getAutoCompletePost.mts new file mode 100644 index 000000000..c405f2bce --- /dev/null +++ b/src/version3/parameters/getAutoCompletePost.mts @@ -0,0 +1,3 @@ +import { SearchAutoCompleteFilter } from '../models/index.mjs'; + +export interface GetAutoCompletePost extends SearchAutoCompleteFilter {} diff --git a/src/version3/parameters/getAutoCompletePost.ts b/src/version3/parameters/getAutoCompletePost.ts deleted file mode 100644 index 7835f621e..000000000 --- a/src/version3/parameters/getAutoCompletePost.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SearchAutoCompleteFilter } from '../models/index.js'; - -export interface GetAutoCompletePost extends SearchAutoCompleteFilter {} diff --git a/src/version3/parameters/getAvailableScreenFields.ts b/src/version3/parameters/getAvailableScreenFields.mts similarity index 100% rename from src/version3/parameters/getAvailableScreenFields.ts rename to src/version3/parameters/getAvailableScreenFields.mts diff --git a/src/version3/parameters/getAvatarImageByID.ts b/src/version3/parameters/getAvatarImageByID.mts similarity index 100% rename from src/version3/parameters/getAvatarImageByID.ts rename to src/version3/parameters/getAvatarImageByID.mts diff --git a/src/version3/parameters/getAvatarImageByOwner.ts b/src/version3/parameters/getAvatarImageByOwner.mts similarity index 100% rename from src/version3/parameters/getAvatarImageByOwner.ts rename to src/version3/parameters/getAvatarImageByOwner.mts diff --git a/src/version3/parameters/getAvatarImageByType.ts b/src/version3/parameters/getAvatarImageByType.mts similarity index 100% rename from src/version3/parameters/getAvatarImageByType.ts rename to src/version3/parameters/getAvatarImageByType.mts diff --git a/src/version3/parameters/getAvatars.ts b/src/version3/parameters/getAvatars.mts similarity index 100% rename from src/version3/parameters/getAvatars.ts rename to src/version3/parameters/getAvatars.mts diff --git a/src/version3/parameters/getBulkPermissions.mts b/src/version3/parameters/getBulkPermissions.mts new file mode 100644 index 000000000..e8f237419 --- /dev/null +++ b/src/version3/parameters/getBulkPermissions.mts @@ -0,0 +1,3 @@ +import { BulkPermissionsRequest } from '../models/index.mjs'; + +export interface GetBulkPermissions extends BulkPermissionsRequest {} diff --git a/src/version3/parameters/getBulkPermissions.ts b/src/version3/parameters/getBulkPermissions.ts deleted file mode 100644 index 433650350..000000000 --- a/src/version3/parameters/getBulkPermissions.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { BulkPermissionsRequest } from '../models/index.js'; - -export interface GetBulkPermissions extends BulkPermissionsRequest {} diff --git a/src/version3/parameters/getChangeLogs.ts b/src/version3/parameters/getChangeLogs.mts similarity index 100% rename from src/version3/parameters/getChangeLogs.ts rename to src/version3/parameters/getChangeLogs.mts diff --git a/src/version3/parameters/getChangeLogsByIds.mts b/src/version3/parameters/getChangeLogsByIds.mts new file mode 100644 index 000000000..873e9d688 --- /dev/null +++ b/src/version3/parameters/getChangeLogsByIds.mts @@ -0,0 +1,6 @@ +import { IssueChangelogIds } from '../models/index.mjs'; + +export interface GetChangeLogsByIds extends IssueChangelogIds { + /** The ID or key of the issue. */ + issueIdOrKey: string; +} diff --git a/src/version3/parameters/getChangeLogsByIds.ts b/src/version3/parameters/getChangeLogsByIds.ts deleted file mode 100644 index 8e46cbc51..000000000 --- a/src/version3/parameters/getChangeLogsByIds.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueChangelogIds } from '../models/index.js'; - -export interface GetChangeLogsByIds extends IssueChangelogIds { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version3/parameters/getColumns.ts b/src/version3/parameters/getColumns.mts similarity index 100% rename from src/version3/parameters/getColumns.ts rename to src/version3/parameters/getColumns.mts diff --git a/src/version3/parameters/getComment.ts b/src/version3/parameters/getComment.mts similarity index 100% rename from src/version3/parameters/getComment.ts rename to src/version3/parameters/getComment.mts diff --git a/src/version3/parameters/getCommentProperty.ts b/src/version3/parameters/getCommentProperty.mts similarity index 100% rename from src/version3/parameters/getCommentProperty.ts rename to src/version3/parameters/getCommentProperty.mts diff --git a/src/version3/parameters/getCommentPropertyKeys.ts b/src/version3/parameters/getCommentPropertyKeys.mts similarity index 100% rename from src/version3/parameters/getCommentPropertyKeys.ts rename to src/version3/parameters/getCommentPropertyKeys.mts diff --git a/src/version3/parameters/getComments.ts b/src/version3/parameters/getComments.mts similarity index 100% rename from src/version3/parameters/getComments.ts rename to src/version3/parameters/getComments.mts diff --git a/src/version3/parameters/getCommentsByIds.mts b/src/version3/parameters/getCommentsByIds.mts new file mode 100644 index 000000000..1ebd9687c --- /dev/null +++ b/src/version3/parameters/getCommentsByIds.mts @@ -0,0 +1,12 @@ +import { IssueCommentListRequest } from '../models/index.mjs'; + +export interface GetCommentsByIds extends IssueCommentListRequest { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `renderedBody` Returns the comment body rendered in HTML. + * - `properties` Returns the comment's properties. + */ + expand?: 'renderedBody' | 'properties' | string | string[]; +} diff --git a/src/version3/parameters/getCommentsByIds.ts b/src/version3/parameters/getCommentsByIds.ts deleted file mode 100644 index 0b2a54625..000000000 --- a/src/version3/parameters/getCommentsByIds.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { IssueCommentListRequest } from '../models/index.js'; - -export interface GetCommentsByIds extends IssueCommentListRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `renderedBody` Returns the comment body rendered in HTML. - * - `properties` Returns the comment's properties. - */ - expand?: 'renderedBody' | 'properties' | string | string[]; -} diff --git a/src/version3/parameters/getComponent.ts b/src/version3/parameters/getComponent.mts similarity index 100% rename from src/version3/parameters/getComponent.ts rename to src/version3/parameters/getComponent.mts diff --git a/src/version3/parameters/getComponentRelatedIssues.ts b/src/version3/parameters/getComponentRelatedIssues.mts similarity index 100% rename from src/version3/parameters/getComponentRelatedIssues.ts rename to src/version3/parameters/getComponentRelatedIssues.mts diff --git a/src/version3/parameters/getContextsForField.ts b/src/version3/parameters/getContextsForField.mts similarity index 100% rename from src/version3/parameters/getContextsForField.ts rename to src/version3/parameters/getContextsForField.mts diff --git a/src/version3/parameters/getCreateIssueMeta.ts b/src/version3/parameters/getCreateIssueMeta.mts similarity index 100% rename from src/version3/parameters/getCreateIssueMeta.ts rename to src/version3/parameters/getCreateIssueMeta.mts diff --git a/src/version3/parameters/getCurrentUser.ts b/src/version3/parameters/getCurrentUser.mts similarity index 100% rename from src/version3/parameters/getCurrentUser.ts rename to src/version3/parameters/getCurrentUser.mts diff --git a/src/version3/parameters/getCustomFieldConfiguration.ts b/src/version3/parameters/getCustomFieldConfiguration.mts similarity index 100% rename from src/version3/parameters/getCustomFieldConfiguration.ts rename to src/version3/parameters/getCustomFieldConfiguration.mts diff --git a/src/version3/parameters/getCustomFieldContextsForProjectsAndIssueTypes.mts b/src/version3/parameters/getCustomFieldContextsForProjectsAndIssueTypes.mts new file mode 100644 index 000000000..7cd730085 --- /dev/null +++ b/src/version3/parameters/getCustomFieldContextsForProjectsAndIssueTypes.mts @@ -0,0 +1,10 @@ +import { ProjectIssueTypeMappings } from '../models/index.mjs'; + +export interface GetCustomFieldContextsForProjectsAndIssueTypes extends ProjectIssueTypeMappings { + /** The ID of the custom field. */ + fieldId: string; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getCustomFieldContextsForProjectsAndIssueTypes.ts b/src/version3/parameters/getCustomFieldContextsForProjectsAndIssueTypes.ts deleted file mode 100644 index 5157e8450..000000000 --- a/src/version3/parameters/getCustomFieldContextsForProjectsAndIssueTypes.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ProjectIssueTypeMappings } from '../models/index.js'; - -export interface GetCustomFieldContextsForProjectsAndIssueTypes extends ProjectIssueTypeMappings { - /** The ID of the custom field. */ - fieldId: string; - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; -} diff --git a/src/version3/parameters/getCustomFieldOption.ts b/src/version3/parameters/getCustomFieldOption.mts similarity index 100% rename from src/version3/parameters/getCustomFieldOption.ts rename to src/version3/parameters/getCustomFieldOption.mts diff --git a/src/version3/parameters/getDashboard.ts b/src/version3/parameters/getDashboard.mts similarity index 100% rename from src/version3/parameters/getDashboard.ts rename to src/version3/parameters/getDashboard.mts diff --git a/src/version3/parameters/getDashboardItemProperty.ts b/src/version3/parameters/getDashboardItemProperty.mts similarity index 100% rename from src/version3/parameters/getDashboardItemProperty.ts rename to src/version3/parameters/getDashboardItemProperty.mts diff --git a/src/version3/parameters/getDashboardItemPropertyKeys.ts b/src/version3/parameters/getDashboardItemPropertyKeys.mts similarity index 100% rename from src/version3/parameters/getDashboardItemPropertyKeys.ts rename to src/version3/parameters/getDashboardItemPropertyKeys.mts diff --git a/src/version3/parameters/getDashboardsPaginated.ts b/src/version3/parameters/getDashboardsPaginated.mts similarity index 100% rename from src/version3/parameters/getDashboardsPaginated.ts rename to src/version3/parameters/getDashboardsPaginated.mts diff --git a/src/version3/parameters/getDefaultValues.ts b/src/version3/parameters/getDefaultValues.mts similarity index 100% rename from src/version3/parameters/getDefaultValues.ts rename to src/version3/parameters/getDefaultValues.mts diff --git a/src/version3/parameters/getDefaultWorkflow.ts b/src/version3/parameters/getDefaultWorkflow.mts similarity index 100% rename from src/version3/parameters/getDefaultWorkflow.ts rename to src/version3/parameters/getDefaultWorkflow.mts diff --git a/src/version3/parameters/getDraftDefaultWorkflow.ts b/src/version3/parameters/getDraftDefaultWorkflow.mts similarity index 100% rename from src/version3/parameters/getDraftDefaultWorkflow.ts rename to src/version3/parameters/getDraftDefaultWorkflow.mts diff --git a/src/version3/parameters/getDraftWorkflow.ts b/src/version3/parameters/getDraftWorkflow.mts similarity index 100% rename from src/version3/parameters/getDraftWorkflow.ts rename to src/version3/parameters/getDraftWorkflow.mts diff --git a/src/version3/parameters/getDynamicWebhooksForApp.ts b/src/version3/parameters/getDynamicWebhooksForApp.mts similarity index 100% rename from src/version3/parameters/getDynamicWebhooksForApp.ts rename to src/version3/parameters/getDynamicWebhooksForApp.mts diff --git a/src/version3/parameters/getEditIssueMeta.ts b/src/version3/parameters/getEditIssueMeta.mts similarity index 100% rename from src/version3/parameters/getEditIssueMeta.ts rename to src/version3/parameters/getEditIssueMeta.mts diff --git a/src/version3/parameters/getFailedWebhooks.ts b/src/version3/parameters/getFailedWebhooks.mts similarity index 100% rename from src/version3/parameters/getFailedWebhooks.ts rename to src/version3/parameters/getFailedWebhooks.mts diff --git a/src/version3/parameters/getFavouriteFilters.ts b/src/version3/parameters/getFavouriteFilters.mts similarity index 100% rename from src/version3/parameters/getFavouriteFilters.ts rename to src/version3/parameters/getFavouriteFilters.mts diff --git a/src/version3/parameters/getFeaturesForProject.ts b/src/version3/parameters/getFeaturesForProject.mts similarity index 100% rename from src/version3/parameters/getFeaturesForProject.ts rename to src/version3/parameters/getFeaturesForProject.mts diff --git a/src/version3/parameters/getFieldAutoCompleteForQueryString.ts b/src/version3/parameters/getFieldAutoCompleteForQueryString.mts similarity index 100% rename from src/version3/parameters/getFieldAutoCompleteForQueryString.ts rename to src/version3/parameters/getFieldAutoCompleteForQueryString.mts diff --git a/src/version3/parameters/getFieldConfigurationItems.ts b/src/version3/parameters/getFieldConfigurationItems.mts similarity index 100% rename from src/version3/parameters/getFieldConfigurationItems.ts rename to src/version3/parameters/getFieldConfigurationItems.mts diff --git a/src/version3/parameters/getFieldConfigurationSchemeMappings.ts b/src/version3/parameters/getFieldConfigurationSchemeMappings.mts similarity index 100% rename from src/version3/parameters/getFieldConfigurationSchemeMappings.ts rename to src/version3/parameters/getFieldConfigurationSchemeMappings.mts diff --git a/src/version3/parameters/getFieldConfigurationSchemeProjectMapping.ts b/src/version3/parameters/getFieldConfigurationSchemeProjectMapping.mts similarity index 100% rename from src/version3/parameters/getFieldConfigurationSchemeProjectMapping.ts rename to src/version3/parameters/getFieldConfigurationSchemeProjectMapping.mts diff --git a/src/version3/parameters/getFieldsPaginated.ts b/src/version3/parameters/getFieldsPaginated.mts similarity index 100% rename from src/version3/parameters/getFieldsPaginated.ts rename to src/version3/parameters/getFieldsPaginated.mts diff --git a/src/version3/parameters/getFilter.ts b/src/version3/parameters/getFilter.mts similarity index 100% rename from src/version3/parameters/getFilter.ts rename to src/version3/parameters/getFilter.mts diff --git a/src/version3/parameters/getFiltersPaginated.mts b/src/version3/parameters/getFiltersPaginated.mts new file mode 100644 index 000000000..fd008ddc8 --- /dev/null +++ b/src/version3/parameters/getFiltersPaginated.mts @@ -0,0 +1,114 @@ +export interface GetFiltersPaginated { + /** String used to perform a case-insensitive partial match with `name`. */ + filterName?: string; + /** + * User account ID used to return filters with the matching `owner.accountId`. This parameter cannot be used with + * `owner`. + */ + accountId?: string; + /** + * As a group's name can change, use of `groupId` is recommended to identify a group. Group name used to returns + * filters that are shared with a group that matches `sharePermissions.group.groupname`. This parameter cannot be used + * with the `groupId` parameter. + */ + groupname?: string; + /** + * Group ID used to returns filters that are shared with a group that matches `sharePermissions.group.groupId`. This + * parameter cannot be used with the `groupname` parameter. + */ + groupId?: string; + /** Project ID used to returns filters that are shared with a project that matches `sharePermissions.project.id`. */ + projectId?: number; + /** + * The list of filter IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * `id=10000&id=10001`. Do not exceed 200 filter IDs. + */ + id?: number[]; + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#ordering) the results by a field: + * + * - `description` Sorts by filter description. Note that this sorting works independently of whether the expand to + * display the description field is in use. + * - `favourite_count` Sorts by the count of how many users have this filter as a favorite. + * - `is_favourite` Sorts by whether the filter is marked as a favorite. + * - `id` Sorts by filter ID. + * - `name` Sorts by filter name. + * - `owner` Sorts by the ID of the filter owner. + * - `is_shared` Sorts by whether the filter is shared. + */ + orderBy?: + | 'description' + | '-description' + | '+description' + | 'favourite_count' + | '-favourite_count' + | '+favourite_count' + | 'id' + | '-id' + | '+id' + | 'is_favourite' + | '-is_favourite' + | '+is_favourite' + | 'name' + | '-name' + | '+name' + | 'owner' + | '-owner' + | '+owner' + | 'is_shared' + | '-is_shared' + | '+is_shared' + | string; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `description` Returns the description of the filter. + * - `favourite` Returns an indicator of whether the user has set the filter as a favorite. + * - `favouritedCount` Returns a count of how many users have set this filter as a favorite. + * - `jql` Returns the Jql query that the filter uses. + * - `owner` Returns the owner of the filter. + * - `searchUrl` Returns a URL to perform the filter's Jql query. + * - `sharePermissions` Returns the share permissions defined for the filter. + * - `editPermissions` Returns the edit permissions defined for the filter. + * - `isWritable` Returns whether the current user has permission to edit the filter. + * - `subscriptions` Returns the users that are subscribed to the filter. + * - `viewUrl` Returns a URL to view the filter. + */ + expand?: + | 'description' + | 'favourite' + | 'favouritedCount' + | 'jql' + | 'owner' + | 'searchUrl' + | 'sharePermissions' + | 'editPermissions' + | 'isWritable' + | 'subscriptions' + | 'viewUrl' + | ( + | 'description' + | 'favourite' + | 'favouritedCount' + | 'jql' + | 'owner' + | 'searchUrl' + | 'sharePermissions' + | 'editPermissions' + | 'isWritable' + | 'subscriptions' + | 'viewUrl' + )[] + | string + | string[]; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. + * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; +} diff --git a/src/version3/parameters/getFiltersPaginated.ts b/src/version3/parameters/getFiltersPaginated.ts deleted file mode 100644 index f60612cb5..000000000 --- a/src/version3/parameters/getFiltersPaginated.ts +++ /dev/null @@ -1,114 +0,0 @@ -export interface GetFiltersPaginated { - /** String used to perform a case-insensitive partial match with `name`. */ - filterName?: string; - /** - * User account ID used to return filters with the matching `owner.accountId`. This parameter cannot be used with - * `owner`. - */ - accountId?: string; - /** - * As a group's name can change, use of `groupId` is recommended to identify a group. Group name used to returns - * filters that are shared with a group that matches `sharePermissions.group.groupname`. This parameter cannot be used - * with the `groupId` parameter. - */ - groupname?: string; - /** - * Group ID used to returns filters that are shared with a group that matches `sharePermissions.group.groupId`. This - * parameter cannot be used with the `groupname` parameter. - */ - groupId?: string; - /** Project ID used to returns filters that are shared with a project that matches `sharePermissions.project.id`. */ - projectId?: number; - /** - * The list of filter IDs. To include multiple IDs, provide an ampersand-separated list. For example, - * `id=10000&id=10001`. Do not exceed 200 filter IDs. - */ - id?: number[]; - /** - * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#ordering) the results by a field: - * - * - `description` Sorts by filter description. Note that this sorting works independently of whether the expand to - * display the description field is in use. - * - `favourite_count` Sorts by the count of how many users have this filter as a favorite. - * - `is_favourite` Sorts by whether the filter is marked as a favorite. - * - `id` Sorts by filter ID. - * - `name` Sorts by filter name. - * - `owner` Sorts by the ID of the filter owner. - * - `is_shared` Sorts by whether the filter is shared. - */ - orderBy?: - | 'description' - | '-description' - | '+description' - | 'favourite_count' - | '-favourite_count' - | '+favourite_count' - | 'id' - | '-id' - | '+id' - | 'is_favourite' - | '-is_favourite' - | '+is_favourite' - | 'name' - | '-name' - | '+name' - | 'owner' - | '-owner' - | '+owner' - | 'is_shared' - | '-is_shared' - | '+is_shared' - | string; - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** The maximum number of items to return per page. */ - maxResults?: number; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `description` Returns the description of the filter. - * - `favourite` Returns an indicator of whether the user has set the filter as a favorite. - * - `favouritedCount` Returns a count of how many users have set this filter as a favorite. - * - `jql` Returns the JQL query that the filter uses. - * - `owner` Returns the owner of the filter. - * - `searchUrl` Returns a URL to perform the filter's JQL query. - * - `sharePermissions` Returns the share permissions defined for the filter. - * - `editPermissions` Returns the edit permissions defined for the filter. - * - `isWritable` Returns whether the current user has permission to edit the filter. - * - `subscriptions` Returns the users that are subscribed to the filter. - * - `viewUrl` Returns a URL to view the filter. - */ - expand?: - | 'description' - | 'favourite' - | 'favouritedCount' - | 'jql' - | 'owner' - | 'searchUrl' - | 'sharePermissions' - | 'editPermissions' - | 'isWritable' - | 'subscriptions' - | 'viewUrl' - | ( - | 'description' - | 'favourite' - | 'favouritedCount' - | 'jql' - | 'owner' - | 'searchUrl' - | 'sharePermissions' - | 'editPermissions' - | 'isWritable' - | 'subscriptions' - | 'viewUrl' - )[] - | string - | string[]; - /** - * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. - * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideSharePermissions?: boolean; -} diff --git a/src/version3/parameters/getHierarchy.ts b/src/version3/parameters/getHierarchy.mts similarity index 100% rename from src/version3/parameters/getHierarchy.ts rename to src/version3/parameters/getHierarchy.mts diff --git a/src/version3/parameters/getIdsOfWorklogsDeletedSince.ts b/src/version3/parameters/getIdsOfWorklogsDeletedSince.mts similarity index 100% rename from src/version3/parameters/getIdsOfWorklogsDeletedSince.ts rename to src/version3/parameters/getIdsOfWorklogsDeletedSince.mts diff --git a/src/version3/parameters/getIdsOfWorklogsModifiedSince.ts b/src/version3/parameters/getIdsOfWorklogsModifiedSince.mts similarity index 100% rename from src/version3/parameters/getIdsOfWorklogsModifiedSince.ts rename to src/version3/parameters/getIdsOfWorklogsModifiedSince.mts diff --git a/src/version3/parameters/getIsWatchingIssueBulk.mts b/src/version3/parameters/getIsWatchingIssueBulk.mts new file mode 100644 index 000000000..3616bfd38 --- /dev/null +++ b/src/version3/parameters/getIsWatchingIssueBulk.mts @@ -0,0 +1,3 @@ +import { IssueList } from '../models/index.mjs'; + +export interface GetIsWatchingIssueBulk extends IssueList {} diff --git a/src/version3/parameters/getIsWatchingIssueBulk.ts b/src/version3/parameters/getIsWatchingIssueBulk.ts deleted file mode 100644 index 97d8ecaa4..000000000 --- a/src/version3/parameters/getIsWatchingIssueBulk.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueList } from '../models/index.js'; - -export interface GetIsWatchingIssueBulk extends IssueList {} diff --git a/src/version3/parameters/getIssue.mts b/src/version3/parameters/getIssue.mts new file mode 100644 index 000000000..7cbeb1415 --- /dev/null +++ b/src/version3/parameters/getIssue.mts @@ -0,0 +1,72 @@ +export interface GetIssue { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** + * A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a + * subset of fields. Allowed values: + * + * - `*all` Returns all fields. + * - `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to exclude. + * + * Examples: + * + * `summary,comment` Returns only the summary and comments fields. `-description` Returns all (default) fields except + * description. `*navigable,-comment` Returns all navigable fields except comment. + * + * This parameter may be specified multiple times. For example, `fields=field1,field2& fields=field3`. + * + * Note: All fields are returned by default. This differs from [Search for issues using Jql + * (GET)](#api-rest-api-3-search-get) and [Search for issues using Jql (POST)](#api-rest-api-3-search-post) where the + * default is all navigable fields. + */ + fields?: string[]; + /** + * Whether fields in `fields` are referenced by keys rather than IDs. This parameter is useful where fields have been + * added by a connect app and a field's key may differ from its ID. + */ + fieldsByKeys?: boolean; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about the issues in the response. This parameter accepts a comma-separated list. Expand options + * include: + * + * - `renderedFields` Returns field values rendered in HTML format. + * - `names` Returns the display name of each field. + * - `schema` Returns the schema describing a field type. + * - `transitions` Returns all possible transitions for the issue. + * - `editmeta` Returns information about how each field can be edited. + * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * - `versionedRepresentations` Returns a JSON array for each version of a field's value, with the highest number + * representing the most recent version. Note: When included in the request, the `fields` parameter is ignored. + */ + expand?: + | 'renderedFields' + | 'name' + | 'schema' + | 'transitions' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | ('renderedFields' | 'name' | 'schema' | 'transitions' | 'editmeta' | 'changelog' | 'versionedRepresentations')[] + | string + | string[]; + /** + * A list of issue properties to return for the issue. This parameter accepts a comma-separated list. Allowed values: + * + * `*all` Returns all issue properties. Any issue property key, prefixed with a minus to exclude. + * + * Examples: + * + * `*all` Returns all properties. `*all,-prop1` Returns all properties except `prop1`. `prop1,prop2` Returns `prop1` + * and `prop2` properties. + * + * This parameter may be specified multiple times. For example, `properties=prop1,prop2& properties=prop3`. + */ + properties?: string[]; + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown + * under **Projects** in Jira. This also populates the [Jql issues search](#api-rest-api-3-search-get) `lastViewed` + * field. + */ + updateHistory?: boolean; +} diff --git a/src/version3/parameters/getIssue.ts b/src/version3/parameters/getIssue.ts deleted file mode 100644 index a85fabe0e..000000000 --- a/src/version3/parameters/getIssue.ts +++ /dev/null @@ -1,72 +0,0 @@ -export interface GetIssue { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a - * subset of fields. Allowed values: - * - * - `*all` Returns all fields. - * - `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to exclude. - * - * Examples: - * - * `summary,comment` Returns only the summary and comments fields. `-description` Returns all (default) fields except - * description. `*navigable,-comment` Returns all navigable fields except comment. - * - * This parameter may be specified multiple times. For example, `fields=field1,field2& fields=field3`. - * - * Note: All fields are returned by default. This differs from [Search for issues using JQL - * (GET)](#api-rest-api-3-search-get) and [Search for issues using JQL (POST)](#api-rest-api-3-search-post) where the - * default is all navigable fields. - */ - fields?: string[]; - /** - * Whether fields in `fields` are referenced by keys rather than IDs. This parameter is useful where fields have been - * added by a connect app and a field's key may differ from its ID. - */ - fieldsByKeys?: boolean; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about the issues in the response. This parameter accepts a comma-separated list. Expand options - * include: - * - * - `renderedFields` Returns field values rendered in HTML format. - * - `names` Returns the display name of each field. - * - `schema` Returns the schema describing a field type. - * - `transitions` Returns all possible transitions for the issue. - * - `editmeta` Returns information about how each field can be edited. - * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. - * - `versionedRepresentations` Returns a JSON array for each version of a field's value, with the highest number - * representing the most recent version. Note: When included in the request, the `fields` parameter is ignored. - */ - expand?: - | 'renderedFields' - | 'name' - | 'schema' - | 'transitions' - | 'editmeta' - | 'changelog' - | 'versionedRepresentations' - | ('renderedFields' | 'name' | 'schema' | 'transitions' | 'editmeta' | 'changelog' | 'versionedRepresentations')[] - | string - | string[]; - /** - * A list of issue properties to return for the issue. This parameter accepts a comma-separated list. Allowed values: - * - * `*all` Returns all issue properties. Any issue property key, prefixed with a minus to exclude. - * - * Examples: - * - * `*all` Returns all properties. `*all,-prop1` Returns all properties except `prop1`. `prop1,prop2` Returns `prop1` - * and `prop2` properties. - * - * This parameter may be specified multiple times. For example, `properties=prop1,prop2& properties=prop3`. - */ - properties?: string[]; - /** - * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown - * under **Projects** in Jira. This also populates the [JQL issues search](#api-rest-api-3-search-get) `lastViewed` - * field. - */ - updateHistory?: boolean; -} diff --git a/src/version3/parameters/getIssueFieldOption.ts b/src/version3/parameters/getIssueFieldOption.mts similarity index 100% rename from src/version3/parameters/getIssueFieldOption.ts rename to src/version3/parameters/getIssueFieldOption.mts diff --git a/src/version3/parameters/getIssueLink.ts b/src/version3/parameters/getIssueLink.mts similarity index 100% rename from src/version3/parameters/getIssueLink.ts rename to src/version3/parameters/getIssueLink.mts diff --git a/src/version3/parameters/getIssueLinkType.ts b/src/version3/parameters/getIssueLinkType.mts similarity index 100% rename from src/version3/parameters/getIssueLinkType.ts rename to src/version3/parameters/getIssueLinkType.mts diff --git a/src/version3/parameters/getIssuePickerResource.mts b/src/version3/parameters/getIssuePickerResource.mts new file mode 100644 index 000000000..aed2154c1 --- /dev/null +++ b/src/version3/parameters/getIssuePickerResource.mts @@ -0,0 +1,23 @@ +export interface GetIssuePickerResource { + /** A string to match against text fields in the issue such as title, description, or comments. */ + query?: string; + /** + * A Jql query defining a list of issues to search for the query term. Note that `username` and `userkey` cannot be + * used as search terms for this parameter, due to privacy reasons. Use `accountId` instead. + */ + currentJQL?: string; + /** + * The key of an issue to exclude from search results. For example, the issue the user is viewing when they perform + * this query. + */ + currentIssueKey?: string; + /** The ID of a project that suggested issues must belong to. */ + currentProjectId?: string; + /** Indicate whether to include subtasks in the suggestions list. */ + showSubTasks?: boolean; + /** + * When `currentIssueKey` is a subtask, whether to include the parent issue in the suggestions if it matches the + * query. + */ + showSubTaskParent?: boolean; +} diff --git a/src/version3/parameters/getIssuePickerResource.ts b/src/version3/parameters/getIssuePickerResource.ts deleted file mode 100644 index 762048d32..000000000 --- a/src/version3/parameters/getIssuePickerResource.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface GetIssuePickerResource { - /** A string to match against text fields in the issue such as title, description, or comments. */ - query?: string; - /** - * A JQL query defining a list of issues to search for the query term. Note that `username` and `userkey` cannot be - * used as search terms for this parameter, due to privacy reasons. Use `accountId` instead. - */ - currentJQL?: string; - /** - * The key of an issue to exclude from search results. For example, the issue the user is viewing when they perform - * this query. - */ - currentIssueKey?: string; - /** The ID of a project that suggested issues must belong to. */ - currentProjectId?: string; - /** Indicate whether to include subtasks in the suggestions list. */ - showSubTasks?: boolean; - /** - * When `currentIssueKey` is a subtask, whether to include the parent issue in the suggestions if it matches the - * query. - */ - showSubTaskParent?: boolean; -} diff --git a/src/version3/parameters/getIssueProperty.ts b/src/version3/parameters/getIssueProperty.mts similarity index 100% rename from src/version3/parameters/getIssueProperty.ts rename to src/version3/parameters/getIssueProperty.mts diff --git a/src/version3/parameters/getIssuePropertyKeys.ts b/src/version3/parameters/getIssuePropertyKeys.mts similarity index 100% rename from src/version3/parameters/getIssuePropertyKeys.ts rename to src/version3/parameters/getIssuePropertyKeys.mts diff --git a/src/version3/parameters/getIssueSecurityLevel.ts b/src/version3/parameters/getIssueSecurityLevel.mts similarity index 100% rename from src/version3/parameters/getIssueSecurityLevel.ts rename to src/version3/parameters/getIssueSecurityLevel.mts diff --git a/src/version3/parameters/getIssueSecurityLevelMembers.ts b/src/version3/parameters/getIssueSecurityLevelMembers.mts similarity index 100% rename from src/version3/parameters/getIssueSecurityLevelMembers.ts rename to src/version3/parameters/getIssueSecurityLevelMembers.mts diff --git a/src/version3/parameters/getIssueSecurityScheme.ts b/src/version3/parameters/getIssueSecurityScheme.mts similarity index 100% rename from src/version3/parameters/getIssueSecurityScheme.ts rename to src/version3/parameters/getIssueSecurityScheme.mts diff --git a/src/version3/parameters/getIssueType.ts b/src/version3/parameters/getIssueType.mts similarity index 100% rename from src/version3/parameters/getIssueType.ts rename to src/version3/parameters/getIssueType.mts diff --git a/src/version3/parameters/getIssueTypeMappingsForContexts.ts b/src/version3/parameters/getIssueTypeMappingsForContexts.mts similarity index 100% rename from src/version3/parameters/getIssueTypeMappingsForContexts.ts rename to src/version3/parameters/getIssueTypeMappingsForContexts.mts diff --git a/src/version3/parameters/getIssueTypeProperty.ts b/src/version3/parameters/getIssueTypeProperty.mts similarity index 100% rename from src/version3/parameters/getIssueTypeProperty.ts rename to src/version3/parameters/getIssueTypeProperty.mts diff --git a/src/version3/parameters/getIssueTypePropertyKeys.ts b/src/version3/parameters/getIssueTypePropertyKeys.mts similarity index 100% rename from src/version3/parameters/getIssueTypePropertyKeys.ts rename to src/version3/parameters/getIssueTypePropertyKeys.mts diff --git a/src/version3/parameters/getIssueTypeSchemeForProjects.ts b/src/version3/parameters/getIssueTypeSchemeForProjects.mts similarity index 100% rename from src/version3/parameters/getIssueTypeSchemeForProjects.ts rename to src/version3/parameters/getIssueTypeSchemeForProjects.mts diff --git a/src/version3/parameters/getIssueTypeSchemesMapping.ts b/src/version3/parameters/getIssueTypeSchemesMapping.mts similarity index 100% rename from src/version3/parameters/getIssueTypeSchemesMapping.ts rename to src/version3/parameters/getIssueTypeSchemesMapping.mts diff --git a/src/version3/parameters/getIssueTypeScreenSchemeMappings.ts b/src/version3/parameters/getIssueTypeScreenSchemeMappings.mts similarity index 100% rename from src/version3/parameters/getIssueTypeScreenSchemeMappings.ts rename to src/version3/parameters/getIssueTypeScreenSchemeMappings.mts diff --git a/src/version3/parameters/getIssueTypeScreenSchemeProjectAssociations.ts b/src/version3/parameters/getIssueTypeScreenSchemeProjectAssociations.mts similarity index 100% rename from src/version3/parameters/getIssueTypeScreenSchemeProjectAssociations.ts rename to src/version3/parameters/getIssueTypeScreenSchemeProjectAssociations.mts diff --git a/src/version3/parameters/getIssueTypeScreenSchemes.ts b/src/version3/parameters/getIssueTypeScreenSchemes.mts similarity index 100% rename from src/version3/parameters/getIssueTypeScreenSchemes.ts rename to src/version3/parameters/getIssueTypeScreenSchemes.mts diff --git a/src/version3/parameters/getIssueTypesForProject.ts b/src/version3/parameters/getIssueTypesForProject.mts similarity index 100% rename from src/version3/parameters/getIssueTypesForProject.ts rename to src/version3/parameters/getIssueTypesForProject.mts diff --git a/src/version3/parameters/getIssueWatchers.ts b/src/version3/parameters/getIssueWatchers.mts similarity index 100% rename from src/version3/parameters/getIssueWatchers.ts rename to src/version3/parameters/getIssueWatchers.mts diff --git a/src/version3/parameters/getIssueWorklog.ts b/src/version3/parameters/getIssueWorklog.mts similarity index 100% rename from src/version3/parameters/getIssueWorklog.ts rename to src/version3/parameters/getIssueWorklog.mts diff --git a/src/version3/parameters/getMyFilters.ts b/src/version3/parameters/getMyFilters.mts similarity index 100% rename from src/version3/parameters/getMyFilters.ts rename to src/version3/parameters/getMyFilters.mts diff --git a/src/version3/parameters/getMyPermissions.ts b/src/version3/parameters/getMyPermissions.mts similarity index 100% rename from src/version3/parameters/getMyPermissions.ts rename to src/version3/parameters/getMyPermissions.mts diff --git a/src/version3/parameters/getNotificationScheme.ts b/src/version3/parameters/getNotificationScheme.mts similarity index 100% rename from src/version3/parameters/getNotificationScheme.ts rename to src/version3/parameters/getNotificationScheme.mts diff --git a/src/version3/parameters/getNotificationSchemeToProjectMappings.ts b/src/version3/parameters/getNotificationSchemeToProjectMappings.mts similarity index 100% rename from src/version3/parameters/getNotificationSchemeToProjectMappings.ts rename to src/version3/parameters/getNotificationSchemeToProjectMappings.mts diff --git a/src/version3/parameters/getNotificationSchemes.ts b/src/version3/parameters/getNotificationSchemes.mts similarity index 100% rename from src/version3/parameters/getNotificationSchemes.ts rename to src/version3/parameters/getNotificationSchemes.mts diff --git a/src/version3/parameters/getOptionsForContext.ts b/src/version3/parameters/getOptionsForContext.mts similarity index 100% rename from src/version3/parameters/getOptionsForContext.ts rename to src/version3/parameters/getOptionsForContext.mts diff --git a/src/version3/parameters/getPermissionScheme.ts b/src/version3/parameters/getPermissionScheme.mts similarity index 100% rename from src/version3/parameters/getPermissionScheme.ts rename to src/version3/parameters/getPermissionScheme.mts diff --git a/src/version3/parameters/getPermissionSchemeGrant.ts b/src/version3/parameters/getPermissionSchemeGrant.mts similarity index 100% rename from src/version3/parameters/getPermissionSchemeGrant.ts rename to src/version3/parameters/getPermissionSchemeGrant.mts diff --git a/src/version3/parameters/getPermissionSchemeGrants.ts b/src/version3/parameters/getPermissionSchemeGrants.mts similarity index 100% rename from src/version3/parameters/getPermissionSchemeGrants.ts rename to src/version3/parameters/getPermissionSchemeGrants.mts diff --git a/src/version3/parameters/getPermittedProjects.mts b/src/version3/parameters/getPermittedProjects.mts new file mode 100644 index 000000000..8f4096475 --- /dev/null +++ b/src/version3/parameters/getPermittedProjects.mts @@ -0,0 +1,3 @@ +import { PermissionsKeys } from '../models/index.mjs'; + +export interface GetPermittedProjects extends PermissionsKeys {} diff --git a/src/version3/parameters/getPermittedProjects.ts b/src/version3/parameters/getPermittedProjects.ts deleted file mode 100644 index 1c8b6a94b..000000000 --- a/src/version3/parameters/getPermittedProjects.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { PermissionsKeys } from '../models/index.js'; - -export interface GetPermittedProjects extends PermissionsKeys {} diff --git a/src/version3/parameters/getPrecomputations.ts b/src/version3/parameters/getPrecomputations.mts similarity index 100% rename from src/version3/parameters/getPrecomputations.ts rename to src/version3/parameters/getPrecomputations.mts diff --git a/src/version3/parameters/getPreference.ts b/src/version3/parameters/getPreference.mts similarity index 100% rename from src/version3/parameters/getPreference.ts rename to src/version3/parameters/getPreference.mts diff --git a/src/version3/parameters/getPriority.ts b/src/version3/parameters/getPriority.mts similarity index 100% rename from src/version3/parameters/getPriority.ts rename to src/version3/parameters/getPriority.mts diff --git a/src/version3/parameters/getProject.ts b/src/version3/parameters/getProject.mts similarity index 100% rename from src/version3/parameters/getProject.ts rename to src/version3/parameters/getProject.mts diff --git a/src/version3/parameters/getProjectCategoryById.ts b/src/version3/parameters/getProjectCategoryById.mts similarity index 100% rename from src/version3/parameters/getProjectCategoryById.ts rename to src/version3/parameters/getProjectCategoryById.mts diff --git a/src/version3/parameters/getProjectComponents.ts b/src/version3/parameters/getProjectComponents.mts similarity index 100% rename from src/version3/parameters/getProjectComponents.ts rename to src/version3/parameters/getProjectComponents.mts diff --git a/src/version3/parameters/getProjectComponentsPaginated.ts b/src/version3/parameters/getProjectComponentsPaginated.mts similarity index 100% rename from src/version3/parameters/getProjectComponentsPaginated.ts rename to src/version3/parameters/getProjectComponentsPaginated.mts diff --git a/src/version3/parameters/getProjectContextMapping.ts b/src/version3/parameters/getProjectContextMapping.mts similarity index 100% rename from src/version3/parameters/getProjectContextMapping.ts rename to src/version3/parameters/getProjectContextMapping.mts diff --git a/src/version3/parameters/getProjectEmail.ts b/src/version3/parameters/getProjectEmail.mts similarity index 100% rename from src/version3/parameters/getProjectEmail.ts rename to src/version3/parameters/getProjectEmail.mts diff --git a/src/version3/parameters/getProjectIssueSecurityScheme.ts b/src/version3/parameters/getProjectIssueSecurityScheme.mts similarity index 100% rename from src/version3/parameters/getProjectIssueSecurityScheme.ts rename to src/version3/parameters/getProjectIssueSecurityScheme.mts diff --git a/src/version3/parameters/getProjectProperty.ts b/src/version3/parameters/getProjectProperty.mts similarity index 100% rename from src/version3/parameters/getProjectProperty.ts rename to src/version3/parameters/getProjectProperty.mts diff --git a/src/version3/parameters/getProjectPropertyKeys.ts b/src/version3/parameters/getProjectPropertyKeys.mts similarity index 100% rename from src/version3/parameters/getProjectPropertyKeys.ts rename to src/version3/parameters/getProjectPropertyKeys.mts diff --git a/src/version3/parameters/getProjectRole.ts b/src/version3/parameters/getProjectRole.mts similarity index 100% rename from src/version3/parameters/getProjectRole.ts rename to src/version3/parameters/getProjectRole.mts diff --git a/src/version3/parameters/getProjectRoleActorsForRole.ts b/src/version3/parameters/getProjectRoleActorsForRole.mts similarity index 100% rename from src/version3/parameters/getProjectRoleActorsForRole.ts rename to src/version3/parameters/getProjectRoleActorsForRole.mts diff --git a/src/version3/parameters/getProjectRoleById.ts b/src/version3/parameters/getProjectRoleById.mts similarity index 100% rename from src/version3/parameters/getProjectRoleById.ts rename to src/version3/parameters/getProjectRoleById.mts diff --git a/src/version3/parameters/getProjectRoleDetails.ts b/src/version3/parameters/getProjectRoleDetails.mts similarity index 100% rename from src/version3/parameters/getProjectRoleDetails.ts rename to src/version3/parameters/getProjectRoleDetails.mts diff --git a/src/version3/parameters/getProjectRoles.ts b/src/version3/parameters/getProjectRoles.mts similarity index 100% rename from src/version3/parameters/getProjectRoles.ts rename to src/version3/parameters/getProjectRoles.mts diff --git a/src/version3/parameters/getProjectTypeByKey.ts b/src/version3/parameters/getProjectTypeByKey.mts similarity index 100% rename from src/version3/parameters/getProjectTypeByKey.ts rename to src/version3/parameters/getProjectTypeByKey.mts diff --git a/src/version3/parameters/getProjectVersions.ts b/src/version3/parameters/getProjectVersions.mts similarity index 100% rename from src/version3/parameters/getProjectVersions.ts rename to src/version3/parameters/getProjectVersions.mts diff --git a/src/version3/parameters/getProjectVersionsPaginated.ts b/src/version3/parameters/getProjectVersionsPaginated.mts similarity index 100% rename from src/version3/parameters/getProjectVersionsPaginated.ts rename to src/version3/parameters/getProjectVersionsPaginated.mts diff --git a/src/version3/parameters/getProjectsForIssueTypeScreenScheme.ts b/src/version3/parameters/getProjectsForIssueTypeScreenScheme.mts similarity index 100% rename from src/version3/parameters/getProjectsForIssueTypeScreenScheme.ts rename to src/version3/parameters/getProjectsForIssueTypeScreenScheme.mts diff --git a/src/version3/parameters/getRecent.ts b/src/version3/parameters/getRecent.mts similarity index 100% rename from src/version3/parameters/getRecent.ts rename to src/version3/parameters/getRecent.mts diff --git a/src/version3/parameters/getRemoteIssueLinkById.ts b/src/version3/parameters/getRemoteIssueLinkById.mts similarity index 100% rename from src/version3/parameters/getRemoteIssueLinkById.ts rename to src/version3/parameters/getRemoteIssueLinkById.mts diff --git a/src/version3/parameters/getRemoteIssueLinks.ts b/src/version3/parameters/getRemoteIssueLinks.mts similarity index 100% rename from src/version3/parameters/getRemoteIssueLinks.ts rename to src/version3/parameters/getRemoteIssueLinks.mts diff --git a/src/version3/parameters/getScreenSchemes.ts b/src/version3/parameters/getScreenSchemes.mts similarity index 100% rename from src/version3/parameters/getScreenSchemes.ts rename to src/version3/parameters/getScreenSchemes.mts diff --git a/src/version3/parameters/getScreens.ts b/src/version3/parameters/getScreens.mts similarity index 100% rename from src/version3/parameters/getScreens.ts rename to src/version3/parameters/getScreens.mts diff --git a/src/version3/parameters/getScreensForField.ts b/src/version3/parameters/getScreensForField.mts similarity index 100% rename from src/version3/parameters/getScreensForField.ts rename to src/version3/parameters/getScreensForField.mts diff --git a/src/version3/parameters/getSecurityLevelMembers.ts b/src/version3/parameters/getSecurityLevelMembers.mts similarity index 100% rename from src/version3/parameters/getSecurityLevelMembers.ts rename to src/version3/parameters/getSecurityLevelMembers.mts diff --git a/src/version3/parameters/getSecurityLevels.ts b/src/version3/parameters/getSecurityLevels.mts similarity index 100% rename from src/version3/parameters/getSecurityLevels.ts rename to src/version3/parameters/getSecurityLevels.mts diff --git a/src/version3/parameters/getSecurityLevelsForProject.ts b/src/version3/parameters/getSecurityLevelsForProject.mts similarity index 100% rename from src/version3/parameters/getSecurityLevelsForProject.ts rename to src/version3/parameters/getSecurityLevelsForProject.mts diff --git a/src/version3/parameters/getSelectableIssueFieldOptions.ts b/src/version3/parameters/getSelectableIssueFieldOptions.mts similarity index 100% rename from src/version3/parameters/getSelectableIssueFieldOptions.ts rename to src/version3/parameters/getSelectableIssueFieldOptions.mts diff --git a/src/version3/parameters/getSharePermission.ts b/src/version3/parameters/getSharePermission.mts similarity index 100% rename from src/version3/parameters/getSharePermission.ts rename to src/version3/parameters/getSharePermission.mts diff --git a/src/version3/parameters/getSharePermissions.ts b/src/version3/parameters/getSharePermissions.mts similarity index 100% rename from src/version3/parameters/getSharePermissions.ts rename to src/version3/parameters/getSharePermissions.mts diff --git a/src/version3/parameters/getStatus.ts b/src/version3/parameters/getStatus.mts similarity index 100% rename from src/version3/parameters/getStatus.ts rename to src/version3/parameters/getStatus.mts diff --git a/src/version3/parameters/getStatusCategory.ts b/src/version3/parameters/getStatusCategory.mts similarity index 100% rename from src/version3/parameters/getStatusCategory.ts rename to src/version3/parameters/getStatusCategory.mts diff --git a/src/version3/parameters/getStatusesById.ts b/src/version3/parameters/getStatusesById.mts similarity index 100% rename from src/version3/parameters/getStatusesById.ts rename to src/version3/parameters/getStatusesById.mts diff --git a/src/version3/parameters/getTask.ts b/src/version3/parameters/getTask.mts similarity index 100% rename from src/version3/parameters/getTask.ts rename to src/version3/parameters/getTask.mts diff --git a/src/version3/parameters/getTransitions.ts b/src/version3/parameters/getTransitions.mts similarity index 100% rename from src/version3/parameters/getTransitions.ts rename to src/version3/parameters/getTransitions.mts diff --git a/src/version3/parameters/getTrashedFieldsPaginated.ts b/src/version3/parameters/getTrashedFieldsPaginated.mts similarity index 100% rename from src/version3/parameters/getTrashedFieldsPaginated.ts rename to src/version3/parameters/getTrashedFieldsPaginated.mts diff --git a/src/version3/parameters/getUiModifications.ts b/src/version3/parameters/getUiModifications.mts similarity index 100% rename from src/version3/parameters/getUiModifications.ts rename to src/version3/parameters/getUiModifications.mts diff --git a/src/version3/parameters/getUser.ts b/src/version3/parameters/getUser.mts similarity index 100% rename from src/version3/parameters/getUser.ts rename to src/version3/parameters/getUser.mts diff --git a/src/version3/parameters/getUserDefaultColumns.ts b/src/version3/parameters/getUserDefaultColumns.mts similarity index 100% rename from src/version3/parameters/getUserDefaultColumns.ts rename to src/version3/parameters/getUserDefaultColumns.mts diff --git a/src/version3/parameters/getUserEmail.ts b/src/version3/parameters/getUserEmail.mts similarity index 100% rename from src/version3/parameters/getUserEmail.ts rename to src/version3/parameters/getUserEmail.mts diff --git a/src/version3/parameters/getUserEmailBulk.ts b/src/version3/parameters/getUserEmailBulk.mts similarity index 100% rename from src/version3/parameters/getUserEmailBulk.ts rename to src/version3/parameters/getUserEmailBulk.mts diff --git a/src/version3/parameters/getUserGroups.ts b/src/version3/parameters/getUserGroups.mts similarity index 100% rename from src/version3/parameters/getUserGroups.ts rename to src/version3/parameters/getUserGroups.mts diff --git a/src/version3/parameters/getUserProperty.ts b/src/version3/parameters/getUserProperty.mts similarity index 100% rename from src/version3/parameters/getUserProperty.ts rename to src/version3/parameters/getUserProperty.mts diff --git a/src/version3/parameters/getUserPropertyKeys.ts b/src/version3/parameters/getUserPropertyKeys.mts similarity index 100% rename from src/version3/parameters/getUserPropertyKeys.ts rename to src/version3/parameters/getUserPropertyKeys.mts diff --git a/src/version3/parameters/getUsersFromGroup.ts b/src/version3/parameters/getUsersFromGroup.mts similarity index 100% rename from src/version3/parameters/getUsersFromGroup.ts rename to src/version3/parameters/getUsersFromGroup.mts diff --git a/src/version3/parameters/getValidProjectKey.ts b/src/version3/parameters/getValidProjectKey.mts similarity index 100% rename from src/version3/parameters/getValidProjectKey.ts rename to src/version3/parameters/getValidProjectKey.mts diff --git a/src/version3/parameters/getValidProjectName.ts b/src/version3/parameters/getValidProjectName.mts similarity index 100% rename from src/version3/parameters/getValidProjectName.ts rename to src/version3/parameters/getValidProjectName.mts diff --git a/src/version3/parameters/getVersion.ts b/src/version3/parameters/getVersion.mts similarity index 100% rename from src/version3/parameters/getVersion.ts rename to src/version3/parameters/getVersion.mts diff --git a/src/version3/parameters/getVersionRelatedIssues.ts b/src/version3/parameters/getVersionRelatedIssues.mts similarity index 100% rename from src/version3/parameters/getVersionRelatedIssues.ts rename to src/version3/parameters/getVersionRelatedIssues.mts diff --git a/src/version3/parameters/getVersionUnresolvedIssues.ts b/src/version3/parameters/getVersionUnresolvedIssues.mts similarity index 100% rename from src/version3/parameters/getVersionUnresolvedIssues.ts rename to src/version3/parameters/getVersionUnresolvedIssues.mts diff --git a/src/version3/parameters/getVisibleIssueFieldOptions.ts b/src/version3/parameters/getVisibleIssueFieldOptions.mts similarity index 100% rename from src/version3/parameters/getVisibleIssueFieldOptions.ts rename to src/version3/parameters/getVisibleIssueFieldOptions.mts diff --git a/src/version3/parameters/getVotes.ts b/src/version3/parameters/getVotes.mts similarity index 100% rename from src/version3/parameters/getVotes.ts rename to src/version3/parameters/getVotes.mts diff --git a/src/version3/parameters/getWorkflow.ts b/src/version3/parameters/getWorkflow.mts similarity index 100% rename from src/version3/parameters/getWorkflow.ts rename to src/version3/parameters/getWorkflow.mts diff --git a/src/version3/parameters/getWorkflowScheme.ts b/src/version3/parameters/getWorkflowScheme.mts similarity index 100% rename from src/version3/parameters/getWorkflowScheme.ts rename to src/version3/parameters/getWorkflowScheme.mts diff --git a/src/version3/parameters/getWorkflowSchemeDraft.ts b/src/version3/parameters/getWorkflowSchemeDraft.mts similarity index 100% rename from src/version3/parameters/getWorkflowSchemeDraft.ts rename to src/version3/parameters/getWorkflowSchemeDraft.mts diff --git a/src/version3/parameters/getWorkflowSchemeDraftIssueType.ts b/src/version3/parameters/getWorkflowSchemeDraftIssueType.mts similarity index 100% rename from src/version3/parameters/getWorkflowSchemeDraftIssueType.ts rename to src/version3/parameters/getWorkflowSchemeDraftIssueType.mts diff --git a/src/version3/parameters/getWorkflowSchemeIssueType.ts b/src/version3/parameters/getWorkflowSchemeIssueType.mts similarity index 100% rename from src/version3/parameters/getWorkflowSchemeIssueType.ts rename to src/version3/parameters/getWorkflowSchemeIssueType.mts diff --git a/src/version3/parameters/getWorkflowSchemeProjectAssociations.ts b/src/version3/parameters/getWorkflowSchemeProjectAssociations.mts similarity index 100% rename from src/version3/parameters/getWorkflowSchemeProjectAssociations.ts rename to src/version3/parameters/getWorkflowSchemeProjectAssociations.mts diff --git a/src/version3/parameters/getWorkflowTransitionProperties.ts b/src/version3/parameters/getWorkflowTransitionProperties.mts similarity index 100% rename from src/version3/parameters/getWorkflowTransitionProperties.ts rename to src/version3/parameters/getWorkflowTransitionProperties.mts diff --git a/src/version3/parameters/getWorkflowTransitionRuleConfigurations.ts b/src/version3/parameters/getWorkflowTransitionRuleConfigurations.mts similarity index 100% rename from src/version3/parameters/getWorkflowTransitionRuleConfigurations.ts rename to src/version3/parameters/getWorkflowTransitionRuleConfigurations.mts diff --git a/src/version3/parameters/getWorkflowsPaginated.ts b/src/version3/parameters/getWorkflowsPaginated.mts similarity index 100% rename from src/version3/parameters/getWorkflowsPaginated.ts rename to src/version3/parameters/getWorkflowsPaginated.mts diff --git a/src/version3/parameters/getWorklog.ts b/src/version3/parameters/getWorklog.mts similarity index 100% rename from src/version3/parameters/getWorklog.ts rename to src/version3/parameters/getWorklog.mts diff --git a/src/version3/parameters/getWorklogProperty.ts b/src/version3/parameters/getWorklogProperty.mts similarity index 100% rename from src/version3/parameters/getWorklogProperty.ts rename to src/version3/parameters/getWorklogProperty.mts diff --git a/src/version3/parameters/getWorklogPropertyKeys.ts b/src/version3/parameters/getWorklogPropertyKeys.mts similarity index 100% rename from src/version3/parameters/getWorklogPropertyKeys.ts rename to src/version3/parameters/getWorklogPropertyKeys.mts diff --git a/src/version3/parameters/getWorklogsForIds.mts b/src/version3/parameters/getWorklogsForIds.mts new file mode 100644 index 000000000..a2f3108fb --- /dev/null +++ b/src/version3/parameters/getWorklogsForIds.mts @@ -0,0 +1,10 @@ +import { WorklogIdsRequest } from '../models/index.mjs'; + +export interface GetWorklogsForIds extends WorklogIdsRequest { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about worklogs in the response. This parameter accepts `properties` that returns the properties of each + * worklog. + */ + expand?: string; +} diff --git a/src/version3/parameters/getWorklogsForIds.ts b/src/version3/parameters/getWorklogsForIds.ts deleted file mode 100644 index f0cbfb033..000000000 --- a/src/version3/parameters/getWorklogsForIds.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { WorklogIdsRequest } from '../models/index.js'; - -export interface GetWorklogsForIds extends WorklogIdsRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about worklogs in the response. This parameter accepts `properties` that returns the properties of each - * worklog. - */ - expand?: string; -} diff --git a/src/version3/parameters/index.mts b/src/version3/parameters/index.mts new file mode 100644 index 000000000..bbc8fa911 --- /dev/null +++ b/src/version3/parameters/index.mts @@ -0,0 +1,462 @@ +export * from './addActorUsers.mjs'; +export * from './addAttachment.mjs'; +export * from './addComment.mjs'; +export * from './addFieldToDefaultScreen.mjs'; +export * from './addGadget.mjs'; +export * from './addIssueTypesToContext.mjs'; +export * from './addIssueTypesToIssueTypeScheme.mjs'; +export * from './addProjectRoleActorsToRole.mjs'; +export * from './addScreenTab.mjs'; +export * from './addScreenTabField.mjs'; +export * from './addSecurityLevel.mjs'; +export * from './addSecurityLevelMembers.mjs'; +export * from './addSharePermission.mjs'; +export * from './addUserToGroup.mjs'; +export * from './addVote.mjs'; +export * from './addWatcher.mjs'; +export * from './addWorklog.mjs'; +export * from './analyseExpression.mjs'; +export * from './appendMappingsForIssueTypeScreenScheme.mjs'; +export * from './archiveIssues.mjs'; +export * from './archiveIssuesAsync.mjs'; +export * from './archiveProject.mjs'; +export * from './assignFieldConfigurationSchemeToProject.mjs'; +export * from './assignIssue.mjs'; +export * from './assignIssueTypeSchemeToProject.mjs'; +export * from './assignIssueTypeScreenSchemeToProject.mjs'; +export * from './assignPermissionScheme.mjs'; +export * from './assignProjectsToCustomFieldContext.mjs'; +export * from './assignSchemeToProject.mjs'; +export * from './associateSchemesToProjects.mjs'; +export * from './bulkDeleteIssueProperty.mjs'; +export * from './bulkEditDashboards.mjs'; +export * from './bulkGetGroups.mjs'; +export * from './bulkGetUsers.mjs'; +export * from './bulkGetUsersMigration.mjs'; +export * from './bulkSetIssuePropertiesByIssue.mjs'; +export * from './bulkSetIssueProperty.mjs'; +export * from './bulkSetIssuesProperties.mjs'; +export * from './cancelTask.mjs'; +export * from './changeFilterOwner.mjs'; +export * from './copyDashboard.mjs'; +export * from './createComponent.mjs'; +export * from './createCustomField.mjs'; +export * from './createCustomFieldContext.mjs'; +export * from './createCustomFieldOption.mjs'; +export * from './createDashboard.mjs'; +export * from './createFieldConfiguration.mjs'; +export * from './createFieldConfigurationScheme.mjs'; +export * from './createFilter.mjs'; +export * from './createGroup.mjs'; +export * from './createIssue.mjs'; +export * from './createIssueFieldOption.mjs'; +export * from './createIssueLinkType.mjs'; +export * from './createIssues.mjs'; +export * from './createIssueSecurityScheme.mjs'; +export * from './createIssueType.mjs'; +export * from './createIssueTypeAvatar.mjs'; +export * from './createIssueTypeScheme.mjs'; +export * from './createIssueTypeScreenScheme.mjs'; +export * from './createNotificationScheme.mjs'; +export * from './createOrUpdateRemoteIssueLink.mjs'; +export * from './createPermissionGrant.mjs'; +export * from './createPermissionScheme.mjs'; +export * from './createPriority.mjs'; +export * from './createProject.mjs'; +export * from './createProjectAvatar.mjs'; +export * from './createProjectCategory.mjs'; +export * from './createProjectRole.mjs'; +export * from './createResolution.mjs'; +export * from './createScreen.mjs'; +export * from './createScreenScheme.mjs'; +export * from './createStatuses.mjs'; +export * from './createUiModification.mjs'; +export * from './createUser.mjs'; +export * from './createVersion.mjs'; +export * from './createWorkflow.mjs'; +export * from './createWorkflowScheme.mjs'; +export * from './createWorkflowSchemeDraftFromParent.mjs'; +export * from './createWorkflowTransitionProperty.mjs'; +export * from './deleteActor.mjs'; +export * from './deleteAddonProperty.mjs'; +export * from './deleteAndReplaceVersion.mjs'; +export * from './deleteAppProperty.mjs'; +export * from './deleteAvatar.mjs'; +export * from './deleteComment.mjs'; +export * from './deleteCommentProperty.mjs'; +export * from './deleteComponent.mjs'; +export * from './deleteCustomField.mjs'; +export * from './deleteCustomFieldContext.mjs'; +export * from './deleteCustomFieldOption.mjs'; +export * from './deleteDashboard.mjs'; +export * from './deleteDashboardItemProperty.mjs'; +export * from './deleteDefaultWorkflow.mjs'; +export * from './deleteDraftDefaultWorkflow.mjs'; +export * from './deleteDraftWorkflowMapping.mjs'; +export * from './deleteFavouriteForFilter.mjs'; +export * from './deleteFieldConfiguration.mjs'; +export * from './deleteFieldConfigurationScheme.mjs'; +export * from './deleteFilter.mjs'; +export * from './deleteInactiveWorkflow.mjs'; +export * from './deleteIssue.mjs'; +export * from './deleteIssueFieldOption.mjs'; +export * from './deleteIssueLink.mjs'; +export * from './deleteIssueLinkType.mjs'; +export * from './deleteIssueProperty.mjs'; +export * from './deleteIssueType.mjs'; +export * from './deleteIssueTypeProperty.mjs'; +export * from './deleteIssueTypeScheme.mjs'; +export * from './deleteIssueTypeScreenScheme.mjs'; +export * from './deleteNotificationScheme.mjs'; +export * from './deletePermissionScheme.mjs'; +export * from './deletePermissionSchemeEntity.mjs'; +export * from './deleteProject.mjs'; +export * from './deleteProjectAsynchronously.mjs'; +export * from './deleteProjectAvatar.mjs'; +export * from './deleteProjectProperty.mjs'; +export * from './deleteProjectRole.mjs'; +export * from './deleteProjectRoleActorsFromRole.mjs'; +export * from './deleteRemoteIssueLinkByGlobalId.mjs'; +export * from './deleteRemoteIssueLinkById.mjs'; +export * from './deleteResolution.mjs'; +export * from './deleteScreen.mjs'; +export * from './deleteScreenScheme.mjs'; +export * from './deleteScreenTab.mjs'; +export * from './deleteSecurityScheme.mjs'; +export * from './deleteSharePermission.mjs'; +export * from './deleteStatusesById.mjs'; +export * from './deleteUiModification.mjs'; +export * from './deleteUserProperty.mjs'; +export * from './deleteWebhookById.mjs'; +export * from './deleteWorkflowMapping.mjs'; +export * from './deleteWorkflowScheme.mjs'; +export * from './deleteWorkflowSchemeDraft.mjs'; +export * from './deleteWorkflowSchemeDraftIssueType.mjs'; +export * from './deleteWorkflowSchemeIssueType.mjs'; +export * from './deleteWorkflowTransitionProperty.mjs'; +export * from './deleteWorkflowTransitionRuleConfigurations.mjs'; +export * from './deleteWorklog.mjs'; +export * from './deleteWorklogProperty.mjs'; +export * from './doTransition.mjs'; +export * from './editIssue.mjs'; +export * from './evaluateJiraExpression.mjs'; +export * from './expandAttachmentForHumans.mjs'; +export * from './expandAttachmentForMachines.mjs'; +export * from './exportArchivedIssues.mjs'; +export * from './findAssignableUsers.mjs'; +export * from './findBulkAssignableUsers.mjs'; +export * from './findGroups.mjs'; +export * from './findUserKeysByQuery.mjs'; +export * from './findUsers.mjs'; +export * from './findUsersAndGroups.mjs'; +export * from './findUsersByQuery.mjs'; +export * from './findUsersForPicker.mjs'; +export * from './findUsersWithAllPermissions.mjs'; +export * from './findUsersWithBrowsePermission.mjs'; +export * from './fullyUpdateProjectRole.mjs'; +export * from './getAccessibleProjectTypeByKey.mjs'; +export * from './getAddonProperties.mjs'; +export * from './getAddonProperty.mjs'; +export * from './getAllDashboards.mjs'; +export * from './getAllFieldConfigurations.mjs'; +export * from './getAllFieldConfigurationSchemes.mjs'; +export * from './getAllGadgets.mjs'; +export * from './getAllIssueFieldOptions.mjs'; +export * from './getAllIssueTypeSchemes.mjs'; +export * from './getAllLabels.mjs'; +export * from './getAllPermissionSchemes.mjs'; +export * from './getAllProjectAvatars.mjs'; +export * from './getAllScreenTabFields.mjs'; +export * from './getAllScreenTabs.mjs'; +export * from './getAllStatuses.mjs'; +export * from './getAllSystemAvatars.mjs'; +export * from './getAllUsers.mjs'; +export * from './getAllUsersDefault.mjs'; +export * from './getAllWorkflowSchemes.mjs'; +export * from './getAlternativeIssueTypes.mjs'; +export * from './getApplicationProperty.mjs'; +export * from './getApplicationRole.mjs'; +export * from './getAssignedPermissionScheme.mjs'; +export * from './getAttachment.mjs'; +export * from './getAttachmentContent.mjs'; +export * from './getAttachmentThumbnail.mjs'; +export * from './getAuditRecords.mjs'; +export * from './getAutoCompletePost.mjs'; +export * from './getAvailableScreenFields.mjs'; +export * from './getAvatarImageByID.mjs'; +export * from './getAvatarImageByOwner.mjs'; +export * from './getAvatarImageByType.mjs'; +export * from './getAvatars.mjs'; +export * from './getBulkPermissions.mjs'; +export * from './getChangeLogs.mjs'; +export * from './getChangeLogsByIds.mjs'; +export * from './getColumns.mjs'; +export * from './getComment.mjs'; +export * from './getCommentProperty.mjs'; +export * from './getCommentPropertyKeys.mjs'; +export * from './getComments.mjs'; +export * from './getCommentsByIds.mjs'; +export * from './getComponent.mjs'; +export * from './getComponentRelatedIssues.mjs'; +export * from './getContextsForField.mjs'; +export * from './getCreateIssueMeta.mjs'; +export * from './getCurrentUser.mjs'; +export * from './getCustomFieldConfiguration.mjs'; +export * from './getCustomFieldContextsForProjectsAndIssueTypes.mjs'; +export * from './getCustomFieldOption.mjs'; +export * from './getDashboard.mjs'; +export * from './getDashboardItemProperty.mjs'; +export * from './getDashboardItemPropertyKeys.mjs'; +export * from './getDashboardsPaginated.mjs'; +export * from './getDefaultValues.mjs'; +export * from './getDefaultWorkflow.mjs'; +export * from './getDraftDefaultWorkflow.mjs'; +export * from './getDraftWorkflow.mjs'; +export * from './getDynamicWebhooksForApp.mjs'; +export * from './getEditIssueMeta.mjs'; +export * from './getFailedWebhooks.mjs'; +export * from './getFavouriteFilters.mjs'; +export * from './getFeaturesForProject.mjs'; +export * from './getFieldAutoCompleteForQueryString.mjs'; +export * from './getFieldConfigurationItems.mjs'; +export * from './getFieldConfigurationSchemeMappings.mjs'; +export * from './getFieldConfigurationSchemeProjectMapping.mjs'; +export * from './getFieldsPaginated.mjs'; +export * from './getFilter.mjs'; +export * from './getFiltersPaginated.mjs'; +export * from './getHierarchy.mjs'; +export * from './getIdsOfWorklogsDeletedSince.mjs'; +export * from './getIdsOfWorklogsModifiedSince.mjs'; +export * from './getIssue.mjs'; +export * from './getIssueFieldOption.mjs'; +export * from './getIssueLink.mjs'; +export * from './getIssueLinkType.mjs'; +export * from './getIssuePickerResource.mjs'; +export * from './getIssueProperty.mjs'; +export * from './getIssuePropertyKeys.mjs'; +export * from './getIssueSecurityLevel.mjs'; +export * from './getIssueSecurityLevelMembers.mjs'; +export * from './getIssueSecurityScheme.mjs'; +export * from './getIssueType.mjs'; +export * from './getIssueTypeMappingsForContexts.mjs'; +export * from './getIssueTypeProperty.mjs'; +export * from './getIssueTypePropertyKeys.mjs'; +export * from './getIssueTypeSchemeForProjects.mjs'; +export * from './getIssueTypeSchemesMapping.mjs'; +export * from './getIssueTypeScreenSchemeMappings.mjs'; +export * from './getIssueTypeScreenSchemeProjectAssociations.mjs'; +export * from './getIssueTypeScreenSchemes.mjs'; +export * from './getIssueTypesForProject.mjs'; +export * from './getIssueWatchers.mjs'; +export * from './getIssueWorklog.mjs'; +export * from './getIsWatchingIssueBulk.mjs'; +export * from './getMyFilters.mjs'; +export * from './getMyPermissions.mjs'; +export * from './getNotificationScheme.mjs'; +export * from './getNotificationSchemes.mjs'; +export * from './getNotificationSchemeToProjectMappings.mjs'; +export * from './getOptionsForContext.mjs'; +export * from './getPermissionScheme.mjs'; +export * from './getPermissionSchemeGrant.mjs'; +export * from './getPermissionSchemeGrants.mjs'; +export * from './getPermittedProjects.mjs'; +export * from './getPrecomputations.mjs'; +export * from './getPreference.mjs'; +export * from './getPriority.mjs'; +export * from './getProject.mjs'; +export * from './getProjectCategoryById.mjs'; +export * from './getProjectComponents.mjs'; +export * from './getProjectComponentsPaginated.mjs'; +export * from './getProjectContextMapping.mjs'; +export * from './getProjectEmail.mjs'; +export * from './getProjectIssueSecurityScheme.mjs'; +export * from './getProjectProperty.mjs'; +export * from './getProjectPropertyKeys.mjs'; +export * from './getProjectRole.mjs'; +export * from './getProjectRoleActorsForRole.mjs'; +export * from './getProjectRoleById.mjs'; +export * from './getProjectRoleDetails.mjs'; +export * from './getProjectRoles.mjs'; +export * from './getProjectsForIssueTypeScreenScheme.mjs'; +export * from './getProjectTypeByKey.mjs'; +export * from './getProjectVersions.mjs'; +export * from './getProjectVersionsPaginated.mjs'; +export * from './getRecent.mjs'; +export * from './getRemoteIssueLinkById.mjs'; +export * from './getRemoteIssueLinks.mjs'; +export * from './getScreens.mjs'; +export * from './getScreenSchemes.mjs'; +export * from './getScreensForField.mjs'; +export * from './getSecurityLevelMembers.mjs'; +export * from './getSecurityLevels.mjs'; +export * from './getSecurityLevelsForProject.mjs'; +export * from './getSelectableIssueFieldOptions.mjs'; +export * from './getSharePermission.mjs'; +export * from './getSharePermissions.mjs'; +export * from './getStatus.mjs'; +export * from './getStatusCategory.mjs'; +export * from './getStatusesById.mjs'; +export * from './getTask.mjs'; +export * from './getTransitions.mjs'; +export * from './getTrashedFieldsPaginated.mjs'; +export * from './getUiModifications.mjs'; +export * from './getUser.mjs'; +export * from './getUserDefaultColumns.mjs'; +export * from './getUserEmail.mjs'; +export * from './getUserEmailBulk.mjs'; +export * from './getUserGroups.mjs'; +export * from './getUserProperty.mjs'; +export * from './getUserPropertyKeys.mjs'; +export * from './getUsersFromGroup.mjs'; +export * from './getValidProjectKey.mjs'; +export * from './getValidProjectName.mjs'; +export * from './getVersion.mjs'; +export * from './getVersionRelatedIssues.mjs'; +export * from './getVersionUnresolvedIssues.mjs'; +export * from './getVisibleIssueFieldOptions.mjs'; +export * from './getVotes.mjs'; +export * from './getWorkflow.mjs'; +export * from './getWorkflowScheme.mjs'; +export * from './getWorkflowSchemeDraft.mjs'; +export * from './getWorkflowSchemeDraftIssueType.mjs'; +export * from './getWorkflowSchemeIssueType.mjs'; +export * from './getWorkflowSchemeProjectAssociations.mjs'; +export * from './getWorkflowsPaginated.mjs'; +export * from './getWorkflowTransitionProperties.mjs'; +export * from './getWorkflowTransitionRuleConfigurations.mjs'; +export * from './getWorklog.mjs'; +export * from './getWorklogProperty.mjs'; +export * from './getWorklogPropertyKeys.mjs'; +export * from './getWorklogsForIds.mjs'; +export * from './linkIssues.mjs'; +export * from './matchIssues.mjs'; +export * from './mergeVersions.mjs'; +export * from './migrateQueries.mjs'; +export * from './movePriorities.mjs'; +export * from './moveResolutions.mjs'; +export * from './moveScreenTab.mjs'; +export * from './moveScreenTabField.mjs'; +export * from './moveVersion.mjs'; +export * from './notify.mjs'; +export * from './parseJqlQueries.mjs'; +export * from './partialUpdateProjectRole.mjs'; +export * from './publishDraftWorkflowScheme.mjs'; +export * from './putAddonProperty.mjs'; +export * from './putAppProperty.mjs'; +export * from './refreshWebhooks.mjs'; +export * from './registerDynamicWebhooks.mjs'; +export * from './registerModules.mjs'; +export * from './removeAttachment.mjs'; +export * from './removeCustomFieldContextFromProjects.mjs'; +export * from './removeGadget.mjs'; +export * from './removeGroup.mjs'; +export * from './removeIssueTypeFromIssueTypeScheme.mjs'; +export * from './removeIssueTypesFromContext.mjs'; +export * from './removeIssueTypesFromGlobalFieldConfigurationScheme.mjs'; +export * from './removeLevel.mjs'; +export * from './removeMappingsFromIssueTypeScreenScheme.mjs'; +export * from './removeMemberFromSecurityLevel.mjs'; +export * from './removeModules.mjs'; +export * from './removeNotificationFromNotificationScheme.mjs'; +export * from './removePreference.mjs'; +export * from './removeProjectCategory.mjs'; +export * from './removeScreenTabField.mjs'; +export * from './removeUser.mjs'; +export * from './removeUserFromGroup.mjs'; +export * from './removeVote.mjs'; +export * from './removeWatcher.mjs'; +export * from './renameScreenTab.mjs'; +export * from './reorderCustomFieldOptions.mjs'; +export * from './reorderIssueTypesInIssueTypeScheme.mjs'; +export * from './replaceIssueFieldOption.mjs'; +export * from './resetColumns.mjs'; +export * from './resetUserColumns.mjs'; +export * from './restore.mjs'; +export * from './restoreCustomField.mjs'; +export * from './sanitiseJqlQueries.mjs'; +export * from './search.mjs'; +export * from './searchForIssuesUsingJql.mjs'; +export * from './searchForIssuesUsingJqlPost.mjs'; +export * from './searchPriorities.mjs'; +export * from './searchProjects.mjs'; +export * from './searchProjectsUsingSecuritySchemes.mjs'; +export * from './searchResolutions.mjs'; +export * from './searchSecuritySchemes.mjs'; +export * from './selectTimeTrackingImplementation.mjs'; +export * from './setActors.mjs'; +export * from './setApplicationProperty.mjs'; +export * from './setBanner.mjs'; +export * from './setColumns.mjs'; +export * from './setCommentProperty.mjs'; +export * from './setDashboardItemProperty.mjs'; +export * from './setDefaultLevels.mjs'; +export * from './setDefaultPriority.mjs'; +export * from './setDefaultResolution.mjs'; +export * from './setDefaultShareScope.mjs'; +export * from './setDefaultValues.mjs'; +export * from './setFavouriteForFilter.mjs'; +export * from './setFieldConfigurationSchemeMapping.mjs'; +export * from './setIssueProperty.mjs'; +export * from './setIssueTypeProperty.mjs'; +export * from './setPreference.mjs'; +export * from './setProjectProperty.mjs'; +export * from './setSharedTimeTrackingConfiguration.mjs'; +export * from './setUserColumns.mjs'; +export * from './setUserProperty.mjs'; +export * from './setWorkflowSchemeDraftIssueType.mjs'; +export * from './setWorkflowSchemeIssueType.mjs'; +export * from './setWorklogProperty.mjs'; +export * from './storeAvatar.mjs'; +export * from './toggleFeatureForProject.mjs'; +export * from './trashCustomField.mjs'; +export * from './unarchiveIssues.mjs'; +export * from './updateComment.mjs'; +export * from './updateComponent.mjs'; +export * from './updateCustomField.mjs'; +export * from './updateCustomFieldConfiguration.mjs'; +export * from './updateCustomFieldContext.mjs'; +export * from './updateCustomFieldOption.mjs'; +export * from './updateCustomFieldValue.mjs'; +export * from './updateDashboard.mjs'; +export * from './updateDefaultScreenScheme.mjs'; +export * from './updateDefaultWorkflow.mjs'; +export * from './updateDraftDefaultWorkflow.mjs'; +export * from './updateDraftWorkflowMapping.mjs'; +export * from './updateEntityPropertiesValue.mjs'; +export * from './updateFieldConfiguration.mjs'; +export * from './updateFieldConfigurationItems.mjs'; +export * from './updateFieldConfigurationScheme.mjs'; +export * from './updateFilter.mjs'; +export * from './updateGadget.mjs'; +export * from './updateIssueFieldOption.mjs'; +export * from './updateIssueFields.mjs'; +export * from './updateIssueLinkType.mjs'; +export * from './updateIssueSecurityScheme.mjs'; +export * from './updateIssueType.mjs'; +export * from './updateIssueTypeScheme.mjs'; +export * from './updateIssueTypeScreenScheme.mjs'; +export * from './updateMultipleCustomFieldValues.mjs'; +export * from './updateNotificationScheme.mjs'; +export * from './updatePermissionScheme.mjs'; +export * from './updatePrecomputations.mjs'; +export * from './updatePriority.mjs'; +export * from './updateProject.mjs'; +export * from './updateProjectAvatar.mjs'; +export * from './updateProjectCategory.mjs'; +export * from './updateProjectEmail.mjs'; +export * from './updateRemoteIssueLink.mjs'; +export * from './updateResolution.mjs'; +export * from './updateScreen.mjs'; +export * from './updateScreenScheme.mjs'; +export * from './updateSecurityLevel.mjs'; +export * from './updateStatuses.mjs'; +export * from './updateUiModification.mjs'; +export * from './updateVersion.mjs'; +export * from './updateWorkflowMapping.mjs'; +export * from './updateWorkflowScheme.mjs'; +export * from './updateWorkflowSchemeDraft.mjs'; +export * from './updateWorkflowTransitionProperty.mjs'; +export * from './updateWorkflowTransitionRuleConfigurations.mjs'; +export * from './updateWorklog.mjs'; +export * from './validateProjectKey.mjs'; +export * from './workflowRuleSearch.mjs'; diff --git a/src/version3/parameters/index.ts b/src/version3/parameters/index.ts deleted file mode 100644 index b3e50a602..000000000 --- a/src/version3/parameters/index.ts +++ /dev/null @@ -1,462 +0,0 @@ -export * from './addActorUsers.js'; -export * from './addAttachment.js'; -export * from './addComment.js'; -export * from './addFieldToDefaultScreen.js'; -export * from './addGadget.js'; -export * from './addIssueTypesToContext.js'; -export * from './addIssueTypesToIssueTypeScheme.js'; -export * from './addProjectRoleActorsToRole.js'; -export * from './addScreenTab.js'; -export * from './addScreenTabField.js'; -export * from './addSecurityLevel.js'; -export * from './addSecurityLevelMembers.js'; -export * from './addSharePermission.js'; -export * from './addUserToGroup.js'; -export * from './addVote.js'; -export * from './addWatcher.js'; -export * from './addWorklog.js'; -export * from './analyseExpression.js'; -export * from './appendMappingsForIssueTypeScreenScheme.js'; -export * from './archiveIssues.js'; -export * from './archiveIssuesAsync.js'; -export * from './archiveProject.js'; -export * from './assignFieldConfigurationSchemeToProject.js'; -export * from './assignIssue.js'; -export * from './assignIssueTypeSchemeToProject.js'; -export * from './assignIssueTypeScreenSchemeToProject.js'; -export * from './assignPermissionScheme.js'; -export * from './assignProjectsToCustomFieldContext.js'; -export * from './assignSchemeToProject.js'; -export * from './associateSchemesToProjects.js'; -export * from './bulkDeleteIssueProperty.js'; -export * from './bulkEditDashboards.js'; -export * from './bulkGetGroups.js'; -export * from './bulkGetUsers.js'; -export * from './bulkGetUsersMigration.js'; -export * from './bulkSetIssuePropertiesByIssue.js'; -export * from './bulkSetIssueProperty.js'; -export * from './bulkSetIssuesProperties.js'; -export * from './cancelTask.js'; -export * from './changeFilterOwner.js'; -export * from './copyDashboard.js'; -export * from './createComponent.js'; -export * from './createCustomField.js'; -export * from './createCustomFieldContext.js'; -export * from './createCustomFieldOption.js'; -export * from './createDashboard.js'; -export * from './createFieldConfiguration.js'; -export * from './createFieldConfigurationScheme.js'; -export * from './createFilter.js'; -export * from './createGroup.js'; -export * from './createIssue.js'; -export * from './createIssueFieldOption.js'; -export * from './createIssueLinkType.js'; -export * from './createIssues.js'; -export * from './createIssueSecurityScheme.js'; -export * from './createIssueType.js'; -export * from './createIssueTypeAvatar.js'; -export * from './createIssueTypeScheme.js'; -export * from './createIssueTypeScreenScheme.js'; -export * from './createNotificationScheme.js'; -export * from './createOrUpdateRemoteIssueLink.js'; -export * from './createPermissionGrant.js'; -export * from './createPermissionScheme.js'; -export * from './createPriority.js'; -export * from './createProject.js'; -export * from './createProjectAvatar.js'; -export * from './createProjectCategory.js'; -export * from './createProjectRole.js'; -export * from './createResolution.js'; -export * from './createScreen.js'; -export * from './createScreenScheme.js'; -export * from './createStatuses.js'; -export * from './createUiModification.js'; -export * from './createUser.js'; -export * from './createVersion.js'; -export * from './createWorkflow.js'; -export * from './createWorkflowScheme.js'; -export * from './createWorkflowSchemeDraftFromParent.js'; -export * from './createWorkflowTransitionProperty.js'; -export * from './deleteActor.js'; -export * from './deleteAddonProperty.js'; -export * from './deleteAndReplaceVersion.js'; -export * from './deleteAppProperty.js'; -export * from './deleteAvatar.js'; -export * from './deleteComment.js'; -export * from './deleteCommentProperty.js'; -export * from './deleteComponent.js'; -export * from './deleteCustomField.js'; -export * from './deleteCustomFieldContext.js'; -export * from './deleteCustomFieldOption.js'; -export * from './deleteDashboard.js'; -export * from './deleteDashboardItemProperty.js'; -export * from './deleteDefaultWorkflow.js'; -export * from './deleteDraftDefaultWorkflow.js'; -export * from './deleteDraftWorkflowMapping.js'; -export * from './deleteFavouriteForFilter.js'; -export * from './deleteFieldConfiguration.js'; -export * from './deleteFieldConfigurationScheme.js'; -export * from './deleteFilter.js'; -export * from './deleteInactiveWorkflow.js'; -export * from './deleteIssue.js'; -export * from './deleteIssueFieldOption.js'; -export * from './deleteIssueLink.js'; -export * from './deleteIssueLinkType.js'; -export * from './deleteIssueProperty.js'; -export * from './deleteIssueType.js'; -export * from './deleteIssueTypeProperty.js'; -export * from './deleteIssueTypeScheme.js'; -export * from './deleteIssueTypeScreenScheme.js'; -export * from './deleteNotificationScheme.js'; -export * from './deletePermissionScheme.js'; -export * from './deletePermissionSchemeEntity.js'; -export * from './deleteProject.js'; -export * from './deleteProjectAsynchronously.js'; -export * from './deleteProjectAvatar.js'; -export * from './deleteProjectProperty.js'; -export * from './deleteProjectRole.js'; -export * from './deleteProjectRoleActorsFromRole.js'; -export * from './deleteRemoteIssueLinkByGlobalId.js'; -export * from './deleteRemoteIssueLinkById.js'; -export * from './deleteResolution.js'; -export * from './deleteScreen.js'; -export * from './deleteScreenScheme.js'; -export * from './deleteScreenTab.js'; -export * from './deleteSecurityScheme.js'; -export * from './deleteSharePermission.js'; -export * from './deleteStatusesById.js'; -export * from './deleteUiModification.js'; -export * from './deleteUserProperty.js'; -export * from './deleteWebhookById.js'; -export * from './deleteWorkflowMapping.js'; -export * from './deleteWorkflowScheme.js'; -export * from './deleteWorkflowSchemeDraft.js'; -export * from './deleteWorkflowSchemeDraftIssueType.js'; -export * from './deleteWorkflowSchemeIssueType.js'; -export * from './deleteWorkflowTransitionProperty.js'; -export * from './deleteWorkflowTransitionRuleConfigurations.js'; -export * from './deleteWorklog.js'; -export * from './deleteWorklogProperty.js'; -export * from './doTransition.js'; -export * from './editIssue.js'; -export * from './evaluateJiraExpression.js'; -export * from './expandAttachmentForHumans.js'; -export * from './expandAttachmentForMachines.js'; -export * from './exportArchivedIssues.js'; -export * from './findAssignableUsers.js'; -export * from './findBulkAssignableUsers.js'; -export * from './findGroups.js'; -export * from './findUserKeysByQuery.js'; -export * from './findUsers.js'; -export * from './findUsersAndGroups.js'; -export * from './findUsersByQuery.js'; -export * from './findUsersForPicker.js'; -export * from './findUsersWithAllPermissions.js'; -export * from './findUsersWithBrowsePermission.js'; -export * from './fullyUpdateProjectRole.js'; -export * from './getAccessibleProjectTypeByKey.js'; -export * from './getAddonProperties.js'; -export * from './getAddonProperty.js'; -export * from './getAllDashboards.js'; -export * from './getAllFieldConfigurations.js'; -export * from './getAllFieldConfigurationSchemes.js'; -export * from './getAllGadgets.js'; -export * from './getAllIssueFieldOptions.js'; -export * from './getAllIssueTypeSchemes.js'; -export * from './getAllLabels.js'; -export * from './getAllPermissionSchemes.js'; -export * from './getAllProjectAvatars.js'; -export * from './getAllScreenTabFields.js'; -export * from './getAllScreenTabs.js'; -export * from './getAllStatuses.js'; -export * from './getAllSystemAvatars.js'; -export * from './getAllUsers.js'; -export * from './getAllUsersDefault.js'; -export * from './getAllWorkflowSchemes.js'; -export * from './getAlternativeIssueTypes.js'; -export * from './getApplicationProperty.js'; -export * from './getApplicationRole.js'; -export * from './getAssignedPermissionScheme.js'; -export * from './getAttachment.js'; -export * from './getAttachmentContent.js'; -export * from './getAttachmentThumbnail.js'; -export * from './getAuditRecords.js'; -export * from './getAutoCompletePost.js'; -export * from './getAvailableScreenFields.js'; -export * from './getAvatarImageByID.js'; -export * from './getAvatarImageByOwner.js'; -export * from './getAvatarImageByType.js'; -export * from './getAvatars.js'; -export * from './getBulkPermissions.js'; -export * from './getChangeLogs.js'; -export * from './getChangeLogsByIds.js'; -export * from './getColumns.js'; -export * from './getComment.js'; -export * from './getCommentProperty.js'; -export * from './getCommentPropertyKeys.js'; -export * from './getComments.js'; -export * from './getCommentsByIds.js'; -export * from './getComponent.js'; -export * from './getComponentRelatedIssues.js'; -export * from './getContextsForField.js'; -export * from './getCreateIssueMeta.js'; -export * from './getCurrentUser.js'; -export * from './getCustomFieldConfiguration.js'; -export * from './getCustomFieldContextsForProjectsAndIssueTypes.js'; -export * from './getCustomFieldOption.js'; -export * from './getDashboard.js'; -export * from './getDashboardItemProperty.js'; -export * from './getDashboardItemPropertyKeys.js'; -export * from './getDashboardsPaginated.js'; -export * from './getDefaultValues.js'; -export * from './getDefaultWorkflow.js'; -export * from './getDraftDefaultWorkflow.js'; -export * from './getDraftWorkflow.js'; -export * from './getDynamicWebhooksForApp.js'; -export * from './getEditIssueMeta.js'; -export * from './getFailedWebhooks.js'; -export * from './getFavouriteFilters.js'; -export * from './getFeaturesForProject.js'; -export * from './getFieldAutoCompleteForQueryString.js'; -export * from './getFieldConfigurationItems.js'; -export * from './getFieldConfigurationSchemeMappings.js'; -export * from './getFieldConfigurationSchemeProjectMapping.js'; -export * from './getFieldsPaginated.js'; -export * from './getFilter.js'; -export * from './getFiltersPaginated.js'; -export * from './getHierarchy.js'; -export * from './getIdsOfWorklogsDeletedSince.js'; -export * from './getIdsOfWorklogsModifiedSince.js'; -export * from './getIssue.js'; -export * from './getIssueFieldOption.js'; -export * from './getIssueLink.js'; -export * from './getIssueLinkType.js'; -export * from './getIssuePickerResource.js'; -export * from './getIssueProperty.js'; -export * from './getIssuePropertyKeys.js'; -export * from './getIssueSecurityLevel.js'; -export * from './getIssueSecurityLevelMembers.js'; -export * from './getIssueSecurityScheme.js'; -export * from './getIssueType.js'; -export * from './getIssueTypeMappingsForContexts.js'; -export * from './getIssueTypeProperty.js'; -export * from './getIssueTypePropertyKeys.js'; -export * from './getIssueTypeSchemeForProjects.js'; -export * from './getIssueTypeSchemesMapping.js'; -export * from './getIssueTypeScreenSchemeMappings.js'; -export * from './getIssueTypeScreenSchemeProjectAssociations.js'; -export * from './getIssueTypeScreenSchemes.js'; -export * from './getIssueTypesForProject.js'; -export * from './getIssueWatchers.js'; -export * from './getIssueWorklog.js'; -export * from './getIsWatchingIssueBulk.js'; -export * from './getMyFilters.js'; -export * from './getMyPermissions.js'; -export * from './getNotificationScheme.js'; -export * from './getNotificationSchemes.js'; -export * from './getNotificationSchemeToProjectMappings.js'; -export * from './getOptionsForContext.js'; -export * from './getPermissionScheme.js'; -export * from './getPermissionSchemeGrant.js'; -export * from './getPermissionSchemeGrants.js'; -export * from './getPermittedProjects.js'; -export * from './getPrecomputations.js'; -export * from './getPreference.js'; -export * from './getPriority.js'; -export * from './getProject.js'; -export * from './getProjectCategoryById.js'; -export * from './getProjectComponents.js'; -export * from './getProjectComponentsPaginated.js'; -export * from './getProjectContextMapping.js'; -export * from './getProjectEmail.js'; -export * from './getProjectIssueSecurityScheme.js'; -export * from './getProjectProperty.js'; -export * from './getProjectPropertyKeys.js'; -export * from './getProjectRole.js'; -export * from './getProjectRoleActorsForRole.js'; -export * from './getProjectRoleById.js'; -export * from './getProjectRoleDetails.js'; -export * from './getProjectRoles.js'; -export * from './getProjectsForIssueTypeScreenScheme.js'; -export * from './getProjectTypeByKey.js'; -export * from './getProjectVersions.js'; -export * from './getProjectVersionsPaginated.js'; -export * from './getRecent.js'; -export * from './getRemoteIssueLinkById.js'; -export * from './getRemoteIssueLinks.js'; -export * from './getScreens.js'; -export * from './getScreenSchemes.js'; -export * from './getScreensForField.js'; -export * from './getSecurityLevelMembers.js'; -export * from './getSecurityLevels.js'; -export * from './getSecurityLevelsForProject.js'; -export * from './getSelectableIssueFieldOptions.js'; -export * from './getSharePermission.js'; -export * from './getSharePermissions.js'; -export * from './getStatus.js'; -export * from './getStatusCategory.js'; -export * from './getStatusesById.js'; -export * from './getTask.js'; -export * from './getTransitions.js'; -export * from './getTrashedFieldsPaginated.js'; -export * from './getUiModifications.js'; -export * from './getUser.js'; -export * from './getUserDefaultColumns.js'; -export * from './getUserEmail.js'; -export * from './getUserEmailBulk.js'; -export * from './getUserGroups.js'; -export * from './getUserProperty.js'; -export * from './getUserPropertyKeys.js'; -export * from './getUsersFromGroup.js'; -export * from './getValidProjectKey.js'; -export * from './getValidProjectName.js'; -export * from './getVersion.js'; -export * from './getVersionRelatedIssues.js'; -export * from './getVersionUnresolvedIssues.js'; -export * from './getVisibleIssueFieldOptions.js'; -export * from './getVotes.js'; -export * from './getWorkflow.js'; -export * from './getWorkflowScheme.js'; -export * from './getWorkflowSchemeDraft.js'; -export * from './getWorkflowSchemeDraftIssueType.js'; -export * from './getWorkflowSchemeIssueType.js'; -export * from './getWorkflowSchemeProjectAssociations.js'; -export * from './getWorkflowsPaginated.js'; -export * from './getWorkflowTransitionProperties.js'; -export * from './getWorkflowTransitionRuleConfigurations.js'; -export * from './getWorklog.js'; -export * from './getWorklogProperty.js'; -export * from './getWorklogPropertyKeys.js'; -export * from './getWorklogsForIds.js'; -export * from './linkIssues.js'; -export * from './matchIssues.js'; -export * from './mergeVersions.js'; -export * from './migrateQueries.js'; -export * from './movePriorities.js'; -export * from './moveResolutions.js'; -export * from './moveScreenTab.js'; -export * from './moveScreenTabField.js'; -export * from './moveVersion.js'; -export * from './notify.js'; -export * from './parseJqlQueries.js'; -export * from './partialUpdateProjectRole.js'; -export * from './publishDraftWorkflowScheme.js'; -export * from './putAddonProperty.js'; -export * from './putAppProperty.js'; -export * from './refreshWebhooks.js'; -export * from './registerDynamicWebhooks.js'; -export * from './registerModules.js'; -export * from './removeAttachment.js'; -export * from './removeCustomFieldContextFromProjects.js'; -export * from './removeGadget.js'; -export * from './removeGroup.js'; -export * from './removeIssueTypeFromIssueTypeScheme.js'; -export * from './removeIssueTypesFromContext.js'; -export * from './removeIssueTypesFromGlobalFieldConfigurationScheme.js'; -export * from './removeLevel.js'; -export * from './removeMappingsFromIssueTypeScreenScheme.js'; -export * from './removeMemberFromSecurityLevel.js'; -export * from './removeModules.js'; -export * from './removeNotificationFromNotificationScheme.js'; -export * from './removePreference.js'; -export * from './removeProjectCategory.js'; -export * from './removeScreenTabField.js'; -export * from './removeUser.js'; -export * from './removeUserFromGroup.js'; -export * from './removeVote.js'; -export * from './removeWatcher.js'; -export * from './renameScreenTab.js'; -export * from './reorderCustomFieldOptions.js'; -export * from './reorderIssueTypesInIssueTypeScheme.js'; -export * from './replaceIssueFieldOption.js'; -export * from './resetColumns.js'; -export * from './resetUserColumns.js'; -export * from './restore.js'; -export * from './restoreCustomField.js'; -export * from './sanitiseJqlQueries.js'; -export * from './search.js'; -export * from './searchForIssuesUsingJql.js'; -export * from './searchForIssuesUsingJqlPost.js'; -export * from './searchPriorities.js'; -export * from './searchProjects.js'; -export * from './searchProjectsUsingSecuritySchemes.js'; -export * from './searchResolutions.js'; -export * from './searchSecuritySchemes.js'; -export * from './selectTimeTrackingImplementation.js'; -export * from './setActors.js'; -export * from './setApplicationProperty.js'; -export * from './setBanner.js'; -export * from './setColumns.js'; -export * from './setCommentProperty.js'; -export * from './setDashboardItemProperty.js'; -export * from './setDefaultLevels.js'; -export * from './setDefaultPriority.js'; -export * from './setDefaultResolution.js'; -export * from './setDefaultShareScope.js'; -export * from './setDefaultValues.js'; -export * from './setFavouriteForFilter.js'; -export * from './setFieldConfigurationSchemeMapping.js'; -export * from './setIssueProperty.js'; -export * from './setIssueTypeProperty.js'; -export * from './setPreference.js'; -export * from './setProjectProperty.js'; -export * from './setSharedTimeTrackingConfiguration.js'; -export * from './setUserColumns.js'; -export * from './setUserProperty.js'; -export * from './setWorkflowSchemeDraftIssueType.js'; -export * from './setWorkflowSchemeIssueType.js'; -export * from './setWorklogProperty.js'; -export * from './storeAvatar.js'; -export * from './toggleFeatureForProject.js'; -export * from './trashCustomField.js'; -export * from './unarchiveIssues.js'; -export * from './updateComment.js'; -export * from './updateComponent.js'; -export * from './updateCustomField.js'; -export * from './updateCustomFieldConfiguration.js'; -export * from './updateCustomFieldContext.js'; -export * from './updateCustomFieldOption.js'; -export * from './updateCustomFieldValue.js'; -export * from './updateDashboard.js'; -export * from './updateDefaultScreenScheme.js'; -export * from './updateDefaultWorkflow.js'; -export * from './updateDraftDefaultWorkflow.js'; -export * from './updateDraftWorkflowMapping.js'; -export * from './updateEntityPropertiesValue.js'; -export * from './updateFieldConfiguration.js'; -export * from './updateFieldConfigurationItems.js'; -export * from './updateFieldConfigurationScheme.js'; -export * from './updateFilter.js'; -export * from './updateGadget.js'; -export * from './updateIssueFieldOption.js'; -export * from './updateIssueFields.js'; -export * from './updateIssueLinkType.js'; -export * from './updateIssueSecurityScheme.js'; -export * from './updateIssueType.js'; -export * from './updateIssueTypeScheme.js'; -export * from './updateIssueTypeScreenScheme.js'; -export * from './updateMultipleCustomFieldValues.js'; -export * from './updateNotificationScheme.js'; -export * from './updatePermissionScheme.js'; -export * from './updatePrecomputations.js'; -export * from './updatePriority.js'; -export * from './updateProject.js'; -export * from './updateProjectAvatar.js'; -export * from './updateProjectCategory.js'; -export * from './updateProjectEmail.js'; -export * from './updateRemoteIssueLink.js'; -export * from './updateResolution.js'; -export * from './updateScreen.js'; -export * from './updateScreenScheme.js'; -export * from './updateSecurityLevel.js'; -export * from './updateStatuses.js'; -export * from './updateUiModification.js'; -export * from './updateVersion.js'; -export * from './updateWorkflowMapping.js'; -export * from './updateWorkflowScheme.js'; -export * from './updateWorkflowSchemeDraft.js'; -export * from './updateWorkflowTransitionProperty.js'; -export * from './updateWorkflowTransitionRuleConfigurations.js'; -export * from './updateWorklog.js'; -export * from './validateProjectKey.js'; -export * from './workflowRuleSearch.js'; diff --git a/src/version3/parameters/linkIssues.mts b/src/version3/parameters/linkIssues.mts new file mode 100644 index 000000000..5b913d246 --- /dev/null +++ b/src/version3/parameters/linkIssues.mts @@ -0,0 +1,3 @@ +import { LinkIssueRequestJson } from '../models/index.mjs'; + +export interface LinkIssues extends LinkIssueRequestJson {} diff --git a/src/version3/parameters/linkIssues.ts b/src/version3/parameters/linkIssues.ts deleted file mode 100644 index f8b4b095c..000000000 --- a/src/version3/parameters/linkIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { LinkIssueRequestJson } from '../models/index.js'; - -export interface LinkIssues extends LinkIssueRequestJson {} diff --git a/src/version3/parameters/matchIssues.mts b/src/version3/parameters/matchIssues.mts new file mode 100644 index 000000000..10f28eb7e --- /dev/null +++ b/src/version3/parameters/matchIssues.mts @@ -0,0 +1,3 @@ +import { IssuesAndJQLQueries } from '../models/index.mjs'; + +export interface MatchIssues extends IssuesAndJQLQueries {} diff --git a/src/version3/parameters/matchIssues.ts b/src/version3/parameters/matchIssues.ts deleted file mode 100644 index 6ef7e314d..000000000 --- a/src/version3/parameters/matchIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssuesAndJQLQueries } from '../models/index.js'; - -export interface MatchIssues extends IssuesAndJQLQueries {} diff --git a/src/version3/parameters/mergeVersions.ts b/src/version3/parameters/mergeVersions.mts similarity index 100% rename from src/version3/parameters/mergeVersions.ts rename to src/version3/parameters/mergeVersions.mts diff --git a/src/version3/parameters/migrateQueries.mts b/src/version3/parameters/migrateQueries.mts new file mode 100644 index 000000000..6a6dd34d7 --- /dev/null +++ b/src/version3/parameters/migrateQueries.mts @@ -0,0 +1,3 @@ +import { JQLPersonalDataMigrationRequest } from '../models/index.mjs'; + +export interface MigrateQueries extends JQLPersonalDataMigrationRequest {} diff --git a/src/version3/parameters/migrateQueries.ts b/src/version3/parameters/migrateQueries.ts deleted file mode 100644 index aaac24678..000000000 --- a/src/version3/parameters/migrateQueries.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { JQLPersonalDataMigrationRequest } from '../models/index.js'; - -export interface MigrateQueries extends JQLPersonalDataMigrationRequest {} diff --git a/src/version3/parameters/movePriorities.mts b/src/version3/parameters/movePriorities.mts new file mode 100644 index 000000000..f9e8521f8 --- /dev/null +++ b/src/version3/parameters/movePriorities.mts @@ -0,0 +1,3 @@ +import { ReorderIssuePriorities } from '../models/index.mjs'; + +export interface MovePriorities extends ReorderIssuePriorities {} diff --git a/src/version3/parameters/movePriorities.ts b/src/version3/parameters/movePriorities.ts deleted file mode 100644 index 4462a3100..000000000 --- a/src/version3/parameters/movePriorities.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ReorderIssuePriorities } from '../models/index.js'; - -export interface MovePriorities extends ReorderIssuePriorities {} diff --git a/src/version3/parameters/moveResolutions.mts b/src/version3/parameters/moveResolutions.mts new file mode 100644 index 000000000..0e1d9a829 --- /dev/null +++ b/src/version3/parameters/moveResolutions.mts @@ -0,0 +1,3 @@ +import { ReorderIssueResolutionsRequest } from '../models/index.mjs'; + +export interface MoveResolutions extends ReorderIssueResolutionsRequest {} diff --git a/src/version3/parameters/moveResolutions.ts b/src/version3/parameters/moveResolutions.ts deleted file mode 100644 index 058416084..000000000 --- a/src/version3/parameters/moveResolutions.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ReorderIssueResolutionsRequest } from '../models/index.js'; - -export interface MoveResolutions extends ReorderIssueResolutionsRequest {} diff --git a/src/version3/parameters/moveScreenTab.ts b/src/version3/parameters/moveScreenTab.mts similarity index 100% rename from src/version3/parameters/moveScreenTab.ts rename to src/version3/parameters/moveScreenTab.mts diff --git a/src/version3/parameters/moveScreenTabField.mts b/src/version3/parameters/moveScreenTabField.mts new file mode 100644 index 000000000..0ed677e4e --- /dev/null +++ b/src/version3/parameters/moveScreenTabField.mts @@ -0,0 +1,10 @@ +import { MoveField } from '../models/index.mjs'; + +export interface MoveScreenTabField extends MoveField { + /** The ID of the screen. */ + screenId: number; + /** The ID of the screen tab. */ + tabId: number; + /** The ID of the field. */ + id: string; +} diff --git a/src/version3/parameters/moveScreenTabField.ts b/src/version3/parameters/moveScreenTabField.ts deleted file mode 100644 index b4090203b..000000000 --- a/src/version3/parameters/moveScreenTabField.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { MoveField } from '../models/index.js'; - -export interface MoveScreenTabField extends MoveField { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; - /** The ID of the field. */ - id: string; -} diff --git a/src/version3/parameters/moveVersion.mts b/src/version3/parameters/moveVersion.mts new file mode 100644 index 000000000..406cf9055 --- /dev/null +++ b/src/version3/parameters/moveVersion.mts @@ -0,0 +1,6 @@ +import { VersionMove } from '../models/index.mjs'; + +export interface MoveVersion extends VersionMove { + /** The ID of the version to be moved. */ + id: string; +} diff --git a/src/version3/parameters/moveVersion.ts b/src/version3/parameters/moveVersion.ts deleted file mode 100644 index 2537a26dd..000000000 --- a/src/version3/parameters/moveVersion.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { VersionMove } from '../models/index.js'; - -export interface MoveVersion extends VersionMove { - /** The ID of the version to be moved. */ - id: string; -} diff --git a/src/version3/parameters/notify.mts b/src/version3/parameters/notify.mts new file mode 100644 index 000000000..1485a4206 --- /dev/null +++ b/src/version3/parameters/notify.mts @@ -0,0 +1,6 @@ +import { Notification } from '../models/index.mjs'; + +export interface Notify extends Notification { + /** ID or key of the issue that the notification is sent for. */ + issueIdOrKey: string; +} diff --git a/src/version3/parameters/notify.ts b/src/version3/parameters/notify.ts deleted file mode 100644 index 3b176fd9d..000000000 --- a/src/version3/parameters/notify.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Notification } from '../models/index.js'; - -export interface Notify extends Notification { - /** ID or key of the issue that the notification is sent for. */ - issueIdOrKey: string; -} diff --git a/src/version3/parameters/parseJqlQueries.mts b/src/version3/parameters/parseJqlQueries.mts new file mode 100644 index 000000000..5f8584cb2 --- /dev/null +++ b/src/version3/parameters/parseJqlQueries.mts @@ -0,0 +1,13 @@ +import { JqlQueriesToParse } from '../models/index.mjs'; + +export interface ParseJqlQueries extends JqlQueriesToParse { + /** + * How to validate the Jql query and treat the validation results. Validation options include: + * + * - `strict` Returns all errors. If validation fails, the query structure is not returned. + * - `warn` Returns all errors. If validation fails but the Jql query is correctly formed, the query structure is + * returned. + * - `none` No validation is performed. If Jql query is correctly formed, the query structure is returned. + */ + validation?: 'strict' | 'warn' | 'none' | string; +} diff --git a/src/version3/parameters/parseJqlQueries.ts b/src/version3/parameters/parseJqlQueries.ts deleted file mode 100644 index e256e6dd8..000000000 --- a/src/version3/parameters/parseJqlQueries.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { JqlQueriesToParse } from '../models/index.js'; - -export interface ParseJqlQueries extends JqlQueriesToParse { - /** - * How to validate the JQL query and treat the validation results. Validation options include: - * - * - `strict` Returns all errors. If validation fails, the query structure is not returned. - * - `warn` Returns all errors. If validation fails but the JQL query is correctly formed, the query structure is - * returned. - * - `none` No validation is performed. If JQL query is correctly formed, the query structure is returned. - */ - validation?: 'strict' | 'warn' | 'none' | string; -} diff --git a/src/version3/parameters/partialUpdateProjectRole.mts b/src/version3/parameters/partialUpdateProjectRole.mts new file mode 100644 index 000000000..abe1dbc8d --- /dev/null +++ b/src/version3/parameters/partialUpdateProjectRole.mts @@ -0,0 +1,9 @@ +import { CreateUpdateRoleRequest } from '../models/index.mjs'; + +export interface PartialUpdateProjectRole extends CreateUpdateRoleRequest { + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role + * IDs. + */ + id: number; +} diff --git a/src/version3/parameters/partialUpdateProjectRole.ts b/src/version3/parameters/partialUpdateProjectRole.ts deleted file mode 100644 index cbbae08b5..000000000 --- a/src/version3/parameters/partialUpdateProjectRole.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { CreateUpdateRoleRequest } from '../models/index.js'; - -export interface PartialUpdateProjectRole extends CreateUpdateRoleRequest { - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version3/parameters/publishDraftWorkflowScheme.mts b/src/version3/parameters/publishDraftWorkflowScheme.mts new file mode 100644 index 000000000..4befa82a0 --- /dev/null +++ b/src/version3/parameters/publishDraftWorkflowScheme.mts @@ -0,0 +1,9 @@ +import { StatusMapping } from '../models/index.mjs'; + +export interface PublishDraftWorkflowScheme { + /** The ID of the workflow scheme that the draft belongs to. */ + id: number; + /** Whether the request only performs a validation. */ + validateOnly?: boolean; + statusMappings?: StatusMapping[]; +} diff --git a/src/version3/parameters/publishDraftWorkflowScheme.ts b/src/version3/parameters/publishDraftWorkflowScheme.ts deleted file mode 100644 index 3d2cf8f40..000000000 --- a/src/version3/parameters/publishDraftWorkflowScheme.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { StatusMapping } from '../models/index.js'; - -export interface PublishDraftWorkflowScheme { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** Whether the request only performs a validation. */ - validateOnly?: boolean; - statusMappings?: StatusMapping[]; -} diff --git a/src/version3/parameters/putAddonProperty.ts b/src/version3/parameters/putAddonProperty.mts similarity index 100% rename from src/version3/parameters/putAddonProperty.ts rename to src/version3/parameters/putAddonProperty.mts diff --git a/src/version3/parameters/putAppProperty.ts b/src/version3/parameters/putAppProperty.mts similarity index 100% rename from src/version3/parameters/putAppProperty.ts rename to src/version3/parameters/putAppProperty.mts diff --git a/src/version3/parameters/refreshWebhooks.mts b/src/version3/parameters/refreshWebhooks.mts new file mode 100644 index 000000000..33d4bceaa --- /dev/null +++ b/src/version3/parameters/refreshWebhooks.mts @@ -0,0 +1,3 @@ +import { ContainerForWebhookIDs } from '../models/index.mjs'; + +export interface RefreshWebhooks extends ContainerForWebhookIDs {} diff --git a/src/version3/parameters/refreshWebhooks.ts b/src/version3/parameters/refreshWebhooks.ts deleted file mode 100644 index a7fcb0f72..000000000 --- a/src/version3/parameters/refreshWebhooks.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ContainerForWebhookIDs } from '../models/index.js'; - -export interface RefreshWebhooks extends ContainerForWebhookIDs {} diff --git a/src/version3/parameters/registerDynamicWebhooks.mts b/src/version3/parameters/registerDynamicWebhooks.mts new file mode 100644 index 000000000..b88825dc5 --- /dev/null +++ b/src/version3/parameters/registerDynamicWebhooks.mts @@ -0,0 +1,3 @@ +import { WebhookRegistrationDetails } from '../models/index.mjs'; + +export interface RegisterDynamicWebhooks extends WebhookRegistrationDetails {} diff --git a/src/version3/parameters/registerDynamicWebhooks.ts b/src/version3/parameters/registerDynamicWebhooks.ts deleted file mode 100644 index efe7f5c28..000000000 --- a/src/version3/parameters/registerDynamicWebhooks.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WebhookRegistrationDetails } from '../models/index.js'; - -export interface RegisterDynamicWebhooks extends WebhookRegistrationDetails {} diff --git a/src/version3/parameters/registerModules.mts b/src/version3/parameters/registerModules.mts new file mode 100644 index 000000000..3d88a2183 --- /dev/null +++ b/src/version3/parameters/registerModules.mts @@ -0,0 +1,3 @@ +import { ConnectModules } from '../models/index.mjs'; + +export interface RegisterModules extends ConnectModules {} diff --git a/src/version3/parameters/registerModules.ts b/src/version3/parameters/registerModules.ts deleted file mode 100644 index 4672e7393..000000000 --- a/src/version3/parameters/registerModules.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ConnectModules } from '../models/index.js'; - -export interface RegisterModules extends ConnectModules {} diff --git a/src/version3/parameters/removeAttachment.ts b/src/version3/parameters/removeAttachment.mts similarity index 100% rename from src/version3/parameters/removeAttachment.ts rename to src/version3/parameters/removeAttachment.mts diff --git a/src/version3/parameters/removeCustomFieldContextFromProjects.mts b/src/version3/parameters/removeCustomFieldContextFromProjects.mts new file mode 100644 index 000000000..b1c3958a0 --- /dev/null +++ b/src/version3/parameters/removeCustomFieldContextFromProjects.mts @@ -0,0 +1,8 @@ +import { ProjectIds } from '../models/index.mjs'; + +export interface RemoveCustomFieldContextFromProjects extends ProjectIds { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/removeCustomFieldContextFromProjects.ts b/src/version3/parameters/removeCustomFieldContextFromProjects.ts deleted file mode 100644 index 10400c536..000000000 --- a/src/version3/parameters/removeCustomFieldContextFromProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectIds } from '../models/index.js'; - -export interface RemoveCustomFieldContextFromProjects extends ProjectIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version3/parameters/removeGadget.ts b/src/version3/parameters/removeGadget.mts similarity index 100% rename from src/version3/parameters/removeGadget.ts rename to src/version3/parameters/removeGadget.mts diff --git a/src/version3/parameters/removeGroup.ts b/src/version3/parameters/removeGroup.mts similarity index 100% rename from src/version3/parameters/removeGroup.ts rename to src/version3/parameters/removeGroup.mts diff --git a/src/version3/parameters/removeIssueTypeFromIssueTypeScheme.ts b/src/version3/parameters/removeIssueTypeFromIssueTypeScheme.mts similarity index 100% rename from src/version3/parameters/removeIssueTypeFromIssueTypeScheme.ts rename to src/version3/parameters/removeIssueTypeFromIssueTypeScheme.mts diff --git a/src/version3/parameters/removeIssueTypesFromContext.mts b/src/version3/parameters/removeIssueTypesFromContext.mts new file mode 100644 index 000000000..cc50dcd40 --- /dev/null +++ b/src/version3/parameters/removeIssueTypesFromContext.mts @@ -0,0 +1,8 @@ +import { IssueTypeIds } from '../models/index.mjs'; + +export interface RemoveIssueTypesFromContext extends IssueTypeIds { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/removeIssueTypesFromContext.ts b/src/version3/parameters/removeIssueTypesFromContext.ts deleted file mode 100644 index f810fb377..000000000 --- a/src/version3/parameters/removeIssueTypesFromContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypeIds } from '../models/index.js'; - -export interface RemoveIssueTypesFromContext extends IssueTypeIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version3/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.mts b/src/version3/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.mts new file mode 100644 index 000000000..f78e9be21 --- /dev/null +++ b/src/version3/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeIdsToRemove } from '../models/index.mjs'; + +export interface RemoveIssueTypesFromGlobalFieldConfigurationScheme extends IssueTypeIdsToRemove { + /** The ID of the field configuration scheme. */ + id: number; +} diff --git a/src/version3/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts b/src/version3/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts deleted file mode 100644 index 72bd7f2b8..000000000 --- a/src/version3/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeIdsToRemove } from '../models/index.js'; - -export interface RemoveIssueTypesFromGlobalFieldConfigurationScheme extends IssueTypeIdsToRemove { - /** The ID of the field configuration scheme. */ - id: number; -} diff --git a/src/version3/parameters/removeLevel.ts b/src/version3/parameters/removeLevel.mts similarity index 100% rename from src/version3/parameters/removeLevel.ts rename to src/version3/parameters/removeLevel.mts diff --git a/src/version3/parameters/removeMappingsFromIssueTypeScreenScheme.mts b/src/version3/parameters/removeMappingsFromIssueTypeScreenScheme.mts new file mode 100644 index 000000000..117d550ce --- /dev/null +++ b/src/version3/parameters/removeMappingsFromIssueTypeScreenScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeIds } from '../models/index.mjs'; + +export interface RemoveMappingsFromIssueTypeScreenScheme extends IssueTypeIds { + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: string; +} diff --git a/src/version3/parameters/removeMappingsFromIssueTypeScreenScheme.ts b/src/version3/parameters/removeMappingsFromIssueTypeScreenScheme.ts deleted file mode 100644 index 9525f31fe..000000000 --- a/src/version3/parameters/removeMappingsFromIssueTypeScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeIds } from '../models/index.js'; - -export interface RemoveMappingsFromIssueTypeScreenScheme extends IssueTypeIds { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; -} diff --git a/src/version3/parameters/removeMemberFromSecurityLevel.ts b/src/version3/parameters/removeMemberFromSecurityLevel.mts similarity index 100% rename from src/version3/parameters/removeMemberFromSecurityLevel.ts rename to src/version3/parameters/removeMemberFromSecurityLevel.mts diff --git a/src/version3/parameters/removeModules.ts b/src/version3/parameters/removeModules.mts similarity index 100% rename from src/version3/parameters/removeModules.ts rename to src/version3/parameters/removeModules.mts diff --git a/src/version3/parameters/removeNotificationFromNotificationScheme.ts b/src/version3/parameters/removeNotificationFromNotificationScheme.mts similarity index 100% rename from src/version3/parameters/removeNotificationFromNotificationScheme.ts rename to src/version3/parameters/removeNotificationFromNotificationScheme.mts diff --git a/src/version3/parameters/removePreference.ts b/src/version3/parameters/removePreference.mts similarity index 100% rename from src/version3/parameters/removePreference.ts rename to src/version3/parameters/removePreference.mts diff --git a/src/version3/parameters/removeProjectCategory.ts b/src/version3/parameters/removeProjectCategory.mts similarity index 100% rename from src/version3/parameters/removeProjectCategory.ts rename to src/version3/parameters/removeProjectCategory.mts diff --git a/src/version3/parameters/removeScreenTabField.ts b/src/version3/parameters/removeScreenTabField.mts similarity index 100% rename from src/version3/parameters/removeScreenTabField.ts rename to src/version3/parameters/removeScreenTabField.mts diff --git a/src/version3/parameters/removeUser.ts b/src/version3/parameters/removeUser.mts similarity index 100% rename from src/version3/parameters/removeUser.ts rename to src/version3/parameters/removeUser.mts diff --git a/src/version3/parameters/removeUserFromGroup.ts b/src/version3/parameters/removeUserFromGroup.mts similarity index 100% rename from src/version3/parameters/removeUserFromGroup.ts rename to src/version3/parameters/removeUserFromGroup.mts diff --git a/src/version3/parameters/removeVote.ts b/src/version3/parameters/removeVote.mts similarity index 100% rename from src/version3/parameters/removeVote.ts rename to src/version3/parameters/removeVote.mts diff --git a/src/version3/parameters/removeWatcher.ts b/src/version3/parameters/removeWatcher.mts similarity index 100% rename from src/version3/parameters/removeWatcher.ts rename to src/version3/parameters/removeWatcher.mts diff --git a/src/version3/parameters/renameScreenTab.mts b/src/version3/parameters/renameScreenTab.mts new file mode 100644 index 000000000..593fc3705 --- /dev/null +++ b/src/version3/parameters/renameScreenTab.mts @@ -0,0 +1,8 @@ +import { ScreenableTab } from '../models/index.mjs'; + +export interface RenameScreenTab extends ScreenableTab { + /** The ID of the screen. */ + screenId: number; + /** The ID of the screen tab. */ + tabId: number; +} diff --git a/src/version3/parameters/renameScreenTab.ts b/src/version3/parameters/renameScreenTab.ts deleted file mode 100644 index f3c458556..000000000 --- a/src/version3/parameters/renameScreenTab.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ScreenableTab } from '../models/index.js'; - -export interface RenameScreenTab extends ScreenableTab { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; -} diff --git a/src/version3/parameters/reorderCustomFieldOptions.mts b/src/version3/parameters/reorderCustomFieldOptions.mts new file mode 100644 index 000000000..9d2f7ff59 --- /dev/null +++ b/src/version3/parameters/reorderCustomFieldOptions.mts @@ -0,0 +1,8 @@ +import { OrderOfCustomFieldOptions } from '../models/index.mjs'; + +export interface ReorderCustomFieldOptions extends OrderOfCustomFieldOptions { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/reorderCustomFieldOptions.ts b/src/version3/parameters/reorderCustomFieldOptions.ts deleted file mode 100644 index 5490d7582..000000000 --- a/src/version3/parameters/reorderCustomFieldOptions.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { OrderOfCustomFieldOptions } from '../models/index.js'; - -export interface ReorderCustomFieldOptions extends OrderOfCustomFieldOptions { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version3/parameters/reorderIssueTypesInIssueTypeScheme.mts b/src/version3/parameters/reorderIssueTypesInIssueTypeScheme.mts new file mode 100644 index 000000000..d9f4c6061 --- /dev/null +++ b/src/version3/parameters/reorderIssueTypesInIssueTypeScheme.mts @@ -0,0 +1,6 @@ +import { OrderOfIssueTypes } from '../models/index.mjs'; + +export interface ReorderIssueTypesInIssueTypeScheme extends OrderOfIssueTypes { + /** The ID of the issue type scheme. */ + issueTypeSchemeId: number; +} diff --git a/src/version3/parameters/reorderIssueTypesInIssueTypeScheme.ts b/src/version3/parameters/reorderIssueTypesInIssueTypeScheme.ts deleted file mode 100644 index 357a2a352..000000000 --- a/src/version3/parameters/reorderIssueTypesInIssueTypeScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { OrderOfIssueTypes } from '../models/index.js'; - -export interface ReorderIssueTypesInIssueTypeScheme extends OrderOfIssueTypes { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; -} diff --git a/src/version3/parameters/replaceIssueFieldOption.mts b/src/version3/parameters/replaceIssueFieldOption.mts new file mode 100644 index 000000000..629f7301e --- /dev/null +++ b/src/version3/parameters/replaceIssueFieldOption.mts @@ -0,0 +1,28 @@ +export interface ReplaceIssueFieldOption { + /** The ID of the option that will replace the currently selected option. */ + replaceWith?: number; + /** A Jql query that specifies the issues to be updated. For example, _project=10000_. */ + jql?: string; + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect and Forge app + * users with admin permission. + */ + overrideScreenSecurity?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect and Forge app + * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For + * example, `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: string; + /** The ID of the option to be deselected. */ + optionId: number; +} diff --git a/src/version3/parameters/replaceIssueFieldOption.ts b/src/version3/parameters/replaceIssueFieldOption.ts deleted file mode 100644 index fd536f3d2..000000000 --- a/src/version3/parameters/replaceIssueFieldOption.ts +++ /dev/null @@ -1,28 +0,0 @@ -export interface ReplaceIssueFieldOption { - /** The ID of the option that will replace the currently selected option. */ - replaceWith?: number; - /** A JQL query that specifies the issues to be updated. For example, _project=10000_. */ - jql?: string; - /** - * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect and Forge app - * users with admin permission. - */ - overrideScreenSecurity?: boolean; - /** - * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect and Forge app - * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideEditableFlag?: boolean; - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; - /** The ID of the option to be deselected. */ - optionId: number; -} diff --git a/src/version3/parameters/resetColumns.ts b/src/version3/parameters/resetColumns.mts similarity index 100% rename from src/version3/parameters/resetColumns.ts rename to src/version3/parameters/resetColumns.mts diff --git a/src/version3/parameters/resetUserColumns.ts b/src/version3/parameters/resetUserColumns.mts similarity index 100% rename from src/version3/parameters/resetUserColumns.ts rename to src/version3/parameters/resetUserColumns.mts diff --git a/src/version3/parameters/restore.ts b/src/version3/parameters/restore.mts similarity index 100% rename from src/version3/parameters/restore.ts rename to src/version3/parameters/restore.mts diff --git a/src/version3/parameters/restoreCustomField.ts b/src/version3/parameters/restoreCustomField.mts similarity index 100% rename from src/version3/parameters/restoreCustomField.ts rename to src/version3/parameters/restoreCustomField.mts diff --git a/src/version3/parameters/sanitiseJqlQueries.mts b/src/version3/parameters/sanitiseJqlQueries.mts new file mode 100644 index 000000000..d9517074f --- /dev/null +++ b/src/version3/parameters/sanitiseJqlQueries.mts @@ -0,0 +1,3 @@ +import { JqlQueriesToSanitize } from '../models/index.mjs'; + +export interface SanitiseJqlQueries extends JqlQueriesToSanitize {} diff --git a/src/version3/parameters/sanitiseJqlQueries.ts b/src/version3/parameters/sanitiseJqlQueries.ts deleted file mode 100644 index 42b1a0a51..000000000 --- a/src/version3/parameters/sanitiseJqlQueries.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { JqlQueriesToSanitize } from '../models/index.js'; - -export interface SanitiseJqlQueries extends JqlQueriesToSanitize {} diff --git a/src/version3/parameters/search.ts b/src/version3/parameters/search.mts similarity index 100% rename from src/version3/parameters/search.ts rename to src/version3/parameters/search.mts diff --git a/src/version3/parameters/searchForIssuesUsingJql.mts b/src/version3/parameters/searchForIssuesUsingJql.mts new file mode 100644 index 000000000..710c5227e --- /dev/null +++ b/src/version3/parameters/searchForIssuesUsingJql.mts @@ -0,0 +1,66 @@ +export interface SearchForIssuesUsingJql { + /** + * The [Jql](https://confluence.atlassian.com/x/egORLQ) that defines the search. Note: + * + * If no Jql expression is provided, all issues are returned. `username` and `userkey` cannot be used as search terms + * due to privacy reasons. Use `accountId` instead. If a user has hidden their email address in their user profile, + * partial matches of the email address will not find the user. An exact match is required. + */ + jql?: string; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** + * The maximum number of items to return per page. To manage page size, Jira may return fewer items per page where a + * large number of fields are requested. The greatest number of items returned per page is achieved when requesting + * `id` or `key` only. + */ + maxResults?: number; + /** + * Determines how to validate the Jql query and treat the validation results. Supported values are: + * + * - `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). + * - `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for + * - `strict`. `false` _Deprecated_ A legacy synonym for `warn`. + * + * Note: If the Jql is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. + */ + validateQuery?: 'strict' | 'warn' | 'none' | string; + /** + * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a + * comma-separated list. Expand options include: + * + * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to + * exclude. + * + * Examples: + * + * `summary,comment` Returns only the summary and comments fields. `-description` Returns all navigable (default) + * fields except description. `*all,-comment` Returns all fields except comments. + * + * This parameter may be specified multiple times. For example, `fields=field1,field2&fields=field3`. + * + * Note: All navigable fields are returned by default. This differs from [GET + * issue](#api-rest-api-3-issue-issueIdOrKey-get) where the default is all fields. + */ + fields?: string[]; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about issues in the response. This parameter accepts a comma-separated list. Expand options include: + * + * `renderedFields` Returns field values rendered in HTML format. `names` Returns the display name of each field. + * `schema` Returns the schema describing a field type. `transitions` Returns all possible transitions for the issue. + * `operations` Returns all possible operations for the issue. `editmeta` Returns information about how each field can + * be edited. `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each + * version of a field's value, with the highest numbered item representing the most recent version. + */ + expand?: string; + /** + * A list of issue property keys for issue properties to include in the results. This parameter accepts a + * comma-separated list. Multiple properties can also be provided using an ampersand separated list. For example, + * `properties=prop1,prop2&properties=prop3`. A maximum of 5 issue property keys can be specified. + */ + properties?: string[]; + /** Reference fields by their key (rather than ID). */ + fieldsByKeys?: boolean; +} diff --git a/src/version3/parameters/searchForIssuesUsingJql.ts b/src/version3/parameters/searchForIssuesUsingJql.ts deleted file mode 100644 index c47b71a6c..000000000 --- a/src/version3/parameters/searchForIssuesUsingJql.ts +++ /dev/null @@ -1,66 +0,0 @@ -export interface SearchForIssuesUsingJql { - /** - * The [JQL](https://confluence.atlassian.com/x/egORLQ) that defines the search. Note: - * - * If no JQL expression is provided, all issues are returned. `username` and `userkey` cannot be used as search terms - * due to privacy reasons. Use `accountId` instead. If a user has hidden their email address in their user profile, - * partial matches of the email address will not find the user. An exact match is required. - */ - jql?: string; - /** The index of the first item to return in a page of results (page offset). */ - startAt?: number; - /** - * The maximum number of items to return per page. To manage page size, Jira may return fewer items per page where a - * large number of fields are requested. The greatest number of items returned per page is achieved when requesting - * `id` or `key` only. - */ - maxResults?: number; - /** - * Determines how to validate the JQL query and treat the validation results. Supported values are: - * - * - `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). - * - `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for - * - `strict`. `false` _Deprecated_ A legacy synonym for `warn`. - * - * Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. - */ - validateQuery?: 'strict' | 'warn' | 'none' | string; - /** - * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a - * comma-separated list. Expand options include: - * - * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to - * exclude. - * - * Examples: - * - * `summary,comment` Returns only the summary and comments fields. `-description` Returns all navigable (default) - * fields except description. `*all,-comment` Returns all fields except comments. - * - * This parameter may be specified multiple times. For example, `fields=field1,field2&fields=field3`. - * - * Note: All navigable fields are returned by default. This differs from [GET - * issue](#api-rest-api-3-issue-issueIdOrKey-get) where the default is all fields. - */ - fields?: string[]; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about issues in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `renderedFields` Returns field values rendered in HTML format. `names` Returns the display name of each field. - * `schema` Returns the schema describing a field type. `transitions` Returns all possible transitions for the issue. - * `operations` Returns all possible operations for the issue. `editmeta` Returns information about how each field can - * be edited. `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. - * `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each - * version of a field's value, with the highest numbered item representing the most recent version. - */ - expand?: string; - /** - * A list of issue property keys for issue properties to include in the results. This parameter accepts a - * comma-separated list. Multiple properties can also be provided using an ampersand separated list. For example, - * `properties=prop1,prop2&properties=prop3`. A maximum of 5 issue property keys can be specified. - */ - properties?: string[]; - /** Reference fields by their key (rather than ID). */ - fieldsByKeys?: boolean; -} diff --git a/src/version3/parameters/searchForIssuesUsingJqlPost.mts b/src/version3/parameters/searchForIssuesUsingJqlPost.mts new file mode 100644 index 000000000..d087fe638 --- /dev/null +++ b/src/version3/parameters/searchForIssuesUsingJqlPost.mts @@ -0,0 +1,3 @@ +import { SearchRequest } from '../models/index.mjs'; + +export interface SearchForIssuesUsingJqlPost extends SearchRequest {} diff --git a/src/version3/parameters/searchForIssuesUsingJqlPost.ts b/src/version3/parameters/searchForIssuesUsingJqlPost.ts deleted file mode 100644 index a78ee34ac..000000000 --- a/src/version3/parameters/searchForIssuesUsingJqlPost.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SearchRequest } from '../models/index.js'; - -export interface SearchForIssuesUsingJqlPost extends SearchRequest {} diff --git a/src/version3/parameters/searchPriorities.ts b/src/version3/parameters/searchPriorities.mts similarity index 100% rename from src/version3/parameters/searchPriorities.ts rename to src/version3/parameters/searchPriorities.mts diff --git a/src/version3/parameters/searchProjects.ts b/src/version3/parameters/searchProjects.mts similarity index 100% rename from src/version3/parameters/searchProjects.ts rename to src/version3/parameters/searchProjects.mts diff --git a/src/version3/parameters/searchProjectsUsingSecuritySchemes.ts b/src/version3/parameters/searchProjectsUsingSecuritySchemes.mts similarity index 100% rename from src/version3/parameters/searchProjectsUsingSecuritySchemes.ts rename to src/version3/parameters/searchProjectsUsingSecuritySchemes.mts diff --git a/src/version3/parameters/searchResolutions.ts b/src/version3/parameters/searchResolutions.mts similarity index 100% rename from src/version3/parameters/searchResolutions.ts rename to src/version3/parameters/searchResolutions.mts diff --git a/src/version3/parameters/searchSecuritySchemes.ts b/src/version3/parameters/searchSecuritySchemes.mts similarity index 100% rename from src/version3/parameters/searchSecuritySchemes.ts rename to src/version3/parameters/searchSecuritySchemes.mts diff --git a/src/version3/parameters/selectTimeTrackingImplementation.mts b/src/version3/parameters/selectTimeTrackingImplementation.mts new file mode 100644 index 000000000..bc2fb949f --- /dev/null +++ b/src/version3/parameters/selectTimeTrackingImplementation.mts @@ -0,0 +1,3 @@ +import { TimeTrackingProvider } from '../models/index.mjs'; + +export interface SelectTimeTrackingImplementation extends TimeTrackingProvider {} diff --git a/src/version3/parameters/selectTimeTrackingImplementation.ts b/src/version3/parameters/selectTimeTrackingImplementation.ts deleted file mode 100644 index 0e1e48c1c..000000000 --- a/src/version3/parameters/selectTimeTrackingImplementation.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TimeTrackingProvider } from '../models/index.js'; - -export interface SelectTimeTrackingImplementation extends TimeTrackingProvider {} diff --git a/src/version3/parameters/setActors.mts b/src/version3/parameters/setActors.mts new file mode 100644 index 000000000..77a54cf56 --- /dev/null +++ b/src/version3/parameters/setActors.mts @@ -0,0 +1,11 @@ +import { ProjectRoleActorsUpdate } from '../models/index.mjs'; + +export interface SetActors extends ProjectRoleActorsUpdate { + /** The project ID or project key (case sensitive). */ + projectIdOrKey: string; + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role + * IDs. + */ + id: number; +} diff --git a/src/version3/parameters/setActors.ts b/src/version3/parameters/setActors.ts deleted file mode 100644 index c49888e77..000000000 --- a/src/version3/parameters/setActors.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { ProjectRoleActorsUpdate } from '../models/index.js'; - -export interface SetActors extends ProjectRoleActorsUpdate { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; - /** - * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role - * IDs. - */ - id: number; -} diff --git a/src/version3/parameters/setApplicationProperty.mts b/src/version3/parameters/setApplicationProperty.mts new file mode 100644 index 000000000..a729fce3b --- /dev/null +++ b/src/version3/parameters/setApplicationProperty.mts @@ -0,0 +1,14 @@ +import { SimpleApplicationProperty } from '../models/index.mjs'; + +export interface SetApplicationProperty extends SimpleApplicationProperty { + /** The key of the application property to update. */ + id: string; + + body?: { + /** The ID of the application property. */ + id?: string; + + /** The new value. */ + value?: string; + }; +} diff --git a/src/version3/parameters/setApplicationProperty.ts b/src/version3/parameters/setApplicationProperty.ts deleted file mode 100644 index 2788ded31..000000000 --- a/src/version3/parameters/setApplicationProperty.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { SimpleApplicationProperty } from '../models/index.js'; - -export interface SetApplicationProperty extends SimpleApplicationProperty { - /** The key of the application property to update. */ - id: string; - - body?: { - /** The ID of the application property. */ - id?: string; - - /** The new value. */ - value?: string; - }; -} diff --git a/src/version3/parameters/setBanner.mts b/src/version3/parameters/setBanner.mts new file mode 100644 index 000000000..29ff18a39 --- /dev/null +++ b/src/version3/parameters/setBanner.mts @@ -0,0 +1,3 @@ +import { AnnouncementBannerConfigurationUpdate } from '../models/index.mjs'; + +export interface SetBanner extends AnnouncementBannerConfigurationUpdate {} diff --git a/src/version3/parameters/setBanner.ts b/src/version3/parameters/setBanner.ts deleted file mode 100644 index 943309dc1..000000000 --- a/src/version3/parameters/setBanner.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { AnnouncementBannerConfigurationUpdate } from '../models/index.js'; - -export interface SetBanner extends AnnouncementBannerConfigurationUpdate {} diff --git a/src/version3/parameters/setColumns.ts b/src/version3/parameters/setColumns.mts similarity index 100% rename from src/version3/parameters/setColumns.ts rename to src/version3/parameters/setColumns.mts diff --git a/src/version3/parameters/setCommentProperty.ts b/src/version3/parameters/setCommentProperty.mts similarity index 100% rename from src/version3/parameters/setCommentProperty.ts rename to src/version3/parameters/setCommentProperty.mts diff --git a/src/version3/parameters/setDashboardItemProperty.ts b/src/version3/parameters/setDashboardItemProperty.mts similarity index 100% rename from src/version3/parameters/setDashboardItemProperty.ts rename to src/version3/parameters/setDashboardItemProperty.mts diff --git a/src/version3/parameters/setDefaultLevels.mts b/src/version3/parameters/setDefaultLevels.mts new file mode 100644 index 000000000..34c8ce77b --- /dev/null +++ b/src/version3/parameters/setDefaultLevels.mts @@ -0,0 +1,3 @@ +import { SetDefaultLevelsRequest } from '../models/index.mjs'; + +export interface SetDefaultLevels extends SetDefaultLevelsRequest {} diff --git a/src/version3/parameters/setDefaultLevels.ts b/src/version3/parameters/setDefaultLevels.ts deleted file mode 100644 index 03104ef79..000000000 --- a/src/version3/parameters/setDefaultLevels.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SetDefaultLevelsRequest } from '../models/index.js'; - -export interface SetDefaultLevels extends SetDefaultLevelsRequest {} diff --git a/src/version3/parameters/setDefaultPriority.mts b/src/version3/parameters/setDefaultPriority.mts new file mode 100644 index 000000000..c21ba5cc6 --- /dev/null +++ b/src/version3/parameters/setDefaultPriority.mts @@ -0,0 +1,3 @@ +import { SetDefaultPriorityRequest } from '../models/index.mjs'; + +export interface SetDefaultPriority extends SetDefaultPriorityRequest {} diff --git a/src/version3/parameters/setDefaultPriority.ts b/src/version3/parameters/setDefaultPriority.ts deleted file mode 100644 index a6bec9517..000000000 --- a/src/version3/parameters/setDefaultPriority.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SetDefaultPriorityRequest } from '../models/index.js'; - -export interface SetDefaultPriority extends SetDefaultPriorityRequest {} diff --git a/src/version3/parameters/setDefaultResolution.mts b/src/version3/parameters/setDefaultResolution.mts new file mode 100644 index 000000000..7231abde6 --- /dev/null +++ b/src/version3/parameters/setDefaultResolution.mts @@ -0,0 +1,3 @@ +import { SetDefaultResolutionRequest } from '../models/index.mjs'; + +export interface SetDefaultResolution extends SetDefaultResolutionRequest {} diff --git a/src/version3/parameters/setDefaultResolution.ts b/src/version3/parameters/setDefaultResolution.ts deleted file mode 100644 index 53ed1d093..000000000 --- a/src/version3/parameters/setDefaultResolution.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SetDefaultResolutionRequest } from '../models/index.js'; - -export interface SetDefaultResolution extends SetDefaultResolutionRequest {} diff --git a/src/version3/parameters/setDefaultShareScope.mts b/src/version3/parameters/setDefaultShareScope.mts new file mode 100644 index 000000000..f915d2df5 --- /dev/null +++ b/src/version3/parameters/setDefaultShareScope.mts @@ -0,0 +1,3 @@ +import { DefaultShareScope } from '../models/index.mjs'; + +export interface SetDefaultShareScope extends DefaultShareScope {} diff --git a/src/version3/parameters/setDefaultShareScope.ts b/src/version3/parameters/setDefaultShareScope.ts deleted file mode 100644 index fa5f5f799..000000000 --- a/src/version3/parameters/setDefaultShareScope.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { DefaultShareScope } from '../models/index.js'; - -export interface SetDefaultShareScope extends DefaultShareScope {} diff --git a/src/version3/parameters/setDefaultValues.mts b/src/version3/parameters/setDefaultValues.mts new file mode 100644 index 000000000..9359c4d77 --- /dev/null +++ b/src/version3/parameters/setDefaultValues.mts @@ -0,0 +1,6 @@ +import { CustomFieldContextDefaultValueUpdate } from '../models/index.mjs'; + +export interface SetDefaultValues extends CustomFieldContextDefaultValueUpdate { + /** The ID of the custom field. */ + fieldId: string; +} diff --git a/src/version3/parameters/setDefaultValues.ts b/src/version3/parameters/setDefaultValues.ts deleted file mode 100644 index c08e6eb98..000000000 --- a/src/version3/parameters/setDefaultValues.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CustomFieldContextDefaultValueUpdate } from '../models/index.js'; - -export interface SetDefaultValues extends CustomFieldContextDefaultValueUpdate { - /** The ID of the custom field. */ - fieldId: string; -} diff --git a/src/version3/parameters/setFavouriteForFilter.ts b/src/version3/parameters/setFavouriteForFilter.mts similarity index 100% rename from src/version3/parameters/setFavouriteForFilter.ts rename to src/version3/parameters/setFavouriteForFilter.mts diff --git a/src/version3/parameters/setFieldConfigurationSchemeMapping.mts b/src/version3/parameters/setFieldConfigurationSchemeMapping.mts new file mode 100644 index 000000000..a782ef41d --- /dev/null +++ b/src/version3/parameters/setFieldConfigurationSchemeMapping.mts @@ -0,0 +1,6 @@ +import { AssociateFieldConfigurationsWithIssueTypesRequest } from '../models/index.mjs'; + +export interface SetFieldConfigurationSchemeMapping extends AssociateFieldConfigurationsWithIssueTypesRequest { + /** The ID of the field configuration scheme. */ + id: number; +} diff --git a/src/version3/parameters/setFieldConfigurationSchemeMapping.ts b/src/version3/parameters/setFieldConfigurationSchemeMapping.ts deleted file mode 100644 index d12f80738..000000000 --- a/src/version3/parameters/setFieldConfigurationSchemeMapping.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AssociateFieldConfigurationsWithIssueTypesRequest } from '../models/index.js'; - -export interface SetFieldConfigurationSchemeMapping extends AssociateFieldConfigurationsWithIssueTypesRequest { - /** The ID of the field configuration scheme. */ - id: number; -} diff --git a/src/version3/parameters/setIssueProperty.ts b/src/version3/parameters/setIssueProperty.mts similarity index 100% rename from src/version3/parameters/setIssueProperty.ts rename to src/version3/parameters/setIssueProperty.mts diff --git a/src/version3/parameters/setIssueTypeProperty.ts b/src/version3/parameters/setIssueTypeProperty.mts similarity index 100% rename from src/version3/parameters/setIssueTypeProperty.ts rename to src/version3/parameters/setIssueTypeProperty.mts diff --git a/src/version3/parameters/setPreference.ts b/src/version3/parameters/setPreference.mts similarity index 100% rename from src/version3/parameters/setPreference.ts rename to src/version3/parameters/setPreference.mts diff --git a/src/version3/parameters/setProjectProperty.ts b/src/version3/parameters/setProjectProperty.mts similarity index 100% rename from src/version3/parameters/setProjectProperty.ts rename to src/version3/parameters/setProjectProperty.mts diff --git a/src/version3/parameters/setSharedTimeTrackingConfiguration.mts b/src/version3/parameters/setSharedTimeTrackingConfiguration.mts new file mode 100644 index 000000000..e97c080ff --- /dev/null +++ b/src/version3/parameters/setSharedTimeTrackingConfiguration.mts @@ -0,0 +1,3 @@ +import { TimeTrackingConfiguration } from '../models/index.mjs'; + +export interface SetSharedTimeTrackingConfiguration extends TimeTrackingConfiguration {} diff --git a/src/version3/parameters/setSharedTimeTrackingConfiguration.ts b/src/version3/parameters/setSharedTimeTrackingConfiguration.ts deleted file mode 100644 index 6725860be..000000000 --- a/src/version3/parameters/setSharedTimeTrackingConfiguration.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TimeTrackingConfiguration } from '../models/index.js'; - -export interface SetSharedTimeTrackingConfiguration extends TimeTrackingConfiguration {} diff --git a/src/version3/parameters/setUserColumns.ts b/src/version3/parameters/setUserColumns.mts similarity index 100% rename from src/version3/parameters/setUserColumns.ts rename to src/version3/parameters/setUserColumns.mts diff --git a/src/version3/parameters/setUserProperty.ts b/src/version3/parameters/setUserProperty.mts similarity index 100% rename from src/version3/parameters/setUserProperty.ts rename to src/version3/parameters/setUserProperty.mts diff --git a/src/version3/parameters/setWorkflowSchemeDraftIssueType.mts b/src/version3/parameters/setWorkflowSchemeDraftIssueType.mts new file mode 100644 index 000000000..c67e2d47e --- /dev/null +++ b/src/version3/parameters/setWorkflowSchemeDraftIssueType.mts @@ -0,0 +1,24 @@ +import { IssueTypeWorkflowMapping } from '../models/index.mjs'; + +export interface SetWorkflowSchemeDraftIssueType extends IssueTypeWorkflowMapping { + /** The ID of the workflow scheme that the draft belongs to. */ + id: number; + /** The ID of the issue type. */ + issueType: string; + + /** Details about the mapping between an issue type and a workflow. */ + details?: { + /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ + issueType?: string; + + /** The name of the workflow. */ + workflow?: string; + + /** + * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the + * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types + * mapping. + */ + updateDraftIfNeeded?: boolean; + }; +} diff --git a/src/version3/parameters/setWorkflowSchemeDraftIssueType.ts b/src/version3/parameters/setWorkflowSchemeDraftIssueType.ts deleted file mode 100644 index 0d5e5d63e..000000000 --- a/src/version3/parameters/setWorkflowSchemeDraftIssueType.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { IssueTypeWorkflowMapping } from '../models/index.js'; - -export interface SetWorkflowSchemeDraftIssueType extends IssueTypeWorkflowMapping { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** The ID of the issue type. */ - issueType: string; - - /** Details about the mapping between an issue type and a workflow. */ - details?: { - /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ - issueType?: string; - - /** The name of the workflow. */ - workflow?: string; - - /** - * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the - * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types - * mapping. - */ - updateDraftIfNeeded?: boolean; - }; -} diff --git a/src/version3/parameters/setWorkflowSchemeIssueType.mts b/src/version3/parameters/setWorkflowSchemeIssueType.mts new file mode 100644 index 000000000..213e194ca --- /dev/null +++ b/src/version3/parameters/setWorkflowSchemeIssueType.mts @@ -0,0 +1,24 @@ +import { IssueTypeWorkflowMapping } from '../models/index.mjs'; + +export interface SetWorkflowSchemeIssueType extends IssueTypeWorkflowMapping { + /** The ID of the workflow scheme. */ + id: number; + /** The ID of the issue type. */ + issueType: string; + + /** Details about the mapping between an issue type and a workflow. */ + details?: { + /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ + issueType?: string; + + /** The name of the workflow. */ + workflow?: string; + + /** + * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the + * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types + * mapping. + */ + updateDraftIfNeeded?: boolean; + }; +} diff --git a/src/version3/parameters/setWorkflowSchemeIssueType.ts b/src/version3/parameters/setWorkflowSchemeIssueType.ts deleted file mode 100644 index 960080134..000000000 --- a/src/version3/parameters/setWorkflowSchemeIssueType.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { IssueTypeWorkflowMapping } from '../models/index.js'; - -export interface SetWorkflowSchemeIssueType extends IssueTypeWorkflowMapping { - /** The ID of the workflow scheme. */ - id: number; - /** The ID of the issue type. */ - issueType: string; - - /** Details about the mapping between an issue type and a workflow. */ - details?: { - /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ - issueType?: string; - - /** The name of the workflow. */ - workflow?: string; - - /** - * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the - * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types - * mapping. - */ - updateDraftIfNeeded?: boolean; - }; -} diff --git a/src/version3/parameters/setWorklogProperty.ts b/src/version3/parameters/setWorklogProperty.mts similarity index 100% rename from src/version3/parameters/setWorklogProperty.ts rename to src/version3/parameters/setWorklogProperty.mts diff --git a/src/version3/parameters/storeAvatar.ts b/src/version3/parameters/storeAvatar.mts similarity index 100% rename from src/version3/parameters/storeAvatar.ts rename to src/version3/parameters/storeAvatar.mts diff --git a/src/version3/parameters/toggleFeatureForProject.mts b/src/version3/parameters/toggleFeatureForProject.mts new file mode 100644 index 000000000..3bcd5cfab --- /dev/null +++ b/src/version3/parameters/toggleFeatureForProject.mts @@ -0,0 +1,8 @@ +import { ProjectFeatureToggleRequest } from '../models/index.mjs'; + +export interface ToggleFeatureForProject extends ProjectFeatureToggleRequest { + /** The ID or (case-sensitive) key of the project. */ + projectIdOrKey: string; + /** The key of the feature. */ + featureKey: string; +} diff --git a/src/version3/parameters/toggleFeatureForProject.ts b/src/version3/parameters/toggleFeatureForProject.ts deleted file mode 100644 index b6b01dc2f..000000000 --- a/src/version3/parameters/toggleFeatureForProject.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ProjectFeatureToggleRequest } from '../models/index.js'; - -export interface ToggleFeatureForProject extends ProjectFeatureToggleRequest { - /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; - /** The key of the feature. */ - featureKey: string; -} diff --git a/src/version3/parameters/trashCustomField.ts b/src/version3/parameters/trashCustomField.mts similarity index 100% rename from src/version3/parameters/trashCustomField.ts rename to src/version3/parameters/trashCustomField.mts diff --git a/src/version3/parameters/unarchiveIssues.mts b/src/version3/parameters/unarchiveIssues.mts new file mode 100644 index 000000000..d923e8b50 --- /dev/null +++ b/src/version3/parameters/unarchiveIssues.mts @@ -0,0 +1,3 @@ +import { IssueArchivalSyncRequest } from '../models/index.mjs'; + +export interface UnarchiveIssues extends IssueArchivalSyncRequest {} diff --git a/src/version3/parameters/unarchiveIssues.ts b/src/version3/parameters/unarchiveIssues.ts deleted file mode 100644 index 05dfb0982..000000000 --- a/src/version3/parameters/unarchiveIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IssueArchivalSyncRequest } from '../models/index.js'; - -export interface UnarchiveIssues extends IssueArchivalSyncRequest {} diff --git a/src/version3/parameters/updateComment.mts b/src/version3/parameters/updateComment.mts new file mode 100644 index 000000000..05c869e60 --- /dev/null +++ b/src/version3/parameters/updateComment.mts @@ -0,0 +1,22 @@ +import { Comment } from '../models/index.mjs'; + +export interface UpdateComment extends Comment { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** The ID of the comment. */ + id: string; + /** Whether users are notified when a comment is updated. */ + notifyUsers?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with + * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on + * behalf of users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body + * rendered in HTML. + */ + expand?: 'renderedBody' | ['renderedBody'] | string | string[]; +} diff --git a/src/version3/parameters/updateComment.ts b/src/version3/parameters/updateComment.ts deleted file mode 100644 index 786cff6a8..000000000 --- a/src/version3/parameters/updateComment.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { Comment } from '../models/index.js'; - -export interface UpdateComment extends Comment { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the comment. */ - id: string; - /** Whether users are notified when a comment is updated. */ - notifyUsers?: boolean; - /** - * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with - * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on - * behalf of users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideEditableFlag?: boolean; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body - * rendered in HTML. - */ - expand?: 'renderedBody' | ['renderedBody'] | string | string[]; -} diff --git a/src/version3/parameters/updateComponent.mts b/src/version3/parameters/updateComponent.mts new file mode 100644 index 000000000..83eaa7ed4 --- /dev/null +++ b/src/version3/parameters/updateComponent.mts @@ -0,0 +1,6 @@ +import { ProjectComponent } from '../models/index.mjs'; + +export interface UpdateComponent extends ProjectComponent { + /** The ID of the component. */ + id: string; +} diff --git a/src/version3/parameters/updateComponent.ts b/src/version3/parameters/updateComponent.ts deleted file mode 100644 index 99e70f0e1..000000000 --- a/src/version3/parameters/updateComponent.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ProjectComponent } from '../models/index.js'; - -export interface UpdateComponent extends ProjectComponent { - /** The ID of the component. */ - id: string; -} diff --git a/src/version3/parameters/updateCustomField.mts b/src/version3/parameters/updateCustomField.mts new file mode 100644 index 000000000..92185635d --- /dev/null +++ b/src/version3/parameters/updateCustomField.mts @@ -0,0 +1,6 @@ +import { UpdateCustomFieldDetails } from '../models/index.mjs'; + +export interface UpdateCustomField extends UpdateCustomFieldDetails { + /** The ID of the custom field. */ + fieldId: string; +} diff --git a/src/version3/parameters/updateCustomField.ts b/src/version3/parameters/updateCustomField.ts deleted file mode 100644 index 819d71266..000000000 --- a/src/version3/parameters/updateCustomField.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateCustomFieldDetails } from '../models/index.js'; - -export interface UpdateCustomField extends UpdateCustomFieldDetails { - /** The ID of the custom field. */ - fieldId: string; -} diff --git a/src/version3/parameters/updateCustomFieldConfiguration.mts b/src/version3/parameters/updateCustomFieldConfiguration.mts new file mode 100644 index 000000000..01de512fb --- /dev/null +++ b/src/version3/parameters/updateCustomFieldConfiguration.mts @@ -0,0 +1,6 @@ +import { CustomFieldConfigurations } from '../models/index.mjs'; + +export interface UpdateCustomFieldConfiguration extends CustomFieldConfigurations { + /** The ID or key of the custom field, for example `customfield_10000`. */ + fieldIdOrKey: string; +} diff --git a/src/version3/parameters/updateCustomFieldConfiguration.ts b/src/version3/parameters/updateCustomFieldConfiguration.ts deleted file mode 100644 index 4c1ae86b2..000000000 --- a/src/version3/parameters/updateCustomFieldConfiguration.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CustomFieldConfigurations } from '../models/index.js'; - -export interface UpdateCustomFieldConfiguration extends CustomFieldConfigurations { - /** The ID or key of the custom field, for example `customfield_10000`. */ - fieldIdOrKey: string; -} diff --git a/src/version3/parameters/updateCustomFieldContext.mts b/src/version3/parameters/updateCustomFieldContext.mts new file mode 100644 index 000000000..bf7f31a74 --- /dev/null +++ b/src/version3/parameters/updateCustomFieldContext.mts @@ -0,0 +1,8 @@ +import { CustomFieldContextUpdateDetails } from '../models/index.mjs'; + +export interface UpdateCustomFieldContext extends CustomFieldContextUpdateDetails { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/updateCustomFieldContext.ts b/src/version3/parameters/updateCustomFieldContext.ts deleted file mode 100644 index f04305c5c..000000000 --- a/src/version3/parameters/updateCustomFieldContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CustomFieldContextUpdateDetails } from '../models/index.js'; - -export interface UpdateCustomFieldContext extends CustomFieldContextUpdateDetails { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version3/parameters/updateCustomFieldOption.mts b/src/version3/parameters/updateCustomFieldOption.mts new file mode 100644 index 000000000..65cf799f0 --- /dev/null +++ b/src/version3/parameters/updateCustomFieldOption.mts @@ -0,0 +1,8 @@ +import { BulkCustomFieldOptionUpdateRequest } from '../models/index.mjs'; + +export interface UpdateCustomFieldOption extends BulkCustomFieldOptionUpdateRequest { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/updateCustomFieldOption.ts b/src/version3/parameters/updateCustomFieldOption.ts deleted file mode 100644 index df4b85436..000000000 --- a/src/version3/parameters/updateCustomFieldOption.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { BulkCustomFieldOptionUpdateRequest } from '../models/index.js'; - -export interface UpdateCustomFieldOption extends BulkCustomFieldOptionUpdateRequest { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version3/parameters/updateCustomFieldValue.mts b/src/version3/parameters/updateCustomFieldValue.mts new file mode 100644 index 000000000..faf2c0889 --- /dev/null +++ b/src/version3/parameters/updateCustomFieldValue.mts @@ -0,0 +1,8 @@ +import { CustomFieldValueUpdateRequest } from '../models/index.mjs'; + +export interface UpdateCustomFieldValue extends CustomFieldValueUpdateRequest { + /** The ID or key of the custom field. For example, `customfield_10010`. */ + fieldIdOrKey: string; + /** Whether to generate a changelog for this update. */ + generateChangelog?: boolean; +} diff --git a/src/version3/parameters/updateCustomFieldValue.ts b/src/version3/parameters/updateCustomFieldValue.ts deleted file mode 100644 index c70745db0..000000000 --- a/src/version3/parameters/updateCustomFieldValue.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CustomFieldValueUpdateRequest } from '../models/index.js'; - -export interface UpdateCustomFieldValue extends CustomFieldValueUpdateRequest { - /** The ID or key of the custom field. For example, `customfield_10010`. */ - fieldIdOrKey: string; - /** Whether to generate a changelog for this update. */ - generateChangelog?: boolean; -} diff --git a/src/version3/parameters/updateDashboard.mts b/src/version3/parameters/updateDashboard.mts new file mode 100644 index 000000000..e180543c8 --- /dev/null +++ b/src/version3/parameters/updateDashboard.mts @@ -0,0 +1,6 @@ +import { DashboardDetails } from '../models/index.mjs'; + +export interface UpdateDashboard extends DashboardDetails { + /** The ID of the dashboard to update. */ + id: string; +} diff --git a/src/version3/parameters/updateDashboard.ts b/src/version3/parameters/updateDashboard.ts deleted file mode 100644 index e0200a626..000000000 --- a/src/version3/parameters/updateDashboard.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DashboardDetails } from '../models/index.js'; - -export interface UpdateDashboard extends DashboardDetails { - /** The ID of the dashboard to update. */ - id: string; -} diff --git a/src/version3/parameters/updateDefaultScreenScheme.ts b/src/version3/parameters/updateDefaultScreenScheme.mts similarity index 100% rename from src/version3/parameters/updateDefaultScreenScheme.ts rename to src/version3/parameters/updateDefaultScreenScheme.mts diff --git a/src/version3/parameters/updateDefaultWorkflow.mts b/src/version3/parameters/updateDefaultWorkflow.mts new file mode 100644 index 000000000..26baa37fe --- /dev/null +++ b/src/version3/parameters/updateDefaultWorkflow.mts @@ -0,0 +1,6 @@ +import { DefaultWorkflow } from '../models/index.mjs'; + +export interface UpdateDefaultWorkflow extends DefaultWorkflow { + /** The ID of the workflow scheme. */ + id: number; +} diff --git a/src/version3/parameters/updateDefaultWorkflow.ts b/src/version3/parameters/updateDefaultWorkflow.ts deleted file mode 100644 index f9067e0af..000000000 --- a/src/version3/parameters/updateDefaultWorkflow.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DefaultWorkflow } from '../models/index.js'; - -export interface UpdateDefaultWorkflow extends DefaultWorkflow { - /** The ID of the workflow scheme. */ - id: number; -} diff --git a/src/version3/parameters/updateDraftDefaultWorkflow.mts b/src/version3/parameters/updateDraftDefaultWorkflow.mts new file mode 100644 index 000000000..7ea28013a --- /dev/null +++ b/src/version3/parameters/updateDraftDefaultWorkflow.mts @@ -0,0 +1,6 @@ +import { DefaultWorkflow } from '../models/index.mjs'; + +export interface UpdateDraftDefaultWorkflow extends DefaultWorkflow { + /** The ID of the workflow scheme that the draft belongs to. */ + id: number; +} diff --git a/src/version3/parameters/updateDraftDefaultWorkflow.ts b/src/version3/parameters/updateDraftDefaultWorkflow.ts deleted file mode 100644 index a61f2b5ad..000000000 --- a/src/version3/parameters/updateDraftDefaultWorkflow.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { DefaultWorkflow } from '../models/index.js'; - -export interface UpdateDraftDefaultWorkflow extends DefaultWorkflow { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; -} diff --git a/src/version3/parameters/updateDraftWorkflowMapping.mts b/src/version3/parameters/updateDraftWorkflowMapping.mts new file mode 100644 index 000000000..43a88b8ce --- /dev/null +++ b/src/version3/parameters/updateDraftWorkflowMapping.mts @@ -0,0 +1,8 @@ +import { IssueTypesWorkflowMapping } from '../models/index.mjs'; + +export interface UpdateDraftWorkflowMapping extends IssueTypesWorkflowMapping { + /** The ID of the workflow scheme that the draft belongs to. */ + id: number; + /** The name of the workflow. */ + workflowName: string; +} diff --git a/src/version3/parameters/updateDraftWorkflowMapping.ts b/src/version3/parameters/updateDraftWorkflowMapping.ts deleted file mode 100644 index 3758d6384..000000000 --- a/src/version3/parameters/updateDraftWorkflowMapping.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypesWorkflowMapping } from '../models/index.js'; - -export interface UpdateDraftWorkflowMapping extends IssueTypesWorkflowMapping { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** The name of the workflow. */ - workflowName: string; -} diff --git a/src/version3/parameters/updateEntityPropertiesValue.mts b/src/version3/parameters/updateEntityPropertiesValue.mts new file mode 100644 index 000000000..286fe02fa --- /dev/null +++ b/src/version3/parameters/updateEntityPropertiesValue.mts @@ -0,0 +1,22 @@ +import { EntityPropertyDetails } from '../models/index.mjs'; + +export interface UpdateEntityPropertiesValue { + /** The app migration transfer ID. */ + transferId: string; + /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ + accountId: string; + /** The type indicating the object that contains the entity properties. */ + entityType: + | 'IssueProperty' + | 'CommentProperty' + | 'DashboardItemProperty' + | 'IssueTypeProperty' + | 'ProjectProperty' + | 'UserProperty' + | 'WorklogProperty' + | 'BoardProperty' + | 'SprintProperty' + | string; + + entities?: Array; +} diff --git a/src/version3/parameters/updateEntityPropertiesValue.ts b/src/version3/parameters/updateEntityPropertiesValue.ts deleted file mode 100644 index d0f68ff61..000000000 --- a/src/version3/parameters/updateEntityPropertiesValue.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { EntityPropertyDetails } from '../models/index.js'; - -export interface UpdateEntityPropertiesValue { - /** The app migration transfer ID. */ - transferId: string; - /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ - accountId: string; - /** The type indicating the object that contains the entity properties. */ - entityType: - | 'IssueProperty' - | 'CommentProperty' - | 'DashboardItemProperty' - | 'IssueTypeProperty' - | 'ProjectProperty' - | 'UserProperty' - | 'WorklogProperty' - | 'BoardProperty' - | 'SprintProperty' - | string; - - entities?: Array; -} diff --git a/src/version3/parameters/updateFieldConfiguration.mts b/src/version3/parameters/updateFieldConfiguration.mts new file mode 100644 index 000000000..6c0eebad8 --- /dev/null +++ b/src/version3/parameters/updateFieldConfiguration.mts @@ -0,0 +1,6 @@ +import { FieldConfigurationDetails } from '../models/index.mjs'; + +export interface UpdateFieldConfiguration extends FieldConfigurationDetails { + /** The ID of the field configuration. */ + id: number; +} diff --git a/src/version3/parameters/updateFieldConfiguration.ts b/src/version3/parameters/updateFieldConfiguration.ts deleted file mode 100644 index 2e4e24792..000000000 --- a/src/version3/parameters/updateFieldConfiguration.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { FieldConfigurationDetails } from '../models/index.js'; - -export interface UpdateFieldConfiguration extends FieldConfigurationDetails { - /** The ID of the field configuration. */ - id: number; -} diff --git a/src/version3/parameters/updateFieldConfigurationItems.mts b/src/version3/parameters/updateFieldConfigurationItems.mts new file mode 100644 index 000000000..da43ec28a --- /dev/null +++ b/src/version3/parameters/updateFieldConfigurationItems.mts @@ -0,0 +1,6 @@ +import { FieldConfigurationItemsDetails } from '../models/index.mjs'; + +export interface UpdateFieldConfigurationItems extends FieldConfigurationItemsDetails { + /** The ID of the field configuration. */ + id: number; +} diff --git a/src/version3/parameters/updateFieldConfigurationItems.ts b/src/version3/parameters/updateFieldConfigurationItems.ts deleted file mode 100644 index e6da23d2d..000000000 --- a/src/version3/parameters/updateFieldConfigurationItems.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { FieldConfigurationItemsDetails } from '../models/index.js'; - -export interface UpdateFieldConfigurationItems extends FieldConfigurationItemsDetails { - /** The ID of the field configuration. */ - id: number; -} diff --git a/src/version3/parameters/updateFieldConfigurationScheme.mts b/src/version3/parameters/updateFieldConfigurationScheme.mts new file mode 100644 index 000000000..da4f130a3 --- /dev/null +++ b/src/version3/parameters/updateFieldConfigurationScheme.mts @@ -0,0 +1,6 @@ +import { UpdateFieldConfigurationSchemeDetails } from '../models/index.mjs'; + +export interface UpdateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails { + /** The ID of the field configuration scheme. */ + id: number; +} diff --git a/src/version3/parameters/updateFieldConfigurationScheme.ts b/src/version3/parameters/updateFieldConfigurationScheme.ts deleted file mode 100644 index 9904250c8..000000000 --- a/src/version3/parameters/updateFieldConfigurationScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateFieldConfigurationSchemeDetails } from '../models/index.js'; - -export interface UpdateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails { - /** The ID of the field configuration scheme. */ - id: number; -} diff --git a/src/version3/parameters/updateFilter.mts b/src/version3/parameters/updateFilter.mts new file mode 100644 index 000000000..7328d8aa1 --- /dev/null +++ b/src/version3/parameters/updateFilter.mts @@ -0,0 +1,26 @@ +import { Filter } from '../models/index.mjs'; + +export interface UpdateFilter extends Omit { + /** The ID of the filter to update. */ + id: number; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that + * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it + * doesn't list any users. The list of users returned is limited to 1000, to access additional users append + * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use + * `?expand=sharedUsers[1001:2000]`. + * - `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the + * `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is + * limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For + * example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand?: 'sharedUsers' | 'subscriptions' | ('sharedUsers' | 'subscriptions')[] | string | string[]; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable the addition of any share permissions to filters. + * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; +} diff --git a/src/version3/parameters/updateFilter.ts b/src/version3/parameters/updateFilter.ts deleted file mode 100644 index 3e61e74f8..000000000 --- a/src/version3/parameters/updateFilter.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { Filter } from '../models/index.js'; - -export interface UpdateFilter extends Omit { - /** The ID of the filter to update. */ - id: number; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that - * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it - * doesn't list any users. The list of users returned is limited to 1000, to access additional users append - * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use - * `?expand=sharedUsers[1001:2000]`. - * - `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the - * `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is - * limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For - * example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. - */ - expand?: 'sharedUsers' | 'subscriptions' | ('sharedUsers' | 'subscriptions')[] | string | string[]; - /** - * EXPERIMENTAL: Whether share permissions are overridden to enable the addition of any share permissions to filters. - * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideSharePermissions?: boolean; -} diff --git a/src/version3/parameters/updateGadget.mts b/src/version3/parameters/updateGadget.mts new file mode 100644 index 000000000..f6b2c56f8 --- /dev/null +++ b/src/version3/parameters/updateGadget.mts @@ -0,0 +1,8 @@ +import { DashboardGadgetUpdateRequest } from '../models/index.mjs'; + +export interface UpdateGadget extends DashboardGadgetUpdateRequest { + /** The ID of the dashboard. */ + dashboardId: number; + /** The ID of the gadget. */ + gadgetId: number; +} diff --git a/src/version3/parameters/updateGadget.ts b/src/version3/parameters/updateGadget.ts deleted file mode 100644 index 8514bbd03..000000000 --- a/src/version3/parameters/updateGadget.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { DashboardGadgetUpdateRequest } from '../models/index.js'; - -export interface UpdateGadget extends DashboardGadgetUpdateRequest { - /** The ID of the dashboard. */ - dashboardId: number; - /** The ID of the gadget. */ - gadgetId: number; -} diff --git a/src/version3/parameters/updateIssueFieldOption.mts b/src/version3/parameters/updateIssueFieldOption.mts new file mode 100644 index 000000000..e1ff1f276 --- /dev/null +++ b/src/version3/parameters/updateIssueFieldOption.mts @@ -0,0 +1,16 @@ +import { IssueFieldOption } from '../models/index.mjs'; + +export interface UpdateIssueFieldOption extends IssueFieldOption { + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For + * example, `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: string; + /** The ID of the option to be updated. */ + optionId: number; +} diff --git a/src/version3/parameters/updateIssueFieldOption.ts b/src/version3/parameters/updateIssueFieldOption.ts deleted file mode 100644 index fe6a966a9..000000000 --- a/src/version3/parameters/updateIssueFieldOption.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { IssueFieldOption } from '../models/index.js'; - -export interface UpdateIssueFieldOption extends IssueFieldOption { - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; - /** The ID of the option to be updated. */ - optionId: number; -} diff --git a/src/version3/parameters/updateIssueFields.mts b/src/version3/parameters/updateIssueFields.mts new file mode 100644 index 000000000..2928b6b9b --- /dev/null +++ b/src/version3/parameters/updateIssueFields.mts @@ -0,0 +1,8 @@ +import { ConnectCustomFieldValues } from '../models/index.mjs'; + +export interface UpdateIssueFields extends ConnectCustomFieldValues { + /** The ID of the transfer. */ + transferId: string; + /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ + accountId: string; +} diff --git a/src/version3/parameters/updateIssueFields.ts b/src/version3/parameters/updateIssueFields.ts deleted file mode 100644 index f944a92ed..000000000 --- a/src/version3/parameters/updateIssueFields.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ConnectCustomFieldValues } from '../models/index.js'; - -export interface UpdateIssueFields extends ConnectCustomFieldValues { - /** The ID of the transfer. */ - transferId: string; - /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ - accountId: string; -} diff --git a/src/version3/parameters/updateIssueLinkType.mts b/src/version3/parameters/updateIssueLinkType.mts new file mode 100644 index 000000000..2dcdc0b23 --- /dev/null +++ b/src/version3/parameters/updateIssueLinkType.mts @@ -0,0 +1,6 @@ +import { IssueLinkType } from '../models/index.mjs'; + +export interface UpdateIssueLinkType extends IssueLinkType { + /** The ID of the issue link type. */ + issueLinkTypeId: string; +} diff --git a/src/version3/parameters/updateIssueLinkType.ts b/src/version3/parameters/updateIssueLinkType.ts deleted file mode 100644 index 70b1474f9..000000000 --- a/src/version3/parameters/updateIssueLinkType.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueLinkType } from '../models/index.js'; - -export interface UpdateIssueLinkType extends IssueLinkType { - /** The ID of the issue link type. */ - issueLinkTypeId: string; -} diff --git a/src/version3/parameters/updateIssueSecurityScheme.mts b/src/version3/parameters/updateIssueSecurityScheme.mts new file mode 100644 index 000000000..d7a384098 --- /dev/null +++ b/src/version3/parameters/updateIssueSecurityScheme.mts @@ -0,0 +1,6 @@ +import { UpdateIssueSecuritySchemeRequest } from '../models/index.mjs'; + +export interface UpdateIssueSecurityScheme extends UpdateIssueSecuritySchemeRequest { + /** The ID of the issue security scheme. */ + id: string; +} diff --git a/src/version3/parameters/updateIssueSecurityScheme.ts b/src/version3/parameters/updateIssueSecurityScheme.ts deleted file mode 100644 index a4ba65125..000000000 --- a/src/version3/parameters/updateIssueSecurityScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateIssueSecuritySchemeRequest } from '../models/index.js'; - -export interface UpdateIssueSecurityScheme extends UpdateIssueSecuritySchemeRequest { - /** The ID of the issue security scheme. */ - id: string; -} diff --git a/src/version3/parameters/updateIssueType.mts b/src/version3/parameters/updateIssueType.mts new file mode 100644 index 000000000..934664605 --- /dev/null +++ b/src/version3/parameters/updateIssueType.mts @@ -0,0 +1,6 @@ +import { IssueTypeUpdate } from '../models/index.mjs'; + +export interface UpdateIssueType extends IssueTypeUpdate { + /** The ID of the issue type. */ + id: string; +} diff --git a/src/version3/parameters/updateIssueType.ts b/src/version3/parameters/updateIssueType.ts deleted file mode 100644 index 32061e2bd..000000000 --- a/src/version3/parameters/updateIssueType.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeUpdate } from '../models/index.js'; - -export interface UpdateIssueType extends IssueTypeUpdate { - /** The ID of the issue type. */ - id: string; -} diff --git a/src/version3/parameters/updateIssueTypeScheme.mts b/src/version3/parameters/updateIssueTypeScheme.mts new file mode 100644 index 000000000..c968a35bd --- /dev/null +++ b/src/version3/parameters/updateIssueTypeScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeSchemeUpdateDetails } from '../models/index.mjs'; + +export interface UpdateIssueTypeScheme extends IssueTypeSchemeUpdateDetails { + /** The ID of the issue type scheme. */ + issueTypeSchemeId: number; +} diff --git a/src/version3/parameters/updateIssueTypeScheme.ts b/src/version3/parameters/updateIssueTypeScheme.ts deleted file mode 100644 index 2edc63c41..000000000 --- a/src/version3/parameters/updateIssueTypeScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeSchemeUpdateDetails } from '../models/index.js'; - -export interface UpdateIssueTypeScheme extends IssueTypeSchemeUpdateDetails { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; -} diff --git a/src/version3/parameters/updateIssueTypeScreenScheme.mts b/src/version3/parameters/updateIssueTypeScreenScheme.mts new file mode 100644 index 000000000..c13563a8a --- /dev/null +++ b/src/version3/parameters/updateIssueTypeScreenScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeScreenSchemeUpdateDetails } from '../models/index.mjs'; + +export interface UpdateIssueTypeScreenScheme extends IssueTypeScreenSchemeUpdateDetails { + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: string; +} diff --git a/src/version3/parameters/updateIssueTypeScreenScheme.ts b/src/version3/parameters/updateIssueTypeScreenScheme.ts deleted file mode 100644 index 0ca5221d8..000000000 --- a/src/version3/parameters/updateIssueTypeScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { IssueTypeScreenSchemeUpdateDetails } from '../models/index.js'; - -export interface UpdateIssueTypeScreenScheme extends IssueTypeScreenSchemeUpdateDetails { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; -} diff --git a/src/version3/parameters/updateMultipleCustomFieldValues.mts b/src/version3/parameters/updateMultipleCustomFieldValues.mts new file mode 100644 index 000000000..cc7672a3d --- /dev/null +++ b/src/version3/parameters/updateMultipleCustomFieldValues.mts @@ -0,0 +1,6 @@ +import { MultipleCustomFieldValuesUpdateDetails } from '../models/index.mjs'; + +export interface UpdateMultipleCustomFieldValues extends MultipleCustomFieldValuesUpdateDetails { + /** Whether to generate a changelog for this update. */ + generateChangelog?: boolean; +} diff --git a/src/version3/parameters/updateMultipleCustomFieldValues.ts b/src/version3/parameters/updateMultipleCustomFieldValues.ts deleted file mode 100644 index ee984b47b..000000000 --- a/src/version3/parameters/updateMultipleCustomFieldValues.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { MultipleCustomFieldValuesUpdateDetails } from '../models/index.js'; - -export interface UpdateMultipleCustomFieldValues extends MultipleCustomFieldValuesUpdateDetails { - /** Whether to generate a changelog for this update. */ - generateChangelog?: boolean; -} diff --git a/src/version3/parameters/updateNotificationScheme.mts b/src/version3/parameters/updateNotificationScheme.mts new file mode 100644 index 000000000..5374c83b0 --- /dev/null +++ b/src/version3/parameters/updateNotificationScheme.mts @@ -0,0 +1,6 @@ +import { UpdateNotificationSchemeDetails } from '../models/index.mjs'; + +export interface UpdateNotificationScheme extends UpdateNotificationSchemeDetails { + /** The ID of the notification scheme. */ + id: string; +} diff --git a/src/version3/parameters/updateNotificationScheme.ts b/src/version3/parameters/updateNotificationScheme.ts deleted file mode 100644 index c242aa92f..000000000 --- a/src/version3/parameters/updateNotificationScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateNotificationSchemeDetails } from '../models/index.js'; - -export interface UpdateNotificationScheme extends UpdateNotificationSchemeDetails { - /** The ID of the notification scheme. */ - id: string; -} diff --git a/src/version3/parameters/updatePermissionScheme.mts b/src/version3/parameters/updatePermissionScheme.mts new file mode 100644 index 000000000..0cd431f69 --- /dev/null +++ b/src/version3/parameters/updatePermissionScheme.mts @@ -0,0 +1,16 @@ +import { PermissionScheme } from '../models/index.mjs'; + +export interface UpdatePermissionScheme extends PermissionScheme { + /** The ID of the permission scheme to update. */ + schemeId: number; + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * `all` Returns all expandable information. `field` Returns information about the custom field granted the + * permission. `group` Returns information about the group that is granted the permission. `permissions` Returns all + * permission grants for each permission scheme. `projectRole` Returns information about the project role granted the + * permission. `user` Returns information about the user who is granted the permission. + */ + expand?: string; +} diff --git a/src/version3/parameters/updatePermissionScheme.ts b/src/version3/parameters/updatePermissionScheme.ts deleted file mode 100644 index e7a8926fb..000000000 --- a/src/version3/parameters/updatePermissionScheme.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { PermissionScheme } from '../models/index.js'; - -export interface UpdatePermissionScheme extends PermissionScheme { - /** The ID of the permission scheme to update. */ - schemeId: number; - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * `all` Returns all expandable information. `field` Returns information about the custom field granted the - * permission. `group` Returns information about the group that is granted the permission. `permissions` Returns all - * permission grants for each permission scheme. `projectRole` Returns information about the project role granted the - * permission. `user` Returns information about the user who is granted the permission. - */ - expand?: string; -} diff --git a/src/version3/parameters/updatePrecomputations.mts b/src/version3/parameters/updatePrecomputations.mts new file mode 100644 index 000000000..6b7b3a1d4 --- /dev/null +++ b/src/version3/parameters/updatePrecomputations.mts @@ -0,0 +1,3 @@ +import { JqlFunctionPrecomputationUpdateRequest } from '../models/index.mjs'; + +export interface UpdatePrecomputations extends JqlFunctionPrecomputationUpdateRequest {} diff --git a/src/version3/parameters/updatePrecomputations.ts b/src/version3/parameters/updatePrecomputations.ts deleted file mode 100644 index 301f51cb8..000000000 --- a/src/version3/parameters/updatePrecomputations.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { JqlFunctionPrecomputationUpdateRequest } from '../models/index.js'; - -export interface UpdatePrecomputations extends JqlFunctionPrecomputationUpdateRequest {} diff --git a/src/version3/parameters/updatePriority.mts b/src/version3/parameters/updatePriority.mts new file mode 100644 index 000000000..bb6d71864 --- /dev/null +++ b/src/version3/parameters/updatePriority.mts @@ -0,0 +1,6 @@ +import { UpdatePriorityDetails } from '../models/index.mjs'; + +export interface UpdatePriority extends UpdatePriorityDetails { + /** The ID of the issue priority. */ + id: string; +} diff --git a/src/version3/parameters/updatePriority.ts b/src/version3/parameters/updatePriority.ts deleted file mode 100644 index f3d3fb075..000000000 --- a/src/version3/parameters/updatePriority.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdatePriorityDetails } from '../models/index.js'; - -export interface UpdatePriority extends UpdatePriorityDetails { - /** The ID of the issue priority. */ - id: string; -} diff --git a/src/version3/parameters/updateProject.mts b/src/version3/parameters/updateProject.mts new file mode 100644 index 000000000..b6c43c7a9 --- /dev/null +++ b/src/version3/parameters/updateProject.mts @@ -0,0 +1,26 @@ +import { UpdateProjectDetails } from '../models/index.mjs'; + +export interface UpdateProject extends UpdateProjectDetails { + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: string; + projectTypeKey?: string; + projectTemplateKey?: string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Note that the project description, + * issue types, and project lead are included in all responses by default. Expand options include: + * + * - `description` The project description. + * - `issueTypes` The issue types associated with the project. + * - `lead` The project lead. + * - `projectKeys` All project keys associated with the project. + */ + expand?: + | 'description' + | 'issueTypes' + | 'lead' + | 'projectKeys' + | ('description' | 'issueTypes' | 'lead' | 'projectKeys')[] + | string + | string[]; +} diff --git a/src/version3/parameters/updateProject.ts b/src/version3/parameters/updateProject.ts deleted file mode 100644 index e37068565..000000000 --- a/src/version3/parameters/updateProject.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { UpdateProjectDetails } from '../models/index.js'; - -export interface UpdateProject extends UpdateProjectDetails { - /** The project ID or project key (case-sensitive). */ - projectIdOrKey: string; - projectTypeKey?: string; - projectTemplateKey?: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Note that the project description, - * issue types, and project lead are included in all responses by default. Expand options include: - * - * - `description` The project description. - * - `issueTypes` The issue types associated with the project. - * - `lead` The project lead. - * - `projectKeys` All project keys associated with the project. - */ - expand?: - | 'description' - | 'issueTypes' - | 'lead' - | 'projectKeys' - | ('description' | 'issueTypes' | 'lead' | 'projectKeys')[] - | string - | string[]; -} diff --git a/src/version3/parameters/updateProjectAvatar.mts b/src/version3/parameters/updateProjectAvatar.mts new file mode 100644 index 000000000..5759946c9 --- /dev/null +++ b/src/version3/parameters/updateProjectAvatar.mts @@ -0,0 +1,6 @@ +import { Avatar } from '../models/index.mjs'; + +export interface UpdateProjectAvatar extends Avatar { + /** The ID or (case-sensitive) key of the project. */ + projectIdOrKey: string; +} diff --git a/src/version3/parameters/updateProjectAvatar.ts b/src/version3/parameters/updateProjectAvatar.ts deleted file mode 100644 index e8d64e8ff..000000000 --- a/src/version3/parameters/updateProjectAvatar.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Avatar } from '../models/index.js'; - -export interface UpdateProjectAvatar extends Avatar { - /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; -} diff --git a/src/version3/parameters/updateProjectCategory.mts b/src/version3/parameters/updateProjectCategory.mts new file mode 100644 index 000000000..5518f22fd --- /dev/null +++ b/src/version3/parameters/updateProjectCategory.mts @@ -0,0 +1,5 @@ +import { ProjectCategory } from '../models/index.mjs'; + +export interface UpdateProjectCategory extends Omit { + id: number; +} diff --git a/src/version3/parameters/updateProjectCategory.ts b/src/version3/parameters/updateProjectCategory.ts deleted file mode 100644 index 2f2a7aeaa..000000000 --- a/src/version3/parameters/updateProjectCategory.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { ProjectCategory } from '../models/index.js'; - -export interface UpdateProjectCategory extends Omit { - id: number; -} diff --git a/src/version3/parameters/updateProjectEmail.mts b/src/version3/parameters/updateProjectEmail.mts new file mode 100644 index 000000000..fcf15aabb --- /dev/null +++ b/src/version3/parameters/updateProjectEmail.mts @@ -0,0 +1,6 @@ +import { ProjectEmailAddress } from '../models/index.mjs'; + +export interface UpdateProjectEmail extends ProjectEmailAddress { + /** The project ID. */ + projectId: number; +} diff --git a/src/version3/parameters/updateProjectEmail.ts b/src/version3/parameters/updateProjectEmail.ts deleted file mode 100644 index 110c3c1d9..000000000 --- a/src/version3/parameters/updateProjectEmail.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ProjectEmailAddress } from '../models/index.js'; - -export interface UpdateProjectEmail extends ProjectEmailAddress { - /** The project ID. */ - projectId: number; -} diff --git a/src/version3/parameters/updateRemoteIssueLink.mts b/src/version3/parameters/updateRemoteIssueLink.mts new file mode 100644 index 000000000..5d0702075 --- /dev/null +++ b/src/version3/parameters/updateRemoteIssueLink.mts @@ -0,0 +1,8 @@ +import { RemoteIssueLinkRequest } from '../models/index.mjs'; + +export interface UpdateRemoteIssueLink extends RemoteIssueLinkRequest { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** The ID of the remote issue link. */ + linkId: string; +} diff --git a/src/version3/parameters/updateRemoteIssueLink.ts b/src/version3/parameters/updateRemoteIssueLink.ts deleted file mode 100644 index a426ea9aa..000000000 --- a/src/version3/parameters/updateRemoteIssueLink.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { RemoteIssueLinkRequest } from '../models/index.js'; - -export interface UpdateRemoteIssueLink extends RemoteIssueLinkRequest { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the remote issue link. */ - linkId: string; -} diff --git a/src/version3/parameters/updateResolution.mts b/src/version3/parameters/updateResolution.mts new file mode 100644 index 000000000..0bbc9d1cd --- /dev/null +++ b/src/version3/parameters/updateResolution.mts @@ -0,0 +1,6 @@ +import { UpdateResolutionDetails } from '../models/index.mjs'; + +export interface UpdateResolution extends UpdateResolutionDetails { + /** The ID of the issue resolution. */ + id: string; +} diff --git a/src/version3/parameters/updateResolution.ts b/src/version3/parameters/updateResolution.ts deleted file mode 100644 index 3f20f9e35..000000000 --- a/src/version3/parameters/updateResolution.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateResolutionDetails } from '../models/index.js'; - -export interface UpdateResolution extends UpdateResolutionDetails { - /** The ID of the issue resolution. */ - id: string; -} diff --git a/src/version3/parameters/updateScreen.mts b/src/version3/parameters/updateScreen.mts new file mode 100644 index 000000000..70c1100c0 --- /dev/null +++ b/src/version3/parameters/updateScreen.mts @@ -0,0 +1,6 @@ +import { UpdateScreenDetails } from '../models/index.mjs'; + +export interface UpdateScreen extends UpdateScreenDetails { + /** The ID of the screen. */ + screenId: number; +} diff --git a/src/version3/parameters/updateScreen.ts b/src/version3/parameters/updateScreen.ts deleted file mode 100644 index 0c1742964..000000000 --- a/src/version3/parameters/updateScreen.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateScreenDetails } from '../models/index.js'; - -export interface UpdateScreen extends UpdateScreenDetails { - /** The ID of the screen. */ - screenId: number; -} diff --git a/src/version3/parameters/updateScreenScheme.mts b/src/version3/parameters/updateScreenScheme.mts new file mode 100644 index 000000000..023292e8a --- /dev/null +++ b/src/version3/parameters/updateScreenScheme.mts @@ -0,0 +1,6 @@ +import { UpdateScreenSchemeDetails } from '../models/index.mjs'; + +export interface UpdateScreenScheme extends UpdateScreenSchemeDetails { + /** The ID of the screen scheme. */ + screenSchemeId: string; +} diff --git a/src/version3/parameters/updateScreenScheme.ts b/src/version3/parameters/updateScreenScheme.ts deleted file mode 100644 index 9648252a0..000000000 --- a/src/version3/parameters/updateScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateScreenSchemeDetails } from '../models/index.js'; - -export interface UpdateScreenScheme extends UpdateScreenSchemeDetails { - /** The ID of the screen scheme. */ - screenSchemeId: string; -} diff --git a/src/version3/parameters/updateSecurityLevel.mts b/src/version3/parameters/updateSecurityLevel.mts new file mode 100644 index 000000000..f7764e51c --- /dev/null +++ b/src/version3/parameters/updateSecurityLevel.mts @@ -0,0 +1,8 @@ +import { UpdateIssueSecurityLevelDetails } from '../models/index.mjs'; + +export interface UpdateSecurityLevel extends UpdateIssueSecurityLevelDetails { + /** The ID of the issue security scheme level belongs to. */ + schemeId: string; + /** The ID of the issue security level to update. */ + levelId: string; +} diff --git a/src/version3/parameters/updateSecurityLevel.ts b/src/version3/parameters/updateSecurityLevel.ts deleted file mode 100644 index 687fc3e27..000000000 --- a/src/version3/parameters/updateSecurityLevel.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { UpdateIssueSecurityLevelDetails } from '../models/index.js'; - -export interface UpdateSecurityLevel extends UpdateIssueSecurityLevelDetails { - /** The ID of the issue security scheme level belongs to. */ - schemeId: string; - /** The ID of the issue security level to update. */ - levelId: string; -} diff --git a/src/version3/parameters/updateStatuses.mts b/src/version3/parameters/updateStatuses.mts new file mode 100644 index 000000000..7e701dc09 --- /dev/null +++ b/src/version3/parameters/updateStatuses.mts @@ -0,0 +1,3 @@ +import { StatusUpdateRequest } from '../models/index.mjs'; + +export interface UpdateStatuses extends StatusUpdateRequest {} diff --git a/src/version3/parameters/updateStatuses.ts b/src/version3/parameters/updateStatuses.ts deleted file mode 100644 index 66d710de3..000000000 --- a/src/version3/parameters/updateStatuses.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { StatusUpdateRequest } from '../models/index.js'; - -export interface UpdateStatuses extends StatusUpdateRequest {} diff --git a/src/version3/parameters/updateUiModification.mts b/src/version3/parameters/updateUiModification.mts new file mode 100644 index 000000000..c8610f285 --- /dev/null +++ b/src/version3/parameters/updateUiModification.mts @@ -0,0 +1,6 @@ +import { UpdateUiModificationDetails } from '../models/index.mjs'; + +export interface UpdateUiModification extends UpdateUiModificationDetails { + /** The ID of the UI modification. */ + uiModificationId: string; +} diff --git a/src/version3/parameters/updateUiModification.ts b/src/version3/parameters/updateUiModification.ts deleted file mode 100644 index 233d4270e..000000000 --- a/src/version3/parameters/updateUiModification.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UpdateUiModificationDetails } from '../models/index.js'; - -export interface UpdateUiModification extends UpdateUiModificationDetails { - /** The ID of the UI modification. */ - uiModificationId: string; -} diff --git a/src/version3/parameters/updateVersion.mts b/src/version3/parameters/updateVersion.mts new file mode 100644 index 000000000..738c6cd15 --- /dev/null +++ b/src/version3/parameters/updateVersion.mts @@ -0,0 +1,6 @@ +import { Version } from '../models/index.mjs'; + +export interface UpdateVersion extends Version { + /** The ID of the version. */ + id: string; +} diff --git a/src/version3/parameters/updateVersion.ts b/src/version3/parameters/updateVersion.ts deleted file mode 100644 index 92fd341ca..000000000 --- a/src/version3/parameters/updateVersion.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Version } from '../models/index.js'; - -export interface UpdateVersion extends Version { - /** The ID of the version. */ - id: string; -} diff --git a/src/version3/parameters/updateWorkflowMapping.mts b/src/version3/parameters/updateWorkflowMapping.mts new file mode 100644 index 000000000..ba35e58e4 --- /dev/null +++ b/src/version3/parameters/updateWorkflowMapping.mts @@ -0,0 +1,8 @@ +import type { IssueTypesWorkflowMapping } from '../models/index.mjs'; + +export interface UpdateWorkflowMapping extends IssueTypesWorkflowMapping { + /** The ID of the workflow scheme. */ + id: number; + /** The name of the workflow. */ + workflowName: string; +} diff --git a/src/version3/parameters/updateWorkflowMapping.ts b/src/version3/parameters/updateWorkflowMapping.ts deleted file mode 100644 index ebd271b02..000000000 --- a/src/version3/parameters/updateWorkflowMapping.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { IssueTypesWorkflowMapping } from '../models/index.js'; - -export interface UpdateWorkflowMapping extends IssueTypesWorkflowMapping { - /** The ID of the workflow scheme. */ - id: number; - /** The name of the workflow. */ - workflowName: string; -} diff --git a/src/version3/parameters/updateWorkflowScheme.mts b/src/version3/parameters/updateWorkflowScheme.mts new file mode 100644 index 000000000..0311bfff1 --- /dev/null +++ b/src/version3/parameters/updateWorkflowScheme.mts @@ -0,0 +1,9 @@ +import { WorkflowScheme } from '../models/index.mjs'; + +export interface UpdateWorkflowScheme extends WorkflowScheme { + /** + * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the + * URL as `schemeId`. For example, _schemeId=10301_. + */ + id: number; +} diff --git a/src/version3/parameters/updateWorkflowScheme.ts b/src/version3/parameters/updateWorkflowScheme.ts deleted file mode 100644 index fd6007dca..000000000 --- a/src/version3/parameters/updateWorkflowScheme.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { WorkflowScheme } from '../models/index.js'; - -export interface UpdateWorkflowScheme extends WorkflowScheme { - /** - * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the - * URL as `schemeId`. For example, _schemeId=10301_. - */ - id: number; -} diff --git a/src/version3/parameters/updateWorkflowSchemeDraft.mts b/src/version3/parameters/updateWorkflowSchemeDraft.mts new file mode 100644 index 000000000..ba6eca727 --- /dev/null +++ b/src/version3/parameters/updateWorkflowSchemeDraft.mts @@ -0,0 +1,6 @@ +import { WorkflowScheme } from '../models/index.mjs'; + +export interface UpdateWorkflowSchemeDraft extends WorkflowScheme { + /** The ID of the active workflow scheme that the draft was created from. */ + id: number; +} diff --git a/src/version3/parameters/updateWorkflowSchemeDraft.ts b/src/version3/parameters/updateWorkflowSchemeDraft.ts deleted file mode 100644 index 70a2b581d..000000000 --- a/src/version3/parameters/updateWorkflowSchemeDraft.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { WorkflowScheme } from '../models/index.js'; - -export interface UpdateWorkflowSchemeDraft extends WorkflowScheme { - /** The ID of the active workflow scheme that the draft was created from. */ - id: number; -} diff --git a/src/version3/parameters/updateWorkflowTransitionProperty.mts b/src/version3/parameters/updateWorkflowTransitionProperty.mts new file mode 100644 index 000000000..191f633ea --- /dev/null +++ b/src/version3/parameters/updateWorkflowTransitionProperty.mts @@ -0,0 +1,21 @@ +import { WorkflowTransitionProperty } from '../models/index.mjs'; + +export interface UpdateWorkflowTransitionProperty extends WorkflowTransitionProperty { + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown + * next to the transition. + */ + transitionId: number; + /** + * The key of the property being updated, also known as the name of the property. Set this to the same value as the + * `key` defined in the request body. + */ + key: string; + /** The name of the workflow that the transition belongs to. */ + workflowName: string; + /** + * The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot + * be edited. + */ + workflowMode?: 'live' | 'draft' | string; +} diff --git a/src/version3/parameters/updateWorkflowTransitionProperty.ts b/src/version3/parameters/updateWorkflowTransitionProperty.ts deleted file mode 100644 index a6b5ab677..000000000 --- a/src/version3/parameters/updateWorkflowTransitionProperty.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { WorkflowTransitionProperty } from '../models/index.js'; - -export interface UpdateWorkflowTransitionProperty extends WorkflowTransitionProperty { - /** - * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown - * next to the transition. - */ - transitionId: number; - /** - * The key of the property being updated, also known as the name of the property. Set this to the same value as the - * `key` defined in the request body. - */ - key: string; - /** The name of the workflow that the transition belongs to. */ - workflowName: string; - /** - * The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot - * be edited. - */ - workflowMode?: 'live' | 'draft' | string; -} diff --git a/src/version3/parameters/updateWorkflowTransitionRuleConfigurations.mts b/src/version3/parameters/updateWorkflowTransitionRuleConfigurations.mts new file mode 100644 index 000000000..581275047 --- /dev/null +++ b/src/version3/parameters/updateWorkflowTransitionRuleConfigurations.mts @@ -0,0 +1,3 @@ +import type { WorkflowTransitionRulesUpdate } from '../models/index.mjs'; + +export interface UpdateWorkflowTransitionRuleConfigurations extends WorkflowTransitionRulesUpdate {} diff --git a/src/version3/parameters/updateWorkflowTransitionRuleConfigurations.ts b/src/version3/parameters/updateWorkflowTransitionRuleConfigurations.ts deleted file mode 100644 index 90ae8c673..000000000 --- a/src/version3/parameters/updateWorkflowTransitionRuleConfigurations.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { WorkflowTransitionRulesUpdate } from '../models/index.js'; - -export interface UpdateWorkflowTransitionRuleConfigurations extends WorkflowTransitionRulesUpdate {} diff --git a/src/version3/parameters/updateWorklog.mts b/src/version3/parameters/updateWorklog.mts new file mode 100644 index 000000000..e874d922a --- /dev/null +++ b/src/version3/parameters/updateWorklog.mts @@ -0,0 +1,41 @@ +import { Document, Worklog } from '../models/index.mjs'; + +export interface UpdateWorklog extends Omit { + /** The ID or key the issue. */ + issueIdOrKey: string; + /** The ID of the worklog. */ + id: string; + /** Whether users watching the issue are notified by email. */ + notifyUsers?: boolean; + /** + * Defines how to update the issue's time estimate, the options are: + * + * - `new` Sets the estimate to a specific value, defined in `newEstimate`. + * - `leave` Leaves the estimate unchanged. + * - `auto` Updates the estimate by the difference between the original and updated value of `timeSpent` or + * `timeSpentSeconds`. + */ + adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; + /** + * A comment about the worklog in [Atlassian Document + * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). Optional when creating or + * updating a worklog. + */ + comment?: string | Document; + /** + * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For + * example, _2d_. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about worklogs in the response. This parameter accepts `properties`, which returns worklog properties. + */ + expand?: string; + /** + * Whether the worklog should be added to the issue even if the issue is not editable. For example, because the issue + * is closed. Connect and Forge app users with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + */ + overrideEditableFlag?: boolean; +} diff --git a/src/version3/parameters/updateWorklog.ts b/src/version3/parameters/updateWorklog.ts deleted file mode 100644 index 696c17e7f..000000000 --- a/src/version3/parameters/updateWorklog.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { Document, Worklog } from '../models/index.js'; - -export interface UpdateWorklog extends Omit { - /** The ID or key the issue. */ - issueIdOrKey: string; - /** The ID of the worklog. */ - id: string; - /** Whether users watching the issue are notified by email. */ - notifyUsers?: boolean; - /** - * Defines how to update the issue's time estimate, the options are: - * - * - `new` Sets the estimate to a specific value, defined in `newEstimate`. - * - `leave` Leaves the estimate unchanged. - * - `auto` Updates the estimate by the difference between the original and updated value of `timeSpent` or - * `timeSpentSeconds`. - */ - adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; - /** - * A comment about the worklog in [Atlassian Document - * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). Optional when creating or - * updating a worklog. - */ - comment?: string | Document; - /** - * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For - * example, _2d_. Required when `adjustEstimate` is `new`. - */ - newEstimate?: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about worklogs in the response. This parameter accepts `properties`, which returns worklog properties. - */ - expand?: string; - /** - * Whether the worklog should be added to the issue even if the issue is not editable. For example, because the issue - * is closed. Connect and Forge app users with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. - */ - overrideEditableFlag?: boolean; -} diff --git a/src/version3/parameters/validateProjectKey.ts b/src/version3/parameters/validateProjectKey.mts similarity index 100% rename from src/version3/parameters/validateProjectKey.ts rename to src/version3/parameters/validateProjectKey.mts diff --git a/src/version3/parameters/workflowRuleSearch.mts b/src/version3/parameters/workflowRuleSearch.mts new file mode 100644 index 000000000..65b1dc274 --- /dev/null +++ b/src/version3/parameters/workflowRuleSearch.mts @@ -0,0 +1,6 @@ +import { WorkflowRulesSearch } from '../models/index.mjs'; + +export interface WorkflowRuleSearch extends WorkflowRulesSearch { + /** The app migration transfer ID. */ + transferId: string; +} diff --git a/src/version3/parameters/workflowRuleSearch.ts b/src/version3/parameters/workflowRuleSearch.ts deleted file mode 100644 index a48c50fc8..000000000 --- a/src/version3/parameters/workflowRuleSearch.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { WorkflowRulesSearch } from '../models/index.js'; - -export interface WorkflowRuleSearch extends WorkflowRulesSearch { - /** The app migration transfer ID. */ - transferId: string; -} diff --git a/src/version3/permissionSchemes.mts b/src/version3/permissionSchemes.mts new file mode 100644 index 000000000..8a8bb1509 --- /dev/null +++ b/src/version3/permissionSchemes.mts @@ -0,0 +1,558 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class PermissionSchemes { + constructor(private client: Client) {} + + /** + * Returns all permission schemes. + * + * ### About permission schemes and grants + * + * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a + * `permission`. + * + * #### Holder object + * + * The `holder` object contains information about the user or group being granted the permission. For example, the + * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the + * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and + * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. The `holder` object is defined by the + * following properties: + * + * - `type` Identifies the user or group (see the list of types below). + * - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the + * `type`. For example, if the `type` is a group, then you need to specify the group name. + * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the + * group ID. For other `type` it has the same value as `parameter` + * + * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some + * types may not have a `parameter` or `value`): + * + * - `anyone` Grant for anonymous users. + * - `applicationRole` Grant for users with access to the specified application (application name, application name). + * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. + * - `assignee` Grant for the user currently assigned to an issue. + * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). + * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field + * ID, `value` : custom field ID). + * - `projectLead` Grant for a project lead. + * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). + * - `reporter` Grant for the user who reported the issue. + * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not + * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more + * information. + * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is + * deprecated and the account ID should be used, `value` : user ID). + * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : + * custom field ID). + * + * #### Built-in permissions + * + * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define + * custom permissions. See the [project + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation + * for more information. + * + * **Project permissions** + * + * - `ADMINISTER_PROJECTS` + * - `BROWSE_PROJECTS` + * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) + * - `SERVICEDESK_AGENT` (Jira Service Desk only) + * - `VIEW_DEV_TOOLS` (Jira Software only) + * - `VIEW_READONLY_WORKFLOW` + * + * **Issue permissions** + * + * - `ASSIGNABLE_USER` + * - `ASSIGN_ISSUES` + * - `CLOSE_ISSUES` + * - `CREATE_ISSUES` + * - `DELETE_ISSUES` + * - `EDIT_ISSUES` + * - `LINK_ISSUES` + * - `MODIFY_REPORTER` + * - `MOVE_ISSUES` + * - `RESOLVE_ISSUES` + * - `SCHEDULE_ISSUES` + * - `SET_ISSUE_SECURITY` + * - `TRANSITION_ISSUES` + * + * **Voters and watchers permissions** + * + * - `MANAGE_WATCHERS` + * - `VIEW_VOTERS_AND_WATCHERS` + * + * **Comments permissions** + * + * - `ADD_COMMENTS` + * - `DELETE_ALL_COMMENTS` + * - `DELETE_OWN_COMMENTS` + * - `EDIT_ALL_COMMENTS` + * - `EDIT_OWN_COMMENTS` + * + * **Attachments permissions** + * + * - `CREATE_ATTACHMENTS` + * - `DELETE_ALL_ATTACHMENTS` + * - `DELETE_OWN_ATTACHMENTS` + * + * **Time tracking permissions** + * + * - `DELETE_ALL_WORKLOGS` + * - `DELETE_OWN_WORKLOGS` + * - `EDIT_ALL_WORKLOGS` + * - `EDIT_OWN_WORKLOGS` + * - `WORK_ON_ISSUES` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAllPermissionSchemes( + parameters: Parameters.GetAllPermissionSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns all permission schemes. + * + * ### About permission schemes and grants + * + * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a + * `permission`. + * + * #### Holder object + * + * The `holder` object contains information about the user or group being granted the permission. For example, the + * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the + * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and + * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. The `holder` object is defined by the + * following properties: + * + * - `type` Identifies the user or group (see the list of types below). + * - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the + * `type`. For example, if the `type` is a group, then you need to specify the group name. + * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the + * group ID. For other `type` it has the same value as `parameter` + * + * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some + * types may not have a `parameter` or `value`): + * + * - `anyone` Grant for anonymous users. + * - `applicationRole` Grant for users with access to the specified application (application name, application name). + * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. + * - `assignee` Grant for the user currently assigned to an issue. + * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). + * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field + * ID, `value` : custom field ID). + * - `projectLead` Grant for a project lead. + * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). + * - `reporter` Grant for the user who reported the issue. + * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not + * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more + * information. + * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is + * deprecated and the account ID should be used, `value` : user ID). + * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : + * custom field ID). + * + * #### Built-in permissions + * + * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define + * custom permissions. See the [project + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation + * for more information. + * + * **Project permissions** + * + * - `ADMINISTER_PROJECTS` + * - `BROWSE_PROJECTS` + * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) + * - `SERVICEDESK_AGENT` (Jira Service Desk only) + * - `VIEW_DEV_TOOLS` (Jira Software only) + * - `VIEW_READONLY_WORKFLOW` + * + * **Issue permissions** + * + * - `ASSIGNABLE_USER` + * - `ASSIGN_ISSUES` + * - `CLOSE_ISSUES` + * - `CREATE_ISSUES` + * - `DELETE_ISSUES` + * - `EDIT_ISSUES` + * - `LINK_ISSUES` + * - `MODIFY_REPORTER` + * - `MOVE_ISSUES` + * - `RESOLVE_ISSUES` + * - `SCHEDULE_ISSUES` + * - `SET_ISSUE_SECURITY` + * - `TRANSITION_ISSUES` + * + * **Voters and watchers permissions** + * + * - `MANAGE_WATCHERS` + * - `VIEW_VOTERS_AND_WATCHERS` + * + * **Comments permissions** + * + * - `ADD_COMMENTS` + * - `DELETE_ALL_COMMENTS` + * - `DELETE_OWN_COMMENTS` + * - `EDIT_ALL_COMMENTS` + * - `EDIT_OWN_COMMENTS` + * + * **Attachments permissions** + * + * - `CREATE_ATTACHMENTS` + * - `DELETE_ALL_ATTACHMENTS` + * - `DELETE_OWN_ATTACHMENTS` + * + * **Time tracking permissions** + * + * - `DELETE_ALL_WORKLOGS` + * - `DELETE_OWN_WORKLOGS` + * - `EDIT_ALL_WORKLOGS` + * - `EDIT_OWN_WORKLOGS` + * - `WORK_ON_ISSUES` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAllPermissionSchemes( + parameters?: Parameters.GetAllPermissionSchemes, + callback?: never, + ): Promise; + async getAllPermissionSchemes( + parameters?: Parameters.GetAllPermissionSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/permissionscheme', + method: 'GET', + params: { + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission + * grants. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPermissionScheme( + parameters: Parameters.CreatePermissionScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission + * grants. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPermissionScheme( + parameters?: Parameters.CreatePermissionScheme, + callback?: never, + ): Promise; + async createPermissionScheme( + parameters?: Parameters.CreatePermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/permissionscheme', + method: 'POST', + params: { + expand: parameters?.expand, + }, + data: { + ...parameters, + expand: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionScheme( + parameters: Parameters.GetPermissionScheme, + callback: Callback, + ): Promise; + /** + * Returns a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionScheme( + parameters: Parameters.GetPermissionScheme, + callback?: never, + ): Promise; + async getPermissionScheme( + parameters: Parameters.GetPermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/permissionscheme/${parameters.schemeId}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a permission scheme. Below are some important things to note when using this resource: + * + * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all + * existing_ grants. + * - If you want to update only the name and description, then do not send a permissions list in the request. + * - Sending an empty list will remove all permission grants from the permission scheme. + * + * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission + * grant](#api-rest-api-3-permissionscheme-schemeId-permission-post) or [Delete permission scheme + * entity](#api-rest-api-3-permissionscheme-schemeId-permission-permissionId-delete). + * + * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for + * more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updatePermissionScheme( + parameters: Parameters.UpdatePermissionScheme, + callback: Callback, + ): Promise; + /** + * Updates a permission scheme. Below are some important things to note when using this resource: + * + * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all + * existing_ grants. + * - If you want to update only the name and description, then do not send a permissions list in the request. + * - Sending an empty list will remove all permission grants from the permission scheme. + * + * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission + * grant](#api-rest-api-3-permissionscheme-schemeId-permission-post) or [Delete permission scheme + * entity](#api-rest-api-3-permissionscheme-schemeId-permission-permissionId-delete). + * + * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for + * more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updatePermissionScheme( + parameters: Parameters.UpdatePermissionScheme, + callback?: never, + ): Promise; + async updatePermissionScheme( + parameters: Parameters.UpdatePermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/permissionscheme/${parameters.schemeId}`, + method: 'PUT', + params: { + expand: parameters.expand, + }, + data: { + ...parameters, + schemeId: undefined, + expand: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePermissionScheme( + parameters: Parameters.DeletePermissionScheme, + callback: Callback, + ): Promise; + /** + * Deletes a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePermissionScheme(parameters: Parameters.DeletePermissionScheme, callback?: never): Promise; + async deletePermissionScheme( + parameters: Parameters.DeletePermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/permissionscheme/${parameters.schemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all permission grants for a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionSchemeGrants( + parameters: Parameters.GetPermissionSchemeGrants, + callback: Callback, + ): Promise; + /** + * Returns all permission grants for a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionSchemeGrants( + parameters: Parameters.GetPermissionSchemeGrants, + callback?: never, + ): Promise; + async getPermissionSchemeGrants( + parameters: Parameters.GetPermissionSchemeGrants, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/permissionscheme/${parameters.schemeId}/permission`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a permission grant in a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPermissionGrant( + parameters: Parameters.CreatePermissionGrant, + callback: Callback, + ): Promise; + /** + * Creates a permission grant in a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPermissionGrant( + parameters: Parameters.CreatePermissionGrant, + callback?: never, + ): Promise; + async createPermissionGrant( + parameters: Parameters.CreatePermissionGrant, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/permissionscheme/${parameters.schemeId}/permission`, + method: 'POST', + params: { + expand: parameters.expand, + }, + data: { + id: parameters.id, + self: parameters.self, + holder: parameters.holder, + permission: parameters.permission, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a permission grant. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionSchemeGrant( + parameters: Parameters.GetPermissionSchemeGrant, + callback: Callback, + ): Promise; + /** + * Returns a permission grant. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionSchemeGrant( + parameters: Parameters.GetPermissionSchemeGrant, + callback?: never, + ): Promise; + async getPermissionSchemeGrant( + parameters: Parameters.GetPermissionSchemeGrant, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a permission grant from a permission scheme. See [About permission schemes and + * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePermissionSchemeEntity( + parameters: Parameters.DeletePermissionSchemeEntity, + callback: Callback, + ): Promise; + /** + * Deletes a permission grant from a permission scheme. See [About permission schemes and + * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePermissionSchemeEntity( + parameters: Parameters.DeletePermissionSchemeEntity, + callback?: never, + ): Promise; + async deletePermissionSchemeEntity( + parameters: Parameters.DeletePermissionSchemeEntity, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/permissionSchemes.ts b/src/version3/permissionSchemes.ts deleted file mode 100644 index f1743bacf..000000000 --- a/src/version3/permissionSchemes.ts +++ /dev/null @@ -1,558 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class PermissionSchemes { - constructor(private client: Client) {} - - /** - * Returns all permission schemes. - * - * ### About permission schemes and grants - * - * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a - * `permission`. - * - * #### Holder object - * - * The `holder` object contains information about the user or group being granted the permission. For example, the - * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the - * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and - * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. The `holder` object is defined by the - * following properties: - * - * - `type` Identifies the user or group (see the list of types below). - * - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the - * `type`. For example, if the `type` is a group, then you need to specify the group name. - * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the - * group ID. For other `type` it has the same value as `parameter` - * - * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some - * types may not have a `parameter` or `value`): - * - * - `anyone` Grant for anonymous users. - * - `applicationRole` Grant for users with access to the specified application (application name, application name). - * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. - * - `assignee` Grant for the user currently assigned to an issue. - * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). - * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field - * ID, `value` : custom field ID). - * - `projectLead` Grant for a project lead. - * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). - * - `reporter` Grant for the user who reported the issue. - * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not - * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more - * information. - * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is - * deprecated and the account ID should be used, `value` : user ID). - * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : - * custom field ID). - * - * #### Built-in permissions - * - * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define - * custom permissions. See the [project - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation - * for more information. - * - * **Project permissions** - * - * - `ADMINISTER_PROJECTS` - * - `BROWSE_PROJECTS` - * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) - * - `SERVICEDESK_AGENT` (Jira Service Desk only) - * - `VIEW_DEV_TOOLS` (Jira Software only) - * - `VIEW_READONLY_WORKFLOW` - * - * **Issue permissions** - * - * - `ASSIGNABLE_USER` - * - `ASSIGN_ISSUES` - * - `CLOSE_ISSUES` - * - `CREATE_ISSUES` - * - `DELETE_ISSUES` - * - `EDIT_ISSUES` - * - `LINK_ISSUES` - * - `MODIFY_REPORTER` - * - `MOVE_ISSUES` - * - `RESOLVE_ISSUES` - * - `SCHEDULE_ISSUES` - * - `SET_ISSUE_SECURITY` - * - `TRANSITION_ISSUES` - * - * **Voters and watchers permissions** - * - * - `MANAGE_WATCHERS` - * - `VIEW_VOTERS_AND_WATCHERS` - * - * **Comments permissions** - * - * - `ADD_COMMENTS` - * - `DELETE_ALL_COMMENTS` - * - `DELETE_OWN_COMMENTS` - * - `EDIT_ALL_COMMENTS` - * - `EDIT_OWN_COMMENTS` - * - * **Attachments permissions** - * - * - `CREATE_ATTACHMENTS` - * - `DELETE_ALL_ATTACHMENTS` - * - `DELETE_OWN_ATTACHMENTS` - * - * **Time tracking permissions** - * - * - `DELETE_ALL_WORKLOGS` - * - `DELETE_OWN_WORKLOGS` - * - `EDIT_ALL_WORKLOGS` - * - `EDIT_OWN_WORKLOGS` - * - `WORK_ON_ISSUES` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllPermissionSchemes( - parameters: Parameters.GetAllPermissionSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns all permission schemes. - * - * ### About permission schemes and grants - * - * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a - * `permission`. - * - * #### Holder object - * - * The `holder` object contains information about the user or group being granted the permission. For example, the - * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the - * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and - * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. The `holder` object is defined by the - * following properties: - * - * - `type` Identifies the user or group (see the list of types below). - * - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the - * `type`. For example, if the `type` is a group, then you need to specify the group name. - * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the - * group ID. For other `type` it has the same value as `parameter` - * - * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some - * types may not have a `parameter` or `value`): - * - * - `anyone` Grant for anonymous users. - * - `applicationRole` Grant for users with access to the specified application (application name, application name). - * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. - * - `assignee` Grant for the user currently assigned to an issue. - * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). - * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field - * ID, `value` : custom field ID). - * - `projectLead` Grant for a project lead. - * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). - * - `reporter` Grant for the user who reported the issue. - * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not - * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more - * information. - * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is - * deprecated and the account ID should be used, `value` : user ID). - * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : - * custom field ID). - * - * #### Built-in permissions - * - * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define - * custom permissions. See the [project - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation - * for more information. - * - * **Project permissions** - * - * - `ADMINISTER_PROJECTS` - * - `BROWSE_PROJECTS` - * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) - * - `SERVICEDESK_AGENT` (Jira Service Desk only) - * - `VIEW_DEV_TOOLS` (Jira Software only) - * - `VIEW_READONLY_WORKFLOW` - * - * **Issue permissions** - * - * - `ASSIGNABLE_USER` - * - `ASSIGN_ISSUES` - * - `CLOSE_ISSUES` - * - `CREATE_ISSUES` - * - `DELETE_ISSUES` - * - `EDIT_ISSUES` - * - `LINK_ISSUES` - * - `MODIFY_REPORTER` - * - `MOVE_ISSUES` - * - `RESOLVE_ISSUES` - * - `SCHEDULE_ISSUES` - * - `SET_ISSUE_SECURITY` - * - `TRANSITION_ISSUES` - * - * **Voters and watchers permissions** - * - * - `MANAGE_WATCHERS` - * - `VIEW_VOTERS_AND_WATCHERS` - * - * **Comments permissions** - * - * - `ADD_COMMENTS` - * - `DELETE_ALL_COMMENTS` - * - `DELETE_OWN_COMMENTS` - * - `EDIT_ALL_COMMENTS` - * - `EDIT_OWN_COMMENTS` - * - * **Attachments permissions** - * - * - `CREATE_ATTACHMENTS` - * - `DELETE_ALL_ATTACHMENTS` - * - `DELETE_OWN_ATTACHMENTS` - * - * **Time tracking permissions** - * - * - `DELETE_ALL_WORKLOGS` - * - `DELETE_OWN_WORKLOGS` - * - `EDIT_ALL_WORKLOGS` - * - `EDIT_OWN_WORKLOGS` - * - `WORK_ON_ISSUES` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllPermissionSchemes( - parameters?: Parameters.GetAllPermissionSchemes, - callback?: never, - ): Promise; - async getAllPermissionSchemes( - parameters?: Parameters.GetAllPermissionSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/permissionscheme', - method: 'GET', - params: { - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission - * grants. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPermissionScheme( - parameters: Parameters.CreatePermissionScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission - * grants. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPermissionScheme( - parameters?: Parameters.CreatePermissionScheme, - callback?: never, - ): Promise; - async createPermissionScheme( - parameters?: Parameters.CreatePermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/permissionscheme', - method: 'POST', - params: { - expand: parameters?.expand, - }, - data: { - ...parameters, - expand: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionScheme( - parameters: Parameters.GetPermissionScheme, - callback: Callback, - ): Promise; - /** - * Returns a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionScheme( - parameters: Parameters.GetPermissionScheme, - callback?: never, - ): Promise; - async getPermissionScheme( - parameters: Parameters.GetPermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/permissionscheme/${parameters.schemeId}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a permission scheme. Below are some important things to note when using this resource: - * - * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all - * existing_ grants. - * - If you want to update only the name and description, then do not send a permissions list in the request. - * - Sending an empty list will remove all permission grants from the permission scheme. - * - * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission - * grant](#api-rest-api-3-permissionscheme-schemeId-permission-post) or [Delete permission scheme - * entity](#api-rest-api-3-permissionscheme-schemeId-permission-permissionId-delete). - * - * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for - * more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updatePermissionScheme( - parameters: Parameters.UpdatePermissionScheme, - callback: Callback, - ): Promise; - /** - * Updates a permission scheme. Below are some important things to note when using this resource: - * - * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all - * existing_ grants. - * - If you want to update only the name and description, then do not send a permissions list in the request. - * - Sending an empty list will remove all permission grants from the permission scheme. - * - * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission - * grant](#api-rest-api-3-permissionscheme-schemeId-permission-post) or [Delete permission scheme - * entity](#api-rest-api-3-permissionscheme-schemeId-permission-permissionId-delete). - * - * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for - * more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updatePermissionScheme( - parameters: Parameters.UpdatePermissionScheme, - callback?: never, - ): Promise; - async updatePermissionScheme( - parameters: Parameters.UpdatePermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/permissionscheme/${parameters.schemeId}`, - method: 'PUT', - params: { - expand: parameters.expand, - }, - data: { - ...parameters, - schemeId: undefined, - expand: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deletePermissionScheme( - parameters: Parameters.DeletePermissionScheme, - callback: Callback, - ): Promise; - /** - * Deletes a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deletePermissionScheme(parameters: Parameters.DeletePermissionScheme, callback?: never): Promise; - async deletePermissionScheme( - parameters: Parameters.DeletePermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/permissionscheme/${parameters.schemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all permission grants for a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrants( - parameters: Parameters.GetPermissionSchemeGrants, - callback: Callback, - ): Promise; - /** - * Returns all permission grants for a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrants( - parameters: Parameters.GetPermissionSchemeGrants, - callback?: never, - ): Promise; - async getPermissionSchemeGrants( - parameters: Parameters.GetPermissionSchemeGrants, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/permissionscheme/${parameters.schemeId}/permission`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a permission grant in a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPermissionGrant( - parameters: Parameters.CreatePermissionGrant, - callback: Callback, - ): Promise; - /** - * Creates a permission grant in a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPermissionGrant( - parameters: Parameters.CreatePermissionGrant, - callback?: never, - ): Promise; - async createPermissionGrant( - parameters: Parameters.CreatePermissionGrant, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/permissionscheme/${parameters.schemeId}/permission`, - method: 'POST', - params: { - expand: parameters.expand, - }, - data: { - id: parameters.id, - self: parameters.self, - holder: parameters.holder, - permission: parameters.permission, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a permission grant. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrant( - parameters: Parameters.GetPermissionSchemeGrant, - callback: Callback, - ): Promise; - /** - * Returns a permission grant. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrant( - parameters: Parameters.GetPermissionSchemeGrant, - callback?: never, - ): Promise; - async getPermissionSchemeGrant( - parameters: Parameters.GetPermissionSchemeGrant, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a permission grant from a permission scheme. See [About permission schemes and - * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deletePermissionSchemeEntity( - parameters: Parameters.DeletePermissionSchemeEntity, - callback: Callback, - ): Promise; - /** - * Deletes a permission grant from a permission scheme. See [About permission schemes and - * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deletePermissionSchemeEntity( - parameters: Parameters.DeletePermissionSchemeEntity, - callback?: never, - ): Promise; - async deletePermissionSchemeEntity( - parameters: Parameters.DeletePermissionSchemeEntity, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/permissions.mts b/src/version3/permissions.mts new file mode 100644 index 000000000..7d99d41d0 --- /dev/null +++ b/src/version3/permissions.mts @@ -0,0 +1,236 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Permissions { + constructor(private client: Client) {} + + /** + * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be + * obtained in a global, project, issue or comment context. + * + * The user is reported as having a project permission: + * + * - In the global context, if the user has the project permission in any project. + * - For a project, where the project permission is determined using issue data, if the user meets the permission's + * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. + * - For an issue, where a project permission is determined using issue data, if the user has the permission in the + * issue. Otherwise, if the user has the project permission in the project containing the issue. + * - For a comment, where the user has both the permission to browse the comment and the project permission for the + * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose + * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. + * + * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a + * project context but may not have the permission for any or all issues. For example, if Reporters have the + * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a + * project, because any user can be a reporter. However, if they are not the user who reported the issue queried they + * would not have EDIT_ISSUES permission for that issue. + * + * Global permissions are unaffected by context. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getMyPermissions( + parameters: Parameters.GetMyPermissions | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be + * obtained in a global, project, issue or comment context. + * + * The user is reported as having a project permission: + * + * - In the global context, if the user has the project permission in any project. + * - For a project, where the project permission is determined using issue data, if the user meets the permission's + * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. + * - For an issue, where a project permission is determined using issue data, if the user has the permission in the + * issue. Otherwise, if the user has the project permission in the project containing the issue. + * - For a comment, where the user has both the permission to browse the comment and the project permission for the + * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose + * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. + * + * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a + * project context but may not have the permission for any or all issues. For example, if Reporters have the + * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a + * project, because any user can be a reporter. However, if they are not the user who reported the issue queried they + * would not have EDIT_ISSUES permission for that issue. + * + * Global permissions are unaffected by context. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getMyPermissions( + parameters?: Parameters.GetMyPermissions, + callback?: never, + ): Promise; + async getMyPermissions( + parameters?: Parameters.GetMyPermissions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/mypermissions', + method: 'GET', + params: { + projectKey: parameters?.projectKey, + projectId: parameters?.projectId, + issueKey: parameters?.issueKey, + issueId: parameters?.issueId, + permissions: parameters?.permissions, + projectUuid: parameters?.projectUuid, + projectConfigurationUuid: parameters?.projectConfigurationUuid, + commentId: parameters?.commentId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all permissions, including: + * + * - Global permissions. + * - Project permissions. + * - Global permissions added by plugins. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllPermissions(callback: Callback): Promise; + /** + * Returns all permissions, including: + * + * - Global permissions. + * - Project permissions. + * - Global permissions added by plugins. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllPermissions(callback?: never): Promise; + async getAllPermissions(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/permissions', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns: + * + * - For a list of global permissions, the global permissions granted to a user. + * - For a list of project permissions and lists of projects and issues, for each project permission a list of the + * projects and issues a user can access or manipulate. + * + * If no account ID is provided, the operation returns details for the logged in user. + * + * Note that: + * + * - Invalid project and issue IDs are ignored. + * - A maximum of 1000 projects and 1000 issues can be checked. + * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and + * `projectPermissions.issues` are ignored. + * - Empty strings in `projectPermissions.permissions` are ignored. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other + * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain + * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made + * using AP.request() in a browser. + */ + async getBulkPermissions( + parameters: Parameters.GetBulkPermissions | undefined, + callback: Callback, + ): Promise; + /** + * Returns: + * + * - For a list of global permissions, the global permissions granted to a user. + * - For a list of project permissions and lists of projects and issues, for each project permission a list of the + * projects and issues a user can access or manipulate. + * + * If no account ID is provided, the operation returns details for the logged in user. + * + * Note that: + * + * - Invalid project and issue IDs are ignored. + * - A maximum of 1000 projects and 1000 issues can be checked. + * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and + * `projectPermissions.issues` are ignored. + * - Empty strings in `projectPermissions.permissions` are ignored. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other + * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain + * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made + * using AP.request() in a browser. + */ + async getBulkPermissions( + parameters?: Parameters.GetBulkPermissions, + callback?: never, + ): Promise; + async getBulkPermissions( + parameters?: Parameters.GetBulkPermissions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/permissions/check', + method: 'POST', + data: { + projectPermissions: parameters?.projectPermissions, + globalPermissions: parameters?.globalPermissions, + accountId: parameters?.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all the projects where the user is granted a list of project permissions. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getPermittedProjects( + parameters: Parameters.GetPermittedProjects | undefined, + callback: Callback, + ): Promise; + /** + * Returns all the projects where the user is granted a list of project permissions. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getPermittedProjects( + parameters?: Parameters.GetPermittedProjects, + callback?: never, + ): Promise; + async getPermittedProjects( + parameters?: Parameters.GetPermittedProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/permissions/project', + method: 'POST', + data: { + permissions: parameters?.permissions, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/permissions.ts b/src/version3/permissions.ts deleted file mode 100644 index c1245bb3b..000000000 --- a/src/version3/permissions.ts +++ /dev/null @@ -1,236 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Permissions { - constructor(private client: Client) {} - - /** - * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be - * obtained in a global, project, issue or comment context. - * - * The user is reported as having a project permission: - * - * - In the global context, if the user has the project permission in any project. - * - For a project, where the project permission is determined using issue data, if the user meets the permission's - * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. - * - For an issue, where a project permission is determined using issue data, if the user has the permission in the - * issue. Otherwise, if the user has the project permission in the project containing the issue. - * - For a comment, where the user has both the permission to browse the comment and the project permission for the - * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose - * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. - * - * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a - * project context but may not have the permission for any or all issues. For example, if Reporters have the - * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a - * project, because any user can be a reporter. However, if they are not the user who reported the issue queried they - * would not have EDIT_ISSUES permission for that issue. - * - * Global permissions are unaffected by context. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getMyPermissions( - parameters: Parameters.GetMyPermissions | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be - * obtained in a global, project, issue or comment context. - * - * The user is reported as having a project permission: - * - * - In the global context, if the user has the project permission in any project. - * - For a project, where the project permission is determined using issue data, if the user meets the permission's - * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. - * - For an issue, where a project permission is determined using issue data, if the user has the permission in the - * issue. Otherwise, if the user has the project permission in the project containing the issue. - * - For a comment, where the user has both the permission to browse the comment and the project permission for the - * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose - * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. - * - * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a - * project context but may not have the permission for any or all issues. For example, if Reporters have the - * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a - * project, because any user can be a reporter. However, if they are not the user who reported the issue queried they - * would not have EDIT_ISSUES permission for that issue. - * - * Global permissions are unaffected by context. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getMyPermissions( - parameters?: Parameters.GetMyPermissions, - callback?: never, - ): Promise; - async getMyPermissions( - parameters?: Parameters.GetMyPermissions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/mypermissions', - method: 'GET', - params: { - projectKey: parameters?.projectKey, - projectId: parameters?.projectId, - issueKey: parameters?.issueKey, - issueId: parameters?.issueId, - permissions: parameters?.permissions, - projectUuid: parameters?.projectUuid, - projectConfigurationUuid: parameters?.projectConfigurationUuid, - commentId: parameters?.commentId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all permissions, including: - * - * - Global permissions. - * - Project permissions. - * - Global permissions added by plugins. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllPermissions(callback: Callback): Promise; - /** - * Returns all permissions, including: - * - * - Global permissions. - * - Project permissions. - * - Global permissions added by plugins. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllPermissions(callback?: never): Promise; - async getAllPermissions(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/permissions', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns: - * - * - For a list of global permissions, the global permissions granted to a user. - * - For a list of project permissions and lists of projects and issues, for each project permission a list of the - * projects and issues a user can access or manipulate. - * - * If no account ID is provided, the operation returns details for the logged in user. - * - * Note that: - * - * - Invalid project and issue IDs are ignored. - * - A maximum of 1000 projects and 1000 issues can be checked. - * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and - * `projectPermissions.issues` are ignored. - * - Empty strings in `projectPermissions.permissions` are ignored. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other - * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain - * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made - * using AP.request() in a browser. - */ - async getBulkPermissions( - parameters: Parameters.GetBulkPermissions | undefined, - callback: Callback, - ): Promise; - /** - * Returns: - * - * - For a list of global permissions, the global permissions granted to a user. - * - For a list of project permissions and lists of projects and issues, for each project permission a list of the - * projects and issues a user can access or manipulate. - * - * If no account ID is provided, the operation returns details for the logged in user. - * - * Note that: - * - * - Invalid project and issue IDs are ignored. - * - A maximum of 1000 projects and 1000 issues can be checked. - * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and - * `projectPermissions.issues` are ignored. - * - Empty strings in `projectPermissions.permissions` are ignored. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other - * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain - * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made - * using AP.request() in a browser. - */ - async getBulkPermissions( - parameters?: Parameters.GetBulkPermissions, - callback?: never, - ): Promise; - async getBulkPermissions( - parameters?: Parameters.GetBulkPermissions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/permissions/check', - method: 'POST', - data: { - projectPermissions: parameters?.projectPermissions, - globalPermissions: parameters?.globalPermissions, - accountId: parameters?.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all the projects where the user is granted a list of project permissions. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getPermittedProjects( - parameters: Parameters.GetPermittedProjects | undefined, - callback: Callback, - ): Promise; - /** - * Returns all the projects where the user is granted a list of project permissions. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getPermittedProjects( - parameters?: Parameters.GetPermittedProjects, - callback?: never, - ): Promise; - async getPermittedProjects( - parameters?: Parameters.GetPermittedProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/permissions/project', - method: 'POST', - data: { - permissions: parameters?.permissions, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectAvatars.mts b/src/version3/projectAvatars.mts new file mode 100644 index 000000000..d7d7ba6fd --- /dev/null +++ b/src/version3/projectAvatars.mts @@ -0,0 +1,202 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectAvatars { + constructor(private client: Client) {} + + /** + * Sets the avatar displayed for a project. + * + * Use [Load project avatar](#api-rest-api-3-project-projectIdOrKey-avatar2-post) to store avatars against the + * project, before using this operation to set the displayed avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback: Callback): Promise; + /** + * Sets the avatar displayed for a project. + * + * Use [Load project avatar](#api-rest-api-3-project-projectIdOrKey-avatar2-post) to store avatars against the + * project, before using this operation to set the displayed avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback?: never): Promise; + async updateProjectAvatar( + parameters: Parameters.UpdateProjectAvatar, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatar`, + method: 'PUT', + data: { + fileName: parameters.fileName, + id: parameters.id, + isDeletable: parameters.isDeletable, + isSelected: parameters.isSelected, + isSystemAvatar: parameters.isSystemAvatar, + owner: parameters.owner, + urls: parameters.urls, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback: Callback): Promise; + /** + * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback?: never): Promise; + async deleteProjectAvatar( + parameters: Parameters.DeleteProjectAvatar, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatar/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Loads an avatar for a project. + * + * Specify the avatar's local file location in the body of the request. Also, include the following headers: + * + * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special + * Headers](#special-request-headers). + * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * + * For example: `curl --request POST ` + * + * `--user email@example.com: ` + * + * `--header 'X-Atlassian-Token: no-check' ` + * + * `--header 'Content-Type: image/< image_type>' ` + * + * `--data-binary "<@/path/to/file/with/your/avatar>" ` + * + * `--url 'https://your-domain.atlassian.net/rest/api/3/project/{projectIdOrKey}/avatar2'` + * + * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of + * the image. The length of the square's sides is set to the smaller of the height or width of the image. + * + * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. + * + * After creating the avatar use [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as + * the project's displayed avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async createProjectAvatar( + parameters: Parameters.CreateProjectAvatar, + callback: Callback, + ): Promise; + /** + * Loads an avatar for a project. + * + * Specify the avatar's local file location in the body of the request. Also, include the following headers: + * + * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special + * Headers](#special-request-headers). + * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * + * For example: `curl --request POST ` + * + * `--user email@example.com: ` + * + * `--header 'X-Atlassian-Token: no-check' ` + * + * `--header 'Content-Type: image/< image_type>' ` + * + * `--data-binary "<@/path/to/file/with/your/avatar>" ` + * + * `--url 'https://your-domain.atlassian.net/rest/api/3/project/{projectIdOrKey}/avatar2'` + * + * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of + * the image. The length of the square's sides is set to the smaller of the height or width of the image. + * + * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. + * + * After creating the avatar use [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as + * the project's displayed avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async createProjectAvatar( + parameters: Parameters.CreateProjectAvatar, + callback?: never, + ): Promise; + async createProjectAvatar( + parameters: Parameters.CreateProjectAvatar, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatar2`, + method: 'POST', + params: { + x: parameters.x, + y: parameters.y, + size: parameters.size, + }, + data: parameters.avatar, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all project avatars, grouped by system and custom avatars. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getAllProjectAvatars( + parameters: Parameters.GetAllProjectAvatars, + callback: Callback, + ): Promise; + /** + * Returns all project avatars, grouped by system and custom avatars. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getAllProjectAvatars( + parameters: Parameters.GetAllProjectAvatars, + callback?: never, + ): Promise; + async getAllProjectAvatars( + parameters: Parameters.GetAllProjectAvatars, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatars`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectAvatars.ts b/src/version3/projectAvatars.ts deleted file mode 100644 index a652ef33c..000000000 --- a/src/version3/projectAvatars.ts +++ /dev/null @@ -1,202 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectAvatars { - constructor(private client: Client) {} - - /** - * Sets the avatar displayed for a project. - * - * Use [Load project avatar](#api-rest-api-3-project-projectIdOrKey-avatar2-post) to store avatars against the - * project, before using this operation to set the displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback: Callback): Promise; - /** - * Sets the avatar displayed for a project. - * - * Use [Load project avatar](#api-rest-api-3-project-projectIdOrKey-avatar2-post) to store avatars against the - * project, before using this operation to set the displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback?: never): Promise; - async updateProjectAvatar( - parameters: Parameters.UpdateProjectAvatar, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatar`, - method: 'PUT', - data: { - fileName: parameters.fileName, - id: parameters.id, - isDeletable: parameters.isDeletable, - isSelected: parameters.isSelected, - isSystemAvatar: parameters.isSystemAvatar, - owner: parameters.owner, - urls: parameters.urls, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback: Callback): Promise; - /** - * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback?: never): Promise; - async deleteProjectAvatar( - parameters: Parameters.DeleteProjectAvatar, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatar/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Loads an avatar for a project. - * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * For example: `curl --request POST ` - * - * `--user email@example.com: ` - * - * `--header 'X-Atlassian-Token: no-check' ` - * - * `--header 'Content-Type: image/< image_type>' ` - * - * `--data-binary "<@/path/to/file/with/your/avatar>" ` - * - * `--url 'https://your-domain.atlassian.net/rest/api/3/project/{projectIdOrKey}/avatar2'` - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar use [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as - * the project's displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async createProjectAvatar( - parameters: Parameters.CreateProjectAvatar, - callback: Callback, - ): Promise; - /** - * Loads an avatar for a project. - * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * For example: `curl --request POST ` - * - * `--user email@example.com: ` - * - * `--header 'X-Atlassian-Token: no-check' ` - * - * `--header 'Content-Type: image/< image_type>' ` - * - * `--data-binary "<@/path/to/file/with/your/avatar>" ` - * - * `--url 'https://your-domain.atlassian.net/rest/api/3/project/{projectIdOrKey}/avatar2'` - * - * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of - * the image. The length of the square's sides is set to the smaller of the height or width of the image. - * - * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. - * - * After creating the avatar use [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as - * the project's displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async createProjectAvatar( - parameters: Parameters.CreateProjectAvatar, - callback?: never, - ): Promise; - async createProjectAvatar( - parameters: Parameters.CreateProjectAvatar, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatar2`, - method: 'POST', - params: { - x: parameters.x, - y: parameters.y, - size: parameters.size, - }, - data: parameters.avatar, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all project avatars, grouped by system and custom avatars. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getAllProjectAvatars( - parameters: Parameters.GetAllProjectAvatars, - callback: Callback, - ): Promise; - /** - * Returns all project avatars, grouped by system and custom avatars. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getAllProjectAvatars( - parameters: Parameters.GetAllProjectAvatars, - callback?: never, - ): Promise; - async getAllProjectAvatars( - parameters: Parameters.GetAllProjectAvatars, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatars`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectCategories.mts b/src/version3/projectCategories.mts new file mode 100644 index 000000000..6d795ebda --- /dev/null +++ b/src/version3/projectCategories.mts @@ -0,0 +1,167 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectCategories { + constructor(private client: Client) {} + + /** + * Returns all project categories. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAllProjectCategories(callback: Callback): Promise; + /** + * Returns all project categories. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAllProjectCategories(callback?: never): Promise; + async getAllProjectCategories(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/projectCategory', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProjectCategory( + parameters: Parameters.CreateProjectCategory, + callback: Callback, + ): Promise; + /** + * Creates a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProjectCategory( + parameters: Parameters.CreateProjectCategory, + callback?: never, + ): Promise; + async createProjectCategory( + parameters: Parameters.CreateProjectCategory, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/projectCategory', + method: 'POST', + data: { + description: parameters.description, + id: parameters.id, + name: parameters.name, + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getProjectCategoryById( + parameters: Parameters.GetProjectCategoryById, + callback: Callback, + ): Promise; + /** + * Returns a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getProjectCategoryById( + parameters: Parameters.GetProjectCategoryById, + callback?: never, + ): Promise; + async getProjectCategoryById( + parameters: Parameters.GetProjectCategoryById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/projectCategory/${parameters.id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateProjectCategory( + parameters: Parameters.UpdateProjectCategory, + callback: Callback, + ): Promise; + /** + * Updates a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateProjectCategory( + parameters: Parameters.UpdateProjectCategory, + callback?: never, + ): Promise; + async updateProjectCategory( + parameters: Parameters.UpdateProjectCategory, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/projectCategory/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeProjectCategory( + parameters: Parameters.RemoveProjectCategory, + callback: Callback, + ): Promise; + /** + * Deletes a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeProjectCategory(parameters: Parameters.RemoveProjectCategory, callback?: never): Promise; + async removeProjectCategory( + parameters: Parameters.RemoveProjectCategory, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/projectCategory/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectCategories.ts b/src/version3/projectCategories.ts deleted file mode 100644 index 6cd84f14f..000000000 --- a/src/version3/projectCategories.ts +++ /dev/null @@ -1,167 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectCategories { - constructor(private client: Client) {} - - /** - * Returns all project categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllProjectCategories(callback: Callback): Promise; - /** - * Returns all project categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllProjectCategories(callback?: never): Promise; - async getAllProjectCategories(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/projectCategory', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectCategory( - parameters: Parameters.CreateProjectCategory, - callback: Callback, - ): Promise; - /** - * Creates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectCategory( - parameters: Parameters.CreateProjectCategory, - callback?: never, - ): Promise; - async createProjectCategory( - parameters: Parameters.CreateProjectCategory, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/projectCategory', - method: 'POST', - data: { - description: parameters.description, - id: parameters.id, - name: parameters.name, - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getProjectCategoryById( - parameters: Parameters.GetProjectCategoryById, - callback: Callback, - ): Promise; - /** - * Returns a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getProjectCategoryById( - parameters: Parameters.GetProjectCategoryById, - callback?: never, - ): Promise; - async getProjectCategoryById( - parameters: Parameters.GetProjectCategoryById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/projectCategory/${parameters.id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateProjectCategory( - parameters: Parameters.UpdateProjectCategory, - callback: Callback, - ): Promise; - /** - * Updates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateProjectCategory( - parameters: Parameters.UpdateProjectCategory, - callback?: never, - ): Promise; - async updateProjectCategory( - parameters: Parameters.UpdateProjectCategory, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/projectCategory/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeProjectCategory( - parameters: Parameters.RemoveProjectCategory, - callback: Callback, - ): Promise; - /** - * Deletes a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeProjectCategory(parameters: Parameters.RemoveProjectCategory, callback?: never): Promise; - async removeProjectCategory( - parameters: Parameters.RemoveProjectCategory, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/projectCategory/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectComponents.mts b/src/version3/projectComponents.mts new file mode 100644 index 000000000..3f45594a7 --- /dev/null +++ b/src/version3/projectComponents.mts @@ -0,0 +1,296 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectComponents { + constructor(private client: Client) {} + + /** + * Creates a component. Use components to provide containers for issues within a project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the + * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createComponent( + parameters: Parameters.CreateComponent, + callback: Callback, + ): Promise; + /** + * Creates a component. Use components to provide containers for issues within a project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the + * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createComponent( + parameters: Parameters.CreateComponent, + callback?: never, + ): Promise; + async createComponent( + parameters: Parameters.CreateComponent, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/component', + method: 'POST', + data: { + assignee: parameters?.assignee, + assigneeType: parameters?.assigneeType, + description: parameters?.description, + id: parameters?.id, + isAssigneeTypeValid: parameters?.isAssigneeTypeValid, + lead: parameters?.lead, + leadAccountId: parameters?.leadAccountId, + leadUserName: parameters?.leadUserName, + name: parameters?.name, + project: parameters?.project, + projectId: parameters?.projectId, + realAssignee: parameters?.realAssignee, + realAssigneeType: parameters?.realAssigneeType, + self: parameters?.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a component. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for project containing the component. + */ + async getComponent( + parameters: Parameters.GetComponent, + callback: Callback, + ): Promise; + /** + * Returns a component. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for project containing the component. + */ + async getComponent(parameters: Parameters.GetComponent, callback?: never): Promise; + async getComponent( + parameters: Parameters.GetComponent, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/component/${parameters.id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") + * the component lead is removed. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateComponent( + parameters: Parameters.UpdateComponent, + callback: Callback, + ): Promise; + /** + * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") + * the component lead is removed. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateComponent( + parameters: Parameters.UpdateComponent, + callback?: never, + ): Promise; + async updateComponent( + parameters: Parameters.UpdateComponent, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/component/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + leadUserName: parameters.leadUserName, + leadAccountId: parameters.leadAccountId, + assigneeType: parameters.assigneeType, + project: parameters.project, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a component. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteComponent(parameters: Parameters.DeleteComponent, callback: Callback): Promise; + /** + * Deletes a component. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteComponent(parameters: Parameters.DeleteComponent, callback?: never): Promise; + async deleteComponent(parameters: Parameters.DeleteComponent, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/component/${parameters.id}`, + method: 'DELETE', + params: { + moveIssuesTo: parameters.moveIssuesTo, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the counts of issues assigned to the component. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getComponentRelatedIssues( + parameters: Parameters.GetComponentRelatedIssues, + callback: Callback, + ): Promise; + /** + * Returns the counts of issues assigned to the component. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getComponentRelatedIssues( + parameters: Parameters.GetComponentRelatedIssues, + callback?: never, + ): Promise; + async getComponentRelatedIssues( + parameters: Parameters.GetComponentRelatedIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/component/${parameters.id}/relatedIssueCounts`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * components in a project. See the [Get project components](#api-rest-api-3-project-projectIdOrKey-components-get) + * resource if you want to get a full list of versions without pagination. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectComponentsPaginated( + parameters: Parameters.GetProjectComponentsPaginated, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * components in a project. See the [Get project components](#api-rest-api-3-project-projectIdOrKey-components-get) + * resource if you want to get a full list of versions without pagination. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectComponentsPaginated( + parameters: Parameters.GetProjectComponentsPaginated, + callback?: never, + ): Promise; + async getProjectComponentsPaginated( + parameters: Parameters.GetProjectComponentsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/component`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + orderBy: parameters.orderBy, + query: parameters.query, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all components in a project. See the [Get project components + * paginated](#api-rest-api-3-project-projectIdOrKey-component-get) resource if you want to get a full list of + * components with pagination. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectComponents( + parameters: Parameters.GetProjectComponents, + callback: Callback, + ): Promise; + /** + * Returns all components in a project. See the [Get project components + * paginated](#api-rest-api-3-project-projectIdOrKey-component-get) resource if you want to get a full list of + * components with pagination. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectComponents( + parameters: Parameters.GetProjectComponents, + callback?: never, + ): Promise; + async getProjectComponents( + parameters: Parameters.GetProjectComponents, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/components`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectComponents.ts b/src/version3/projectComponents.ts deleted file mode 100644 index c5bf311b6..000000000 --- a/src/version3/projectComponents.ts +++ /dev/null @@ -1,296 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectComponents { - constructor(private client: Client) {} - - /** - * Creates a component. Use components to provide containers for issues within a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the - * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createComponent( - parameters: Parameters.CreateComponent, - callback: Callback, - ): Promise; - /** - * Creates a component. Use components to provide containers for issues within a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the - * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createComponent( - parameters: Parameters.CreateComponent, - callback?: never, - ): Promise; - async createComponent( - parameters: Parameters.CreateComponent, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/component', - method: 'POST', - data: { - assignee: parameters?.assignee, - assigneeType: parameters?.assigneeType, - description: parameters?.description, - id: parameters?.id, - isAssigneeTypeValid: parameters?.isAssigneeTypeValid, - lead: parameters?.lead, - leadAccountId: parameters?.leadAccountId, - leadUserName: parameters?.leadUserName, - name: parameters?.name, - project: parameters?.project, - projectId: parameters?.projectId, - realAssignee: parameters?.realAssignee, - realAssigneeType: parameters?.realAssigneeType, - self: parameters?.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for project containing the component. - */ - async getComponent( - parameters: Parameters.GetComponent, - callback: Callback, - ): Promise; - /** - * Returns a component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for project containing the component. - */ - async getComponent(parameters: Parameters.GetComponent, callback?: never): Promise; - async getComponent( - parameters: Parameters.GetComponent, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/component/${parameters.id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") - * the component lead is removed. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateComponent( - parameters: Parameters.UpdateComponent, - callback: Callback, - ): Promise; - /** - * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") - * the component lead is removed. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateComponent( - parameters: Parameters.UpdateComponent, - callback?: never, - ): Promise; - async updateComponent( - parameters: Parameters.UpdateComponent, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/component/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - leadUserName: parameters.leadUserName, - leadAccountId: parameters.leadAccountId, - assigneeType: parameters.assigneeType, - project: parameters.project, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteComponent(parameters: Parameters.DeleteComponent, callback: Callback): Promise; - /** - * Deletes a component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteComponent(parameters: Parameters.DeleteComponent, callback?: never): Promise; - async deleteComponent(parameters: Parameters.DeleteComponent, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/component/${parameters.id}`, - method: 'DELETE', - params: { - moveIssuesTo: parameters.moveIssuesTo, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the counts of issues assigned to the component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues, - callback: Callback, - ): Promise; - /** - * Returns the counts of issues assigned to the component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues, - callback?: never, - ): Promise; - async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/component/${parameters.id}/relatedIssueCounts`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * components in a project. See the [Get project components](#api-rest-api-3-project-projectIdOrKey-components-get) - * resource if you want to get a full list of versions without pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectComponentsPaginated( - parameters: Parameters.GetProjectComponentsPaginated, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * components in a project. See the [Get project components](#api-rest-api-3-project-projectIdOrKey-components-get) - * resource if you want to get a full list of versions without pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectComponentsPaginated( - parameters: Parameters.GetProjectComponentsPaginated, - callback?: never, - ): Promise; - async getProjectComponentsPaginated( - parameters: Parameters.GetProjectComponentsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/component`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - orderBy: parameters.orderBy, - query: parameters.query, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all components in a project. See the [Get project components - * paginated](#api-rest-api-3-project-projectIdOrKey-component-get) resource if you want to get a full list of - * components with pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectComponents( - parameters: Parameters.GetProjectComponents, - callback: Callback, - ): Promise; - /** - * Returns all components in a project. See the [Get project components - * paginated](#api-rest-api-3-project-projectIdOrKey-component-get) resource if you want to get a full list of - * components with pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectComponents( - parameters: Parameters.GetProjectComponents, - callback?: never, - ): Promise; - async getProjectComponents( - parameters: Parameters.GetProjectComponents, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/components`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectEmail.mts b/src/version3/projectEmail.mts new file mode 100644 index 000000000..7df0bced0 --- /dev/null +++ b/src/version3/projectEmail.mts @@ -0,0 +1,77 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectEmail { + constructor(private client: Client) {} + + /** + * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectEmail( + parameters: Parameters.GetProjectEmail | string, + callback: Callback, + ): Promise; + /** + * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectEmail( + parameters: Parameters.GetProjectEmail | string, + callback?: never, + ): Promise; + async getProjectEmail( + parameters: Parameters.GetProjectEmail | string, + callback?: Callback, + ): Promise { + const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectId}/email`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * + * If `emailAddress` is an empty string, the default email address is restored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback: Callback): Promise; + /** + * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * + * If `emailAddress` is an empty string, the default email address is restored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback?: never): Promise; + async updateProjectEmail( + parameters: Parameters.UpdateProjectEmail, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectId}/email`, + method: 'PUT', + data: { + emailAddress: parameters.emailAddress, + emailAddressStatus: parameters.emailAddressStatus, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectEmail.ts b/src/version3/projectEmail.ts deleted file mode 100644 index 5821c7b65..000000000 --- a/src/version3/projectEmail.ts +++ /dev/null @@ -1,77 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectEmail { - constructor(private client: Client) {} - - /** - * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectEmail( - parameters: Parameters.GetProjectEmail | string, - callback: Callback, - ): Promise; - /** - * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectEmail( - parameters: Parameters.GetProjectEmail | string, - callback?: never, - ): Promise; - async getProjectEmail( - parameters: Parameters.GetProjectEmail | string, - callback?: Callback, - ): Promise { - const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectId}/email`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * If `emailAddress` is an empty string, the default email address is restored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback: Callback): Promise; - /** - * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * If `emailAddress` is an empty string, the default email address is restored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback?: never): Promise; - async updateProjectEmail( - parameters: Parameters.UpdateProjectEmail, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectId}/email`, - method: 'PUT', - data: { - emailAddress: parameters.emailAddress, - emailAddressStatus: parameters.emailAddressStatus, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectFeatures.mts b/src/version3/projectFeatures.mts new file mode 100644 index 000000000..32174e5ac --- /dev/null +++ b/src/version3/projectFeatures.mts @@ -0,0 +1,58 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectFeatures { + constructor(private client: Client) {} + + /** Returns the list of features for a project. */ + async getFeaturesForProject( + parameters: Parameters.GetFeaturesForProject | string, + callback: Callback, + ): Promise; + /** Returns the list of features for a project. */ + async getFeaturesForProject( + parameters: Parameters.GetFeaturesForProject | string, + callback?: never, + ): Promise; + async getFeaturesForProject( + parameters: Parameters.GetFeaturesForProject | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/features`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** Sets the state of a project feature. */ + async toggleFeatureForProject( + parameters: Parameters.ToggleFeatureForProject, + callback: Callback, + ): Promise; + /** Sets the state of a project feature. */ + async toggleFeatureForProject( + parameters: Parameters.ToggleFeatureForProject, + callback?: never, + ): Promise; + async toggleFeatureForProject( + parameters: Parameters.ToggleFeatureForProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/features/${parameters.featureKey}`, + method: 'PUT', + data: { + state: parameters.state, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectFeatures.ts b/src/version3/projectFeatures.ts deleted file mode 100644 index 90d9ef762..000000000 --- a/src/version3/projectFeatures.ts +++ /dev/null @@ -1,58 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectFeatures { - constructor(private client: Client) {} - - /** Returns the list of features for a project. */ - async getFeaturesForProject( - parameters: Parameters.GetFeaturesForProject | string, - callback: Callback, - ): Promise; - /** Returns the list of features for a project. */ - async getFeaturesForProject( - parameters: Parameters.GetFeaturesForProject | string, - callback?: never, - ): Promise; - async getFeaturesForProject( - parameters: Parameters.GetFeaturesForProject | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/features`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** Sets the state of a project feature. */ - async toggleFeatureForProject( - parameters: Parameters.ToggleFeatureForProject, - callback: Callback, - ): Promise; - /** Sets the state of a project feature. */ - async toggleFeatureForProject( - parameters: Parameters.ToggleFeatureForProject, - callback?: never, - ): Promise; - async toggleFeatureForProject( - parameters: Parameters.ToggleFeatureForProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/features/${parameters.featureKey}`, - method: 'PUT', - data: { - state: parameters.state, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectKeyAndNameValidation.mts b/src/version3/projectKeyAndNameValidation.mts new file mode 100644 index 000000000..b36ec0ff5 --- /dev/null +++ b/src/version3/projectKeyAndNameValidation.mts @@ -0,0 +1,118 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectKeyAndNameValidation { + constructor(private client: Client) {} + + /** + * Validates a project key by confirming the key is a valid string and not in use. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async validateProjectKey( + parameters: Parameters.ValidateProjectKey | string | undefined, + callback: Callback, + ): Promise; + /** + * Validates a project key by confirming the key is a valid string and not in use. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async validateProjectKey( + parameters?: Parameters.ValidateProjectKey | string, + callback?: never, + ): Promise; + async validateProjectKey( + parameters?: Parameters.ValidateProjectKey | string, + callback?: Callback, + ): Promise { + const key = typeof parameters === 'string' ? parameters : parameters?.key; + + const config: RequestConfig = { + url: '/rest/api/3/projectvalidate/key', + method: 'GET', + params: { + key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getValidProjectKey( + parameters: Parameters.GetValidProjectKey | string | undefined, + callback: Callback, + ): Promise; + /** + * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getValidProjectKey( + parameters?: Parameters.GetValidProjectKey | string, + callback?: never, + ): Promise; + async getValidProjectKey( + parameters?: Parameters.GetValidProjectKey | string, + callback?: Callback, + ): Promise { + const key = typeof parameters === 'string' ? parameters : parameters?.key; + + const config: RequestConfig = { + url: '/rest/api/3/projectvalidate/validProjectKey', + method: 'GET', + params: { + key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in + * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a + * sequence number. If a valid project name cannot be generated, a 404 response is returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getValidProjectName( + parameters: Parameters.GetValidProjectName | string, + callback: Callback, + ): Promise; + /** + * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in + * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a + * sequence number. If a valid project name cannot be generated, a 404 response is returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getValidProjectName( + parameters: Parameters.GetValidProjectName | string, + callback?: never, + ): Promise; + async getValidProjectName( + parameters: Parameters.GetValidProjectName | string, + callback?: Callback, + ): Promise { + const name = typeof parameters === 'string' ? parameters : parameters.name; + + const config: RequestConfig = { + url: '/rest/api/3/projectvalidate/validProjectName', + method: 'GET', + params: { + name, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectKeyAndNameValidation.ts b/src/version3/projectKeyAndNameValidation.ts deleted file mode 100644 index f3931f8f2..000000000 --- a/src/version3/projectKeyAndNameValidation.ts +++ /dev/null @@ -1,118 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectKeyAndNameValidation { - constructor(private client: Client) {} - - /** - * Validates a project key by confirming the key is a valid string and not in use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async validateProjectKey( - parameters: Parameters.ValidateProjectKey | string | undefined, - callback: Callback, - ): Promise; - /** - * Validates a project key by confirming the key is a valid string and not in use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async validateProjectKey( - parameters?: Parameters.ValidateProjectKey | string, - callback?: never, - ): Promise; - async validateProjectKey( - parameters?: Parameters.ValidateProjectKey | string, - callback?: Callback, - ): Promise { - const key = typeof parameters === 'string' ? parameters : parameters?.key; - - const config: RequestConfig = { - url: '/rest/api/3/projectvalidate/key', - method: 'GET', - params: { - key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getValidProjectKey( - parameters: Parameters.GetValidProjectKey | string | undefined, - callback: Callback, - ): Promise; - /** - * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getValidProjectKey( - parameters?: Parameters.GetValidProjectKey | string, - callback?: never, - ): Promise; - async getValidProjectKey( - parameters?: Parameters.GetValidProjectKey | string, - callback?: Callback, - ): Promise { - const key = typeof parameters === 'string' ? parameters : parameters?.key; - - const config: RequestConfig = { - url: '/rest/api/3/projectvalidate/validProjectKey', - method: 'GET', - params: { - key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in - * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a - * sequence number. If a valid project name cannot be generated, a 404 response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getValidProjectName( - parameters: Parameters.GetValidProjectName | string, - callback: Callback, - ): Promise; - /** - * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in - * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a - * sequence number. If a valid project name cannot be generated, a 404 response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getValidProjectName( - parameters: Parameters.GetValidProjectName | string, - callback?: never, - ): Promise; - async getValidProjectName( - parameters: Parameters.GetValidProjectName | string, - callback?: Callback, - ): Promise { - const name = typeof parameters === 'string' ? parameters : parameters.name; - - const config: RequestConfig = { - url: '/rest/api/3/projectvalidate/validProjectName', - method: 'GET', - params: { - name, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectPermissionSchemes.mts b/src/version3/projectPermissionSchemes.mts new file mode 100644 index 000000000..232301791 --- /dev/null +++ b/src/version3/projectPermissionSchemes.mts @@ -0,0 +1,168 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectPermissionSchemes { + constructor(private client: Client) {} + + /** + * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) associated with the project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or the _Administer Projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async getProjectIssueSecurityScheme( + parameters: Parameters.GetProjectIssueSecurityScheme | string, + callback: Callback, + ): Promise; + /** + * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) associated with the project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or the _Administer Projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async getProjectIssueSecurityScheme( + parameters: Parameters.GetProjectIssueSecurityScheme | string, + callback?: never, + ): Promise; + async getProjectIssueSecurityScheme( + parameters: Parameters.GetProjectIssueSecurityScheme | string, + callback?: Callback, + ): Promise { + const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectKeyOrId}/issuesecuritylevelscheme`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) associated with the project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg). + */ + async getAssignedPermissionScheme( + parameters: Parameters.GetAssignedPermissionScheme | string, + callback: Callback, + ): Promise; + /** + * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) associated with the project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg). + */ + async getAssignedPermissionScheme( + parameters: Parameters.GetAssignedPermissionScheme | string, + callback?: never, + ): Promise; + async getAssignedPermissionScheme( + parameters: Parameters.GetAssignedPermissionScheme | string, + callback?: Callback, + ): Promise { + const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectKeyOrId}/permissionscheme`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns a permission scheme with a project. See [Managing project + * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + */ + async assignPermissionScheme( + parameters: Parameters.AssignPermissionScheme, + callback: Callback, + ): Promise; + /** + * Assigns a permission scheme with a project. See [Managing project + * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + */ + async assignPermissionScheme( + parameters: Parameters.AssignPermissionScheme, + callback?: never, + ): Promise; + async assignPermissionScheme( + parameters: Parameters.AssignPermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectKeyOrId}/permissionscheme`, + method: 'PUT', + params: { + expand: parameters.expand, + }, + data: { + id: parameters.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has + * access to. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security + * levels are only returned for authenticated user with _Set Issue Security_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. + */ + async getSecurityLevelsForProject( + parameters: Parameters.GetSecurityLevelsForProject | string, + callback: Callback, + ): Promise; + /** + * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has + * access to. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security + * levels are only returned for authenticated user with _Set Issue Security_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. + */ + async getSecurityLevelsForProject( + parameters: Parameters.GetSecurityLevelsForProject | string, + callback?: never, + ): Promise; + async getSecurityLevelsForProject( + parameters: Parameters.GetSecurityLevelsForProject | string, + callback?: Callback, + ): Promise { + const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectKeyOrId}/securitylevel`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectPermissionSchemes.ts b/src/version3/projectPermissionSchemes.ts deleted file mode 100644 index cea70ff85..000000000 --- a/src/version3/projectPermissionSchemes.ts +++ /dev/null @@ -1,168 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectPermissionSchemes { - constructor(private client: Client) {} - - /** - * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) associated with the project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or the _Administer Projects_ - * [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getProjectIssueSecurityScheme( - parameters: Parameters.GetProjectIssueSecurityScheme | string, - callback: Callback, - ): Promise; - /** - * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) associated with the project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or the _Administer Projects_ - * [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getProjectIssueSecurityScheme( - parameters: Parameters.GetProjectIssueSecurityScheme | string, - callback?: never, - ): Promise; - async getProjectIssueSecurityScheme( - parameters: Parameters.GetProjectIssueSecurityScheme | string, - callback?: Callback, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectKeyOrId}/issuesecuritylevelscheme`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) associated with the project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getAssignedPermissionScheme( - parameters: Parameters.GetAssignedPermissionScheme | string, - callback: Callback, - ): Promise; - /** - * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) associated with the project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getAssignedPermissionScheme( - parameters: Parameters.GetAssignedPermissionScheme | string, - callback?: never, - ): Promise; - async getAssignedPermissionScheme( - parameters: Parameters.GetAssignedPermissionScheme | string, - callback?: Callback, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectKeyOrId}/permissionscheme`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns a permission scheme with a project. See [Managing project - * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - */ - async assignPermissionScheme( - parameters: Parameters.AssignPermissionScheme, - callback: Callback, - ): Promise; - /** - * Assigns a permission scheme with a project. See [Managing project - * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - */ - async assignPermissionScheme( - parameters: Parameters.AssignPermissionScheme, - callback?: never, - ): Promise; - async assignPermissionScheme( - parameters: Parameters.AssignPermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectKeyOrId}/permissionscheme`, - method: 'PUT', - params: { - expand: parameters.expand, - }, - data: { - id: parameters.id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has - * access to. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security - * levels are only returned for authenticated user with _Set Issue Security_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. - */ - async getSecurityLevelsForProject( - parameters: Parameters.GetSecurityLevelsForProject | string, - callback: Callback, - ): Promise; - /** - * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has - * access to. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security - * levels are only returned for authenticated user with _Set Issue Security_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. - */ - async getSecurityLevelsForProject( - parameters: Parameters.GetSecurityLevelsForProject | string, - callback?: never, - ): Promise; - async getSecurityLevelsForProject( - parameters: Parameters.GetSecurityLevelsForProject | string, - callback?: Callback, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectKeyOrId}/securitylevel`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectProperties.mts b/src/version3/projectProperties.mts new file mode 100644 index 000000000..64dc45381 --- /dev/null +++ b/src/version3/projectProperties.mts @@ -0,0 +1,174 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectProperties { + constructor(private client: Client) {} + + /** + * Returns all [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * keys for the project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectPropertyKeys( + parameters: Parameters.GetProjectPropertyKeys | string, + callback: Callback, + ): Promise; + /** + * Returns all [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * keys for the project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectPropertyKeys( + parameters: Parameters.GetProjectPropertyKeys | string, + callback?: never, + ): Promise; + async getProjectPropertyKeys( + parameters: Parameters.GetProjectPropertyKeys | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. + */ + async getProjectProperty( + parameters: Parameters.GetProjectProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. + */ + async getProjectProperty( + parameters: Parameters.GetProjectProperty, + callback?: never, + ): Promise; + async getProjectProperty( + parameters: Parameters.GetProjectProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of the [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * You can use project properties to store custom data against the project. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the property is created. + */ + async setProjectProperty( + parameters: Parameters.SetProjectProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of the [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * You can use project properties to store custom data against the project. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the property is created. + */ + async setProjectProperty(parameters: Parameters.SetProjectProperty, callback?: never): Promise; + async setProjectProperty( + parameters: Parameters.SetProjectProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the + * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * from a project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. + */ + async deleteProjectProperty( + parameters: Parameters.DeleteProjectProperty, + callback: Callback, + ): Promise; + /** + * Deletes the + * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * from a project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. + */ + async deleteProjectProperty(parameters: Parameters.DeleteProjectProperty, callback?: never): Promise; + async deleteProjectProperty( + parameters: Parameters.DeleteProjectProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectProperties.ts b/src/version3/projectProperties.ts deleted file mode 100644 index ebb49988d..000000000 --- a/src/version3/projectProperties.ts +++ /dev/null @@ -1,174 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectProperties { - constructor(private client: Client) {} - - /** - * Returns all [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys for the project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectPropertyKeys( - parameters: Parameters.GetProjectPropertyKeys | string, - callback: Callback, - ): Promise; - /** - * Returns all [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys for the project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectPropertyKeys( - parameters: Parameters.GetProjectPropertyKeys | string, - callback?: never, - ): Promise; - async getProjectPropertyKeys( - parameters: Parameters.GetProjectPropertyKeys | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. - */ - async getProjectProperty( - parameters: Parameters.GetProjectProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. - */ - async getProjectProperty( - parameters: Parameters.GetProjectProperty, - callback?: never, - ): Promise; - async getProjectProperty( - parameters: Parameters.GetProjectProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of the [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * You can use project properties to store custom data against the project. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the property is created. - */ - async setProjectProperty( - parameters: Parameters.SetProjectProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of the [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * You can use project properties to store custom data against the project. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the property is created. - */ - async setProjectProperty(parameters: Parameters.SetProjectProperty, callback?: never): Promise; - async setProjectProperty( - parameters: Parameters.SetProjectProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the - * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * from a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. - */ - async deleteProjectProperty( - parameters: Parameters.DeleteProjectProperty, - callback: Callback, - ): Promise; - /** - * Deletes the - * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * from a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. - */ - async deleteProjectProperty(parameters: Parameters.DeleteProjectProperty, callback?: never): Promise; - async deleteProjectProperty( - parameters: Parameters.DeleteProjectProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectRoleActors.mts b/src/version3/projectRoleActors.mts new file mode 100644 index 000000000..2086178ea --- /dev/null +++ b/src/version3/projectRoleActors.mts @@ -0,0 +1,249 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectRoleActors { + constructor(private client: Client) {} + + /** + * Adds actors to a project role for the project. + * + * To replace all actors for the project, use [Set actors for project + * role](#api-rest-api-3-project-projectIdOrKey-role-id-put). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addActorUsers( + parameters: Parameters.AddActorUsers, + callback: Callback, + ): Promise; + /** + * Adds actors to a project role for the project. + * + * To replace all actors for the project, use [Set actors for project + * role](#api-rest-api-3-project-projectIdOrKey-role-id-put). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addActorUsers(parameters: Parameters.AddActorUsers, callback?: never): Promise; + async addActorUsers( + parameters: Parameters.AddActorUsers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'POST', + data: { + user: parameters.user, + group: parameters.group, + groupId: parameters.groupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the actors for a project role for a project, replacing all existing actors. + * + * To add actors to the project without overwriting the existing list, use [Add actors to project + * role](#api-rest-api-3-project-projectIdOrKey-role-id-post). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setActors(parameters: Parameters.SetActors, callback: Callback): Promise; + /** + * Sets the actors for a project role for a project, replacing all existing actors. + * + * To add actors to the project without overwriting the existing list, use [Add actors to project + * role](#api-rest-api-3-project-projectIdOrKey-role-id-post). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setActors(parameters: Parameters.SetActors, callback?: never): Promise; + async setActors(parameters: Parameters.SetActors, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'PUT', + data: { + categorisedActors: parameters.categorisedActors, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes actors from a project role for the project. + * + * To remove default actors from the project role, use [Delete default actors from project + * role](#api-rest-api-3-role-id-actors-delete). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteActor(parameters: Parameters.DeleteActor, callback: Callback): Promise; + /** + * Deletes actors from a project role for the project. + * + * To remove default actors from the project role, use [Delete default actors from project + * role](#api-rest-api-3-role-id-actors-delete). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteActor(parameters: Parameters.DeleteActor, callback?: never): Promise; + async deleteActor(parameters: Parameters.DeleteActor, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'DELETE', + params: { + user: parameters.user, + group: parameters.group, + groupId: parameters.groupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the [default actors](#api-rest-api-3-resolution-get) for the project role. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoleActorsForRole( + parameters: Parameters.GetProjectRoleActorsForRole | string, + callback: Callback, + ): Promise; + /** + * Returns the [default actors](#api-rest-api-3-resolution-get) for the project role. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoleActorsForRole( + parameters: Parameters.GetProjectRoleActorsForRole | string, + callback?: never, + ): Promise; + async getProjectRoleActorsForRole( + parameters: Parameters.GetProjectRoleActorsForRole | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/role/${id}/actors`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds [default actors](#api-rest-api-3-resolution-get) to a role. You may add groups or users, but you cannot add + * groups and users in the same request. + * + * Changing a project role's default actors does not affect project role members for projects already created. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addProjectRoleActorsToRole( + parameters: Parameters.AddProjectRoleActorsToRole, + callback: Callback, + ): Promise; + /** + * Adds [default actors](#api-rest-api-3-resolution-get) to a role. You may add groups or users, but you cannot add + * groups and users in the same request. + * + * Changing a project role's default actors does not affect project role members for projects already created. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addProjectRoleActorsToRole( + parameters: Parameters.AddProjectRoleActorsToRole, + callback?: never, + ): Promise; + async addProjectRoleActorsToRole( + parameters: Parameters.AddProjectRoleActorsToRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/role/${parameters.id}/actors`, + method: 'POST', + data: { + user: parameters.user, + groupId: parameters.groupId, + group: parameters.group, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the [default actors](#api-rest-api-3-resolution-get) from a project role. You may delete a group or user, + * but you cannot delete a group and a user in the same request. + * + * Changing a project role's default actors does not affect project role members for projects already created. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectRoleActorsFromRole( + parameters: Parameters.DeleteProjectRoleActorsFromRole, + callback: Callback, + ): Promise; + /** + * Deletes the [default actors](#api-rest-api-3-resolution-get) from a project role. You may delete a group or user, + * but you cannot delete a group and a user in the same request. + * + * Changing a project role's default actors does not affect project role members for projects already created. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectRoleActorsFromRole( + parameters: Parameters.DeleteProjectRoleActorsFromRole, + callback?: never, + ): Promise; + async deleteProjectRoleActorsFromRole( + parameters: Parameters.DeleteProjectRoleActorsFromRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/role/${parameters.id}/actors`, + method: 'DELETE', + params: { + user: parameters.user, + groupId: parameters.groupId, + group: parameters.group, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectRoleActors.ts b/src/version3/projectRoleActors.ts deleted file mode 100644 index 307f44446..000000000 --- a/src/version3/projectRoleActors.ts +++ /dev/null @@ -1,249 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectRoleActors { - constructor(private client: Client) {} - - /** - * Adds actors to a project role for the project. - * - * To replace all actors for the project, use [Set actors for project - * role](#api-rest-api-3-project-projectIdOrKey-role-id-put). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addActorUsers( - parameters: Parameters.AddActorUsers, - callback: Callback, - ): Promise; - /** - * Adds actors to a project role for the project. - * - * To replace all actors for the project, use [Set actors for project - * role](#api-rest-api-3-project-projectIdOrKey-role-id-put). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addActorUsers(parameters: Parameters.AddActorUsers, callback?: never): Promise; - async addActorUsers( - parameters: Parameters.AddActorUsers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, - method: 'POST', - data: { - user: parameters.user, - group: parameters.group, - groupId: parameters.groupId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the actors for a project role for a project, replacing all existing actors. - * - * To add actors to the project without overwriting the existing list, use [Add actors to project - * role](#api-rest-api-3-project-projectIdOrKey-role-id-post). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setActors(parameters: Parameters.SetActors, callback: Callback): Promise; - /** - * Sets the actors for a project role for a project, replacing all existing actors. - * - * To add actors to the project without overwriting the existing list, use [Add actors to project - * role](#api-rest-api-3-project-projectIdOrKey-role-id-post). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setActors(parameters: Parameters.SetActors, callback?: never): Promise; - async setActors(parameters: Parameters.SetActors, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, - method: 'PUT', - data: { - categorisedActors: parameters.categorisedActors, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes actors from a project role for the project. - * - * To remove default actors from the project role, use [Delete default actors from project - * role](#api-rest-api-3-role-id-actors-delete). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteActor(parameters: Parameters.DeleteActor, callback: Callback): Promise; - /** - * Deletes actors from a project role for the project. - * - * To remove default actors from the project role, use [Delete default actors from project - * role](#api-rest-api-3-role-id-actors-delete). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteActor(parameters: Parameters.DeleteActor, callback?: never): Promise; - async deleteActor(parameters: Parameters.DeleteActor, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, - method: 'DELETE', - params: { - user: parameters.user, - group: parameters.group, - groupId: parameters.groupId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the [default actors](#api-rest-api-3-resolution-get) for the project role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleActorsForRole( - parameters: Parameters.GetProjectRoleActorsForRole | string, - callback: Callback, - ): Promise; - /** - * Returns the [default actors](#api-rest-api-3-resolution-get) for the project role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleActorsForRole( - parameters: Parameters.GetProjectRoleActorsForRole | string, - callback?: never, - ): Promise; - async getProjectRoleActorsForRole( - parameters: Parameters.GetProjectRoleActorsForRole | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/role/${id}/actors`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds [default actors](#api-rest-api-3-resolution-get) to a role. You may add groups or users, but you cannot add - * groups and users in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addProjectRoleActorsToRole( - parameters: Parameters.AddProjectRoleActorsToRole, - callback: Callback, - ): Promise; - /** - * Adds [default actors](#api-rest-api-3-resolution-get) to a role. You may add groups or users, but you cannot add - * groups and users in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addProjectRoleActorsToRole( - parameters: Parameters.AddProjectRoleActorsToRole, - callback?: never, - ): Promise; - async addProjectRoleActorsToRole( - parameters: Parameters.AddProjectRoleActorsToRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/role/${parameters.id}/actors`, - method: 'POST', - data: { - user: parameters.user, - groupId: parameters.groupId, - group: parameters.group, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the [default actors](#api-rest-api-3-resolution-get) from a project role. You may delete a group or user, - * but you cannot delete a group and a user in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRoleActorsFromRole( - parameters: Parameters.DeleteProjectRoleActorsFromRole, - callback: Callback, - ): Promise; - /** - * Deletes the [default actors](#api-rest-api-3-resolution-get) from a project role. You may delete a group or user, - * but you cannot delete a group and a user in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRoleActorsFromRole( - parameters: Parameters.DeleteProjectRoleActorsFromRole, - callback?: never, - ): Promise; - async deleteProjectRoleActorsFromRole( - parameters: Parameters.DeleteProjectRoleActorsFromRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/role/${parameters.id}/actors`, - method: 'DELETE', - params: { - user: parameters.user, - groupId: parameters.groupId, - group: parameters.group, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectRoles.mts b/src/version3/projectRoles.mts new file mode 100644 index 000000000..469544122 --- /dev/null +++ b/src/version3/projectRoles.mts @@ -0,0 +1,422 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectRoles { + constructor(private client: Client) {} + + /** + * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and + * self URL for each role. + * + * Note that all project roles are shared with all projects in Jira Cloud. See [Get all project + * roles](#api-rest-api-3-role-get) for more information. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site + * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoles>( + parameters: Parameters.GetProjectRoles | string, + callback: Callback, + ): Promise; + /** + * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and + * self URL for each role. + * + * Note that all project roles are shared with all projects in Jira Cloud. See [Get all project + * roles](#api-rest-api-3-role-get) for more information. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site + * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoles>( + parameters: Parameters.GetProjectRoles | string, + callback?: never, + ): Promise; + async getProjectRoles>( + parameters: Parameters.GetProjectRoles | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/role`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a project role's details and actors associated with the project. The list of actors is sorted by display + * name. + * + * To check whether a user belongs to a role based on their group memberships, use [Get + * user](#api-rest-api-3-user-get) with the `groups` expand parameter selected. Then check whether the user keys and + * groups match with the actors returned for the project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRole( + parameters: Parameters.GetProjectRole, + callback: Callback, + ): Promise; + /** + * Returns a project role's details and actors associated with the project. The list of actors is sorted by display + * name. + * + * To check whether a user belongs to a role based on their group memberships, use [Get + * user](#api-rest-api-3-user-get) with the `groups` expand parameter selected. Then check whether the user keys and + * groups match with the actors returned for the project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRole(parameters: Parameters.GetProjectRole, callback?: never): Promise; + async getProjectRole( + parameters: Parameters.GetProjectRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'GET', + params: { + excludeInactiveUsers: parameters.excludeInactiveUsers, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the + * list of project roles is common to all projects. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectRoleDetails( + parameters: Parameters.GetProjectRoleDetails | string, + callback: Callback, + ): Promise; + /** + * Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the + * list of project roles is common to all projects. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectRoleDetails( + parameters: Parameters.GetProjectRoleDetails | string, + callback?: never, + ): Promise; + async getProjectRoleDetails( + parameters: Parameters.GetProjectRoleDetails | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/roledetails`, + method: 'GET', + params: { + currentMember: typeof parameters !== 'string' && parameters.currentMember, + excludeConnectAddons: typeof parameters !== 'string' && parameters.excludeConnectAddons, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets a list of all project roles, complete with project role details and default actors. + * + * ### About project roles + * + * [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with + * projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have + * a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira + * applications). + * + * Project roles are used in [permission schemes](#api-rest-api-3-permissionscheme-get), [email notification + * schemes](#api-rest-api-3-notificationscheme-get), [issue security + * levels](#api-rest-api-3-issuesecurityschemes-get), [comment visibility](#api-rest-api-3-comment-list-post), and + * workflow conditions. + * + * #### Members and actors + * + * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated + * with a project role. + * + * Actors may be set as [default + * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) + * of the project role or set at the project level: + * + * - Default actors: Users and groups that are assigned to the project role for all newly created projects. The default + * actors can be removed at the project level later if desired. + * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default + * actors. This enables you to assign a user to different roles in different projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllProjectRoles(callback: Callback): Promise; + /** + * Gets a list of all project roles, complete with project role details and default actors. + * + * ### About project roles + * + * [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with + * projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have + * a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira + * applications). + * + * Project roles are used in [permission schemes](#api-rest-api-3-permissionscheme-get), [email notification + * schemes](#api-rest-api-3-notificationscheme-get), [issue security + * levels](#api-rest-api-3-issuesecurityschemes-get), [comment visibility](#api-rest-api-3-comment-list-post), and + * workflow conditions. + * + * #### Members and actors + * + * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated + * with a project role. + * + * Actors may be set as [default + * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) + * of the project role or set at the project level: + * + * - Default actors: Users and groups that are assigned to the project role for all newly created projects. The default + * actors can be removed at the project level later if desired. + * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default + * actors. This enables you to assign a user to different roles in different projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllProjectRoles(callback?: never): Promise; + async getAllProjectRoles(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/role', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a new project role with no [default actors](#api-rest-api-3-resolution-get). You can use the [Add default + * actors to project role](#api-rest-api-3-role-id-actors-post) operation to add default actors to the project role + * after creating it. + * + * _Note that although a new project role is available to all projects upon creation, any default actors that are + * associated with the project role are not added to projects that existed prior to the role being created._< + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProjectRole( + parameters: Parameters.CreateProjectRole, + callback: Callback, + ): Promise; + /** + * Creates a new project role with no [default actors](#api-rest-api-3-resolution-get). You can use the [Add default + * actors to project role](#api-rest-api-3-role-id-actors-post) operation to add default actors to the project role + * after creating it. + * + * _Note that although a new project role is available to all projects upon creation, any default actors that are + * associated with the project role are not added to projects that existed prior to the role being created._< + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProjectRole( + parameters: Parameters.CreateProjectRole, + callback?: never, + ): Promise; + async createProjectRole( + parameters: Parameters.CreateProjectRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/role', + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets the project role details and the default actors associated with the role. The list of default actors is sorted + * by display name. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoleById( + parameters: Parameters.GetProjectRoleById | string, + callback: Callback, + ): Promise; + /** + * Gets the project role details and the default actors associated with the role. The list of default actors is sorted + * by display name. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoleById( + parameters: Parameters.GetProjectRoleById | string, + callback?: never, + ): Promise; + async getProjectRoleById( + parameters: Parameters.GetProjectRoleById | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/role/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates either the project role's name or its description. + * + * You cannot update both the name and description at the same time using this operation. If you send a request with a + * name and a description only the name is updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async partialUpdateProjectRole( + parameters: Parameters.PartialUpdateProjectRole, + callback: Callback, + ): Promise; + /** + * Updates either the project role's name or its description. + * + * You cannot update both the name and description at the same time using this operation. If you send a request with a + * name and a description only the name is updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async partialUpdateProjectRole( + parameters: Parameters.PartialUpdateProjectRole, + callback?: never, + ): Promise; + async partialUpdateProjectRole( + parameters: Parameters.PartialUpdateProjectRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/role/${parameters.id}`, + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the project role's name and description. You must include both a name and a description in the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async fullyUpdateProjectRole( + parameters: Parameters.FullyUpdateProjectRole, + callback: Callback, + ): Promise; + /** + * Updates the project role's name and description. You must include both a name and a description in the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async fullyUpdateProjectRole( + parameters: Parameters.FullyUpdateProjectRole, + callback?: never, + ): Promise; + async fullyUpdateProjectRole( + parameters: Parameters.FullyUpdateProjectRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/role/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in + * use. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectRole( + parameters: Parameters.DeleteProjectRole | string, + callback: Callback, + ): Promise; + /** + * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in + * use. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectRole(parameters: Parameters.DeleteProjectRole | string, callback?: never): Promise; + async deleteProjectRole( + parameters: Parameters.DeleteProjectRole | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/role/${id}`, + method: 'DELETE', + params: { + swap: typeof parameters !== 'string' && parameters.swap, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectRoles.ts b/src/version3/projectRoles.ts deleted file mode 100644 index b9d7a7376..000000000 --- a/src/version3/projectRoles.ts +++ /dev/null @@ -1,422 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectRoles { - constructor(private client: Client) {} - - /** - * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and - * self URL for each role. - * - * Note that all project roles are shared with all projects in Jira Cloud. See [Get all project - * roles](#api-rest-api-3-role-get) for more information. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site - * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoles>( - parameters: Parameters.GetProjectRoles | string, - callback: Callback, - ): Promise; - /** - * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and - * self URL for each role. - * - * Note that all project roles are shared with all projects in Jira Cloud. See [Get all project - * roles](#api-rest-api-3-role-get) for more information. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site - * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoles>( - parameters: Parameters.GetProjectRoles | string, - callback?: never, - ): Promise; - async getProjectRoles>( - parameters: Parameters.GetProjectRoles | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/role`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a project role's details and actors associated with the project. The list of actors is sorted by display - * name. - * - * To check whether a user belongs to a role based on their group memberships, use [Get - * user](#api-rest-api-3-user-get) with the `groups` expand parameter selected. Then check whether the user keys and - * groups match with the actors returned for the project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRole( - parameters: Parameters.GetProjectRole, - callback: Callback, - ): Promise; - /** - * Returns a project role's details and actors associated with the project. The list of actors is sorted by display - * name. - * - * To check whether a user belongs to a role based on their group memberships, use [Get - * user](#api-rest-api-3-user-get) with the `groups` expand parameter selected. Then check whether the user keys and - * groups match with the actors returned for the project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRole(parameters: Parameters.GetProjectRole, callback?: never): Promise; - async getProjectRole( - parameters: Parameters.GetProjectRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, - method: 'GET', - params: { - excludeInactiveUsers: parameters.excludeInactiveUsers, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the - * list of project roles is common to all projects. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, - callback: Callback, - ): Promise; - /** - * Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the - * list of project roles is common to all projects. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, - callback?: never, - ): Promise; - async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/roledetails`, - method: 'GET', - params: { - currentMember: typeof parameters !== 'string' && parameters.currentMember, - excludeConnectAddons: typeof parameters !== 'string' && parameters.excludeConnectAddons, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets a list of all project roles, complete with project role details and default actors. - * - * ### About project roles - * - * [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with - * projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have - * a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira - * applications). - * - * Project roles are used in [permission schemes](#api-rest-api-3-permissionscheme-get), [email notification - * schemes](#api-rest-api-3-notificationscheme-get), [issue security - * levels](#api-rest-api-3-issuesecurityschemes-get), [comment visibility](#api-rest-api-3-comment-list-post), and - * workflow conditions. - * - * #### Members and actors - * - * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated - * with a project role. - * - * Actors may be set as [default - * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) - * of the project role or set at the project level: - * - * - Default actors: Users and groups that are assigned to the project role for all newly created projects. The default - * actors can be removed at the project level later if desired. - * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default - * actors. This enables you to assign a user to different roles in different projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllProjectRoles(callback: Callback): Promise; - /** - * Gets a list of all project roles, complete with project role details and default actors. - * - * ### About project roles - * - * [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with - * projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have - * a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira - * applications). - * - * Project roles are used in [permission schemes](#api-rest-api-3-permissionscheme-get), [email notification - * schemes](#api-rest-api-3-notificationscheme-get), [issue security - * levels](#api-rest-api-3-issuesecurityschemes-get), [comment visibility](#api-rest-api-3-comment-list-post), and - * workflow conditions. - * - * #### Members and actors - * - * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated - * with a project role. - * - * Actors may be set as [default - * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) - * of the project role or set at the project level: - * - * - Default actors: Users and groups that are assigned to the project role for all newly created projects. The default - * actors can be removed at the project level later if desired. - * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default - * actors. This enables you to assign a user to different roles in different projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllProjectRoles(callback?: never): Promise; - async getAllProjectRoles(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/role', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a new project role with no [default actors](#api-rest-api-3-resolution-get). You can use the [Add default - * actors to project role](#api-rest-api-3-role-id-actors-post) operation to add default actors to the project role - * after creating it. - * - * _Note that although a new project role is available to all projects upon creation, any default actors that are - * associated with the project role are not added to projects that existed prior to the role being created._< - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectRole( - parameters: Parameters.CreateProjectRole, - callback: Callback, - ): Promise; - /** - * Creates a new project role with no [default actors](#api-rest-api-3-resolution-get). You can use the [Add default - * actors to project role](#api-rest-api-3-role-id-actors-post) operation to add default actors to the project role - * after creating it. - * - * _Note that although a new project role is available to all projects upon creation, any default actors that are - * associated with the project role are not added to projects that existed prior to the role being created._< - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectRole( - parameters: Parameters.CreateProjectRole, - callback?: never, - ): Promise; - async createProjectRole( - parameters: Parameters.CreateProjectRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/role', - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets the project role details and the default actors associated with the role. The list of default actors is sorted - * by display name. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, - callback: Callback, - ): Promise; - /** - * Gets the project role details and the default actors associated with the role. The list of default actors is sorted - * by display name. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, - callback?: never, - ): Promise; - async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/role/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates either the project role's name or its description. - * - * You cannot update both the name and description at the same time using this operation. If you send a request with a - * name and a description only the name is updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async partialUpdateProjectRole( - parameters: Parameters.PartialUpdateProjectRole, - callback: Callback, - ): Promise; - /** - * Updates either the project role's name or its description. - * - * You cannot update both the name and description at the same time using this operation. If you send a request with a - * name and a description only the name is updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async partialUpdateProjectRole( - parameters: Parameters.PartialUpdateProjectRole, - callback?: never, - ): Promise; - async partialUpdateProjectRole( - parameters: Parameters.PartialUpdateProjectRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/role/${parameters.id}`, - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the project role's name and description. You must include both a name and a description in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async fullyUpdateProjectRole( - parameters: Parameters.FullyUpdateProjectRole, - callback: Callback, - ): Promise; - /** - * Updates the project role's name and description. You must include both a name and a description in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async fullyUpdateProjectRole( - parameters: Parameters.FullyUpdateProjectRole, - callback?: never, - ): Promise; - async fullyUpdateProjectRole( - parameters: Parameters.FullyUpdateProjectRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/role/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in - * use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRole( - parameters: Parameters.DeleteProjectRole | string, - callback: Callback, - ): Promise; - /** - * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in - * use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRole(parameters: Parameters.DeleteProjectRole | string, callback?: never): Promise; - async deleteProjectRole( - parameters: Parameters.DeleteProjectRole | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/role/${id}`, - method: 'DELETE', - params: { - swap: typeof parameters !== 'string' && parameters.swap, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectTypes.mts b/src/version3/projectTypes.mts new file mode 100644 index 000000000..d2d7e3630 --- /dev/null +++ b/src/version3/projectTypes.mts @@ -0,0 +1,119 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectTypes { + constructor(private client: Client) {} + + /** + * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid + * license for each type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllProjectTypes(callback: Callback): Promise; + /** + * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid + * license for each type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllProjectTypes(callback?: never): Promise; + async getAllProjectTypes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/project/type', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ + async getAllAccessibleProjectTypes(callback: Callback): Promise; + /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ + async getAllAccessibleProjectTypes(callback?: never): Promise; + async getAllAccessibleProjectTypes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/project/type/accessible', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getProjectTypeByKey( + parameters: Parameters.GetProjectTypeByKey | string, + callback: Callback, + ): Promise; + /** + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getProjectTypeByKey( + parameters: Parameters.GetProjectTypeByKey | string, + callback?: never, + ): Promise; + async getProjectTypeByKey( + parameters: Parameters.GetProjectTypeByKey | string, + callback?: Callback, + ): Promise { + const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/type/${projectTypeKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAccessibleProjectTypeByKey( + parameters: Parameters.GetAccessibleProjectTypeByKey | string, + callback: Callback, + ): Promise; + /** + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAccessibleProjectTypeByKey( + parameters: Parameters.GetAccessibleProjectTypeByKey | string, + callback?: never, + ): Promise; + async getAccessibleProjectTypeByKey( + parameters: Parameters.GetAccessibleProjectTypeByKey | string, + callback?: Callback, + ): Promise { + const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/type/${projectTypeKey}/accessible`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectTypes.ts b/src/version3/projectTypes.ts deleted file mode 100644 index 2e53c7d95..000000000 --- a/src/version3/projectTypes.ts +++ /dev/null @@ -1,119 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectTypes { - constructor(private client: Client) {} - - /** - * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid - * license for each type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllProjectTypes(callback: Callback): Promise; - /** - * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid - * license for each type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllProjectTypes(callback?: never): Promise; - async getAllProjectTypes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/project/type', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ - async getAllAccessibleProjectTypes(callback: Callback): Promise; - /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ - async getAllAccessibleProjectTypes(callback?: never): Promise; - async getAllAccessibleProjectTypes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/project/type/accessible', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getProjectTypeByKey( - parameters: Parameters.GetProjectTypeByKey | string, - callback: Callback, - ): Promise; - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getProjectTypeByKey( - parameters: Parameters.GetProjectTypeByKey | string, - callback?: never, - ): Promise; - async getProjectTypeByKey( - parameters: Parameters.GetProjectTypeByKey | string, - callback?: Callback, - ): Promise { - const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/type/${projectTypeKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAccessibleProjectTypeByKey( - parameters: Parameters.GetAccessibleProjectTypeByKey | string, - callback: Callback, - ): Promise; - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAccessibleProjectTypeByKey( - parameters: Parameters.GetAccessibleProjectTypeByKey | string, - callback?: never, - ): Promise; - async getAccessibleProjectTypeByKey( - parameters: Parameters.GetAccessibleProjectTypeByKey | string, - callback?: Callback, - ): Promise { - const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/type/${projectTypeKey}/accessible`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectVersions.mts b/src/version3/projectVersions.mts new file mode 100644 index 000000000..cd6b8dedc --- /dev/null +++ b/src/version3/projectVersions.mts @@ -0,0 +1,439 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectVersions { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * versions in a project. See the [Get project versions](#api-rest-api-3-project-projectIdOrKey-versions-get) resource + * if you want to get a full list of versions without pagination. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectVersionsPaginated( + parameters: Parameters.GetProjectVersionsPaginated | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * versions in a project. See the [Get project versions](#api-rest-api-3-project-projectIdOrKey-versions-get) resource + * if you want to get a full list of versions without pagination. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectVersionsPaginated( + parameters: Parameters.GetProjectVersionsPaginated | string, + callback?: never, + ): Promise; + async getProjectVersionsPaginated( + parameters: Parameters.GetProjectVersionsPaginated | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/version`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + orderBy: typeof parameters !== 'string' && parameters.orderBy, + query: typeof parameters !== 'string' && parameters.query, + status: typeof parameters !== 'string' && parameters.status, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all versions in a project. The response is not paginated. Use [Get project versions + * paginated](#api-rest-api-3-project-projectIdOrKey-version-get) if you want to get the versions in a project with + * pagination. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectVersions( + parameters: Parameters.GetProjectVersions | string, + callback: Callback, + ): Promise; + /** + * Returns all versions in a project. The response is not paginated. Use [Get project versions + * paginated](#api-rest-api-3-project-projectIdOrKey-version-get) if you want to get the versions in a project with + * pagination. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProjectVersions( + parameters: Parameters.GetProjectVersions | string, + callback?: never, + ): Promise; + async getProjectVersions( + parameters: Parameters.GetProjectVersions | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/versions`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project the version is added to. + */ + async createVersion(parameters: Parameters.CreateVersion, callback: Callback): Promise; + /** + * Creates a project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project the version is added to. + */ + async createVersion(parameters: Parameters.CreateVersion, callback?: never): Promise; + async createVersion( + parameters: Parameters.CreateVersion, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/version', + method: 'POST', + data: { + expand: parameters.expand, + self: parameters.self, + id: parameters.id, + description: parameters.description, + name: parameters.name, + archived: parameters.archived, + released: parameters.released, + startDate: parameters.startDate, + releaseDate: parameters.releaseDate, + overdue: parameters.overdue, + userStartDate: parameters.userStartDate, + userReleaseDate: parameters.userReleaseDate, + projectId: parameters.projectId, + moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, + operations: parameters.operations, + issuesStatusForFixVersion: parameters.issuesStatusForFixVersion, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the version. + */ + async getVersion( + parameters: Parameters.GetVersion | string, + callback: Callback, + ): Promise; + /** + * Returns a project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the version. + */ + async getVersion(parameters: Parameters.GetVersion | string, callback?: never): Promise; + async getVersion( + parameters: Parameters.GetVersion | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/version/${id}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + */ + async updateVersion(parameters: Parameters.UpdateVersion, callback: Callback): Promise; + /** + * Updates a project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + */ + async updateVersion(parameters: Parameters.UpdateVersion, callback?: never): Promise; + async updateVersion( + parameters: Parameters.UpdateVersion, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/version/${parameters.id}`, + method: 'PUT', + data: { + expand: parameters.expand, + description: parameters.description, + name: parameters.name, + archived: parameters.archived, + released: parameters.released, + startDate: parameters.startDate, + releaseDate: parameters.releaseDate, + projectId: parameters.projectId, + moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any + * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. + * + * Consider using [ Delete and replace version](#api-rest-api-3-version-id-removeAndSwap-post) instead. This resource + * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + */ + async mergeVersions(parameters: Parameters.MergeVersions, callback: Callback): Promise; + /** + * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any + * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. + * + * Consider using [ Delete and replace version](#api-rest-api-3-version-id-removeAndSwap-post) instead. This resource + * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + */ + async mergeVersions(parameters: Parameters.MergeVersions, callback?: never): Promise; + async mergeVersions(parameters: Parameters.MergeVersions, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/version/${parameters.id}/mergeto/${parameters.moveIssuesTo}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async moveVersion(parameters: Parameters.MoveVersion, callback: Callback): Promise; + /** + * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async moveVersion(parameters: Parameters.MoveVersion, callback?: never): Promise; + async moveVersion(parameters: Parameters.MoveVersion, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/version/${parameters.id}/move`, + method: 'POST', + data: { + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the following counts for a version: + * + * - Number of issues where the `fixVersion` is set to the version. + * - Number of issues where the `affectedVersion` is set to the version. + * - Number of issues where a version custom field is set to the version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async getVersionRelatedIssues( + parameters: Parameters.GetVersionRelatedIssues | string, + callback: Callback, + ): Promise; + /** + * Returns the following counts for a version: + * + * - Number of issues where the `fixVersion` is set to the version. + * - Number of issues where the `affectedVersion` is set to the version. + * - Number of issues where a version custom field is set to the version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async getVersionRelatedIssues( + parameters: Parameters.GetVersionRelatedIssues | string, + callback?: never, + ): Promise; + async getVersionRelatedIssues( + parameters: Parameters.GetVersionRelatedIssues | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/version/${id}/relatedIssueCounts`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project version. + * + * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, + * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of + * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are + * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version + * being deleted. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + */ + async deleteAndReplaceVersion( + parameters: Parameters.DeleteAndReplaceVersion, + callback: Callback, + ): Promise; + /** + * Deletes a project version. + * + * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, + * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of + * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are + * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version + * being deleted. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + */ + async deleteAndReplaceVersion(parameters: Parameters.DeleteAndReplaceVersion, callback?: never): Promise; + async deleteAndReplaceVersion( + parameters: Parameters.DeleteAndReplaceVersion, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/version/${parameters.id}/removeAndSwap`, + method: 'POST', + data: { + moveFixIssuesTo: parameters.moveFixIssuesTo, + moveAffectedIssuesTo: parameters.moveAffectedIssuesTo, + customFieldReplacementList: parameters.customFieldReplacementList, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns counts of the issues and unresolved issues for the project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async getVersionUnresolvedIssues( + parameters: Parameters.GetVersionUnresolvedIssues | string, + callback: Callback, + ): Promise; + /** + * Returns counts of the issues and unresolved issues for the project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async getVersionUnresolvedIssues( + parameters: Parameters.GetVersionUnresolvedIssues | string, + callback?: never, + ): Promise; + async getVersionUnresolvedIssues( + parameters: Parameters.GetVersionUnresolvedIssues | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/version/${id}/unresolvedIssueCount`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectVersions.ts b/src/version3/projectVersions.ts deleted file mode 100644 index fc5046ef1..000000000 --- a/src/version3/projectVersions.ts +++ /dev/null @@ -1,439 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ProjectVersions { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * versions in a project. See the [Get project versions](#api-rest-api-3-project-projectIdOrKey-versions-get) resource - * if you want to get a full list of versions without pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * versions in a project. See the [Get project versions](#api-rest-api-3-project-projectIdOrKey-versions-get) resource - * if you want to get a full list of versions without pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, - callback?: never, - ): Promise; - async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/version`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - orderBy: typeof parameters !== 'string' && parameters.orderBy, - query: typeof parameters !== 'string' && parameters.query, - status: typeof parameters !== 'string' && parameters.status, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all versions in a project. The response is not paginated. Use [Get project versions - * paginated](#api-rest-api-3-project-projectIdOrKey-version-get) if you want to get the versions in a project with - * pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectVersions( - parameters: Parameters.GetProjectVersions | string, - callback: Callback, - ): Promise; - /** - * Returns all versions in a project. The response is not paginated. Use [Get project versions - * paginated](#api-rest-api-3-project-projectIdOrKey-version-get) if you want to get the versions in a project with - * pagination. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProjectVersions( - parameters: Parameters.GetProjectVersions | string, - callback?: never, - ): Promise; - async getProjectVersions( - parameters: Parameters.GetProjectVersions | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/versions`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project the version is added to. - */ - async createVersion(parameters: Parameters.CreateVersion, callback: Callback): Promise; - /** - * Creates a project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project the version is added to. - */ - async createVersion(parameters: Parameters.CreateVersion, callback?: never): Promise; - async createVersion( - parameters: Parameters.CreateVersion, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/version', - method: 'POST', - data: { - expand: parameters.expand, - self: parameters.self, - id: parameters.id, - description: parameters.description, - name: parameters.name, - archived: parameters.archived, - released: parameters.released, - startDate: parameters.startDate, - releaseDate: parameters.releaseDate, - overdue: parameters.overdue, - userStartDate: parameters.userStartDate, - userReleaseDate: parameters.userReleaseDate, - projectId: parameters.projectId, - moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, - operations: parameters.operations, - issuesStatusForFixVersion: parameters.issuesStatusForFixVersion, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the version. - */ - async getVersion( - parameters: Parameters.GetVersion | string, - callback: Callback, - ): Promise; - /** - * Returns a project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the version. - */ - async getVersion(parameters: Parameters.GetVersion | string, callback?: never): Promise; - async getVersion( - parameters: Parameters.GetVersion | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/version/${id}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. - */ - async updateVersion(parameters: Parameters.UpdateVersion, callback: Callback): Promise; - /** - * Updates a project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. - */ - async updateVersion(parameters: Parameters.UpdateVersion, callback?: never): Promise; - async updateVersion( - parameters: Parameters.UpdateVersion, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/version/${parameters.id}`, - method: 'PUT', - data: { - expand: parameters.expand, - description: parameters.description, - name: parameters.name, - archived: parameters.archived, - released: parameters.released, - startDate: parameters.startDate, - releaseDate: parameters.releaseDate, - projectId: parameters.projectId, - moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any - * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. - * - * Consider using [ Delete and replace version](#api-rest-api-3-version-id-removeAndSwap-post) instead. This resource - * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. - */ - async mergeVersions(parameters: Parameters.MergeVersions, callback: Callback): Promise; - /** - * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any - * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. - * - * Consider using [ Delete and replace version](#api-rest-api-3-version-id-removeAndSwap-post) instead. This resource - * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. - */ - async mergeVersions(parameters: Parameters.MergeVersions, callback?: never): Promise; - async mergeVersions(parameters: Parameters.MergeVersions, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/version/${parameters.id}/mergeto/${parameters.moveIssuesTo}`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async moveVersion(parameters: Parameters.MoveVersion, callback: Callback): Promise; - /** - * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async moveVersion(parameters: Parameters.MoveVersion, callback?: never): Promise; - async moveVersion(parameters: Parameters.MoveVersion, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/version/${parameters.id}/move`, - method: 'POST', - data: { - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the following counts for a version: - * - * - Number of issues where the `fixVersion` is set to the version. - * - Number of issues where the `affectedVersion` is set to the version. - * - Number of issues where a version custom field is set to the version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, - callback: Callback, - ): Promise; - /** - * Returns the following counts for a version: - * - * - Number of issues where the `fixVersion` is set to the version. - * - Number of issues where the `affectedVersion` is set to the version. - * - Number of issues where a version custom field is set to the version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, - callback?: never, - ): Promise; - async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/version/${id}/relatedIssueCounts`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project version. - * - * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, - * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of - * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are - * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version - * being deleted. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. - */ - async deleteAndReplaceVersion( - parameters: Parameters.DeleteAndReplaceVersion, - callback: Callback, - ): Promise; - /** - * Deletes a project version. - * - * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, - * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of - * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are - * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version - * being deleted. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. - */ - async deleteAndReplaceVersion(parameters: Parameters.DeleteAndReplaceVersion, callback?: never): Promise; - async deleteAndReplaceVersion( - parameters: Parameters.DeleteAndReplaceVersion, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/version/${parameters.id}/removeAndSwap`, - method: 'POST', - data: { - moveFixIssuesTo: parameters.moveFixIssuesTo, - moveAffectedIssuesTo: parameters.moveAffectedIssuesTo, - customFieldReplacementList: parameters.customFieldReplacementList, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns counts of the issues and unresolved issues for the project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, - callback: Callback, - ): Promise; - /** - * Returns counts of the issues and unresolved issues for the project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, - callback?: never, - ): Promise; - async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/version/${id}/unresolvedIssueCount`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projects.mts b/src/version3/projects.mts new file mode 100644 index 000000000..50e7f898e --- /dev/null +++ b/src/version3/projects.mts @@ -0,0 +1,514 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Projects { + constructor(private client: Client) {} + + /** + * Creates a project based on a project type template, as shown in the following table: + * + * | Project Type Key | Project Template Key | + * | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | + * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-internal-service-desk`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-finance-service-desk` | + * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-cross-team-template`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | + * + * The project types are available according to the installed Jira features as follows: + * + * - Jira Core, the default, enables `business` projects. + * - Jira Service Management enables `service_desk` projects. + * - Jira Software enables `software` projects. + * + * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the + * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > + * **Apps** > **Finding new apps**. For more information, see [ Managing + * add-ons](https://confluence.atlassian.com/x/S31NLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProject( + parameters: Parameters.CreateProject, + callback: Callback, + ): Promise; + /** + * Creates a project based on a project type template, as shown in the following table: + * + * | Project Type Key | Project Template Key | + * | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | + * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-internal-service-desk`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-finance-service-desk` | + * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-cross-team-template`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | + * + * The project types are available according to the installed Jira features as follows: + * + * - Jira Core, the default, enables `business` projects. + * - Jira Service Management enables `service_desk` projects. + * - Jira Software enables `software` projects. + * + * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the + * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > + * **Apps** > **Finding new apps**. For more information, see [ Managing + * add-ons](https://confluence.atlassian.com/x/S31NLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProject( + parameters: Parameters.CreateProject, + callback?: never, + ): Promise; + async createProject( + parameters: Parameters.CreateProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/project', + method: 'POST', + data: { + assigneeType: parameters.assigneeType, + avatarId: parameters.avatarId, + categoryId: parameters.categoryId, + description: parameters.description, + fieldConfigurationScheme: parameters.fieldConfigurationScheme, + issueSecurityScheme: parameters.issueSecurityScheme, + issueTypeScheme: parameters.issueTypeScheme, + issueTypeScreenScheme: parameters.issueTypeScreenScheme, + key: parameters.key, + leadAccountId: parameters.leadAccountId, + name: parameters.name, + notificationScheme: parameters.notificationScheme, + permissionScheme: parameters.permissionScheme, + projectTemplateKey: parameters.projectTemplateKey, + projectTypeKey: parameters.projectTypeKey, + url: parameters.url, + workflowScheme: parameters.workflowScheme, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getRecent( + parameters: Parameters.GetRecent | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getRecent(parameters?: Parameters.GetRecent, callback?: never): Promise; + async getRecent(parameters?: Parameters.GetRecent, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/project/recent', + method: 'GET', + params: { + expand: parameters?.expand, + properties: parameters?.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * projects visible to the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchProjects( + parameters: Parameters.SearchProjects | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * projects visible to the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchProjects(parameters?: Parameters.SearchProjects, callback?: never): Promise; + async searchProjects( + parameters?: Parameters.SearchProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/project/search', + method: 'GET', + params: { + action: parameters?.action, + categoryId: parameters?.categoryId, + expand: parameters?.expand, + id: parameters?.id, + keys: parameters?.keys, + maxResults: parameters?.maxResults, + orderBy: parameters?.orderBy, + properties: parameters?.properties, + propertyQuery: parameters?.propertyQuery, + query: parameters?.query, + startAt: parameters?.startAt, + status: parameters?.status, + typeKey: parameters?.typeKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProject( + parameters: Parameters.GetProject | string, + callback: Callback, + ): Promise; + /** + * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getProject(parameters: Parameters.GetProject | string, callback?: never): Promise; + async getProject( + parameters: Parameters.GetProject | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + properties: typeof parameters !== 'string' && parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. + * + * All parameters are optional in the body of the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateProject(parameters: Parameters.UpdateProject, callback: Callback): Promise; + /** + * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. + * + * All parameters are optional in the body of the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateProject(parameters: Parameters.UpdateProject, callback?: never): Promise; + async updateProject( + parameters: Parameters.UpdateProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}`, + method: 'PUT', + params: { + expand: parameters.expand, + }, + data: { + assigneeType: parameters.assigneeType, + avatarId: parameters.avatarId, + categoryId: parameters.categoryId, + description: parameters.description, + issueSecurityScheme: parameters.issueSecurityScheme, + key: parameters.key, + leadAccountId: parameters.leadAccountId, + name: parameters.name, + notificationScheme: parameters.notificationScheme, + permissionScheme: parameters.permissionScheme, + projectTemplateKey: parameters.projectTemplateKey, + projectTypeKey: parameters.projectTypeKey, + url: parameters.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project. + * + * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. + * To restore a project, use the Jira UI. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProject(parameters: Parameters.DeleteProject | string, callback: Callback): Promise; + /** + * Deletes a project. + * + * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. + * To restore a project, use the Jira UI. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProject(parameters: Parameters.DeleteProject | string, callback?: never): Promise; + async deleteProject( + parameters: Parameters.DeleteProject | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}`, + method: 'DELETE', + params: { + enableUndo: typeof parameters !== 'string' && parameters.enableUndo, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project + * and then delete it. To restore a project, use the Jira UI. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async archiveProject(parameters: Parameters.ArchiveProject | string, callback: Callback): Promise; + /** + * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project + * and then delete it. To restore a project, use the Jira UI. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async archiveProject(parameters: Parameters.ArchiveProject | string, callback?: never): Promise; + async archiveProject( + parameters: Parameters.ArchiveProject | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/archive`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project asynchronously. + * + * This operation is: + * + * - Transactional, that is, if part of the delete fails the project is not deleted. + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectAsynchronously( + parameters: Parameters.DeleteProjectAsynchronously | string, + callback: Callback, + ): Promise; + /** + * Deletes a project asynchronously. + * + * This operation is: + * + * - Transactional, that is, if part of the delete fails the project is not deleted. + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectAsynchronously( + parameters: Parameters.DeleteProjectAsynchronously | string, + callback?: never, + ): Promise; + async deleteProjectAsynchronously( + parameters: Parameters.DeleteProjectAsynchronously | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/delete`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Restores a project that has been archived or placed in the Jira recycle bin. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async restore(parameters: Parameters.Restore | string, callback: Callback): Promise; + /** + * Restores a project that has been archived or placed in the Jira recycle bin. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async restore(parameters: Parameters.Restore | string, callback?: never): Promise; + async restore( + parameters: Parameters.Restore | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/restore`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of + * valid issue types and each issue type has a set of valid statuses. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getAllStatuses( + parameters: Parameters.GetAllStatuses | string, + callback: Callback, + ): Promise; + /** + * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of + * valid issue types and each issue type has a set of valid statuses. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getAllStatuses( + parameters: Parameters.GetAllStatuses | string, + callback?: never, + ): Promise; + async getAllStatuses( + parameters: Parameters.GetAllStatuses | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/statuses`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Get the issue type hierarchy for a next-gen project. + * + * The issue type hierarchy for a project consists of: + * + * - _Epic_ at level 1 (optional). + * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these + * issue types are used to break down the content of an epic. + * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. + * Issues based on a level -1 issue type must have a parent issue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getHierarchy( + parameters: Parameters.GetHierarchy | string, + callback: Callback, + ): Promise; + /** + * Get the issue type hierarchy for a next-gen project. + * + * The issue type hierarchy for a project consists of: + * + * - _Epic_ at level 1 (optional). + * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these + * issue types are used to break down the content of an epic. + * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. + * Issues based on a level -1 issue type must have a parent issue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async getHierarchy( + parameters: Parameters.GetHierarchy | string, + callback?: never, + ): Promise; + async getHierarchy( + parameters: Parameters.GetHierarchy | string, + callback?: Callback, + ): Promise { + const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectId}/hierarchy`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projects.ts b/src/version3/projects.ts deleted file mode 100644 index dceb92b83..000000000 --- a/src/version3/projects.ts +++ /dev/null @@ -1,514 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Projects { - constructor(private client: Client) {} - - /** - * Creates a project based on a project type template, as shown in the following table: - * - * | Project Type Key | Project Template Key | - * | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | - * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-internal-service-desk`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-finance-service-desk` | - * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-cross-team-template`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | - * - * The project types are available according to the installed Jira features as follows: - * - * - Jira Core, the default, enables `business` projects. - * - Jira Service Management enables `service_desk` projects. - * - Jira Software enables `software` projects. - * - * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the - * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > - * **Apps** > **Finding new apps**. For more information, see [ Managing - * add-ons](https://confluence.atlassian.com/x/S31NLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProject( - parameters: Parameters.CreateProject, - callback: Callback, - ): Promise; - /** - * Creates a project based on a project type template, as shown in the following table: - * - * | Project Type Key | Project Template Key | - * | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | - * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-internal-service-desk`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-finance-service-desk` | - * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-cross-team-template`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | - * - * The project types are available according to the installed Jira features as follows: - * - * - Jira Core, the default, enables `business` projects. - * - Jira Service Management enables `service_desk` projects. - * - Jira Software enables `software` projects. - * - * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the - * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > - * **Apps** > **Finding new apps**. For more information, see [ Managing - * add-ons](https://confluence.atlassian.com/x/S31NLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProject( - parameters: Parameters.CreateProject, - callback?: never, - ): Promise; - async createProject( - parameters: Parameters.CreateProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/project', - method: 'POST', - data: { - assigneeType: parameters.assigneeType, - avatarId: parameters.avatarId, - categoryId: parameters.categoryId, - description: parameters.description, - fieldConfigurationScheme: parameters.fieldConfigurationScheme, - issueSecurityScheme: parameters.issueSecurityScheme, - issueTypeScheme: parameters.issueTypeScheme, - issueTypeScreenScheme: parameters.issueTypeScreenScheme, - key: parameters.key, - leadAccountId: parameters.leadAccountId, - name: parameters.name, - notificationScheme: parameters.notificationScheme, - permissionScheme: parameters.permissionScheme, - projectTemplateKey: parameters.projectTemplateKey, - projectTypeKey: parameters.projectTypeKey, - url: parameters.url, - workflowScheme: parameters.workflowScheme, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getRecent( - parameters: Parameters.GetRecent | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getRecent(parameters?: Parameters.GetRecent, callback?: never): Promise; - async getRecent(parameters?: Parameters.GetRecent, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/project/recent', - method: 'GET', - params: { - expand: parameters?.expand, - properties: parameters?.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * projects visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchProjects( - parameters: Parameters.SearchProjects | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * projects visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchProjects(parameters?: Parameters.SearchProjects, callback?: never): Promise; - async searchProjects( - parameters?: Parameters.SearchProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/project/search', - method: 'GET', - params: { - action: parameters?.action, - categoryId: parameters?.categoryId, - expand: parameters?.expand, - id: parameters?.id, - keys: parameters?.keys, - maxResults: parameters?.maxResults, - orderBy: parameters?.orderBy, - properties: parameters?.properties, - propertyQuery: parameters?.propertyQuery, - query: parameters?.query, - startAt: parameters?.startAt, - status: parameters?.status, - typeKey: parameters?.typeKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProject( - parameters: Parameters.GetProject | string, - callback: Callback, - ): Promise; - /** - * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getProject(parameters: Parameters.GetProject | string, callback?: never): Promise; - async getProject( - parameters: Parameters.GetProject | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - properties: typeof parameters !== 'string' && parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. - * - * All parameters are optional in the body of the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateProject(parameters: Parameters.UpdateProject, callback: Callback): Promise; - /** - * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. - * - * All parameters are optional in the body of the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateProject(parameters: Parameters.UpdateProject, callback?: never): Promise; - async updateProject( - parameters: Parameters.UpdateProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}`, - method: 'PUT', - params: { - expand: parameters.expand, - }, - data: { - assigneeType: parameters.assigneeType, - avatarId: parameters.avatarId, - categoryId: parameters.categoryId, - description: parameters.description, - issueSecurityScheme: parameters.issueSecurityScheme, - key: parameters.key, - leadAccountId: parameters.leadAccountId, - name: parameters.name, - notificationScheme: parameters.notificationScheme, - permissionScheme: parameters.permissionScheme, - projectTemplateKey: parameters.projectTemplateKey, - projectTypeKey: parameters.projectTypeKey, - url: parameters.url, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project. - * - * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. - * To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProject(parameters: Parameters.DeleteProject | string, callback: Callback): Promise; - /** - * Deletes a project. - * - * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. - * To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProject(parameters: Parameters.DeleteProject | string, callback?: never): Promise; - async deleteProject( - parameters: Parameters.DeleteProject | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}`, - method: 'DELETE', - params: { - enableUndo: typeof parameters !== 'string' && parameters.enableUndo, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project - * and then delete it. To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async archiveProject(parameters: Parameters.ArchiveProject | string, callback: Callback): Promise; - /** - * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project - * and then delete it. To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async archiveProject(parameters: Parameters.ArchiveProject | string, callback?: never): Promise; - async archiveProject( - parameters: Parameters.ArchiveProject | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/archive`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project asynchronously. - * - * This operation is: - * - * - Transactional, that is, if part of the delete fails the project is not deleted. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, - callback: Callback, - ): Promise; - /** - * Deletes a project asynchronously. - * - * This operation is: - * - * - Transactional, that is, if part of the delete fails the project is not deleted. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, - callback?: never, - ): Promise; - async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/delete`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Restores a project that has been archived or placed in the Jira recycle bin. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async restore(parameters: Parameters.Restore | string, callback: Callback): Promise; - /** - * Restores a project that has been archived or placed in the Jira recycle bin. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async restore(parameters: Parameters.Restore | string, callback?: never): Promise; - async restore( - parameters: Parameters.Restore | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/restore`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of - * valid issue types and each issue type has a set of valid statuses. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getAllStatuses( - parameters: Parameters.GetAllStatuses | string, - callback: Callback, - ): Promise; - /** - * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of - * valid issue types and each issue type has a set of valid statuses. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getAllStatuses( - parameters: Parameters.GetAllStatuses | string, - callback?: never, - ): Promise; - async getAllStatuses( - parameters: Parameters.GetAllStatuses | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/statuses`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Get the issue type hierarchy for a next-gen project. - * - * The issue type hierarchy for a project consists of: - * - * - _Epic_ at level 1 (optional). - * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these - * issue types are used to break down the content of an epic. - * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. - * Issues based on a level -1 issue type must have a parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getHierarchy( - parameters: Parameters.GetHierarchy | string, - callback: Callback, - ): Promise; - /** - * Get the issue type hierarchy for a next-gen project. - * - * The issue type hierarchy for a project consists of: - * - * - _Epic_ at level 1 (optional). - * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these - * issue types are used to break down the content of an epic. - * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. - * Issues based on a level -1 issue type must have a parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. - */ - async getHierarchy( - parameters: Parameters.GetHierarchy | string, - callback?: never, - ): Promise; - async getHierarchy( - parameters: Parameters.GetHierarchy | string, - callback?: Callback, - ): Promise { - const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectId}/hierarchy`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/screenSchemes.mts b/src/version3/screenSchemes.mts new file mode 100644 index 000000000..208c11a52 --- /dev/null +++ b/src/version3/screenSchemes.mts @@ -0,0 +1,160 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ScreenSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of screen + * schemes. + * + * Only screen schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreenSchemes( + parameters: Parameters.GetScreenSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of screen + * schemes. + * + * Only screen schemes used in classic projects are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreenSchemes( + parameters?: Parameters.GetScreenSchemes, + callback?: never, + ): Promise; + async getScreenSchemes( + parameters?: Parameters.GetScreenSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/screenscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + expand: parameters?.expand, + queryString: parameters?.queryString, + orderBy: parameters?.orderBy, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createScreenScheme( + parameters: Parameters.CreateScreenScheme | string, + callback: Callback, + ): Promise; + /** + * Creates a screen scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createScreenScheme( + parameters: Parameters.CreateScreenScheme | string, + callback?: never, + ): Promise; + async createScreenScheme( + parameters: Parameters.CreateScreenScheme | string, + callback?: Callback, + ): Promise { + const name = typeof parameters === 'string' ? parameters : parameters.name; + + const config: RequestConfig = { + url: '/rest/api/3/screenscheme', + method: 'POST', + data: { + name, + description: typeof parameters !== 'string' && parameters.description, + screens: typeof parameters !== 'string' && parameters.screens, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a screen scheme. Only screen schemes used in classic projects can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback: Callback): Promise; + /** + * Updates a screen scheme. Only screen schemes used in classic projects can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback?: never): Promise; + async updateScreenScheme( + parameters: Parameters.UpdateScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screenscheme/${parameters.screenSchemeId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + screens: parameters.screens, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. + * + * Only screens schemes used in classic projects can be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteScreenScheme( + parameters: Parameters.DeleteScreenScheme | string, + callback: Callback, + ): Promise; + /** + * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. + * + * Only screens schemes used in classic projects can be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteScreenScheme(parameters: Parameters.DeleteScreenScheme | string, callback?: never): Promise; + async deleteScreenScheme( + parameters: Parameters.DeleteScreenScheme | string, + callback?: Callback, + ): Promise { + const screenSchemeId = typeof parameters === 'string' ? parameters : parameters.screenSchemeId; + + const config: RequestConfig = { + url: `/rest/api/3/screenscheme/${screenSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/screenSchemes.ts b/src/version3/screenSchemes.ts deleted file mode 100644 index 18b8a820e..000000000 --- a/src/version3/screenSchemes.ts +++ /dev/null @@ -1,160 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ScreenSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of screen - * schemes. - * - * Only screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreenSchemes( - parameters: Parameters.GetScreenSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of screen - * schemes. - * - * Only screen schemes used in classic projects are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreenSchemes( - parameters?: Parameters.GetScreenSchemes, - callback?: never, - ): Promise; - async getScreenSchemes( - parameters?: Parameters.GetScreenSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/screenscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - expand: parameters?.expand, - queryString: parameters?.queryString, - orderBy: parameters?.orderBy, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createScreenScheme( - parameters: Parameters.CreateScreenScheme | string, - callback: Callback, - ): Promise; - /** - * Creates a screen scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createScreenScheme( - parameters: Parameters.CreateScreenScheme | string, - callback?: never, - ): Promise; - async createScreenScheme( - parameters: Parameters.CreateScreenScheme | string, - callback?: Callback, - ): Promise { - const name = typeof parameters === 'string' ? parameters : parameters.name; - - const config: RequestConfig = { - url: '/rest/api/3/screenscheme', - method: 'POST', - data: { - name, - description: typeof parameters !== 'string' && parameters.description, - screens: typeof parameters !== 'string' && parameters.screens, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a screen scheme. Only screen schemes used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback: Callback): Promise; - /** - * Updates a screen scheme. Only screen schemes used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback?: never): Promise; - async updateScreenScheme( - parameters: Parameters.UpdateScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screenscheme/${parameters.screenSchemeId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - screens: parameters.screens, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. - * - * Only screens schemes used in classic projects can be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenScheme( - parameters: Parameters.DeleteScreenScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. - * - * Only screens schemes used in classic projects can be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenScheme(parameters: Parameters.DeleteScreenScheme | string, callback?: never): Promise; - async deleteScreenScheme( - parameters: Parameters.DeleteScreenScheme | string, - callback?: Callback, - ): Promise { - const screenSchemeId = typeof parameters === 'string' ? parameters : parameters.screenSchemeId; - - const config: RequestConfig = { - url: `/rest/api/3/screenscheme/${screenSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/screenTabFields.mts b/src/version3/screenTabFields.mts new file mode 100644 index 000000000..d272e5c06 --- /dev/null +++ b/src/version3/screenTabFields.mts @@ -0,0 +1,150 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ScreenTabFields { + constructor(private client: Client) {} + + /** + * Returns all fields for a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen + * Scheme. + */ + async getAllScreenTabFields( + parameters: Parameters.GetAllScreenTabFields, + callback: Callback, + ): Promise; + /** + * Returns all fields for a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen + * Scheme. + */ + async getAllScreenTabFields( + parameters: Parameters.GetAllScreenTabFields, + callback?: never, + ): Promise; + async getAllScreenTabFields( + parameters: Parameters.GetAllScreenTabFields, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, + method: 'GET', + params: { + projectKey: parameters.projectKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a field to a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addScreenTabField( + parameters: Parameters.AddScreenTabField, + callback: Callback, + ): Promise; + /** + * Adds a field to a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addScreenTabField( + parameters: Parameters.AddScreenTabField, + callback?: never, + ): Promise; + async addScreenTabField( + parameters: Parameters.AddScreenTabField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, + method: 'POST', + data: { + fieldId: parameters.fieldId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a field from a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeScreenTabField( + parameters: Parameters.RemoveScreenTabField, + callback: Callback, + ): Promise; + /** + * Removes a field from a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeScreenTabField(parameters: Parameters.RemoveScreenTabField, callback?: never): Promise; + async removeScreenTabField( + parameters: Parameters.RemoveScreenTabField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a screen tab field. + * + * If `after` and `position` are provided in the request, `position` is ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback: Callback): Promise; + /** + * Moves a screen tab field. + * + * If `after` and `position` are provided in the request, `position` is ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback?: never): Promise; + async moveScreenTabField( + parameters: Parameters.MoveScreenTabField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}/move`, + method: 'POST', + data: { + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/screenTabFields.ts b/src/version3/screenTabFields.ts deleted file mode 100644 index 2945c6586..000000000 --- a/src/version3/screenTabFields.ts +++ /dev/null @@ -1,150 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ScreenTabFields { - constructor(private client: Client) {} - - /** - * Returns all fields for a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabFields( - parameters: Parameters.GetAllScreenTabFields, - callback: Callback, - ): Promise; - /** - * Returns all fields for a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabFields( - parameters: Parameters.GetAllScreenTabFields, - callback?: never, - ): Promise; - async getAllScreenTabFields( - parameters: Parameters.GetAllScreenTabFields, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, - method: 'GET', - params: { - projectKey: parameters.projectKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a field to a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTabField( - parameters: Parameters.AddScreenTabField, - callback: Callback, - ): Promise; - /** - * Adds a field to a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTabField( - parameters: Parameters.AddScreenTabField, - callback?: never, - ): Promise; - async addScreenTabField( - parameters: Parameters.AddScreenTabField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, - method: 'POST', - data: { - fieldId: parameters.fieldId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a field from a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeScreenTabField( - parameters: Parameters.RemoveScreenTabField, - callback: Callback, - ): Promise; - /** - * Removes a field from a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeScreenTabField(parameters: Parameters.RemoveScreenTabField, callback?: never): Promise; - async removeScreenTabField( - parameters: Parameters.RemoveScreenTabField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves a screen tab field. - * - * If `after` and `position` are provided in the request, `position` is ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback: Callback): Promise; - /** - * Moves a screen tab field. - * - * If `after` and `position` are provided in the request, `position` is ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback?: never): Promise; - async moveScreenTabField( - parameters: Parameters.MoveScreenTabField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}/move`, - method: 'POST', - data: { - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/screenTabs.mts b/src/version3/screenTabs.mts new file mode 100644 index 000000000..608f8f819 --- /dev/null +++ b/src/version3/screenTabs.mts @@ -0,0 +1,166 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ScreenTabs { + constructor(private client: Client) {} + + /** + * Returns the list of tabs for a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen + * Scheme. + */ + async getAllScreenTabs( + parameters: Parameters.GetAllScreenTabs | string, + callback: Callback, + ): Promise; + /** + * Returns the list of tabs for a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen + * Scheme. + */ + async getAllScreenTabs( + parameters: Parameters.GetAllScreenTabs | string, + callback?: never, + ): Promise; + async getAllScreenTabs( + parameters: Parameters.GetAllScreenTabs | string, + callback?: Callback, + ): Promise { + const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; + + const config: RequestConfig = { + url: `/rest/api/3/screens/${screenId}/tabs`, + method: 'GET', + params: { + projectKey: typeof parameters !== 'string' && parameters.projectKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a tab for a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addScreenTab( + parameters: Parameters.AddScreenTab, + callback: Callback, + ): Promise; + /** + * Creates a tab for a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addScreenTab(parameters: Parameters.AddScreenTab, callback?: never): Promise; + async addScreenTab( + parameters: Parameters.AddScreenTab, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}/tabs`, + method: 'POST', + data: { + id: parameters.id, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the name of a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async renameScreenTab( + parameters: Parameters.RenameScreenTab, + callback: Callback, + ): Promise; + /** + * Updates the name of a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async renameScreenTab(parameters: Parameters.RenameScreenTab, callback?: never): Promise; + async renameScreenTab( + parameters: Parameters.RenameScreenTab, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}`, + method: 'PUT', + data: { + id: parameters.id, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback: Callback): Promise; + /** + * Deletes a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: never): Promise; + async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveScreenTab(parameters: Parameters.MoveScreenTab, callback: Callback): Promise; + /** + * Moves a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: never): Promise; + async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/move/${parameters.pos}`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/screenTabs.ts b/src/version3/screenTabs.ts deleted file mode 100644 index a358a3f3e..000000000 --- a/src/version3/screenTabs.ts +++ /dev/null @@ -1,166 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ScreenTabs { - constructor(private client: Client) {} - - /** - * Returns the list of tabs for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabs( - parameters: Parameters.GetAllScreenTabs | string, - callback: Callback, - ): Promise; - /** - * Returns the list of tabs for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabs( - parameters: Parameters.GetAllScreenTabs | string, - callback?: never, - ): Promise; - async getAllScreenTabs( - parameters: Parameters.GetAllScreenTabs | string, - callback?: Callback, - ): Promise { - const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; - - const config: RequestConfig = { - url: `/rest/api/3/screens/${screenId}/tabs`, - method: 'GET', - params: { - projectKey: typeof parameters !== 'string' && parameters.projectKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a tab for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTab( - parameters: Parameters.AddScreenTab, - callback: Callback, - ): Promise; - /** - * Creates a tab for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTab(parameters: Parameters.AddScreenTab, callback?: never): Promise; - async addScreenTab( - parameters: Parameters.AddScreenTab, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}/tabs`, - method: 'POST', - data: { - id: parameters.id, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the name of a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async renameScreenTab( - parameters: Parameters.RenameScreenTab, - callback: Callback, - ): Promise; - /** - * Updates the name of a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async renameScreenTab(parameters: Parameters.RenameScreenTab, callback?: never): Promise; - async renameScreenTab( - parameters: Parameters.RenameScreenTab, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}`, - method: 'PUT', - data: { - id: parameters.id, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback: Callback): Promise; - /** - * Deletes a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: never): Promise; - async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTab(parameters: Parameters.MoveScreenTab, callback: Callback): Promise; - /** - * Moves a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: never): Promise; - async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/move/${parameters.pos}`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/screens.mts b/src/version3/screens.mts new file mode 100644 index 000000000..9da60d95c --- /dev/null +++ b/src/version3/screens.mts @@ -0,0 +1,243 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Screens { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the + * screens a field is used in. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreensForField( + parameters: Parameters.GetScreensForField | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the + * screens a field is used in. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreensForField( + parameters: Parameters.GetScreensForField | string, + callback?: never, + ): Promise; + async getScreensForField( + parameters: Parameters.GetScreensForField | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/3/field/${fieldId}/screens`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * screens or those specified by one or more screen IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreens( + parameters: Parameters.GetScreens | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * screens or those specified by one or more screen IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreens(parameters?: Parameters.GetScreens, callback?: never): Promise; + async getScreens( + parameters?: Parameters.GetScreens, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/screens', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + queryString: parameters?.queryString, + scope: parameters?.scope, + orderBy: parameters?.orderBy, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a screen with a default field tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createScreen(parameters: Parameters.CreateScreen, callback: Callback): Promise; + /** + * Creates a screen with a default field tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createScreen(parameters: Parameters.CreateScreen, callback?: never): Promise; + async createScreen( + parameters: Parameters.CreateScreen, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/screens', + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a field to the default tab of the default screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addFieldToDefaultScreen( + parameters: Parameters.AddFieldToDefaultScreen | string, + callback: Callback, + ): Promise; + /** + * Adds a field to the default tab of the default screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addFieldToDefaultScreen( + parameters: Parameters.AddFieldToDefaultScreen | string, + callback?: never, + ): Promise; + async addFieldToDefaultScreen( + parameters: Parameters.AddFieldToDefaultScreen | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/3/screens/addToDefault/${fieldId}`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a screen. Only screens used in classic projects can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateScreen(parameters: Parameters.UpdateScreen, callback: Callback): Promise; + /** + * Updates a screen. Only screens used in classic projects can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateScreen(parameters: Parameters.UpdateScreen, callback?: never): Promise; + async updateScreen( + parameters: Parameters.UpdateScreen, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. + * + * Only screens used in classic projects can be deleted. + */ + async deleteScreen(parameters: Parameters.DeleteScreen | string, callback: Callback): Promise; + /** + * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. + * + * Only screens used in classic projects can be deleted. + */ + async deleteScreen(parameters: Parameters.DeleteScreen | string, callback?: never): Promise; + async deleteScreen( + parameters: Parameters.DeleteScreen | string, + callback?: Callback, + ): Promise { + const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; + + const config: RequestConfig = { + url: `/rest/api/3/screens/${screenId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the fields that can be added to a tab on a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAvailableScreenFields( + parameters: Parameters.GetAvailableScreenFields | string, + callback: Callback, + ): Promise; + /** + * Returns the fields that can be added to a tab on a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAvailableScreenFields( + parameters: Parameters.GetAvailableScreenFields | string, + callback?: never, + ): Promise; + async getAvailableScreenFields( + parameters: Parameters.GetAvailableScreenFields | string, + callback?: Callback, + ): Promise { + const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; + + const config: RequestConfig = { + url: `/rest/api/3/screens/${screenId}/availableFields`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/screens.ts b/src/version3/screens.ts deleted file mode 100644 index 6b3115b60..000000000 --- a/src/version3/screens.ts +++ /dev/null @@ -1,243 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Screens { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the - * screens a field is used in. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreensForField( - parameters: Parameters.GetScreensForField | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the - * screens a field is used in. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreensForField( - parameters: Parameters.GetScreensForField | string, - callback?: never, - ): Promise; - async getScreensForField( - parameters: Parameters.GetScreensForField | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/3/field/${fieldId}/screens`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * screens or those specified by one or more screen IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreens( - parameters: Parameters.GetScreens | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * screens or those specified by one or more screen IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreens(parameters?: Parameters.GetScreens, callback?: never): Promise; - async getScreens( - parameters?: Parameters.GetScreens, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/screens', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - queryString: parameters?.queryString, - scope: parameters?.scope, - orderBy: parameters?.orderBy, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a screen with a default field tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createScreen(parameters: Parameters.CreateScreen, callback: Callback): Promise; - /** - * Creates a screen with a default field tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createScreen(parameters: Parameters.CreateScreen, callback?: never): Promise; - async createScreen( - parameters: Parameters.CreateScreen, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/screens', - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a field to the default tab of the default screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addFieldToDefaultScreen( - parameters: Parameters.AddFieldToDefaultScreen | string, - callback: Callback, - ): Promise; - /** - * Adds a field to the default tab of the default screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addFieldToDefaultScreen( - parameters: Parameters.AddFieldToDefaultScreen | string, - callback?: never, - ): Promise; - async addFieldToDefaultScreen( - parameters: Parameters.AddFieldToDefaultScreen | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/3/screens/addToDefault/${fieldId}`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a screen. Only screens used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreen(parameters: Parameters.UpdateScreen, callback: Callback): Promise; - /** - * Updates a screen. Only screens used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreen(parameters: Parameters.UpdateScreen, callback?: never): Promise; - async updateScreen( - parameters: Parameters.UpdateScreen, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. - * - * Only screens used in classic projects can be deleted. - */ - async deleteScreen(parameters: Parameters.DeleteScreen | string, callback: Callback): Promise; - /** - * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. - * - * Only screens used in classic projects can be deleted. - */ - async deleteScreen(parameters: Parameters.DeleteScreen | string, callback?: never): Promise; - async deleteScreen( - parameters: Parameters.DeleteScreen | string, - callback?: Callback, - ): Promise { - const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; - - const config: RequestConfig = { - url: `/rest/api/3/screens/${screenId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the fields that can be added to a tab on a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableScreenFields( - parameters: Parameters.GetAvailableScreenFields | string, - callback: Callback, - ): Promise; - /** - * Returns the fields that can be added to a tab on a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableScreenFields( - parameters: Parameters.GetAvailableScreenFields | string, - callback?: never, - ): Promise; - async getAvailableScreenFields( - parameters: Parameters.GetAvailableScreenFields | string, - callback?: Callback, - ): Promise { - const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; - - const config: RequestConfig = { - url: `/rest/api/3/screens/${screenId}/availableFields`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/serverInfo.mts b/src/version3/serverInfo.mts new file mode 100644 index 000000000..69b7b7667 --- /dev/null +++ b/src/version3/serverInfo.mts @@ -0,0 +1,33 @@ +import * as Models from './models/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ServerInfo { + constructor(private client: Client) {} + + /** + * Returns information about the Jira instance. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getServerInfo(callback: Callback): Promise; + /** + * Returns information about the Jira instance. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getServerInfo(callback?: never): Promise; + async getServerInfo(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/serverInfo', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/serverInfo.ts b/src/version3/serverInfo.ts deleted file mode 100644 index a4dae0427..000000000 --- a/src/version3/serverInfo.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as Models from './models/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class ServerInfo { - constructor(private client: Client) {} - - /** - * Returns information about the Jira instance. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getServerInfo(callback: Callback): Promise; - /** - * Returns information about the Jira instance. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getServerInfo(callback?: never): Promise; - async getServerInfo(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/serverInfo', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/status.mts b/src/version3/status.mts new file mode 100644 index 000000000..ce2302e2f --- /dev/null +++ b/src/version3/status.mts @@ -0,0 +1,196 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Status { + constructor(private client: Client) {} + + /** + * Returns a list of the statuses specified by one or more status IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async getStatusesById( + parameters: Parameters.GetStatusesById | string, + callback: Callback, + ): Promise; + /** + * Returns a list of the statuses specified by one or more status IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async getStatusesById( + parameters: Parameters.GetStatusesById | string, + callback?: never, + ): Promise; + async getStatusesById( + parameters: Parameters.GetStatusesById | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: '/rest/api/3/statuses', + method: 'GET', + params: { + id, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates statuses for a global or project scope. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async createStatuses( + parameters: Parameters.CreateStatuses, + callback: Callback, + ): Promise; + /** + * Creates statuses for a global or project scope. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async createStatuses(parameters: Parameters.CreateStatuses, callback?: never): Promise; + async createStatuses( + parameters: Parameters.CreateStatuses, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/statuses', + method: 'POST', + data: { + statuses: parameters.statuses, + scope: parameters.scope, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates statuses by ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async updateStatuses(parameters: Parameters.UpdateStatuses, callback: Callback): Promise; + /** + * Updates statuses by ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: never): Promise; + async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/statuses', + method: 'PUT', + data: { + statuses: parameters.statuses, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes statuses by ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async deleteStatusesById( + parameters: Parameters.DeleteStatusesById | string, + callback: Callback, + ): Promise; + /** + * Deletes statuses by ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async deleteStatusesById(parameters: Parameters.DeleteStatusesById | string, callback?: never): Promise; + async deleteStatusesById( + parameters: Parameters.DeleteStatusesById | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: '/rest/api/3/statuses', + method: 'DELETE', + params: { + id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * statuses that match a search on name or project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async search( + parameters: Parameters.Search | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * statuses that match a search on name or project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async search(parameters?: Parameters.Search, callback?: never): Promise; + async search(parameters?: Parameters.Search, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/statuses/search', + method: 'GET', + params: { + expand: parameters?.expand, + projectId: parameters?.projectId, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + searchString: parameters?.searchString, + statusCategory: parameters?.statusCategory, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/status.ts b/src/version3/status.ts deleted file mode 100644 index 309b16762..000000000 --- a/src/version3/status.ts +++ /dev/null @@ -1,196 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Status { - constructor(private client: Client) {} - - /** - * Returns a list of the statuses specified by one or more status IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async getStatusesById( - parameters: Parameters.GetStatusesById | string, - callback: Callback, - ): Promise; - /** - * Returns a list of the statuses specified by one or more status IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async getStatusesById( - parameters: Parameters.GetStatusesById | string, - callback?: never, - ): Promise; - async getStatusesById( - parameters: Parameters.GetStatusesById | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: '/rest/api/3/statuses', - method: 'GET', - params: { - id, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates statuses for a global or project scope. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async createStatuses( - parameters: Parameters.CreateStatuses, - callback: Callback, - ): Promise; - /** - * Creates statuses for a global or project scope. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async createStatuses(parameters: Parameters.CreateStatuses, callback?: never): Promise; - async createStatuses( - parameters: Parameters.CreateStatuses, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/statuses', - method: 'POST', - data: { - statuses: parameters.statuses, - scope: parameters.scope, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async updateStatuses(parameters: Parameters.UpdateStatuses, callback: Callback): Promise; - /** - * Updates statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: never): Promise; - async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/statuses', - method: 'PUT', - data: { - statuses: parameters.statuses, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async deleteStatusesById( - parameters: Parameters.DeleteStatusesById | string, - callback: Callback, - ): Promise; - /** - * Deletes statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async deleteStatusesById(parameters: Parameters.DeleteStatusesById | string, callback?: never): Promise; - async deleteStatusesById( - parameters: Parameters.DeleteStatusesById | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: '/rest/api/3/statuses', - method: 'DELETE', - params: { - id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * statuses that match a search on name or project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async search( - parameters: Parameters.Search | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * statuses that match a search on name or project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async search(parameters?: Parameters.Search, callback?: never): Promise; - async search(parameters?: Parameters.Search, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/statuses/search', - method: 'GET', - params: { - expand: parameters?.expand, - projectId: parameters?.projectId, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - searchString: parameters?.searchString, - statusCategory: parameters?.statusCategory, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/tasks.mts b/src/version3/tasks.mts new file mode 100644 index 000000000..ed927c492 --- /dev/null +++ b/src/version3/tasks.mts @@ -0,0 +1,87 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Tasks { + constructor(private client: Client) {} + + /** + * Returns the status of a [long-running asynchronous + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). + * + * When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the + * operation that created the task for details. Task details are not permanently retained. As of September 2019, + * details are retained for 14 days although this period may change without notice. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Creator of the task. + */ + async getTask( + parameters: Parameters.GetTask | string, + callback: Callback, + ): Promise; + /** + * Returns the status of a [long-running asynchronous + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). + * + * When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the + * operation that created the task for details. Task details are not permanently retained. As of September 2019, + * details are retained for 14 days although this period may change without notice. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Creator of the task. + */ + async getTask(parameters: Parameters.GetTask | string, callback?: never): Promise; + async getTask( + parameters: Parameters.GetTask | string, + callback?: Callback, + ): Promise { + const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; + + const config: RequestConfig = { + url: `/rest/api/3/task/${taskId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Cancels a task. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Creator of the task. + */ + async cancelTask(parameters: Parameters.CancelTask | string, callback: Callback): Promise; + /** + * Cancels a task. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Creator of the task. + */ + async cancelTask(parameters: Parameters.CancelTask | string, callback?: never): Promise; + async cancelTask(parameters: Parameters.CancelTask | string, callback?: Callback): Promise { + const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; + + const config: RequestConfig = { + url: `/rest/api/3/task/${taskId}/cancel`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/tasks.ts b/src/version3/tasks.ts deleted file mode 100644 index b360b5e80..000000000 --- a/src/version3/tasks.ts +++ /dev/null @@ -1,87 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Tasks { - constructor(private client: Client) {} - - /** - * Returns the status of a [long-running asynchronous - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). - * - * When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the - * operation that created the task for details. Task details are not permanently retained. As of September 2019, - * details are retained for 14 days although this period may change without notice. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async getTask( - parameters: Parameters.GetTask | string, - callback: Callback, - ): Promise; - /** - * Returns the status of a [long-running asynchronous - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). - * - * When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the - * operation that created the task for details. Task details are not permanently retained. As of September 2019, - * details are retained for 14 days although this period may change without notice. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async getTask(parameters: Parameters.GetTask | string, callback?: never): Promise; - async getTask( - parameters: Parameters.GetTask | string, - callback?: Callback, - ): Promise { - const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; - - const config: RequestConfig = { - url: `/rest/api/3/task/${taskId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Cancels a task. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async cancelTask(parameters: Parameters.CancelTask | string, callback: Callback): Promise; - /** - * Cancels a task. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async cancelTask(parameters: Parameters.CancelTask | string, callback?: never): Promise; - async cancelTask(parameters: Parameters.CancelTask | string, callback?: Callback): Promise { - const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; - - const config: RequestConfig = { - url: `/rest/api/3/task/${taskId}/cancel`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/timeTracking.mts b/src/version3/timeTracking.mts new file mode 100644 index 000000000..432321d6b --- /dev/null +++ b/src/version3/timeTracking.mts @@ -0,0 +1,169 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class TimeTracking { + constructor(private client: Client) {} + + /** + * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a + * successful but empty response is returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSelectedTimeTrackingImplementation(callback: Callback): Promise; + /** + * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a + * successful but empty response is returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSelectedTimeTrackingImplementation(callback?: never): Promise; + async getSelectedTimeTrackingImplementation(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/configuration/timetracking', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Selects a time tracking provider. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async selectTimeTrackingImplementation( + parameters: Parameters.SelectTimeTrackingImplementation | undefined, + callback: Callback, + ): Promise; + /** + * Selects a time tracking provider. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async selectTimeTrackingImplementation( + parameters?: Parameters.SelectTimeTrackingImplementation, + callback?: never, + ): Promise; + async selectTimeTrackingImplementation( + parameters?: Parameters.SelectTimeTrackingImplementation, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/configuration/timetracking', + method: 'PUT', + data: { + key: parameters?.key, + name: parameters?.name, + url: parameters?.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time + * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more + * information on time tracking providers, see the documentation for the [ Time Tracking + * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAvailableTimeTrackingImplementations( + callback: Callback, + ): Promise; + /** + * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time + * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more + * information on time tracking providers, see the documentation for the [ Time Tracking + * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAvailableTimeTrackingImplementations(callback?: never): Promise; + async getAvailableTimeTrackingImplementations( + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/configuration/timetracking/list', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. + * For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSharedTimeTrackingConfiguration(callback: Callback): Promise; + /** + * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. + * For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSharedTimeTrackingConfiguration(callback?: never): Promise; + async getSharedTimeTrackingConfiguration( + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/configuration/timetracking/options', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the time tracking settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setSharedTimeTrackingConfiguration( + parameters: Parameters.SetSharedTimeTrackingConfiguration | undefined, + callback: Callback, + ): Promise; + /** + * Sets the time tracking settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setSharedTimeTrackingConfiguration( + parameters?: Parameters.SetSharedTimeTrackingConfiguration, + callback?: never, + ): Promise; + async setSharedTimeTrackingConfiguration( + parameters?: Parameters.SetSharedTimeTrackingConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/configuration/timetracking/options', + method: 'PUT', + data: { + workingHoursPerDay: parameters?.workingHoursPerDay, + workingDaysPerWeek: parameters?.workingDaysPerWeek, + timeFormat: parameters?.timeFormat, + defaultUnit: parameters?.defaultUnit, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/timeTracking.ts b/src/version3/timeTracking.ts deleted file mode 100644 index 485eda349..000000000 --- a/src/version3/timeTracking.ts +++ /dev/null @@ -1,169 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class TimeTracking { - constructor(private client: Client) {} - - /** - * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a - * successful but empty response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSelectedTimeTrackingImplementation(callback: Callback): Promise; - /** - * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a - * successful but empty response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSelectedTimeTrackingImplementation(callback?: never): Promise; - async getSelectedTimeTrackingImplementation(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/configuration/timetracking', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Selects a time tracking provider. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async selectTimeTrackingImplementation( - parameters: Parameters.SelectTimeTrackingImplementation | undefined, - callback: Callback, - ): Promise; - /** - * Selects a time tracking provider. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async selectTimeTrackingImplementation( - parameters?: Parameters.SelectTimeTrackingImplementation, - callback?: never, - ): Promise; - async selectTimeTrackingImplementation( - parameters?: Parameters.SelectTimeTrackingImplementation, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/configuration/timetracking', - method: 'PUT', - data: { - key: parameters?.key, - name: parameters?.name, - url: parameters?.url, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time - * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more - * information on time tracking providers, see the documentation for the [ Time Tracking - * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableTimeTrackingImplementations( - callback: Callback, - ): Promise; - /** - * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time - * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more - * information on time tracking providers, see the documentation for the [ Time Tracking - * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableTimeTrackingImplementations(callback?: never): Promise; - async getAvailableTimeTrackingImplementations( - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/configuration/timetracking/list', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. - * For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSharedTimeTrackingConfiguration(callback: Callback): Promise; - /** - * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. - * For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSharedTimeTrackingConfiguration(callback?: never): Promise; - async getSharedTimeTrackingConfiguration( - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/configuration/timetracking/options', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the time tracking settings. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setSharedTimeTrackingConfiguration( - parameters: Parameters.SetSharedTimeTrackingConfiguration | undefined, - callback: Callback, - ): Promise; - /** - * Sets the time tracking settings. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setSharedTimeTrackingConfiguration( - parameters?: Parameters.SetSharedTimeTrackingConfiguration, - callback?: never, - ): Promise; - async setSharedTimeTrackingConfiguration( - parameters?: Parameters.SetSharedTimeTrackingConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/configuration/timetracking/options', - method: 'PUT', - data: { - workingHoursPerDay: parameters?.workingHoursPerDay, - workingDaysPerWeek: parameters?.workingDaysPerWeek, - timeFormat: parameters?.timeFormat, - defaultUnit: parameters?.defaultUnit, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/uIModificationsApps.ts b/src/version3/uIModificationsApps.ts deleted file mode 100644 index a58f3b149..000000000 --- a/src/version3/uIModificationsApps.ts +++ /dev/null @@ -1,171 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class UIModificationsApps { - constructor(private client: Client) {} - - /** - * Gets UI modifications. UI modifications can only be retrieved by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getUiModifications( - parameters: Parameters.GetUiModifications | undefined, - callback: Callback, - ): Promise; - /** - * Gets UI modifications. UI modifications can only be retrieved by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getUiModifications( - parameters?: Parameters.GetUiModifications, - callback?: never, - ): Promise; - async getUiModifications( - parameters?: Parameters.GetUiModifications, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/uiModifications', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a UI modification. UI modification can only be created by Forge apps. - * - * Each app can define up to 100 UI modifications. Each UI modification can define up to 1000 contexts. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _None_ if the UI modification is created without contexts. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the - * UI modification is created with contexts. - */ - async createUiModification( - parameters: Parameters.CreateUiModification, - callback: Callback, - ): Promise; - /** - * Creates a UI modification. UI modification can only be created by Forge apps. - * - * Each app can define up to 100 UI modifications. Each UI modification can define up to 1000 contexts. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _None_ if the UI modification is created without contexts. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the - * UI modification is created with contexts. - */ - async createUiModification( - parameters: Parameters.CreateUiModification, - callback?: never, - ): Promise; - async createUiModification( - parameters: Parameters.CreateUiModification, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/uiModifications', - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - data: parameters.data, - contexts: parameters.contexts, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a UI modification. UI modification can only be updated by Forge apps. - * - * Each UI modification can define up to 1000 contexts. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _None_ if the UI modification is created without contexts. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the - * UI modification is created with contexts. - */ - async updateUiModification( - parameters: Parameters.UpdateUiModification, - callback: Callback, - ): Promise; - /** - * Updates a UI modification. UI modification can only be updated by Forge apps. - * - * Each UI modification can define up to 1000 contexts. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _None_ if the UI modification is created without contexts. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the - * UI modification is created with contexts. - */ - async updateUiModification(parameters: Parameters.UpdateUiModification, callback?: never): Promise; - async updateUiModification( - parameters: Parameters.UpdateUiModification, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/uiModifications/${parameters.uiModificationId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - data: parameters.data, - contexts: parameters.contexts, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can - * only be deleted by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async deleteUiModification( - parameters: Parameters.DeleteUiModification | string, - callback: Callback, - ): Promise; - /** - * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can - * only be deleted by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async deleteUiModification( - parameters: Parameters.DeleteUiModification | string, - callback?: never, - ): Promise; - async deleteUiModification( - parameters: Parameters.DeleteUiModification | string, - callback?: Callback, - ): Promise { - const uiModificationId = typeof parameters === 'string' ? parameters : parameters.uiModificationId; - - const config: RequestConfig = { - url: `/rest/api/3/uiModifications/${uiModificationId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/uiModificationsApps.mts b/src/version3/uiModificationsApps.mts new file mode 100644 index 000000000..b84463e94 --- /dev/null +++ b/src/version3/uiModificationsApps.mts @@ -0,0 +1,171 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class UiModificationsApps { + constructor(private client: Client) {} + + /** + * Gets UI modifications. UI modifications can only be retrieved by Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getUiModifications( + parameters: Parameters.GetUiModifications | undefined, + callback: Callback, + ): Promise; + /** + * Gets UI modifications. UI modifications can only be retrieved by Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getUiModifications( + parameters?: Parameters.GetUiModifications, + callback?: never, + ): Promise; + async getUiModifications( + parameters?: Parameters.GetUiModifications, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/uiModifications', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a UI modification. UI modification can only be created by Forge apps. + * + * Each app can define up to 100 UI modifications. Each UI modification can define up to 1000 contexts. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _None_ if the UI modification is created without contexts. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the + * UI modification is created with contexts. + */ + async createUiModification( + parameters: Parameters.CreateUiModification, + callback: Callback, + ): Promise; + /** + * Creates a UI modification. UI modification can only be created by Forge apps. + * + * Each app can define up to 100 UI modifications. Each UI modification can define up to 1000 contexts. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _None_ if the UI modification is created without contexts. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the + * UI modification is created with contexts. + */ + async createUiModification( + parameters: Parameters.CreateUiModification, + callback?: never, + ): Promise; + async createUiModification( + parameters: Parameters.CreateUiModification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/uiModifications', + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + data: parameters.data, + contexts: parameters.contexts, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a UI modification. UI modification can only be updated by Forge apps. + * + * Each UI modification can define up to 1000 contexts. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _None_ if the UI modification is created without contexts. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the + * UI modification is created with contexts. + */ + async updateUiModification( + parameters: Parameters.UpdateUiModification, + callback: Callback, + ): Promise; + /** + * Updates a UI modification. UI modification can only be updated by Forge apps. + * + * Each UI modification can define up to 1000 contexts. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _None_ if the UI modification is created without contexts. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the + * UI modification is created with contexts. + */ + async updateUiModification(parameters: Parameters.UpdateUiModification, callback?: never): Promise; + async updateUiModification( + parameters: Parameters.UpdateUiModification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/uiModifications/${parameters.uiModificationId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + data: parameters.data, + contexts: parameters.contexts, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can + * only be deleted by Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async deleteUiModification( + parameters: Parameters.DeleteUiModification | string, + callback: Callback, + ): Promise; + /** + * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can + * only be deleted by Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async deleteUiModification( + parameters: Parameters.DeleteUiModification | string, + callback?: never, + ): Promise; + async deleteUiModification( + parameters: Parameters.DeleteUiModification | string, + callback?: Callback, + ): Promise { + const uiModificationId = typeof parameters === 'string' ? parameters : parameters.uiModificationId; + + const config: RequestConfig = { + url: `/rest/api/3/uiModifications/${uiModificationId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/userProperties.mts b/src/version3/userProperties.mts new file mode 100644 index 000000000..7fa616cae --- /dev/null +++ b/src/version3/userProperties.mts @@ -0,0 +1,190 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class UserProperties { + constructor(private client: Client) {} + + /** + * Returns the keys of all properties for a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on + * any user. + * - Access to Jira, to access the calling user's property keys. + */ + async getUserPropertyKeys( + parameters: Parameters.GetUserPropertyKeys | undefined, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on + * any user. + * - Access to Jira, to access the calling user's property keys. + */ + async getUserPropertyKeys( + parameters?: Parameters.GetUserPropertyKeys, + callback?: never, + ): Promise; + async getUserPropertyKeys( + parameters?: Parameters.GetUserPropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/properties', + method: 'GET', + params: { + accountId: parameters?.accountId, + userKey: parameters?.userKey, + username: parameters?.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a user's property. If no property key is provided [Get user property + * keys](#api-rest-api-3-user-properties-get) is called. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. + * - Access to Jira, to get a property from the calling user's record. + */ + async getUserProperty( + parameters: Parameters.GetUserProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a user's property. If no property key is provided [Get user property + * keys](#api-rest-api-3-user-properties-get) is called. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. + * - Access to Jira, to get a property from the calling user's record. + */ + async getUserProperty( + parameters: Parameters.GetUserProperty, + callback?: never, + ): Promise; + async getUserProperty( + parameters: Parameters.GetUserProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/user/properties/${parameters.propertyKey}`, + method: 'GET', + params: { + accountId: parameters.accountId, + userKey: parameters.userKey, + username: parameters.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a user's property. Use this resource to store custom data against a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set a property on any user. + * - Access to Jira, to set a property on the calling user's record. + */ + async setUserProperty(parameters: Parameters.SetUserProperty, callback: Callback): Promise; + /** + * Sets the value of a user's property. Use this resource to store custom data against a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set a property on any user. + * - Access to Jira, to set a property on the calling user's record. + */ + async setUserProperty(parameters: Parameters.SetUserProperty, callback?: never): Promise; + async setUserProperty( + parameters: Parameters.SetUserProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/user/properties/${parameters.propertyKey}`, + method: 'PUT', + params: { + accountId: parameters.accountId, + }, + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a property from a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any + * user. + * - Access to Jira, to delete a property from the calling user's record. + */ + async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback: Callback): Promise; + /** + * Deletes a property from a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any + * user. + * - Access to Jira, to delete a property from the calling user's record. + */ + async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback?: never): Promise; + async deleteUserProperty( + parameters: Parameters.DeleteUserProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/user/properties/${parameters.propertyKey}`, + method: 'DELETE', + params: { + accountId: parameters.accountId, + userKey: parameters.userKey, + username: parameters.username, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/userProperties.ts b/src/version3/userProperties.ts deleted file mode 100644 index 3a87e47e9..000000000 --- a/src/version3/userProperties.ts +++ /dev/null @@ -1,190 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class UserProperties { - constructor(private client: Client) {} - - /** - * Returns the keys of all properties for a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on - * any user. - * - Access to Jira, to access the calling user's property keys. - */ - async getUserPropertyKeys( - parameters: Parameters.GetUserPropertyKeys | undefined, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on - * any user. - * - Access to Jira, to access the calling user's property keys. - */ - async getUserPropertyKeys( - parameters?: Parameters.GetUserPropertyKeys, - callback?: never, - ): Promise; - async getUserPropertyKeys( - parameters?: Parameters.GetUserPropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/properties', - method: 'GET', - params: { - accountId: parameters?.accountId, - userKey: parameters?.userKey, - username: parameters?.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a user's property. If no property key is provided [Get user property - * keys](#api-rest-api-3-user-properties-get) is called. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. - * - Access to Jira, to get a property from the calling user's record. - */ - async getUserProperty( - parameters: Parameters.GetUserProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a user's property. If no property key is provided [Get user property - * keys](#api-rest-api-3-user-properties-get) is called. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. - * - Access to Jira, to get a property from the calling user's record. - */ - async getUserProperty( - parameters: Parameters.GetUserProperty, - callback?: never, - ): Promise; - async getUserProperty( - parameters: Parameters.GetUserProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/user/properties/${parameters.propertyKey}`, - method: 'GET', - params: { - accountId: parameters.accountId, - userKey: parameters.userKey, - username: parameters.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a user's property. Use this resource to store custom data against a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set a property on any user. - * - Access to Jira, to set a property on the calling user's record. - */ - async setUserProperty(parameters: Parameters.SetUserProperty, callback: Callback): Promise; - /** - * Sets the value of a user's property. Use this resource to store custom data against a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set a property on any user. - * - Access to Jira, to set a property on the calling user's record. - */ - async setUserProperty(parameters: Parameters.SetUserProperty, callback?: never): Promise; - async setUserProperty( - parameters: Parameters.SetUserProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/user/properties/${parameters.propertyKey}`, - method: 'PUT', - params: { - accountId: parameters.accountId, - }, - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a property from a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any - * user. - * - Access to Jira, to delete a property from the calling user's record. - */ - async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback: Callback): Promise; - /** - * Deletes a property from a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any - * user. - * - Access to Jira, to delete a property from the calling user's record. - */ - async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback?: never): Promise; - async deleteUserProperty( - parameters: Parameters.DeleteUserProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/user/properties/${parameters.propertyKey}`, - method: 'DELETE', - params: { - accountId: parameters.accountId, - userKey: parameters.userKey, - username: parameters.username, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/userSearch.mts b/src/version3/userSearch.mts new file mode 100644 index 000000000..789499062 --- /dev/null +++ b/src/version3/userSearch.mts @@ -0,0 +1,608 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '@/callback.mjs'; +import { Client } from '@/clients/index.mjs'; +import { paramSerializer } from '@/paramSerializer.mjs'; +import { RequestConfig } from '@/requestConfig.mjs'; + +export class UserSearch { + constructor(private client: Client) {} + + /** + * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users + * whose attributes match a string. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned issues in the projects. This means the operation + * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the + * projects, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async findBulkAssignableUsers( + parameters: Parameters.FindBulkAssignableUsers, + callback: Callback, + ): Promise; + /** + * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users + * whose attributes match a string. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned issues in the projects. This means the operation + * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the + * projects, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async findBulkAssignableUsers( + parameters: Parameters.FindBulkAssignableUsers, + callback?: never, + ): Promise; + async findBulkAssignableUsers( + parameters: Parameters.FindBulkAssignableUsers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/assignable/multiProjectSearch', + method: 'GET', + params: { + query: parameters.query, + username: parameters.username, + accountId: parameters.accountId, + projectKeys: parameters.projectKeys, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be + * assigned to: + * + * - A new issue, by providing the `projectKeyOrId`. + * - An updated issue, by providing the `issueKey`. + * - To an issue during a transition (workflow action), by providing the `issueKey` and the transition id in + * `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in + * the `expand` parameter of [ Get issue](#api-rest-api-3-issue-issueIdOrKey-get). + * + * In all these cases, you can pass an account ID to determine if a user can be assigned to an issue. The user is + * returned in the response if they can be assigned to the issue or issue transition. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned the issue. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get + * all users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async findAssignableUsers( + parameters: Parameters.FindAssignableUsers | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be + * assigned to: + * + * - A new issue, by providing the `projectKeyOrId`. + * - An updated issue, by providing the `issueKey`. + * - To an issue during a transition (workflow action), by providing the `issueKey` and the transition id in + * `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in + * the `expand` parameter of [ Get issue](#api-rest-api-3-issue-issueIdOrKey-get). + * + * In all these cases, you can pass an account ID to determine if a user can be assigned to an issue. The user is + * returned in the response if they can be assigned to the issue or issue transition. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned the issue. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get + * all users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async findAssignableUsers( + parameters?: Parameters.FindAssignableUsers, + callback?: never, + ): Promise; + async findAssignableUsers( + parameters?: Parameters.FindAssignableUsers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/assignable/search', + method: 'GET', + params: { + query: parameters?.query, + sessionId: parameters?.sessionId, + username: parameters?.username, + accountId: parameters?.accountId, + project: parameters?.project, + issueKey: parameters?.issueKey, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + actionDescriptorId: parameters?.actionDescriptorId, + recommend: parameters?.recommend, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users who fulfill these criteria: + * + * - Their user attributes match a search string. + * - They have a set of permissions for a project or issue. + * + * If no search string is provided, a list of all users with the permissions is returned. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission for the project or + * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users + * who match the search string and have permission for the project or issue, use [Get all + * users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users + * for that project. + */ + async findUsersWithAllPermissions( + parameters: Parameters.FindUsersWithAllPermissions, + callback: Callback, + ): Promise; + /** + * Returns a list of users who fulfill these criteria: + * + * - Their user attributes match a search string. + * - They have a set of permissions for a project or issue. + * + * If no search string is provided, a list of all users with the permissions is returned. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission for the project or + * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users + * who match the search string and have permission for the project or issue, use [Get all + * users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users + * for that project. + */ + async findUsersWithAllPermissions( + parameters: Parameters.FindUsersWithAllPermissions, + callback?: never, + ): Promise; + async findUsersWithAllPermissions( + parameters: Parameters.FindUsersWithAllPermissions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/permission/search', + method: 'GET', + params: { + query: parameters.query, + username: parameters.username, + accountId: parameters.accountId, + permissions: parameters.permissions, + issueKey: parameters.issueKey, + projectKey: parameters.projectKey, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where + * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude + * users from the results. + * + * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns + * only the users from that range that match the query term. This means the operation usually returns fewer users than + * specified in `maxResults`. To get all the users who match the query term, use [Get all + * users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by + * users without the required permission return search results for an exact name match only. + */ + async findUsersForPicker( + parameters: Parameters.FindUsersForPicker, + callback: Callback, + ): Promise; + /** + * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where + * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude + * users from the results. + * + * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns + * only the users from that range that match the query term. This means the operation usually returns fewer users than + * specified in `maxResults`. To get all the users who match the query term, use [Get all + * users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by + * users without the required permission return search results for an exact name match only. + */ + async findUsersForPicker( + parameters: Parameters.FindUsersForPicker, + callback?: never, + ): Promise; + async findUsersForPicker( + parameters: Parameters.FindUsersForPicker, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/picker', + method: 'GET', + params: { + query: parameters.query, + maxResults: parameters.maxResults, + showAvatar: parameters.showAvatar, + excludeAccountIds: paramSerializer('excludeAccountIds', parameters.excludeAccountIds), + avatarSize: parameters.avatarSize, + excludeConnectUsers: parameters.excludeConnectUsers, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users that match the search string and property. + * + * This operation first applies a filter to match the search string and property, and then takes the filtered users in + * the range defined by `startAt` and `maxResults`, up to the thousandth user. To get all the users who match the + * search string and property, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your + * code. + * + * This operation can be accessed anonymously. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users + * without the required permission return empty search results. + */ + async findUsers( + parameters: Parameters.FindUsers | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of users that match the search string and property. + * + * This operation first applies a filter to match the search string and property, and then takes the filtered users in + * the range defined by `startAt` and `maxResults`, up to the thousandth user. To get all the users who match the + * search string and property, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your + * code. + * + * This operation can be accessed anonymously. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users + * without the required permission return empty search results. + */ + async findUsers(parameters?: Parameters.FindUsers, callback?: never): Promise; + async findUsers(parameters?: Parameters.FindUsers, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/search', + method: 'GET', + params: { + query: parameters?.query, + username: parameters?.username, + accountId: parameters?.accountId, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + property: parameters?.property, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Finds users with a structured query and returns a + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of user details. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * The query statements are: + * + * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. + * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or + * _PROJ-2_. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * + * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined + * using the `AND` and `OR` operators to form more complex queries. For example: + * + * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + */ + async findUsersByQuery( + parameters: Parameters.FindUsersByQuery, + callback: Callback, + ): Promise; + /** + * Finds users with a structured query and returns a + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of user details. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * The query statements are: + * + * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. + * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or + * _PROJ-2_. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * + * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined + * using the `AND` and `OR` operators to form more complex queries. For example: + * + * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + */ + async findUsersByQuery(parameters: Parameters.FindUsersByQuery, callback?: never): Promise; + async findUsersByQuery( + parameters: Parameters.FindUsersByQuery, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/search/query', + method: 'GET', + params: { + query: parameters.query, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Finds users with a structured query and returns a + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of user keys. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * The query statements are: + * + * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. + * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or + * _PROJ-2_. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * + * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined + * using the `AND` and `OR` operators to form more complex queries. For example: + * + * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + */ + async findUserKeysByQuery( + parameters: Parameters.FindUserKeysByQuery, + callback: Callback, + ): Promise; + /** + * Finds users with a structured query and returns a + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of user keys. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * The query statements are: + * + * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. + * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or + * _PROJ-2_. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * + * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined + * using the `AND` and `OR` operators to form more complex queries. For example: + * + * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + */ + async findUserKeysByQuery( + parameters: Parameters.FindUserKeysByQuery, + callback?: never, + ): Promise; + async findUserKeysByQuery( + parameters: Parameters.FindUserKeysByQuery, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/search/query/key', + method: 'GET', + params: { + query: parameters.query, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users who fulfill these criteria: + * + * - Their user attributes match a search string. + * - They have permission to browse issues. + * + * Use this resource to find users who can browse: + * + * - An issue, by providing the `issueKey`. + * - Any issue in a project, by providing the `projectKey`. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission to browse issues. This + * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the + * search string and have permission to browse issues, use [Get all users](#api-rest-api-3-users-search-get) and + * filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by + * users without the required permission return empty search results. + */ + async findUsersWithBrowsePermission( + parameters: Parameters.FindUsersWithBrowsePermission | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of users who fulfill these criteria: + * + * - Their user attributes match a search string. + * - They have permission to browse issues. + * + * Use this resource to find users who can browse: + * + * - An issue, by providing the `issueKey`. + * - Any issue in a project, by providing the `projectKey`. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission to browse issues. This + * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the + * search string and have permission to browse issues, use [Get all users](#api-rest-api-3-users-search-get) and + * filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by + * users without the required permission return empty search results. + */ + async findUsersWithBrowsePermission( + parameters?: Parameters.FindUsersWithBrowsePermission, + callback?: never, + ): Promise; + async findUsersWithBrowsePermission( + parameters?: Parameters.FindUsersWithBrowsePermission, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/viewissue/search', + method: 'GET', + params: { + query: parameters?.query, + username: parameters?.username, + accountId: parameters?.accountId, + issueKey: parameters?.issueKey, + projectKey: parameters?.projectKey, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/userSearch.ts b/src/version3/userSearch.ts deleted file mode 100644 index f9b0dbe79..000000000 --- a/src/version3/userSearch.ts +++ /dev/null @@ -1,608 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import { paramSerializer } from '../paramSerializer.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class UserSearch { - constructor(private client: Client) {} - - /** - * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users - * whose attributes match a string. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned issues in the projects. This means the operation - * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the - * projects, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async findBulkAssignableUsers( - parameters: Parameters.FindBulkAssignableUsers, - callback: Callback, - ): Promise; - /** - * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users - * whose attributes match a string. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned issues in the projects. This means the operation - * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the - * projects, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async findBulkAssignableUsers( - parameters: Parameters.FindBulkAssignableUsers, - callback?: never, - ): Promise; - async findBulkAssignableUsers( - parameters: Parameters.FindBulkAssignableUsers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/assignable/multiProjectSearch', - method: 'GET', - params: { - query: parameters.query, - username: parameters.username, - accountId: parameters.accountId, - projectKeys: parameters.projectKeys, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be - * assigned to: - * - * - A new issue, by providing the `projectKeyOrId`. - * - An updated issue, by providing the `issueKey`. - * - To an issue during a transition (workflow action), by providing the `issueKey` and the transition id in - * `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in - * the `expand` parameter of [ Get issue](#api-rest-api-3-issue-issueIdOrKey-get). - * - * In all these cases, you can pass an account ID to determine if a user can be assigned to an issue. The user is - * returned in the response if they can be assigned to the issue or issue transition. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned the issue. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get - * all users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async findAssignableUsers( - parameters: Parameters.FindAssignableUsers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be - * assigned to: - * - * - A new issue, by providing the `projectKeyOrId`. - * - An updated issue, by providing the `issueKey`. - * - To an issue during a transition (workflow action), by providing the `issueKey` and the transition id in - * `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in - * the `expand` parameter of [ Get issue](#api-rest-api-3-issue-issueIdOrKey-get). - * - * In all these cases, you can pass an account ID to determine if a user can be assigned to an issue. The user is - * returned in the response if they can be assigned to the issue or issue transition. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned the issue. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get - * all users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async findAssignableUsers( - parameters?: Parameters.FindAssignableUsers, - callback?: never, - ): Promise; - async findAssignableUsers( - parameters?: Parameters.FindAssignableUsers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/assignable/search', - method: 'GET', - params: { - query: parameters?.query, - sessionId: parameters?.sessionId, - username: parameters?.username, - accountId: parameters?.accountId, - project: parameters?.project, - issueKey: parameters?.issueKey, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - actionDescriptorId: parameters?.actionDescriptorId, - recommend: parameters?.recommend, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have a set of permissions for a project or issue. - * - * If no search string is provided, a list of all users with the permissions is returned. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission for the project or - * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users - * who match the search string and have permission for the project or issue, use [Get all - * users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users - * for that project. - */ - async findUsersWithAllPermissions( - parameters: Parameters.FindUsersWithAllPermissions, - callback: Callback, - ): Promise; - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have a set of permissions for a project or issue. - * - * If no search string is provided, a list of all users with the permissions is returned. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission for the project or - * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users - * who match the search string and have permission for the project or issue, use [Get all - * users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users - * for that project. - */ - async findUsersWithAllPermissions( - parameters: Parameters.FindUsersWithAllPermissions, - callback?: never, - ): Promise; - async findUsersWithAllPermissions( - parameters: Parameters.FindUsersWithAllPermissions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/permission/search', - method: 'GET', - params: { - query: parameters.query, - username: parameters.username, - accountId: parameters.accountId, - permissions: parameters.permissions, - issueKey: parameters.issueKey, - projectKey: parameters.projectKey, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where - * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude - * users from the results. - * - * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns - * only the users from that range that match the query term. This means the operation usually returns fewer users than - * specified in `maxResults`. To get all the users who match the query term, use [Get all - * users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by - * users without the required permission return search results for an exact name match only. - */ - async findUsersForPicker( - parameters: Parameters.FindUsersForPicker, - callback: Callback, - ): Promise; - /** - * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where - * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude - * users from the results. - * - * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns - * only the users from that range that match the query term. This means the operation usually returns fewer users than - * specified in `maxResults`. To get all the users who match the query term, use [Get all - * users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by - * users without the required permission return search results for an exact name match only. - */ - async findUsersForPicker( - parameters: Parameters.FindUsersForPicker, - callback?: never, - ): Promise; - async findUsersForPicker( - parameters: Parameters.FindUsersForPicker, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/picker', - method: 'GET', - params: { - query: parameters.query, - maxResults: parameters.maxResults, - showAvatar: parameters.showAvatar, - excludeAccountIds: paramSerializer('excludeAccountIds', parameters.excludeAccountIds), - avatarSize: parameters.avatarSize, - excludeConnectUsers: parameters.excludeConnectUsers, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users that match the search string and property. - * - * This operation first applies a filter to match the search string and property, and then takes the filtered users in - * the range defined by `startAt` and `maxResults`, up to the thousandth user. To get all the users who match the - * search string and property, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your - * code. - * - * This operation can be accessed anonymously. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users - * without the required permission return empty search results. - */ - async findUsers( - parameters: Parameters.FindUsers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of users that match the search string and property. - * - * This operation first applies a filter to match the search string and property, and then takes the filtered users in - * the range defined by `startAt` and `maxResults`, up to the thousandth user. To get all the users who match the - * search string and property, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your - * code. - * - * This operation can be accessed anonymously. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users - * without the required permission return empty search results. - */ - async findUsers(parameters?: Parameters.FindUsers, callback?: never): Promise; - async findUsers(parameters?: Parameters.FindUsers, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/search', - method: 'GET', - params: { - query: parameters?.query, - username: parameters?.username, - accountId: parameters?.accountId, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - property: parameters?.property, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of user details. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. - * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or - * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. - * - * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined - * using the `AND` and `OR` operators to form more complex queries. For example: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUsersByQuery( - parameters: Parameters.FindUsersByQuery, - callback: Callback, - ): Promise; - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of user details. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. - * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or - * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. - * - * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined - * using the `AND` and `OR` operators to form more complex queries. For example: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUsersByQuery(parameters: Parameters.FindUsersByQuery, callback?: never): Promise; - async findUsersByQuery( - parameters: Parameters.FindUsersByQuery, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/search/query', - method: 'GET', - params: { - query: parameters.query, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of user keys. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. - * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or - * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. - * - * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined - * using the `AND` and `OR` operators to form more complex queries. For example: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUserKeysByQuery( - parameters: Parameters.FindUserKeysByQuery, - callback: Callback, - ): Promise; - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of user keys. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. - * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or - * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. - * - * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined - * using the `AND` and `OR` operators to form more complex queries. For example: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUserKeysByQuery( - parameters: Parameters.FindUserKeysByQuery, - callback?: never, - ): Promise; - async findUserKeysByQuery( - parameters: Parameters.FindUserKeysByQuery, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/search/query/key', - method: 'GET', - params: { - query: parameters.query, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have permission to browse issues. - * - * Use this resource to find users who can browse: - * - * - An issue, by providing the `issueKey`. - * - Any issue in a project, by providing the `projectKey`. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission to browse issues. This - * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the - * search string and have permission to browse issues, use [Get all users](#api-rest-api-3-users-search-get) and - * filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by - * users without the required permission return empty search results. - */ - async findUsersWithBrowsePermission( - parameters: Parameters.FindUsersWithBrowsePermission | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have permission to browse issues. - * - * Use this resource to find users who can browse: - * - * - An issue, by providing the `issueKey`. - * - Any issue in a project, by providing the `projectKey`. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission to browse issues. This - * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the - * search string and have permission to browse issues, use [Get all users](#api-rest-api-3-users-search-get) and - * filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by - * users without the required permission return empty search results. - */ - async findUsersWithBrowsePermission( - parameters?: Parameters.FindUsersWithBrowsePermission, - callback?: never, - ): Promise; - async findUsersWithBrowsePermission( - parameters?: Parameters.FindUsersWithBrowsePermission, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/viewissue/search', - method: 'GET', - params: { - query: parameters?.query, - username: parameters?.username, - accountId: parameters?.accountId, - issueKey: parameters?.issueKey, - projectKey: parameters?.projectKey, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/users.mts b/src/version3/users.mts new file mode 100644 index 000000000..0931d968e --- /dev/null +++ b/src/version3/users.mts @@ -0,0 +1,493 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { paramSerializer } from '@/paramSerializer.mjs'; +import { RequestConfig } from '@/requestConfig.mjs'; + +export class Users { + constructor(private client: Client) {} + + /** + * Returns a user. + * + * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getUser(parameters: Parameters.GetUser | undefined, callback: Callback): Promise; + /** + * Returns a user. + * + * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getUser(parameters?: Parameters.GetUser, callback?: never): Promise; + async getUser(parameters?: Parameters.GetUser, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user', + method: 'GET', + params: { + accountId: parameters?.accountId, + expand: parameters?.expand, + key: parameters?.key, + username: parameters?.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is + * available this resource will be deprecated. + * + * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have + * access to Jira, the operation returns a 400 status. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createUser(parameters: Parameters.CreateUser, callback: Callback): Promise; + /** + * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is + * available this resource will be deprecated. + * + * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have + * access to Jira, the operation returns a 400 status. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createUser(parameters: Parameters.CreateUser, callback?: never): Promise; + async createUser(parameters: Parameters.CreateUser, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user', + method: 'POST', + data: { + emailAddress: parameters.emailAddress, + products: parameters.products + ? parameters.products + : ['jira-core', 'jira-servicedesk', 'jira-product-discovery', 'jira-software'], + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This + * operation does not delete the user's Atlassian account. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeUser(parameters: Parameters.RemoveUser, callback: Callback): Promise; + /** + * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This + * operation does not delete the user's Atlassian account. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeUser(parameters: Parameters.RemoveUser, callback?: never): Promise; + async removeUser(parameters: Parameters.RemoveUser, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user', + method: 'DELETE', + params: { + accountId: parameters.accountId, + key: parameters.key, + username: parameters.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the + * users specified by one or more account IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback: Callback): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the + * users specified by one or more account IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback?: never): Promise; + async bulkGetUsers( + parameters: Parameters.BulkGetUsers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/bulk', + method: 'GET', + params: { + accountId: paramSerializer('accountId', parameters.accountId), + maxResults: parameters.maxResults, + startAt: parameters.startAt, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or + * `username` parameters can be specified. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async bulkGetUsersMigration( + parameters: Parameters.BulkGetUsersMigration, + callback: Callback, + ): Promise; + /** + * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or + * `username` parameters can be specified. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async bulkGetUsersMigration( + parameters: Parameters.BulkGetUsersMigration, + callback?: never, + ): Promise; + async bulkGetUsersMigration( + parameters: Parameters.BulkGetUsersMigration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/bulk/migration', + method: 'GET', + params: { + key: paramSerializer('key', parameters.key), + maxResults: parameters.maxResults, + startAt: parameters.startAt, + username: paramSerializer('username', parameters.username), + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` + * is not passed in the request, the calling user's details are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for + * any user. + * - Permission to access Jira, to get the calling user's column details. + */ + async getUserDefaultColumns( + parameters: Parameters.GetUserDefaultColumns | undefined, + callback: Callback, + ): Promise; + /** + * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` + * is not passed in the request, the calling user's details are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for + * any user. + * - Permission to access Jira, to get the calling user's column details. + */ + async getUserDefaultColumns( + parameters?: Parameters.GetUserDefaultColumns, + callback?: never, + ): Promise; + async getUserDefaultColumns( + parameters?: Parameters.GetUserDefaultColumns, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/columns', + method: 'GET', + params: { + accountId: parameters?.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If an account ID + * is not passed, the calling user's default columns are set. If no column details are sent, then all default columns + * are removed. + * + * The parameters for this resource are expressed as HTML form data. For example, in curl: + * + * `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/3/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. + * - Permission to access Jira, to set the calling user's columns. + */ + async setUserColumns( + parameters: Parameters.SetUserColumns | undefined, + callback: Callback, + ): Promise; + /** + * Sets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If an account ID + * is not passed, the calling user's default columns are set. If no column details are sent, then all default columns + * are removed. + * + * The parameters for this resource are expressed as HTML form data. For example, in curl: + * + * `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/3/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. + * - Permission to access Jira, to set the calling user's columns. + */ + async setUserColumns(parameters?: Parameters.SetUserColumns, callback?: never): Promise; + async setUserColumns(parameters?: Parameters.SetUserColumns, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/columns', + method: 'PUT', + params: { + accountId: parameters?.accountId, + }, + data: parameters?.columns, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system + * default. If `accountId` is not passed, the calling user's default columns are reset. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. + * - Permission to access Jira, to set the calling user's columns. + */ + async resetUserColumns(parameters: Parameters.ResetUserColumns, callback: Callback): Promise; + /** + * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system + * default. If `accountId` is not passed, the calling user's default columns are reset. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. + * - Permission to access Jira, to set the calling user's columns. + */ + async resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: never): Promise; + async resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/columns', + method: 'DELETE', + params: { + accountId: parameters.accountId, + username: parameters.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + */ + async getUserEmail( + parameters: Parameters.GetUserEmail | string, + callback: Callback, + ): Promise; + /** + * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + */ + async getUserEmail( + parameters: Parameters.GetUserEmail | string, + callback?: never, + ): Promise; + async getUserEmail( + parameters: Parameters.GetUserEmail | string, + callback?: Callback, + ): Promise { + const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; + + const config: RequestConfig = { + url: '/rest/api/3/user/email', + method: 'GET', + params: { + accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + */ + async getUserEmailBulk( + parameters: Parameters.GetUserEmailBulk | string, + callback: Callback, + ): Promise; + /** + * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + */ + async getUserEmailBulk( + parameters: Parameters.GetUserEmailBulk | string, + callback?: never, + ): Promise; + async getUserEmailBulk( + parameters: Parameters.GetUserEmailBulk | string, + callback?: Callback, + ): Promise { + const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; + + const config: RequestConfig = { + url: '/rest/api/3/user/email/bulk', + method: 'GET', + params: { + accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the groups to which a user belongs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getUserGroups( + parameters: Parameters.GetUserGroups, + callback: Callback, + ): Promise; + /** + * Returns the groups to which a user belongs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getUserGroups(parameters: Parameters.GetUserGroups, callback?: never): Promise; + async getUserGroups( + parameters: Parameters.GetUserGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/groups', + method: 'GET', + params: { + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of all users, including active users, inactive users and previously deleted users that have an + * Atlassian account. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllUsersDefault( + parameters: Parameters.GetAllUsersDefault | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of all users, including active users, inactive users and previously deleted users that have an + * Atlassian account. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllUsersDefault(parameters?: Parameters.GetAllUsersDefault, callback?: never): Promise; + async getAllUsersDefault( + parameters?: Parameters.GetAllUsersDefault, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/users', + method: 'GET', + params: { + maxResults: parameters?.maxResults, + startAt: parameters?.startAt, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of all users, including active users, inactive users and previously deleted users that have an + * Atlassian account. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllUsers( + parameters: Parameters.GetAllUsers | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of all users, including active users, inactive users and previously deleted users that have an + * Atlassian account. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: never): Promise; + async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/users/search', + method: 'GET', + params: { + maxResults: parameters?.maxResults, + startAt: parameters?.startAt, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/users.ts b/src/version3/users.ts deleted file mode 100644 index 96ee50066..000000000 --- a/src/version3/users.ts +++ /dev/null @@ -1,493 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import { paramSerializer } from '../paramSerializer.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Users { - constructor(private client: Client) {} - - /** - * Returns a user. - * - * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getUser(parameters: Parameters.GetUser | undefined, callback: Callback): Promise; - /** - * Returns a user. - * - * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getUser(parameters?: Parameters.GetUser, callback?: never): Promise; - async getUser(parameters?: Parameters.GetUser, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user', - method: 'GET', - params: { - accountId: parameters?.accountId, - expand: parameters?.expand, - key: parameters?.key, - username: parameters?.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is - * available this resource will be deprecated. - * - * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have - * access to Jira, the operation returns a 400 status. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createUser(parameters: Parameters.CreateUser, callback: Callback): Promise; - /** - * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is - * available this resource will be deprecated. - * - * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have - * access to Jira, the operation returns a 400 status. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createUser(parameters: Parameters.CreateUser, callback?: never): Promise; - async createUser(parameters: Parameters.CreateUser, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user', - method: 'POST', - data: { - emailAddress: parameters.emailAddress, - products: parameters.products - ? parameters.products - : ['jira-core', 'jira-servicedesk', 'jira-product-discovery', 'jira-software'], - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This - * operation does not delete the user's Atlassian account. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUser(parameters: Parameters.RemoveUser, callback: Callback): Promise; - /** - * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This - * operation does not delete the user's Atlassian account. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUser(parameters: Parameters.RemoveUser, callback?: never): Promise; - async removeUser(parameters: Parameters.RemoveUser, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user', - method: 'DELETE', - params: { - accountId: parameters.accountId, - key: parameters.key, - username: parameters.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the - * users specified by one or more account IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback: Callback): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the - * users specified by one or more account IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback?: never): Promise; - async bulkGetUsers( - parameters: Parameters.BulkGetUsers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/bulk', - method: 'GET', - params: { - accountId: paramSerializer('accountId', parameters.accountId), - maxResults: parameters.maxResults, - startAt: parameters.startAt, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or - * `username` parameters can be specified. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsersMigration( - parameters: Parameters.BulkGetUsersMigration, - callback: Callback, - ): Promise; - /** - * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or - * `username` parameters can be specified. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsersMigration( - parameters: Parameters.BulkGetUsersMigration, - callback?: never, - ): Promise; - async bulkGetUsersMigration( - parameters: Parameters.BulkGetUsersMigration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/bulk/migration', - method: 'GET', - params: { - key: paramSerializer('key', parameters.key), - maxResults: parameters.maxResults, - startAt: parameters.startAt, - username: paramSerializer('username', parameters.username), - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` - * is not passed in the request, the calling user's details are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for - * any user. - * - Permission to access Jira, to get the calling user's column details. - */ - async getUserDefaultColumns( - parameters: Parameters.GetUserDefaultColumns | undefined, - callback: Callback, - ): Promise; - /** - * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` - * is not passed in the request, the calling user's details are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for - * any user. - * - Permission to access Jira, to get the calling user's column details. - */ - async getUserDefaultColumns( - parameters?: Parameters.GetUserDefaultColumns, - callback?: never, - ): Promise; - async getUserDefaultColumns( - parameters?: Parameters.GetUserDefaultColumns, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/columns', - method: 'GET', - params: { - accountId: parameters?.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If an account ID - * is not passed, the calling user's default columns are set. If no column details are sent, then all default columns - * are removed. - * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/3/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. - * - Permission to access Jira, to set the calling user's columns. - */ - async setUserColumns( - parameters: Parameters.SetUserColumns | undefined, - callback: Callback, - ): Promise; - /** - * Sets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If an account ID - * is not passed, the calling user's default columns are set. If no column details are sent, then all default columns - * are removed. - * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/3/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. - * - Permission to access Jira, to set the calling user's columns. - */ - async setUserColumns(parameters?: Parameters.SetUserColumns, callback?: never): Promise; - async setUserColumns(parameters?: Parameters.SetUserColumns, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/columns', - method: 'PUT', - params: { - accountId: parameters?.accountId, - }, - data: parameters?.columns, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system - * default. If `accountId` is not passed, the calling user's default columns are reset. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. - * - Permission to access Jira, to set the calling user's columns. - */ - async resetUserColumns(parameters: Parameters.ResetUserColumns, callback: Callback): Promise; - /** - * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system - * default. If `accountId` is not passed, the calling user's default columns are reset. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. - * - Permission to access Jira, to set the calling user's columns. - */ - async resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: never): Promise; - async resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/columns', - method: 'DELETE', - params: { - accountId: parameters.accountId, - username: parameters.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these - * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). - */ - async getUserEmail( - parameters: Parameters.GetUserEmail | string, - callback: Callback, - ): Promise; - /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these - * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). - */ - async getUserEmail( - parameters: Parameters.GetUserEmail | string, - callback?: never, - ): Promise; - async getUserEmail( - parameters: Parameters.GetUserEmail | string, - callback?: Callback, - ): Promise { - const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; - - const config: RequestConfig = { - url: '/rest/api/3/user/email', - method: 'GET', - params: { - accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these - * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). - */ - async getUserEmailBulk( - parameters: Parameters.GetUserEmailBulk | string, - callback: Callback, - ): Promise; - /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these - * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). - */ - async getUserEmailBulk( - parameters: Parameters.GetUserEmailBulk | string, - callback?: never, - ): Promise; - async getUserEmailBulk( - parameters: Parameters.GetUserEmailBulk | string, - callback?: Callback, - ): Promise { - const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; - - const config: RequestConfig = { - url: '/rest/api/3/user/email/bulk', - method: 'GET', - params: { - accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the groups to which a user belongs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getUserGroups( - parameters: Parameters.GetUserGroups, - callback: Callback, - ): Promise; - /** - * Returns the groups to which a user belongs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getUserGroups(parameters: Parameters.GetUserGroups, callback?: never): Promise; - async getUserGroups( - parameters: Parameters.GetUserGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/groups', - method: 'GET', - params: { - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsersDefault( - parameters: Parameters.GetAllUsersDefault | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsersDefault(parameters?: Parameters.GetAllUsersDefault, callback?: never): Promise; - async getAllUsersDefault( - parameters?: Parameters.GetAllUsersDefault, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/users', - method: 'GET', - params: { - maxResults: parameters?.maxResults, - startAt: parameters?.startAt, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsers( - parameters: Parameters.GetAllUsers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: never): Promise; - async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/users/search', - method: 'GET', - params: { - maxResults: parameters?.maxResults, - startAt: parameters?.startAt, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/webhooks.mts b/src/version3/webhooks.mts new file mode 100644 index 000000000..42599e7c2 --- /dev/null +++ b/src/version3/webhooks.mts @@ -0,0 +1,221 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Webhooks { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the + * webhooks registered by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async getDynamicWebhooksForApp( + parameters: Parameters.GetDynamicWebhooksForApp | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the + * webhooks registered by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async getDynamicWebhooksForApp( + parameters?: Parameters.GetDynamicWebhooksForApp, + callback?: never, + ): Promise; + async getDynamicWebhooksForApp( + parameters?: Parameters.GetDynamicWebhooksForApp, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/webhook', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Registers webhooks. + * + * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the + * user who registered a dynamic webhook. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async registerDynamicWebhooks( + parameters: Parameters.RegisterDynamicWebhooks, + callback: Callback, + ): Promise; + /** + * Registers webhooks. + * + * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the + * user who registered a dynamic webhook. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async registerDynamicWebhooks( + parameters: Parameters.RegisterDynamicWebhooks, + callback?: never, + ): Promise; + async registerDynamicWebhooks( + parameters: Parameters.RegisterDynamicWebhooks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/webhook', + method: 'POST', + data: { + webhooks: parameters.webhooks, + url: parameters.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps + * are specified, they are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback: Callback): Promise; + /** + * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps + * are specified, they are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback?: never): Promise; + async deleteWebhookById( + parameters: Parameters.DeleteWebhookById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/webhook', + method: 'DELETE', + data: { + webhookIds: parameters.webhookIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of + * retries. + * + * After 72 hours the failure may no longer be returned by this operation. + * + * The oldest failure is returned first. + * + * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on + * the list as the `failedAfter` value or use the URL provided in `next`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. + */ + async getFailedWebhooks( + parameters: Parameters.GetFailedWebhooks | undefined, + callback: Callback, + ): Promise; + /** + * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of + * retries. + * + * After 72 hours the failure may no longer be returned by this operation. + * + * The oldest failure is returned first. + * + * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on + * the list as the `failedAfter` value or use the URL provided in `next`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. + */ + async getFailedWebhooks( + parameters?: Parameters.GetFailedWebhooks, + callback?: never, + ): Promise; + async getFailedWebhooks( + parameters?: Parameters.GetFailedWebhooks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/webhook/failed', + method: 'GET', + params: { + maxResults: parameters?.maxResults, + after: parameters?.after, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to + * keep them alive. + * + * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async refreshWebhooks( + parameters: Parameters.RefreshWebhooks, + callback: Callback, + ): Promise; + /** + * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to + * keep them alive. + * + * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async refreshWebhooks( + parameters: Parameters.RefreshWebhooks, + callback?: never, + ): Promise; + async refreshWebhooks( + parameters: Parameters.RefreshWebhooks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/webhook/refresh', + method: 'PUT', + data: { + webhookIds: parameters.webhookIds, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/webhooks.ts b/src/version3/webhooks.ts deleted file mode 100644 index 62135a5a6..000000000 --- a/src/version3/webhooks.ts +++ /dev/null @@ -1,221 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Webhooks { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the - * webhooks registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async getDynamicWebhooksForApp( - parameters: Parameters.GetDynamicWebhooksForApp | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the - * webhooks registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async getDynamicWebhooksForApp( - parameters?: Parameters.GetDynamicWebhooksForApp, - callback?: never, - ): Promise; - async getDynamicWebhooksForApp( - parameters?: Parameters.GetDynamicWebhooksForApp, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/webhook', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Registers webhooks. - * - * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the - * user who registered a dynamic webhook. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async registerDynamicWebhooks( - parameters: Parameters.RegisterDynamicWebhooks, - callback: Callback, - ): Promise; - /** - * Registers webhooks. - * - * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the - * user who registered a dynamic webhook. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async registerDynamicWebhooks( - parameters: Parameters.RegisterDynamicWebhooks, - callback?: never, - ): Promise; - async registerDynamicWebhooks( - parameters: Parameters.RegisterDynamicWebhooks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/webhook', - method: 'POST', - data: { - webhooks: parameters.webhooks, - url: parameters.url, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps - * are specified, they are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback: Callback): Promise; - /** - * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps - * are specified, they are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback?: never): Promise; - async deleteWebhookById( - parameters: Parameters.DeleteWebhookById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/webhook', - method: 'DELETE', - data: { - webhookIds: parameters.webhookIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of - * retries. - * - * After 72 hours the failure may no longer be returned by this operation. - * - * The oldest failure is returned first. - * - * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on - * the list as the `failedAfter` value or use the URL provided in `next`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. - */ - async getFailedWebhooks( - parameters: Parameters.GetFailedWebhooks | undefined, - callback: Callback, - ): Promise; - /** - * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of - * retries. - * - * After 72 hours the failure may no longer be returned by this operation. - * - * The oldest failure is returned first. - * - * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on - * the list as the `failedAfter` value or use the URL provided in `next`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. - */ - async getFailedWebhooks( - parameters?: Parameters.GetFailedWebhooks, - callback?: never, - ): Promise; - async getFailedWebhooks( - parameters?: Parameters.GetFailedWebhooks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/webhook/failed', - method: 'GET', - params: { - maxResults: parameters?.maxResults, - after: parameters?.after, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to - * keep them alive. - * - * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async refreshWebhooks( - parameters: Parameters.RefreshWebhooks, - callback: Callback, - ): Promise; - /** - * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to - * keep them alive. - * - * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async refreshWebhooks( - parameters: Parameters.RefreshWebhooks, - callback?: never, - ): Promise; - async refreshWebhooks( - parameters: Parameters.RefreshWebhooks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/webhook/refresh', - method: 'PUT', - data: { - webhookIds: parameters.webhookIds, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/workflowSchemeDrafts.mts b/src/version3/workflowSchemeDrafts.mts new file mode 100644 index 000000000..88d8ec6e3 --- /dev/null +++ b/src/version3/workflowSchemeDrafts.mts @@ -0,0 +1,542 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowSchemeDrafts { + constructor(private client: Client) {} + + /** + * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an + * active workflow scheme can only have one draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflowSchemeDraftFromParent( + parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, + callback: Callback, + ): Promise; + /** + * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an + * active workflow scheme can only have one draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflowSchemeDraftFromParent( + parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, + callback?: never, + ): Promise; + async createWorkflowSchemeDraftFromParent( + parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/createdraft`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the draft workflow scheme for an active workflow scheme. Draft workflow schemes allow changes to be made to + * the active workflow schemes: When an active workflow scheme is updated, a draft copy is created. The draft is + * modified, then the changes in the draft are copied back to the active workflow scheme. See [Configuring workflow + * schemes](https://confluence.atlassian.com/x/tohKLg) for more information. Note that: + * + * - Only active workflow schemes can have draft workflow schemes. + * - An active workflow scheme can only have one draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeDraft( + parameters: Parameters.GetWorkflowSchemeDraft | string, + callback: Callback, + ): Promise; + /** + * Returns the draft workflow scheme for an active workflow scheme. Draft workflow schemes allow changes to be made to + * the active workflow schemes: When an active workflow scheme is updated, a draft copy is created. The draft is + * modified, then the changes in the draft are copied back to the active workflow scheme. See [Configuring workflow + * schemes](https://confluence.atlassian.com/x/tohKLg) for more information. Note that: + * + * - Only active workflow schemes can have draft workflow schemes. + * - An active workflow scheme can only have one draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeDraft( + parameters: Parameters.GetWorkflowSchemeDraft | string, + callback?: never, + ): Promise; + async getWorkflowSchemeDraft( + parameters: Parameters.GetWorkflowSchemeDraft | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/draft`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a + * draft is created. Note that an active workflow scheme can only have one draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowSchemeDraft( + parameters: Parameters.UpdateWorkflowSchemeDraft, + callback: Callback, + ): Promise; + /** + * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a + * draft is created. Note that an active workflow scheme can only have one draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowSchemeDraft( + parameters: Parameters.UpdateWorkflowSchemeDraft, + callback?: never, + ): Promise; + async updateWorkflowSchemeDraft( + parameters: Parameters.UpdateWorkflowSchemeDraft, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/draft`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + defaultWorkflow: parameters.defaultWorkflow, + issueTypeMappings: parameters.issueTypeMappings, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeDraft( + parameters: Parameters.DeleteWorkflowSchemeDraft | string, + callback: Callback, + ): Promise; + /** + * Deletes a draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeDraft( + parameters: Parameters.DeleteWorkflowSchemeDraft | string, + callback?: never, + ): Promise; + async deleteWorkflowSchemeDraft( + parameters: Parameters.DeleteWorkflowSchemeDraft | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/draft`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned + * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue + * Types_ listed in its issue types for the workflow scheme in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDraftDefaultWorkflow( + parameters: Parameters.GetDraftDefaultWorkflow | string, + callback: Callback, + ): Promise; + /** + * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned + * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue + * Types_ listed in its issue types for the workflow scheme in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDraftDefaultWorkflow( + parameters: Parameters.GetDraftDefaultWorkflow | string, + callback?: never, + ): Promise; + async getDraftDefaultWorkflow( + parameters: Parameters.GetDraftDefaultWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/draft/default`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default workflow for a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDraftDefaultWorkflow( + parameters: Parameters.UpdateDraftDefaultWorkflow, + callback: Callback, + ): Promise; + /** + * Sets the default workflow for a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDraftDefaultWorkflow( + parameters: Parameters.UpdateDraftDefaultWorkflow, + callback?: never, + ): Promise; + async updateDraftDefaultWorkflow( + parameters: Parameters.UpdateDraftDefaultWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/draft/default`, + method: 'PUT', + data: { + workflow: parameters.workflow, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system + * workflow (the _jira_ workflow). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDraftDefaultWorkflow( + parameters: Parameters.DeleteDraftDefaultWorkflow | string, + callback: Callback, + ): Promise; + /** + * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system + * workflow (the _jira_ workflow). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDraftDefaultWorkflow( + parameters: Parameters.DeleteDraftDefaultWorkflow | string, + callback?: never, + ): Promise; + async deleteDraftDefaultWorkflow( + parameters: Parameters.DeleteDraftDefaultWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/draft/default`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeDraftIssueType( + parameters: Parameters.GetWorkflowSchemeDraftIssueType, + callback: Callback, + ): Promise; + /** + * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeDraftIssueType( + parameters: Parameters.GetWorkflowSchemeDraftIssueType, + callback?: never, + ): Promise; + async getWorkflowSchemeDraftIssueType( + parameters: Parameters.GetWorkflowSchemeDraftIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the workflow for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setWorkflowSchemeDraftIssueType( + parameters: Parameters.SetWorkflowSchemeDraftIssueType, + callback: Callback, + ): Promise; + /** + * Sets the workflow for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setWorkflowSchemeDraftIssueType( + parameters: Parameters.SetWorkflowSchemeDraftIssueType, + callback?: never, + ): Promise; + async setWorkflowSchemeDraftIssueType( + parameters: Parameters.SetWorkflowSchemeDraftIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, + method: 'PUT', + data: parameters.details, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeDraftIssueType( + parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, + callback: Callback, + ): Promise; + /** + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeDraftIssueType( + parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, + callback?: never, + ): Promise; + async deleteWorkflowSchemeDraftIssueType( + parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Publishes a draft workflow scheme. + * + * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues + * with the original workflow status to the new workflow status. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async publishDraftWorkflowScheme( + parameters: Parameters.PublishDraftWorkflowScheme | string, + callback: Callback, + ): Promise; + /** + * Publishes a draft workflow scheme. + * + * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues + * with the original workflow status to the new workflow status. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async publishDraftWorkflowScheme( + parameters: Parameters.PublishDraftWorkflowScheme | string, + callback?: never, + ): Promise; + async publishDraftWorkflowScheme( + parameters: Parameters.PublishDraftWorkflowScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/draft/publish`, + method: 'POST', + params: { + validateOnly: typeof parameters !== 'string' && parameters.validateOnly, + }, + data: { + statusMappings: typeof parameters !== 'string' && parameters.statusMappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the workflow-issue type mappings for a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDraftWorkflow( + parameters: Parameters.GetDraftWorkflow, + callback: Callback, + ): Promise; + /** + * Returns the workflow-issue type mappings for a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDraftWorkflow( + parameters: Parameters.GetDraftWorkflow, + callback?: never, + ): Promise; + async getDraftWorkflow( + parameters: Parameters.GetDraftWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/draft/workflow`, + method: 'GET', + params: { + workflowName: parameters.workflowName, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default + * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDraftWorkflowMapping( + parameters: Parameters.UpdateDraftWorkflowMapping, + callback: Callback, + ): Promise; + /** + * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default + * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDraftWorkflowMapping( + parameters: Parameters.UpdateDraftWorkflowMapping, + callback?: never, + ): Promise; + async updateDraftWorkflowMapping( + parameters: Parameters.UpdateDraftWorkflowMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/draft/workflow`, + method: 'PUT', + params: { + workflowName: parameters.workflowName, + }, + data: { + workflow: parameters.workflow, + issueTypes: parameters.issueTypes, + defaultMapping: parameters.defaultMapping, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDraftWorkflowMapping( + parameters: Parameters.DeleteDraftWorkflowMapping, + callback: Callback, + ): Promise; + /** + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDraftWorkflowMapping( + parameters: Parameters.DeleteDraftWorkflowMapping, + callback?: never, + ): Promise; + async deleteDraftWorkflowMapping( + parameters: Parameters.DeleteDraftWorkflowMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/draft/workflow`, + method: 'DELETE', + params: { + workflowName: parameters.workflowName, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/workflowSchemeDrafts.ts b/src/version3/workflowSchemeDrafts.ts deleted file mode 100644 index 5e603ec80..000000000 --- a/src/version3/workflowSchemeDrafts.ts +++ /dev/null @@ -1,542 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class WorkflowSchemeDrafts { - constructor(private client: Client) {} - - /** - * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an - * active workflow scheme can only have one draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowSchemeDraftFromParent( - parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, - callback: Callback, - ): Promise; - /** - * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an - * active workflow scheme can only have one draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowSchemeDraftFromParent( - parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, - callback?: never, - ): Promise; - async createWorkflowSchemeDraftFromParent( - parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/createdraft`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the draft workflow scheme for an active workflow scheme. Draft workflow schemes allow changes to be made to - * the active workflow schemes: When an active workflow scheme is updated, a draft copy is created. The draft is - * modified, then the changes in the draft are copied back to the active workflow scheme. See [Configuring workflow - * schemes](https://confluence.atlassian.com/x/tohKLg) for more information. Note that: - * - * - Only active workflow schemes can have draft workflow schemes. - * - An active workflow scheme can only have one draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeDraft( - parameters: Parameters.GetWorkflowSchemeDraft | string, - callback: Callback, - ): Promise; - /** - * Returns the draft workflow scheme for an active workflow scheme. Draft workflow schemes allow changes to be made to - * the active workflow schemes: When an active workflow scheme is updated, a draft copy is created. The draft is - * modified, then the changes in the draft are copied back to the active workflow scheme. See [Configuring workflow - * schemes](https://confluence.atlassian.com/x/tohKLg) for more information. Note that: - * - * - Only active workflow schemes can have draft workflow schemes. - * - An active workflow scheme can only have one draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeDraft( - parameters: Parameters.GetWorkflowSchemeDraft | string, - callback?: never, - ): Promise; - async getWorkflowSchemeDraft( - parameters: Parameters.GetWorkflowSchemeDraft | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/draft`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a - * draft is created. Note that an active workflow scheme can only have one draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowSchemeDraft( - parameters: Parameters.UpdateWorkflowSchemeDraft, - callback: Callback, - ): Promise; - /** - * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a - * draft is created. Note that an active workflow scheme can only have one draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowSchemeDraft( - parameters: Parameters.UpdateWorkflowSchemeDraft, - callback?: never, - ): Promise; - async updateWorkflowSchemeDraft( - parameters: Parameters.UpdateWorkflowSchemeDraft, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/draft`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - defaultWorkflow: parameters.defaultWorkflow, - issueTypeMappings: parameters.issueTypeMappings, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeDraft( - parameters: Parameters.DeleteWorkflowSchemeDraft | string, - callback: Callback, - ): Promise; - /** - * Deletes a draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeDraft( - parameters: Parameters.DeleteWorkflowSchemeDraft | string, - callback?: never, - ): Promise; - async deleteWorkflowSchemeDraft( - parameters: Parameters.DeleteWorkflowSchemeDraft | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/draft`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned - * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue - * Types_ listed in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftDefaultWorkflow( - parameters: Parameters.GetDraftDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned - * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue - * Types_ listed in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftDefaultWorkflow( - parameters: Parameters.GetDraftDefaultWorkflow | string, - callback?: never, - ): Promise; - async getDraftDefaultWorkflow( - parameters: Parameters.GetDraftDefaultWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/draft/default`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default workflow for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftDefaultWorkflow( - parameters: Parameters.UpdateDraftDefaultWorkflow, - callback: Callback, - ): Promise; - /** - * Sets the default workflow for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftDefaultWorkflow( - parameters: Parameters.UpdateDraftDefaultWorkflow, - callback?: never, - ): Promise; - async updateDraftDefaultWorkflow( - parameters: Parameters.UpdateDraftDefaultWorkflow, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/draft/default`, - method: 'PUT', - data: { - workflow: parameters.workflow, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system - * workflow (the _jira_ workflow). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftDefaultWorkflow( - parameters: Parameters.DeleteDraftDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system - * workflow (the _jira_ workflow). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftDefaultWorkflow( - parameters: Parameters.DeleteDraftDefaultWorkflow | string, - callback?: never, - ): Promise; - async deleteDraftDefaultWorkflow( - parameters: Parameters.DeleteDraftDefaultWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/draft/default`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeDraftIssueType( - parameters: Parameters.GetWorkflowSchemeDraftIssueType, - callback: Callback, - ): Promise; - /** - * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeDraftIssueType( - parameters: Parameters.GetWorkflowSchemeDraftIssueType, - callback?: never, - ): Promise; - async getWorkflowSchemeDraftIssueType( - parameters: Parameters.GetWorkflowSchemeDraftIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the workflow for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeDraftIssueType( - parameters: Parameters.SetWorkflowSchemeDraftIssueType, - callback: Callback, - ): Promise; - /** - * Sets the workflow for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeDraftIssueType( - parameters: Parameters.SetWorkflowSchemeDraftIssueType, - callback?: never, - ): Promise; - async setWorkflowSchemeDraftIssueType( - parameters: Parameters.SetWorkflowSchemeDraftIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, - method: 'PUT', - data: parameters.details, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeDraftIssueType( - parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, - callback: Callback, - ): Promise; - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeDraftIssueType( - parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, - callback?: never, - ): Promise; - async deleteWorkflowSchemeDraftIssueType( - parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Publishes a draft workflow scheme. - * - * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues - * with the original workflow status to the new workflow status. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async publishDraftWorkflowScheme( - parameters: Parameters.PublishDraftWorkflowScheme | string, - callback: Callback, - ): Promise; - /** - * Publishes a draft workflow scheme. - * - * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues - * with the original workflow status to the new workflow status. - * - * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the - * `location` link in the response to determine the status of the task and use [Get - * task](#api-rest-api-3-task-taskId-get) to obtain updates. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async publishDraftWorkflowScheme( - parameters: Parameters.PublishDraftWorkflowScheme | string, - callback?: never, - ): Promise; - async publishDraftWorkflowScheme( - parameters: Parameters.PublishDraftWorkflowScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/draft/publish`, - method: 'POST', - params: { - validateOnly: typeof parameters !== 'string' && parameters.validateOnly, - }, - data: { - statusMappings: typeof parameters !== 'string' && parameters.statusMappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the workflow-issue type mappings for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftWorkflow( - parameters: Parameters.GetDraftWorkflow, - callback: Callback, - ): Promise; - /** - * Returns the workflow-issue type mappings for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftWorkflow( - parameters: Parameters.GetDraftWorkflow, - callback?: never, - ): Promise; - async getDraftWorkflow( - parameters: Parameters.GetDraftWorkflow, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/draft/workflow`, - method: 'GET', - params: { - workflowName: parameters.workflowName, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default - * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftWorkflowMapping( - parameters: Parameters.UpdateDraftWorkflowMapping, - callback: Callback, - ): Promise; - /** - * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default - * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftWorkflowMapping( - parameters: Parameters.UpdateDraftWorkflowMapping, - callback?: never, - ): Promise; - async updateDraftWorkflowMapping( - parameters: Parameters.UpdateDraftWorkflowMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/draft/workflow`, - method: 'PUT', - params: { - workflowName: parameters.workflowName, - }, - data: { - workflow: parameters.workflow, - issueTypes: parameters.issueTypes, - defaultMapping: parameters.defaultMapping, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftWorkflowMapping( - parameters: Parameters.DeleteDraftWorkflowMapping, - callback: Callback, - ): Promise; - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftWorkflowMapping( - parameters: Parameters.DeleteDraftWorkflowMapping, - callback?: never, - ): Promise; - async deleteDraftWorkflowMapping( - parameters: Parameters.DeleteDraftWorkflowMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/draft/workflow`, - method: 'DELETE', - params: { - workflowName: parameters.workflowName, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/workflowSchemeProjectAssociations.mts b/src/version3/workflowSchemeProjectAssociations.mts new file mode 100644 index 000000000..63fa4a4b8 --- /dev/null +++ b/src/version3/workflowSchemeProjectAssociations.mts @@ -0,0 +1,91 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowSchemeProjectAssociations { + constructor(private client: Client) {} + + /** + * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a + * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are + * ignored and no errors are returned. + * + * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the + * `Default Workflow Scheme` is stored means it has no ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeProjectAssociations( + parameters: Parameters.GetWorkflowSchemeProjectAssociations, + callback: Callback, + ): Promise; + /** + * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a + * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are + * ignored and no errors are returned. + * + * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the + * `Default Workflow Scheme` is stored means it has no ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeProjectAssociations( + parameters: Parameters.GetWorkflowSchemeProjectAssociations, + callback?: never, + ): Promise; + async getWorkflowSchemeProjectAssociations( + parameters: Parameters.GetWorkflowSchemeProjectAssociations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflowscheme/project', + method: 'GET', + params: { + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. + * + * Workflow schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignSchemeToProject( + parameters: Parameters.AssignSchemeToProject | undefined, + callback: Callback, + ): Promise; + /** + * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. + * + * Workflow schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignSchemeToProject(parameters?: Parameters.AssignSchemeToProject, callback?: never): Promise; + async assignSchemeToProject( + parameters?: Parameters.AssignSchemeToProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflowscheme/project', + method: 'PUT', + data: { + workflowSchemeId: parameters?.workflowSchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/workflowSchemeProjectAssociations.ts b/src/version3/workflowSchemeProjectAssociations.ts deleted file mode 100644 index 1fdd9eada..000000000 --- a/src/version3/workflowSchemeProjectAssociations.ts +++ /dev/null @@ -1,91 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class WorkflowSchemeProjectAssociations { - constructor(private client: Client) {} - - /** - * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a - * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are - * ignored and no errors are returned. - * - * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the - * `Default Workflow Scheme` is stored means it has no ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeProjectAssociations( - parameters: Parameters.GetWorkflowSchemeProjectAssociations, - callback: Callback, - ): Promise; - /** - * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a - * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are - * ignored and no errors are returned. - * - * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the - * `Default Workflow Scheme` is stored means it has no ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeProjectAssociations( - parameters: Parameters.GetWorkflowSchemeProjectAssociations, - callback?: never, - ): Promise; - async getWorkflowSchemeProjectAssociations( - parameters: Parameters.GetWorkflowSchemeProjectAssociations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflowscheme/project', - method: 'GET', - params: { - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. - * - * Workflow schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignSchemeToProject( - parameters: Parameters.AssignSchemeToProject | undefined, - callback: Callback, - ): Promise; - /** - * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. - * - * Workflow schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignSchemeToProject(parameters?: Parameters.AssignSchemeToProject, callback?: never): Promise; - async assignSchemeToProject( - parameters?: Parameters.AssignSchemeToProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflowscheme/project', - method: 'PUT', - data: { - workflowSchemeId: parameters?.workflowSchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/workflowSchemes.mts b/src/version3/workflowSchemes.mts new file mode 100644 index 000000000..b067f50b1 --- /dev/null +++ b/src/version3/workflowSchemes.mts @@ -0,0 +1,596 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * workflow schemes, not including draft workflow schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllWorkflowSchemes( + parameters: Parameters.GetAllWorkflowSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * workflow schemes, not including draft workflow schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllWorkflowSchemes( + parameters?: Parameters.GetAllWorkflowSchemes, + callback?: never, + ): Promise; + async getAllWorkflowSchemes( + parameters?: Parameters.GetAllWorkflowSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflowscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflowScheme( + parameters: Parameters.CreateWorkflowScheme, + callback: Callback, + ): Promise; + /** + * Creates a workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflowScheme( + parameters: Parameters.CreateWorkflowScheme, + callback?: never, + ): Promise; + async createWorkflowScheme( + parameters: Parameters.CreateWorkflowScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflowscheme', + method: 'POST', + data: { + id: parameters.id, + name: parameters.name, + description: parameters.description, + defaultWorkflow: parameters.defaultWorkflow, + issueTypeMappings: parameters.issueTypeMappings, + originalDefaultWorkflow: parameters.originalDefaultWorkflow, + originalIssueTypeMappings: parameters.originalIssueTypeMappings, + draft: parameters.draft, + lastModifiedUser: parameters.lastModifiedUser, + lastModified: parameters.lastModified, + self: parameters.self, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + issueTypes: parameters.issueTypes, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowScheme( + parameters: Parameters.GetWorkflowScheme | string, + callback: Callback, + ): Promise; + /** + * Returns a workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowScheme( + parameters: Parameters.GetWorkflowScheme | string, + callback?: never, + ): Promise; + async getWorkflowScheme( + parameters: Parameters.GetWorkflowScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}`, + method: 'GET', + params: { + returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a workflow scheme, including the name, default workflow, issue type to project mappings, and more. If the + * workflow scheme is active (that is, being used by at least one project), then a draft workflow scheme is created or + * updated instead, provided that `updateDraftIfNeeded` is set to `true`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowScheme( + parameters: Parameters.UpdateWorkflowScheme, + callback: Callback, + ): Promise; + /** + * Updates a workflow scheme, including the name, default workflow, issue type to project mappings, and more. If the + * workflow scheme is active (that is, being used by at least one project), then a draft workflow scheme is created or + * updated instead, provided that `updateDraftIfNeeded` is set to `true`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowScheme( + parameters: Parameters.UpdateWorkflowScheme, + callback?: never, + ): Promise; + async updateWorkflowScheme( + parameters: Parameters.UpdateWorkflowScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + defaultWorkflow: parameters.defaultWorkflow, + issueTypeMappings: parameters.issueTypeMappings, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at + * least one project). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowScheme( + parameters: Parameters.DeleteWorkflowScheme | string, + callback: Callback, + ): Promise; + /** + * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at + * least one project). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowScheme( + parameters: Parameters.DeleteWorkflowScheme | string, + callback?: never, + ): Promise; + async deleteWorkflowScheme( + parameters: Parameters.DeleteWorkflowScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue + * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed + * in its issue types for the workflow scheme in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultWorkflow( + parameters: Parameters.GetDefaultWorkflow | string, + callback: Callback, + ): Promise; + /** + * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue + * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed + * in its issue types for the workflow scheme in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultWorkflow( + parameters: Parameters.GetDefaultWorkflow | string, + callback?: never, + ): Promise; + async getDefaultWorkflow( + parameters: Parameters.GetDefaultWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/default`, + method: 'GET', + params: { + returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default workflow for a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The + * draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultWorkflow( + parameters: Parameters.UpdateDefaultWorkflow, + callback: Callback, + ): Promise; + /** + * Sets the default workflow for a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The + * draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultWorkflow( + parameters: Parameters.UpdateDefaultWorkflow, + callback?: never, + ): Promise; + async updateDefaultWorkflow( + parameters: Parameters.UpdateDefaultWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/default`, + method: 'PUT', + data: { + workflow: parameters.workflow, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow + * (the _jira_ workflow). + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme + * can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDefaultWorkflow( + parameters: Parameters.DeleteDefaultWorkflow | string, + callback: Callback, + ): Promise; + /** + * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow + * (the _jira_ workflow). + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme + * can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDefaultWorkflow( + parameters: Parameters.DeleteDefaultWorkflow | string, + callback?: never, + ): Promise; + async deleteDefaultWorkflow( + parameters: Parameters.DeleteDefaultWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/default`, + method: 'DELETE', + params: { + updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the issue type-workflow mapping for an issue type in a workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeIssueType( + parameters: Parameters.GetWorkflowSchemeIssueType, + callback: Callback, + ): Promise; + /** + * Returns the issue type-workflow mapping for an issue type in a workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeIssueType( + parameters: Parameters.GetWorkflowSchemeIssueType, + callback?: never, + ): Promise; + async getWorkflowSchemeIssueType( + parameters: Parameters.GetWorkflowSchemeIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, + method: 'GET', + params: { + returnDraftIfExists: parameters.returnDraftIfExists, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the workflow for an issue type in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow + * mapping. The draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setWorkflowSchemeIssueType( + parameters: Parameters.SetWorkflowSchemeIssueType, + callback: Callback, + ): Promise; + /** + * Sets the workflow for an issue type in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow + * mapping. The draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setWorkflowSchemeIssueType( + parameters: Parameters.SetWorkflowSchemeIssueType, + callback?: never, + ): Promise; + async setWorkflowSchemeIssueType( + parameters: Parameters.SetWorkflowSchemeIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, + method: 'PUT', + data: parameters.details, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft + * workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeIssueType( + parameters: Parameters.DeleteWorkflowSchemeIssueType, + callback: Callback, + ): Promise; + /** + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft + * workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeIssueType( + parameters: Parameters.DeleteWorkflowSchemeIssueType, + callback?: never, + ): Promise; + async deleteWorkflowSchemeIssueType( + parameters: Parameters.DeleteWorkflowSchemeIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, + method: 'DELETE', + params: { + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the workflow-issue type mappings for a workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflow( + parameters: Parameters.GetWorkflow | string, + callback: Callback, + ): Promise; + /** + * Returns the workflow-issue type mappings for a workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflow( + parameters: Parameters.GetWorkflow | string, + callback?: never, + ): Promise; + async getWorkflow( + parameters: Parameters.GetWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/workflow`, + method: 'GET', + params: { + workflowName: typeof parameters !== 'string' && parameters.workflowName, + returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for + * the workflow scheme. Unmapped issues types are mapped to the default workflow. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types + * mappings. The draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowMapping( + parameters: Parameters.UpdateWorkflowMapping, + callback: Callback, + ): Promise; + /** + * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for + * the workflow scheme. Unmapped issues types are mapped to the default workflow. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types + * mappings. The draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowMapping( + parameters: Parameters.UpdateWorkflowMapping, + callback?: never, + ): Promise; + async updateWorkflowMapping( + parameters: Parameters.UpdateWorkflowMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/workflow`, + method: 'PUT', + params: { + workflowName: parameters.workflowName, + }, + data: { + workflow: parameters.workflow, + issueTypes: parameters.issueTypes, + defaultMapping: parameters.defaultMapping, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft + * workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowMapping( + parameters: Parameters.DeleteWorkflowMapping | string, + callback: Callback, + ): Promise; + /** + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft + * workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowMapping( + parameters: Parameters.DeleteWorkflowMapping | string, + callback?: never, + ): Promise; + async deleteWorkflowMapping( + parameters: Parameters.DeleteWorkflowMapping | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/workflow`, + method: 'DELETE', + params: { + workflowName: typeof parameters !== 'string' && parameters.workflowName, + updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/workflowSchemes.ts b/src/version3/workflowSchemes.ts deleted file mode 100644 index a346b4893..000000000 --- a/src/version3/workflowSchemes.ts +++ /dev/null @@ -1,596 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class WorkflowSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * workflow schemes, not including draft workflow schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllWorkflowSchemes( - parameters: Parameters.GetAllWorkflowSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * workflow schemes, not including draft workflow schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllWorkflowSchemes( - parameters?: Parameters.GetAllWorkflowSchemes, - callback?: never, - ): Promise; - async getAllWorkflowSchemes( - parameters?: Parameters.GetAllWorkflowSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflowscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowScheme( - parameters: Parameters.CreateWorkflowScheme, - callback: Callback, - ): Promise; - /** - * Creates a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowScheme( - parameters: Parameters.CreateWorkflowScheme, - callback?: never, - ): Promise; - async createWorkflowScheme( - parameters: Parameters.CreateWorkflowScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflowscheme', - method: 'POST', - data: { - id: parameters.id, - name: parameters.name, - description: parameters.description, - defaultWorkflow: parameters.defaultWorkflow, - issueTypeMappings: parameters.issueTypeMappings, - originalDefaultWorkflow: parameters.originalDefaultWorkflow, - originalIssueTypeMappings: parameters.originalIssueTypeMappings, - draft: parameters.draft, - lastModifiedUser: parameters.lastModifiedUser, - lastModified: parameters.lastModified, - self: parameters.self, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - issueTypes: parameters.issueTypes, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowScheme( - parameters: Parameters.GetWorkflowScheme | string, - callback: Callback, - ): Promise; - /** - * Returns a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowScheme( - parameters: Parameters.GetWorkflowScheme | string, - callback?: never, - ): Promise; - async getWorkflowScheme( - parameters: Parameters.GetWorkflowScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}`, - method: 'GET', - params: { - returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a workflow scheme, including the name, default workflow, issue type to project mappings, and more. If the - * workflow scheme is active (that is, being used by at least one project), then a draft workflow scheme is created or - * updated instead, provided that `updateDraftIfNeeded` is set to `true`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowScheme( - parameters: Parameters.UpdateWorkflowScheme, - callback: Callback, - ): Promise; - /** - * Updates a workflow scheme, including the name, default workflow, issue type to project mappings, and more. If the - * workflow scheme is active (that is, being used by at least one project), then a draft workflow scheme is created or - * updated instead, provided that `updateDraftIfNeeded` is set to `true`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowScheme( - parameters: Parameters.UpdateWorkflowScheme, - callback?: never, - ): Promise; - async updateWorkflowScheme( - parameters: Parameters.UpdateWorkflowScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - defaultWorkflow: parameters.defaultWorkflow, - issueTypeMappings: parameters.issueTypeMappings, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at - * least one project). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowScheme( - parameters: Parameters.DeleteWorkflowScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at - * least one project). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowScheme( - parameters: Parameters.DeleteWorkflowScheme | string, - callback?: never, - ): Promise; - async deleteWorkflowScheme( - parameters: Parameters.DeleteWorkflowScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue - * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed - * in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultWorkflow( - parameters: Parameters.GetDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue - * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed - * in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultWorkflow( - parameters: Parameters.GetDefaultWorkflow | string, - callback?: never, - ): Promise; - async getDefaultWorkflow( - parameters: Parameters.GetDefaultWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/default`, - method: 'GET', - params: { - returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default workflow for a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The - * draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultWorkflow( - parameters: Parameters.UpdateDefaultWorkflow, - callback: Callback, - ): Promise; - /** - * Sets the default workflow for a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The - * draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultWorkflow( - parameters: Parameters.UpdateDefaultWorkflow, - callback?: never, - ): Promise; - async updateDefaultWorkflow( - parameters: Parameters.UpdateDefaultWorkflow, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/default`, - method: 'PUT', - data: { - workflow: parameters.workflow, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow - * (the _jira_ workflow). - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme - * can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDefaultWorkflow( - parameters: Parameters.DeleteDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow - * (the _jira_ workflow). - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme - * can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDefaultWorkflow( - parameters: Parameters.DeleteDefaultWorkflow | string, - callback?: never, - ): Promise; - async deleteDefaultWorkflow( - parameters: Parameters.DeleteDefaultWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/default`, - method: 'DELETE', - params: { - updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the issue type-workflow mapping for an issue type in a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeIssueType( - parameters: Parameters.GetWorkflowSchemeIssueType, - callback: Callback, - ): Promise; - /** - * Returns the issue type-workflow mapping for an issue type in a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeIssueType( - parameters: Parameters.GetWorkflowSchemeIssueType, - callback?: never, - ): Promise; - async getWorkflowSchemeIssueType( - parameters: Parameters.GetWorkflowSchemeIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, - method: 'GET', - params: { - returnDraftIfExists: parameters.returnDraftIfExists, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the workflow for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow - * mapping. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeIssueType( - parameters: Parameters.SetWorkflowSchemeIssueType, - callback: Callback, - ): Promise; - /** - * Sets the workflow for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow - * mapping. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeIssueType( - parameters: Parameters.SetWorkflowSchemeIssueType, - callback?: never, - ): Promise; - async setWorkflowSchemeIssueType( - parameters: Parameters.SetWorkflowSchemeIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, - method: 'PUT', - data: parameters.details, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeIssueType( - parameters: Parameters.DeleteWorkflowSchemeIssueType, - callback: Callback, - ): Promise; - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeIssueType( - parameters: Parameters.DeleteWorkflowSchemeIssueType, - callback?: never, - ): Promise; - async deleteWorkflowSchemeIssueType( - parameters: Parameters.DeleteWorkflowSchemeIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, - method: 'DELETE', - params: { - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the workflow-issue type mappings for a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflow( - parameters: Parameters.GetWorkflow | string, - callback: Callback, - ): Promise; - /** - * Returns the workflow-issue type mappings for a workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflow( - parameters: Parameters.GetWorkflow | string, - callback?: never, - ): Promise; - async getWorkflow( - parameters: Parameters.GetWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/workflow`, - method: 'GET', - params: { - workflowName: typeof parameters !== 'string' && parameters.workflowName, - returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for - * the workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types - * mappings. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowMapping( - parameters: Parameters.UpdateWorkflowMapping, - callback: Callback, - ): Promise; - /** - * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for - * the workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types - * mappings. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowMapping( - parameters: Parameters.UpdateWorkflowMapping, - callback?: never, - ): Promise; - async updateWorkflowMapping( - parameters: Parameters.UpdateWorkflowMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/workflow`, - method: 'PUT', - params: { - workflowName: parameters.workflowName, - }, - data: { - workflow: parameters.workflow, - issueTypes: parameters.issueTypes, - defaultMapping: parameters.defaultMapping, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowMapping( - parameters: Parameters.DeleteWorkflowMapping | string, - callback: Callback, - ): Promise; - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowMapping( - parameters: Parameters.DeleteWorkflowMapping | string, - callback?: never, - ): Promise; - async deleteWorkflowMapping( - parameters: Parameters.DeleteWorkflowMapping | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/workflow`, - method: 'DELETE', - params: { - workflowName: typeof parameters !== 'string' && parameters.workflowName, - updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/workflowStatusCategories.mts b/src/version3/workflowStatusCategories.mts new file mode 100644 index 000000000..a0eb01c9f --- /dev/null +++ b/src/version3/workflowStatusCategories.mts @@ -0,0 +1,68 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowStatusCategories { + constructor(private client: Client) {} + + /** + * Returns a list of all status categories. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getStatusCategories(callback: Callback): Promise; + /** + * Returns a list of all status categories. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getStatusCategories(callback?: never): Promise; + async getStatusCategories(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/statuscategory', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a status category. Status categories provided a mechanism for categorizing + * [statuses](#api-rest-api-3-status-idOrName-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getStatusCategory( + parameters: Parameters.GetStatusCategory | string, + callback: Callback, + ): Promise; + /** + * Returns a status category. Status categories provided a mechanism for categorizing + * [statuses](#api-rest-api-3-status-idOrName-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getStatusCategory( + parameters: Parameters.GetStatusCategory | string, + callback?: never, + ): Promise; + async getStatusCategory( + parameters: Parameters.GetStatusCategory | string, + callback?: Callback, + ): Promise { + const idOrKey = typeof parameters === 'string' ? parameters : parameters.idOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/statuscategory/${idOrKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/workflowStatusCategories.ts b/src/version3/workflowStatusCategories.ts deleted file mode 100644 index 2be195437..000000000 --- a/src/version3/workflowStatusCategories.ts +++ /dev/null @@ -1,68 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class WorkflowStatusCategories { - constructor(private client: Client) {} - - /** - * Returns a list of all status categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategories(callback: Callback): Promise; - /** - * Returns a list of all status categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategories(callback?: never): Promise; - async getStatusCategories(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/statuscategory', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a status category. Status categories provided a mechanism for categorizing - * [statuses](#api-rest-api-3-status-idOrName-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategory( - parameters: Parameters.GetStatusCategory | string, - callback: Callback, - ): Promise; - /** - * Returns a status category. Status categories provided a mechanism for categorizing - * [statuses](#api-rest-api-3-status-idOrName-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategory( - parameters: Parameters.GetStatusCategory | string, - callback?: never, - ): Promise; - async getStatusCategory( - parameters: Parameters.GetStatusCategory | string, - callback?: Callback, - ): Promise { - const idOrKey = typeof parameters === 'string' ? parameters : parameters.idOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/statuscategory/${idOrKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/workflowStatuses.mts b/src/version3/workflowStatuses.mts new file mode 100644 index 000000000..94c8bee6a --- /dev/null +++ b/src/version3/workflowStatuses.mts @@ -0,0 +1,73 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowStatuses { + constructor(private client: Client) {} + + /** + * Returns a list of all statuses associated with active workflows. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getStatuses(callback: Callback): Promise; + /** + * Returns a list of all statuses associated with active workflows. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getStatuses(callback?: never): Promise; + async getStatuses(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/status', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a status. The status must be associated with an active workflow to be returned. + * + * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the + * status by its ID may be preferable. + * + * This operation can be accessed anonymously. + * + * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: None. + */ + async getStatus( + parameters: Parameters.GetStatus | string, + callback: Callback, + ): Promise; + /** + * Returns a status. The status must be associated with an active workflow to be returned. + * + * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the + * status by its ID may be preferable. + * + * This operation can be accessed anonymously. + * + * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: None. + */ + async getStatus(parameters: Parameters.GetStatus | string, callback?: never): Promise; + async getStatus( + parameters: Parameters.GetStatus | string, + callback?: Callback, + ): Promise { + const idOrName = typeof parameters === 'string' ? parameters : parameters.idOrName; + + const config: RequestConfig = { + url: `/rest/api/3/status/${idOrName}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/workflowStatuses.ts b/src/version3/workflowStatuses.ts deleted file mode 100644 index 163a711d0..000000000 --- a/src/version3/workflowStatuses.ts +++ /dev/null @@ -1,73 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class WorkflowStatuses { - constructor(private client: Client) {} - - /** - * Returns a list of all statuses associated with active workflows. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getStatuses(callback: Callback): Promise; - /** - * Returns a list of all statuses associated with active workflows. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getStatuses(callback?: never): Promise; - async getStatuses(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/status', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a status. The status must be associated with an active workflow to be returned. - * - * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the - * status by its ID may be preferable. - * - * This operation can be accessed anonymously. - * - * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: None. - */ - async getStatus( - parameters: Parameters.GetStatus | string, - callback: Callback, - ): Promise; - /** - * Returns a status. The status must be associated with an active workflow to be returned. - * - * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the - * status by its ID may be preferable. - * - * This operation can be accessed anonymously. - * - * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: None. - */ - async getStatus(parameters: Parameters.GetStatus | string, callback?: never): Promise; - async getStatus( - parameters: Parameters.GetStatus | string, - callback?: Callback, - ): Promise { - const idOrName = typeof parameters === 'string' ? parameters : parameters.idOrName; - - const config: RequestConfig = { - url: `/rest/api/3/status/${idOrName}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/workflowTransitionProperties.mts b/src/version3/workflowTransitionProperties.mts new file mode 100644 index 000000000..92dd5b474 --- /dev/null +++ b/src/version3/workflowTransitionProperties.mts @@ -0,0 +1,198 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowTransitionProperties { + constructor(private client: Client) {} + + /** + * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowTransitionProperties( + parameters: Parameters.GetWorkflowTransitionProperties, + callback: Callback, + ): Promise; + /** + * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowTransitionProperties( + parameters: Parameters.GetWorkflowTransitionProperties, + callback?: never, + ): Promise; + async getWorkflowTransitionProperties( + parameters: Parameters.GetWorkflowTransitionProperties, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflow/transitions/${parameters.transitionId}/properties`, + method: 'GET', + params: { + includeReservedKeys: parameters.includeReservedKeys, + key: parameters.key, + workflowName: parameters.workflowName, + workflowMode: parameters.workflowMode, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. + * For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflowTransitionProperty( + parameters: Parameters.CreateWorkflowTransitionProperty, + callback: Callback, + ): Promise; + /** + * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. + * For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflowTransitionProperty( + parameters: Parameters.CreateWorkflowTransitionProperty, + callback?: never, + ): Promise; + async createWorkflowTransitionProperty( + parameters: Parameters.CreateWorkflowTransitionProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflow/transitions/${parameters.transitionId}/properties`, + method: 'POST', + params: { + key: parameters.key, + workflowName: parameters.workflowName, + workflowMode: parameters.workflowMode, + }, + data: { + ...parameters, + transitionId: undefined, + key: undefined, + workflowName: undefined, + workflowMode: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a workflow transition by changing the property value. Trying to update a property that does not exist + * results in a new property being added to the transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowTransitionProperty( + parameters: Parameters.UpdateWorkflowTransitionProperty, + callback: Callback, + ): Promise; + /** + * Updates a workflow transition by changing the property value. Trying to update a property that does not exist + * results in a new property being added to the transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowTransitionProperty( + parameters: Parameters.UpdateWorkflowTransitionProperty, + callback?: never, + ): Promise; + async updateWorkflowTransitionProperty( + parameters: Parameters.UpdateWorkflowTransitionProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflow/transitions/${parameters.transitionId}/properties`, + method: 'PUT', + params: { + key: parameters.key, + workflowName: parameters.workflowName, + workflowMode: parameters.workflowMode, + }, + data: { + ...parameters, + transitionId: undefined, + key: undefined, + workflowName: undefined, + workflowMode: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowTransitionProperty( + parameters: Parameters.DeleteWorkflowTransitionProperty, + callback: Callback, + ): Promise; + /** + * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowTransitionProperty( + parameters: Parameters.DeleteWorkflowTransitionProperty, + callback?: never, + ): Promise; + async deleteWorkflowTransitionProperty( + parameters: Parameters.DeleteWorkflowTransitionProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflow/transitions/${parameters.transitionId}/properties`, + method: 'DELETE', + params: { + key: parameters.key, + workflowName: parameters.workflowName, + workflowMode: parameters.workflowMode, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/workflowTransitionProperties.ts b/src/version3/workflowTransitionProperties.ts deleted file mode 100644 index d4a33caec..000000000 --- a/src/version3/workflowTransitionProperties.ts +++ /dev/null @@ -1,198 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class WorkflowTransitionProperties { - constructor(private client: Client) {} - - /** - * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowTransitionProperties( - parameters: Parameters.GetWorkflowTransitionProperties, - callback: Callback, - ): Promise; - /** - * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowTransitionProperties( - parameters: Parameters.GetWorkflowTransitionProperties, - callback?: never, - ): Promise; - async getWorkflowTransitionProperties( - parameters: Parameters.GetWorkflowTransitionProperties, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflow/transitions/${parameters.transitionId}/properties`, - method: 'GET', - params: { - includeReservedKeys: parameters.includeReservedKeys, - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. - * For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowTransitionProperty( - parameters: Parameters.CreateWorkflowTransitionProperty, - callback: Callback, - ): Promise; - /** - * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. - * For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowTransitionProperty( - parameters: Parameters.CreateWorkflowTransitionProperty, - callback?: never, - ): Promise; - async createWorkflowTransitionProperty( - parameters: Parameters.CreateWorkflowTransitionProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflow/transitions/${parameters.transitionId}/properties`, - method: 'POST', - params: { - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - data: { - ...parameters, - transitionId: undefined, - key: undefined, - workflowName: undefined, - workflowMode: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a workflow transition by changing the property value. Trying to update a property that does not exist - * results in a new property being added to the transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowTransitionProperty( - parameters: Parameters.UpdateWorkflowTransitionProperty, - callback: Callback, - ): Promise; - /** - * Updates a workflow transition by changing the property value. Trying to update a property that does not exist - * results in a new property being added to the transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowTransitionProperty( - parameters: Parameters.UpdateWorkflowTransitionProperty, - callback?: never, - ): Promise; - async updateWorkflowTransitionProperty( - parameters: Parameters.UpdateWorkflowTransitionProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflow/transitions/${parameters.transitionId}/properties`, - method: 'PUT', - params: { - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - data: { - ...parameters, - transitionId: undefined, - key: undefined, - workflowName: undefined, - workflowMode: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowTransitionProperty( - parameters: Parameters.DeleteWorkflowTransitionProperty, - callback: Callback, - ): Promise; - /** - * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowTransitionProperty( - parameters: Parameters.DeleteWorkflowTransitionProperty, - callback?: never, - ): Promise; - async deleteWorkflowTransitionProperty( - parameters: Parameters.DeleteWorkflowTransitionProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflow/transitions/${parameters.transitionId}/properties`, - method: 'DELETE', - params: { - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/workflowTransitionRules.mts b/src/version3/workflowTransitionRules.mts new file mode 100644 index 000000000..9bf5c4c11 --- /dev/null +++ b/src/version3/workflowTransitionRules.mts @@ -0,0 +1,189 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowTransitionRules { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition + * rules: + * + * - Of one or more transition rule types, such as [workflow post + * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). + * - Matching one or more transition rule keys. + * + * Only workflows containing transition rules created by the calling + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app are returned. + * + * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be + * ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. + */ + async getWorkflowTransitionRuleConfigurations( + parameters: Parameters.GetWorkflowTransitionRuleConfigurations, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition + * rules: + * + * - Of one or more transition rule types, such as [workflow post + * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). + * - Matching one or more transition rule keys. + * + * Only workflows containing transition rules created by the calling + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app are returned. + * + * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be + * ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. + */ + async getWorkflowTransitionRuleConfigurations( + parameters: Parameters.GetWorkflowTransitionRuleConfigurations, + callback?: never, + ): Promise; + async getWorkflowTransitionRuleConfigurations( + parameters: Parameters.GetWorkflowTransitionRuleConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflow/rule/config', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + types: parameters.types, + keys: parameters.keys, + workflowNames: parameters.workflowNames, + withTags: parameters.withTags, + draft: parameters.draft, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates configuration of workflow transition rules. The following rule types are supported: + * + * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) + * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) + * + * Only rules created by the calling Connect app can be updated. + * + * To assist with app migration, this operation can be used to: + * + * - Disable a rule. + * - Add a `tag`. Use this to filter rules in the [Get workflow transition rule + * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). + * + * Rules are enabled if the `disabled` parameter is not provided. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can use this operation. + */ + async updateWorkflowTransitionRuleConfigurations( + parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, + callback: Callback, + ): Promise; + /** + * Updates configuration of workflow transition rules. The following rule types are supported: + * + * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) + * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) + * + * Only rules created by the calling Connect app can be updated. + * + * To assist with app migration, this operation can be used to: + * + * - Disable a rule. + * - Add a `tag`. Use this to filter rules in the [Get workflow transition rule + * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). + * + * Rules are enabled if the `disabled` parameter is not provided. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can use this operation. + */ + async updateWorkflowTransitionRuleConfigurations( + parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, + callback?: never, + ): Promise; + async updateWorkflowTransitionRuleConfigurations( + parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflow/rule/config', + method: 'PUT', + data: { + workflows: parameters.workflows, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes workflow transition rules from one or more workflows. These rule types are supported: + * + * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) + * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) + * + * Only rules created by the calling Connect app can be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can use this operation. + */ + async deleteWorkflowTransitionRuleConfigurations( + parameters: Parameters.DeleteWorkflowTransitionRuleConfigurations | undefined, + callback: Callback, + ): Promise; + /** + * Deletes workflow transition rules from one or more workflows. These rule types are supported: + * + * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) + * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) + * + * Only rules created by the calling Connect app can be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can use this operation. + */ + async deleteWorkflowTransitionRuleConfigurations( + parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, + callback?: never, + ): Promise; + async deleteWorkflowTransitionRuleConfigurations( + parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflow/rule/config/delete', + method: 'PUT', + data: { + workflows: parameters?.workflows, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/workflowTransitionRules.ts b/src/version3/workflowTransitionRules.ts deleted file mode 100644 index 97eb621b8..000000000 --- a/src/version3/workflowTransitionRules.ts +++ /dev/null @@ -1,189 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class WorkflowTransitionRules { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition - * rules: - * - * - Of one or more transition rule types, such as [workflow post - * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). - * - Matching one or more transition rule keys. - * - * Only workflows containing transition rules created by the calling - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app are returned. - * - * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be - * ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. - */ - async getWorkflowTransitionRuleConfigurations( - parameters: Parameters.GetWorkflowTransitionRuleConfigurations, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition - * rules: - * - * - Of one or more transition rule types, such as [workflow post - * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). - * - Matching one or more transition rule keys. - * - * Only workflows containing transition rules created by the calling - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app are returned. - * - * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be - * ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or - * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. - */ - async getWorkflowTransitionRuleConfigurations( - parameters: Parameters.GetWorkflowTransitionRuleConfigurations, - callback?: never, - ): Promise; - async getWorkflowTransitionRuleConfigurations( - parameters: Parameters.GetWorkflowTransitionRuleConfigurations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflow/rule/config', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - types: parameters.types, - keys: parameters.keys, - workflowNames: parameters.workflowNames, - withTags: parameters.withTags, - draft: parameters.draft, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates configuration of workflow transition rules. The following rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) - * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) - * - * Only rules created by the calling Connect app can be updated. - * - * To assist with app migration, this operation can be used to: - * - * - Disable a rule. - * - Add a `tag`. Use this to filter rules in the [Get workflow transition rule - * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). - * - * Rules are enabled if the `disabled` parameter is not provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can use this operation. - */ - async updateWorkflowTransitionRuleConfigurations( - parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, - callback: Callback, - ): Promise; - /** - * Updates configuration of workflow transition rules. The following rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) - * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) - * - * Only rules created by the calling Connect app can be updated. - * - * To assist with app migration, this operation can be used to: - * - * - Disable a rule. - * - Add a `tag`. Use this to filter rules in the [Get workflow transition rule - * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). - * - * Rules are enabled if the `disabled` parameter is not provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can use this operation. - */ - async updateWorkflowTransitionRuleConfigurations( - parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, - callback?: never, - ): Promise; - async updateWorkflowTransitionRuleConfigurations( - parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflow/rule/config', - method: 'PUT', - data: { - workflows: parameters.workflows, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes workflow transition rules from one or more workflows. These rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) - * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) - * - * Only rules created by the calling Connect app can be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can use this operation. - */ - async deleteWorkflowTransitionRuleConfigurations( - parameters: Parameters.DeleteWorkflowTransitionRuleConfigurations | undefined, - callback: Callback, - ): Promise; - /** - * Deletes workflow transition rules from one or more workflows. These rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) - * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) - * - * Only rules created by the calling Connect app can be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can use this operation. - */ - async deleteWorkflowTransitionRuleConfigurations( - parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, - callback?: never, - ): Promise; - async deleteWorkflowTransitionRuleConfigurations( - parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflow/rule/config/delete', - method: 'PUT', - data: { - workflows: parameters?.workflows, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/workflows.mts b/src/version3/workflows.mts new file mode 100644 index 000000000..82e595724 --- /dev/null +++ b/src/version3/workflows.mts @@ -0,0 +1,142 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { paramSerializer } from '../paramSerializer.mjs'; +import { RequestConfig } from '../requestConfig.mjs'; + +export class Workflows { + constructor(private client: Client) {} + + /** + * Creates a workflow. Workflow transitions are created with the default system transition rules. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflow( + parameters: Parameters.CreateWorkflow, + callback: Callback, + ): Promise; + /** + * Creates a workflow. Workflow transitions are created with the default system transition rules. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflow(parameters: Parameters.CreateWorkflow, callback?: never): Promise; + async createWorkflow( + parameters: Parameters.CreateWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflow', + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + transitions: parameters.transitions, + statuses: parameters.statuses, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, + * all published classic workflows are returned. + * + * This operation does not return next-gen workflows. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowsPaginated( + parameters: Parameters.GetWorkflowsPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, + * all published classic workflows are returned. + * + * This operation does not return next-gen workflows. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowsPaginated( + parameters?: Parameters.GetWorkflowsPaginated, + callback?: never, + ): Promise; + async getWorkflowsPaginated( + parameters?: Parameters.GetWorkflowsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflow/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + workflowName: paramSerializer('workflowName', parameters?.workflowName), + expand: parameters?.expand, + queryString: parameters?.queryString, + orderBy: parameters?.orderBy, + isActive: parameters?.isActive, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a workflow. + * + * The workflow cannot be deleted if it is: + * + * - An active workflow. + * - A system workflow. + * - Associated with any workflow scheme. + * - Associated with any draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteInactiveWorkflow( + parameters: Parameters.DeleteInactiveWorkflow | string, + callback: Callback, + ): Promise; + /** + * Deletes a workflow. + * + * The workflow cannot be deleted if it is: + * + * - An active workflow. + * - A system workflow. + * - Associated with any workflow scheme. + * - Associated with any draft workflow scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteInactiveWorkflow( + parameters: Parameters.DeleteInactiveWorkflow | string, + callback?: never, + ): Promise; + async deleteInactiveWorkflow( + parameters: Parameters.DeleteInactiveWorkflow | string, + callback?: Callback, + ): Promise { + const entityId = typeof parameters === 'string' ? parameters : parameters.entityId; + + const config: RequestConfig = { + url: `/rest/api/3/workflow/${entityId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/workflows.ts b/src/version3/workflows.ts deleted file mode 100644 index 297836e40..000000000 --- a/src/version3/workflows.ts +++ /dev/null @@ -1,142 +0,0 @@ -import * as Models from './models/index.js'; -import * as Parameters from './parameters/index.js'; -import type { Callback } from '../callback.js'; -import type { Client } from '../clients/index.js'; -import { paramSerializer } from '../paramSerializer.js'; -import type { RequestConfig } from '../requestConfig.js'; - -export class Workflows { - constructor(private client: Client) {} - - /** - * Creates a workflow. Workflow transitions are created with the default system transition rules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflow( - parameters: Parameters.CreateWorkflow, - callback: Callback, - ): Promise; - /** - * Creates a workflow. Workflow transitions are created with the default system transition rules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflow(parameters: Parameters.CreateWorkflow, callback?: never): Promise; - async createWorkflow( - parameters: Parameters.CreateWorkflow, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflow', - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - transitions: parameters.transitions, - statuses: parameters.statuses, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, - * all published classic workflows are returned. - * - * This operation does not return next-gen workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowsPaginated( - parameters: Parameters.GetWorkflowsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, - * all published classic workflows are returned. - * - * This operation does not return next-gen workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowsPaginated( - parameters?: Parameters.GetWorkflowsPaginated, - callback?: never, - ): Promise; - async getWorkflowsPaginated( - parameters?: Parameters.GetWorkflowsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflow/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - workflowName: paramSerializer('workflowName', parameters?.workflowName), - expand: parameters?.expand, - queryString: parameters?.queryString, - orderBy: parameters?.orderBy, - isActive: parameters?.isActive, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a workflow. - * - * The workflow cannot be deleted if it is: - * - * - An active workflow. - * - A system workflow. - * - Associated with any workflow scheme. - * - Associated with any draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteInactiveWorkflow( - parameters: Parameters.DeleteInactiveWorkflow | string, - callback: Callback, - ): Promise; - /** - * Deletes a workflow. - * - * The workflow cannot be deleted if it is: - * - * - An active workflow. - * - A system workflow. - * - Associated with any workflow scheme. - * - Associated with any draft workflow scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteInactiveWorkflow( - parameters: Parameters.DeleteInactiveWorkflow | string, - callback?: never, - ): Promise; - async deleteInactiveWorkflow( - parameters: Parameters.DeleteInactiveWorkflow | string, - callback?: Callback, - ): Promise { - const entityId = typeof parameters === 'string' ? parameters : parameters.entityId; - - const config: RequestConfig = { - url: `/rest/api/3/workflow/${entityId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/tests/integration/agile/sprint.test.mts b/tests/integration/agile/sprint.test.mts new file mode 100644 index 000000000..c9e61a1d1 --- /dev/null +++ b/tests/integration/agile/sprint.test.mts @@ -0,0 +1,88 @@ +import { afterAll, beforeAll, test } from 'vitest'; +import { AgileModels } from '@jirajs'; +import { Constants } from '@tests/integration/constants'; +import { + createAgileProject, + deleteAgileProject, + getAgileClient, + getVersion3Client, +} from '@tests/integration/utils'; + +const client = getAgileClient(); + +let board: any; +let sprint: AgileModels.Sprint; + +beforeAll(async () => { + await createAgileProject(); +}); + +afterAll(async () => { + await deleteAgileProject(); +}); + +test.sequential('should create new sprint', async ({ expect }) => { + const boards = await client.board.getAllBoards({ name: Constants.testAgileProjectKey }); + + expect(boards.total).toBe(1); + + [board] = boards.values; + + sprint = await client.sprint.createSprint({ + name: 'New sprint', + originBoardId: board.id, + }); + + expect(!!sprint).toBeTruthy(); + expect(sprint.name).toBe('New sprint'); + expect(sprint.state).toBe('future'); +}); + +test.sequential('should create and move task to sprint', async ({ expect }) => { + const issue = await getVersion3Client().issues.createIssue({ + fields: { + summary: 'Test task', + project: { + key: Constants.testAgileProjectKey, + }, + issuetype: { + name: 'Task', + }, + }, + }); + + await client.backlog.moveIssuesToBacklog({ + issues: [issue.key], + }); + + await client.sprint.moveIssuesToSprintAndRank({ + sprintId: sprint.id, + issues: [issue.key], + }); + + expect(!!issue).toBeTruthy(); +}); + +test.sequential('should return issues for sprint', async ({ expect }) => { + const { issues } = await client.sprint.getIssuesForSprint({ + sprintId: sprint.id, + }); + + expect(!!issues).toBeTruthy(); + expect(issues[0].fields?.summary).toBe('Test task'); +}); + +test.sequential('should partially update sprint', async ({ expect }) => { + const newSprint = await client.sprint.partiallyUpdateSprint({ + sprintId: sprint.id, + state: 'active', + startDate: new Date(), + endDate: new Date(Date.now() + 1000), + }); + + expect(newSprint.state).toBe('active'); +}); + +test.sequential('should remove sprint', async ({ expect }) => { + await client.sprint.deleteSprint({ sprintId: sprint.id }); +}); diff --git a/tests/integration/agile/sprint.test.ts b/tests/integration/agile/sprint.test.ts deleted file mode 100644 index 299a79ca5..000000000 --- a/tests/integration/agile/sprint.test.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { afterAll, beforeAll, test } from 'vitest'; -import { AgileModels } from '../../../src/index.js'; -import { Constants } from '../constants.js'; -import { - createAgileProject, deleteAgileProject, getAgileClient, getVersion3Client, -} from '../utils/index.js'; - -const client = getAgileClient(); - -let board: any; -let sprint: AgileModels.Sprint; - -beforeAll(async () => { - await createAgileProject(); -}); - -afterAll(async () => { - await deleteAgileProject(); -}); - -test.sequential('should create new sprint', async ({ expect }) => { - const boards = await client.board.getAllBoards({ - name: Constants.testAgileProjectKey, - }); - - expect(boards.total).toBe(1); - - [board] = boards.values; - - sprint = await client.sprint.createSprint({ - name: 'New sprint', - originBoardId: board.id, - }); - - expect(!!sprint).toBeTruthy(); - expect(sprint.name).toBe('New sprint'); - expect(sprint.state).toBe('future'); -}); - -test.sequential('should create and move task to sprint', async ({ expect }) => { - const issue = await getVersion3Client().issues.createIssue({ - fields: { - summary: 'Test task', - project: { - key: Constants.testAgileProjectKey, - }, - issuetype: { - name: 'Task', - }, - }, - }); - - await client.backlog.moveIssuesToBacklog({ - issues: [issue.key], - }); - - await client.sprint.moveIssuesToSprintAndRank({ - sprintId: sprint.id, - issues: [issue.key], - }); - - expect(!!issue).toBeTruthy(); -}); - -test.sequential('should return issues for sprint', async ({ expect }) => { - const { issues } = await client.sprint.getIssuesForSprint({ - sprintId: sprint.id, - }); - - expect(!!issues).toBeTruthy(); - expect(issues[0].fields?.summary).toBe('Test task'); -}); - -test.sequential('should partially update sprint', async ({ expect }) => { - const newSprint = await client.sprint.partiallyUpdateSprint({ - sprintId: sprint.id, - state: 'active', - startDate: new Date(), - endDate: new Date(Date.now() + 1000), - }); - - expect(newSprint.state).toBe('active'); -}); - -test.sequential('should remove sprint', async ({ expect }) => { - await client.sprint.deleteSprint({ sprintId: sprint.id }); -}); diff --git a/tests/integration/constants.ts b/tests/integration/constants.mts similarity index 100% rename from tests/integration/constants.ts rename to tests/integration/constants.mts diff --git a/tests/integration/index.mts b/tests/integration/index.mts new file mode 100644 index 000000000..2b30a95c1 --- /dev/null +++ b/tests/integration/index.mts @@ -0,0 +1,2 @@ +export * from '@tests/constants'; +export * as Utils from '@tests/utils'; diff --git a/tests/integration/index.ts b/tests/integration/index.ts deleted file mode 100644 index da99e1d27..000000000 --- a/tests/integration/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './constants.js'; -export * as Utils from './utils/index.js'; diff --git a/tests/integration/utils/cleanupEnvironment.mts b/tests/integration/utils/cleanupEnvironment.mts new file mode 100644 index 000000000..ea4ccea16 --- /dev/null +++ b/tests/integration/utils/cleanupEnvironment.mts @@ -0,0 +1,5 @@ +import { deleteSoftwareProject } from './deleteSoftwareProject'; + +export const cleanupEnvironment = async () => { + await deleteSoftwareProject(); +}; diff --git a/tests/integration/utils/cleanupEnvironment.ts b/tests/integration/utils/cleanupEnvironment.ts deleted file mode 100644 index df824e2d3..000000000 --- a/tests/integration/utils/cleanupEnvironment.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { deleteSoftwareProject } from './deleteSoftwareProject.js'; - -export const cleanupEnvironment = async () => { - await deleteSoftwareProject(); -}; diff --git a/tests/integration/utils/createAgileProject.mts b/tests/integration/utils/createAgileProject.mts new file mode 100644 index 000000000..a7e5f43a8 --- /dev/null +++ b/tests/integration/utils/createAgileProject.mts @@ -0,0 +1,16 @@ +import { Constants } from '@tests/integration/constants'; +import { getVersion3Client } from './getClient'; + +export const createAgileProject = async () => { + const client = getVersion3Client(); + + const myself = await client.myself.getCurrentUser(); + + return client.projects.createProject({ + key: Constants.testAgileProjectKey, + name: Constants.testAgileProjectName, + leadAccountId: myself.accountId, + projectTypeKey: 'software', + projectTemplateKey: 'com.pyxis.greenhopper.jira:gh-simplified-agility-scrum', + }); +}; diff --git a/tests/integration/utils/createAgileProject.ts b/tests/integration/utils/createAgileProject.ts deleted file mode 100644 index e76fa9b90..000000000 --- a/tests/integration/utils/createAgileProject.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Constants } from '../constants.js'; -import { getVersion3Client } from './getClient.js'; - -export const createAgileProject = async () => { - const client = getVersion3Client(); - - const myself = await client.myself.getCurrentUser(); - - return client.projects.createProject({ - key: Constants.testAgileProjectKey, - name: Constants.testAgileProjectName, - leadAccountId: myself.accountId, - projectTypeKey: 'software', - projectTemplateKey: - 'com.pyxis.greenhopper.jira:gh-simplified-agility-scrum', - }); -}; diff --git a/tests/integration/utils/createIssue.mts b/tests/integration/utils/createIssue.mts new file mode 100644 index 000000000..d0e3a012f --- /dev/null +++ b/tests/integration/utils/createIssue.mts @@ -0,0 +1,18 @@ +import { Constants } from '@tests/integration/constants'; +import { getVersion2Client } from './getClient'; + +export const createIssue = async () => { + const client = getVersion2Client(); + + return client.issues.createIssue({ + fields: { + project: { + key: Constants.testProjectKey, + }, + summary: 'Test issue', + issuetype: { + name: 'Task', + }, + }, + }); +}; diff --git a/tests/integration/utils/createIssue.ts b/tests/integration/utils/createIssue.ts deleted file mode 100644 index fbe82030b..000000000 --- a/tests/integration/utils/createIssue.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Constants } from '../constants.js'; -import { getVersion2Client } from './getClient.js'; - -export const createIssue = async () => { - const client = getVersion2Client(); - - return client.issues.createIssue({ - fields: { - project: { - key: Constants.testProjectKey, - }, - summary: 'Test issue', - issuetype: { - name: 'Task', - }, - }, - }); -}; diff --git a/tests/integration/utils/createSoftwareProject.mts b/tests/integration/utils/createSoftwareProject.mts new file mode 100644 index 000000000..b8d653a86 --- /dev/null +++ b/tests/integration/utils/createSoftwareProject.mts @@ -0,0 +1,22 @@ +import { AxiosError } from 'axios'; +import { Constants } from '@tests/integration/constants'; +import { getVersion2Client } from './getClient'; + +export const createSoftwareProject = async () => { + const client = getVersion2Client(); + const currentUser = await client.myself.getCurrentUser(); + + if (!currentUser.accountId) throw new Error("Couldn't get the current user's account ID", { cause: { currentUser } }); + + return client.projects + .createProject({ + key: Constants.testProjectKey, + name: Constants.testProjectName, + leadAccountId: currentUser.accountId, + projectTypeKey: 'software', + }) + .catch((error: AxiosError) => { + console.error(error.response?.data ?? error); + throw error; + }); +}; diff --git a/tests/integration/utils/createSoftwareProject.ts b/tests/integration/utils/createSoftwareProject.ts deleted file mode 100644 index 58a3460d7..000000000 --- a/tests/integration/utils/createSoftwareProject.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { AxiosError } from 'axios'; -import { Constants } from '../constants.js'; -import { getVersion2Client } from './getClient.js'; - -export const createSoftwareProject = async () => { - const client = getVersion2Client(); - const currentUser = await client.myself.getCurrentUser(); - - if (!currentUser.accountId) - throw new Error("Couldn't get the current user's account ID", { - cause: { currentUser }, - }); - - return client.projects - .createProject({ - key: Constants.testProjectKey, - name: Constants.testProjectName, - leadAccountId: currentUser.accountId, - projectTypeKey: 'software', - }) - .catch((error: AxiosError) => { - console.error(error.response?.data ?? error); - throw error; - }); -}; diff --git a/tests/integration/utils/deleteAgileProject.mts b/tests/integration/utils/deleteAgileProject.mts new file mode 100644 index 000000000..6e21c64f5 --- /dev/null +++ b/tests/integration/utils/deleteAgileProject.mts @@ -0,0 +1,11 @@ +import { Constants } from '@tests/integration/constants'; +import { getVersion3Client } from './getClient'; + +export const deleteAgileProject = async () => { + const client = getVersion3Client(); + + return client.projects.deleteProject({ + projectIdOrKey: Constants.testAgileProjectKey, + enableUndo: false, + }); +}; diff --git a/tests/integration/utils/deleteAgileProject.ts b/tests/integration/utils/deleteAgileProject.ts deleted file mode 100644 index f4975a6d8..000000000 --- a/tests/integration/utils/deleteAgileProject.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Constants } from '../constants.js'; -import { getVersion3Client } from './getClient.js'; - -export const deleteAgileProject = async () => { - const client = getVersion3Client(); - - return client.projects.deleteProject({ - projectIdOrKey: Constants.testAgileProjectKey, - enableUndo: false, - }); -}; diff --git a/tests/integration/utils/deleteSoftwareProject.mts b/tests/integration/utils/deleteSoftwareProject.mts new file mode 100644 index 000000000..3736289fc --- /dev/null +++ b/tests/integration/utils/deleteSoftwareProject.mts @@ -0,0 +1,17 @@ +import { AxiosError } from 'axios'; +import { Constants } from '@tests/integration/constants'; +import { getVersion2Client } from './getClient'; + +export const deleteSoftwareProject = async () => { + const client = getVersion2Client(); + + return client.projects + .deleteProject({ + projectIdOrKey: Constants.testProjectKey, + enableUndo: false, + }) + .catch((error: AxiosError) => { + console.error(error.response?.data ?? error); + throw error; + }); +}; diff --git a/tests/integration/utils/deleteSoftwareProject.ts b/tests/integration/utils/deleteSoftwareProject.ts deleted file mode 100644 index 66c0fcd26..000000000 --- a/tests/integration/utils/deleteSoftwareProject.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { AxiosError } from 'axios'; -import { Constants } from '../constants.js'; -import { getVersion2Client } from './getClient.js'; - -export const deleteSoftwareProject = async () => { - const client = getVersion2Client(); - - return client.projects - .deleteProject({ - projectIdOrKey: Constants.testProjectKey, - enableUndo: false, - }) - .catch((error: AxiosError) => { - console.error(error.response?.data ?? error); - throw error; - }); -}; diff --git a/tests/integration/utils/getClient.mts b/tests/integration/utils/getClient.mts new file mode 100644 index 000000000..1a9dfe5dc --- /dev/null +++ b/tests/integration/utils/getClient.mts @@ -0,0 +1,15 @@ +import { ClientType, type Config, createClient } from '@jirajs'; + +const config = { + host: process.env.HOST!, + authentication: { + basic: { + email: process.env.EMAIL!, + apiToken: process.env.API_TOKEN!, + }, + }, +}; + +export const getAgileClient = (customConfig?: Partial) => createClient(ClientType.Agile, { ...config, ...customConfig }); +export const getVersion2Client = (customConfig?: Partial) => createClient(ClientType.Version2, { ...config, ...customConfig }); +export const getVersion3Client = (customConfig?: Partial) => createClient(ClientType.Version3, { ...config, ...customConfig }); diff --git a/tests/integration/utils/getClient.ts b/tests/integration/utils/getClient.ts deleted file mode 100644 index 89d20d86f..000000000 --- a/tests/integration/utils/getClient.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { ClientType, createClient, type Config } from '../../../src/index.js'; - -const config = { - host: process.env.HOST!, - authentication: { - basic: { - email: process.env.EMAIL!, - apiToken: process.env.API_TOKEN!, - }, - }, -}; - -export const getAgileClient = (customConfig?: Partial) => - createClient(ClientType.Agile, { ...config, ...customConfig }); -export const getVersion2Client = (customConfig?: Partial) => - createClient(ClientType.Version2, { ...config, ...customConfig }); -export const getVersion3Client = (customConfig?: Partial) => - createClient(ClientType.Version3, { ...config, ...customConfig }); diff --git a/tests/integration/utils/index.mts b/tests/integration/utils/index.mts new file mode 100644 index 000000000..3c169ec31 --- /dev/null +++ b/tests/integration/utils/index.mts @@ -0,0 +1,8 @@ +export * from './cleanupEnvironment'; +export * from './createAgileProject'; +export * from './createIssue'; +export * from './createSoftwareProject'; +export * from './deleteAgileProject'; +export * from './deleteSoftwareProject'; +export * from './getClient'; +export * from './prepareEnvironment'; diff --git a/tests/integration/utils/index.ts b/tests/integration/utils/index.ts deleted file mode 100644 index d2019380e..000000000 --- a/tests/integration/utils/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * from './cleanupEnvironment.js'; -export * from './createAgileProject.js'; -export * from './createIssue.js'; -export * from './createSoftwareProject.js'; -export * from './deleteAgileProject.js'; -export * from './deleteSoftwareProject.js'; -export * from './getClient.js'; -export * from './prepareEnvironment.js'; diff --git a/tests/integration/utils/prepareEnvironment.mts b/tests/integration/utils/prepareEnvironment.mts new file mode 100644 index 000000000..1f665770c --- /dev/null +++ b/tests/integration/utils/prepareEnvironment.mts @@ -0,0 +1,5 @@ +import { createSoftwareProject } from './createSoftwareProject'; + +export const prepareEnvironment = async () => { + await createSoftwareProject(); +}; diff --git a/tests/integration/utils/prepareEnvironment.ts b/tests/integration/utils/prepareEnvironment.ts deleted file mode 100644 index 42320439a..000000000 --- a/tests/integration/utils/prepareEnvironment.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { createSoftwareProject } from './createSoftwareProject.js'; - -export const prepareEnvironment = async () => { - await createSoftwareProject(); -}; diff --git a/tests/integration/version2/avatars.test.mts b/tests/integration/version2/avatars.test.mts new file mode 100644 index 000000000..f568b2afe --- /dev/null +++ b/tests/integration/version2/avatars.test.mts @@ -0,0 +1,22 @@ +import { test } from 'vitest'; +import type { Avatar } from '@jirajs/version3/models'; +import { getVersion2Client } from '@tests/integration/utils'; + +const client = getVersion2Client(); + +let avatar: Avatar | undefined; + +test.sequential('should get all system avatars', async ({ expect }) => { + const systemAvatars = await client.avatars.getAllSystemAvatars({ type: 'project' }); + + avatar = systemAvatars.system?.[0]; + + expect(!!avatar).toBeTruthy(); +}); + +test.sequential('should return avatar image with contentType', async ({ expect }) => { + const avatarWithDetails = await client.avatars.getAvatarImageByID({ id: avatar!.id, type: 'project' }); + + expect(avatarWithDetails.contentType).toBe('image/svg+xml'); + expect(avatarWithDetails.avatar instanceof Uint8Array).toBeTruthy(); +}); diff --git a/tests/integration/version2/avatars.test.ts b/tests/integration/version2/avatars.test.ts deleted file mode 100644 index 6b54bd0c7..000000000 --- a/tests/integration/version2/avatars.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { test } from 'vitest'; -import type { Avatar } from '../../../src/version3/models/index.js'; -import { getVersion2Client } from '../utils/index.js'; - -const client = getVersion2Client(); - -let avatar: Avatar | undefined; - -test.sequential('should get all system avatars', async ({ expect }) => { - const systemAvatars = await client.avatars.getAllSystemAvatars({ type: 'project' }); - - avatar = systemAvatars.system?.[0]; - - expect(!!avatar).toBeTruthy(); -}); - -test.sequential('should return avatar image with contentType', async ({ expect }) => { - const avatarWithDetails = await client.avatars.getAvatarImageByID({ id: avatar!.id, type: 'project' }); - - expect(avatarWithDetails.contentType).toBe('image/svg+xml'); - expect(avatarWithDetails.avatar instanceof Uint8Array).toBeTruthy(); -}); diff --git a/tests/integration/version2/dashboards.test.mts b/tests/integration/version2/dashboards.test.mts new file mode 100644 index 000000000..2dfa99a08 --- /dev/null +++ b/tests/integration/version2/dashboards.test.mts @@ -0,0 +1,27 @@ +import { test } from 'vitest'; +import { Version2Models } from '@jirajs'; +import { Constants } from '@tests/integration/constants'; +import { getVersion2Client } from '@tests/integration/utils'; + +let dashboard: Version2Models.Dashboard; +const client = getVersion2Client(); + +test.sequential('should create dashboard', async ({ expect }) => { + dashboard = await client.dashboards.createDashboard({ + name: Constants.testDashboardName, + sharePermissions: [], + }); + + expect(!!dashboard).toBeTruthy(); + expect(dashboard.name).toBe(Constants.testDashboardName); + expect(dashboard.sharePermissions).toStrictEqual([]); +}); + +test.sequential('should remove dashboard', async ({ expect }) => { + const response = await client.dashboards.deleteDashboard({ + id: dashboard.id, + }); + + expect(typeof response).toBe('string'); + expect(response).toBe(''); +}); diff --git a/tests/integration/version2/dashboards.test.ts b/tests/integration/version2/dashboards.test.ts deleted file mode 100644 index 6a3725903..000000000 --- a/tests/integration/version2/dashboards.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { test } from 'vitest'; -import { Version2Models } from '../../../src/index.js'; -import { Constants } from '../constants.js'; -import { getVersion2Client } from '../utils/index.js'; - -let dashboard: Version2Models.Dashboard; -const client = getVersion2Client(); - -test.sequential('should create dashboard', async ({ expect }) => { - dashboard = await client.dashboards.createDashboard({ - name: Constants.testDashboardName, - sharePermissions: [], - }); - - expect(!!dashboard).toBeTruthy(); - expect(dashboard.name).toBe(Constants.testDashboardName); - expect(dashboard.sharePermissions).toStrictEqual([]); -}); - -test.sequential('should remove dashboard', async ({ expect }) => { - const response = await client.dashboards.deleteDashboard({ - id: dashboard.id, - }); - - expect(typeof response).toBe('string'); - expect(response).toBe(''); -}); diff --git a/tests/integration/version2/groups.test.mts b/tests/integration/version2/groups.test.mts new file mode 100644 index 000000000..06cb541a8 --- /dev/null +++ b/tests/integration/version2/groups.test.mts @@ -0,0 +1,23 @@ +import { test } from 'vitest'; +import { Constants } from '@tests/integration/constants'; +import { getVersion2Client } from '@tests/integration/utils'; + +const client = getVersion2Client(); + +test.sequential('should create a group', async ({ expect }) => { + const group = await client.groups.createGroup({ + name: Constants.testGroupName, + }); + + expect(!!group).toBeTruthy(); + expect(group.name).toBe(Constants.testGroupName); +}); + +test.sequential('should remove a group', async ({ expect }) => { + const response = await client.groups.removeGroup({ + groupname: Constants.testGroupName, + }); + + expect(typeof response).toBe('string'); + expect(response.trim()).toBe(''); +}); diff --git a/tests/integration/version2/groups.test.ts b/tests/integration/version2/groups.test.ts deleted file mode 100644 index a511645fb..000000000 --- a/tests/integration/version2/groups.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { test } from 'vitest'; -import { Constants } from '../constants.js'; -import { getVersion2Client } from '../utils/index.js'; - -const client = getVersion2Client(); - -test.sequential('should create a group', async ({ expect }) => { - const group = await client.groups.createGroup({ - name: Constants.testGroupName, - }); - - expect(!!group).toBeTruthy(); - expect(group.name).toBe(Constants.testGroupName); -}); - -test.sequential('should remove a group', async ({ expect }) => { - const response = await client.groups.removeGroup({ - groupname: Constants.testGroupName, - }); - - expect(typeof response).toBe('string'); - expect(response.trim()).toBe(''); -}); diff --git a/tests/integration/version2/issueAttachments.test.mts b/tests/integration/version2/issueAttachments.test.mts new file mode 100644 index 000000000..8e0690776 --- /dev/null +++ b/tests/integration/version2/issueAttachments.test.mts @@ -0,0 +1,56 @@ +import * as fs from 'fs'; +import { afterAll, beforeAll, test } from 'vitest'; +import type { Attachment, Issue } from '@jirajs/version2/models'; +import { Constants } from '@tests/integration/constants'; +import { cleanupEnvironment, getVersion2Client, prepareEnvironment } from '@tests/integration/utils'; + +const client = getVersion2Client({ noCheckAtlassianToken: true }); + +let issue: Issue; +let attachments: Attachment[]; + +beforeAll(async () => { + await prepareEnvironment(); +}); + +afterAll(async () => { + await cleanupEnvironment(); +}); + +test.sequential('should add attachment', async ({ expect }) => { + issue = await client.issues.createIssue({ + fields: { + summary: 'Issue with attachment', + project: { + key: Constants.testProjectKey, + }, + issuetype: { + name: 'Task', + }, + }, + }); + + expect(!!issue).toBeTruthy(); + + attachments = await client.issueAttachments.addAttachment({ + issueIdOrKey: issue.key, + attachment: { + filename: 'issueAttachments.test.ts', + file: fs.readFileSync('./tests/integration/version2/issueAttachments.test.ts'), + }, + }); + + expect(!!attachments).toBeTruthy(); + expect(attachments[0].filename).toBe('issueAttachments.test.ts'); + expect(attachments[0].mimeType).toBe('video/mp2t'); +}); + +test.sequential('should getAttachmentContent', async ({ expect }) => { + const content = await client.issueAttachments.getAttachmentContent({ id: attachments[0].id }); + + expect(Buffer.isBuffer(content)).toBeTruthy(); +}); + +test.sequential('should remove attachment', async ({ expect }) => { + await client.issues.deleteIssue({ issueIdOrKey: issue.key }); +}); diff --git a/tests/integration/version2/issueAttachments.test.ts b/tests/integration/version2/issueAttachments.test.ts deleted file mode 100644 index efdf97c61..000000000 --- a/tests/integration/version2/issueAttachments.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import * as fs from 'fs'; -import { afterAll, beforeAll, test } from 'vitest'; -import type { Attachment, Issue } from '../../../src/version2/models/index.js'; -import { Constants } from '../constants.js'; -import { cleanupEnvironment, getVersion2Client, prepareEnvironment } from '../utils/index.js'; - -const client = getVersion2Client({ noCheckAtlassianToken: true }); - -let issue: Issue; -let attachments: Attachment[]; - -beforeAll(async () => { - await prepareEnvironment(); -}); - -afterAll(async () => { - await cleanupEnvironment(); -}); - -test.sequential('should add attachment', async ({ expect }) => { - issue = await client.issues.createIssue({ - fields: { - summary: 'Issue with attachment', - project: { - key: Constants.testProjectKey, - }, - issuetype: { - name: 'Task', - }, - }, - }); - - expect(!!issue).toBeTruthy(); - - attachments = await client.issueAttachments.addAttachment({ - issueIdOrKey: issue.key, - attachment: { - filename: 'issueAttachments.test.ts', - file: fs.readFileSync('./tests/integration/version2/issueAttachments.test.ts'), - }, - }); - - expect(!!attachments).toBeTruthy(); - expect(attachments[0].filename).toBe('issueAttachments.test.ts'); - expect(attachments[0].mimeType).toBe('video/mp2t'); -}); - -test.sequential('should getAttachmentContent', async ({ expect }) => { - const content = await client.issueAttachments.getAttachmentContent({ id: attachments[0].id }); - - expect(Buffer.isBuffer(content)).toBeTruthy(); -}); - -test.sequential('should remove attachment', async ({ expect }) => { - await client.issues.deleteIssue({ issueIdOrKey: issue.key }); -}); diff --git a/tests/integration/version2/issueComments.test.mts b/tests/integration/version2/issueComments.test.mts new file mode 100644 index 000000000..a31d2b2d3 --- /dev/null +++ b/tests/integration/version2/issueComments.test.mts @@ -0,0 +1,56 @@ +import { AxiosError } from 'axios'; +import { afterAll, beforeAll, test } from 'vitest'; +import { Constants } from '@tests/integration/constants'; +import { cleanupEnvironment, getVersion2Client, prepareEnvironment } from '@tests/integration/utils'; + +beforeAll(async () => { + await prepareEnvironment(); +}); + +afterAll(async () => { + await cleanupEnvironment(); +}); + +test.sequential('should update comment', async ({ expect }) => { + const client = getVersion2Client({ noCheckAtlassianToken: true }); + + const issue = await client.issues.createIssue({ + fields: { + summary: 'Issue with comments', + project: { + key: Constants.testProjectKey, + }, + issuetype: { + name: 'Task', + }, + }, + }); + + expect(!!issue).toBeTruthy(); + + const comment = await client.issueComments + .addComment({ + issueIdOrKey: issue.key, + comment: 'this is a comment', + }) + .catch((error: AxiosError) => { + console.error(error.response?.data ?? error); + + throw error; + }); + + expect(!!comment).toBeTruthy(); + + const updatedComment = await client.issueComments.updateComment({ + issueIdOrKey: issue.key, + id: comment.id, + comment: 'updated comment', + }); + + expect(!!updatedComment).toBeTruthy(); + expect(updatedComment.id).toBe(comment.id); + + await client.issues.deleteIssue({ + issueIdOrKey: issue.key, + }); +}); diff --git a/tests/integration/version2/issueComments.test.ts b/tests/integration/version2/issueComments.test.ts deleted file mode 100644 index 2cadf048b..000000000 --- a/tests/integration/version2/issueComments.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { AxiosError } from 'axios'; -import { afterAll, beforeAll, test } from 'vitest'; -import { Constants } from '../constants.js'; -import { cleanupEnvironment, getVersion2Client, prepareEnvironment } from '../utils/index.js'; - -beforeAll(async () => { - await prepareEnvironment(); -}); - -afterAll(async () => { - await cleanupEnvironment(); -}); - -test.sequential('should update comment', async ({ expect }) => { - const client = getVersion2Client({ noCheckAtlassianToken: true }); - - const issue = await client.issues.createIssue({ - fields: { - summary: 'Issue with comments', - project: { - key: Constants.testProjectKey, - }, - issuetype: { - name: 'Task', - }, - }, - }); - - expect(!!issue).toBeTruthy(); - - const comment = await client.issueComments - .addComment({ - issueIdOrKey: issue.key, - comment: 'this is a comment', - }) - .catch((error: AxiosError) => { - console.error(error.response?.data ?? error); - - throw error; - }); - - expect(!!comment).toBeTruthy(); - - const updatedComment = await client.issueComments.updateComment({ - issueIdOrKey: issue.key, - id: comment.id, - comment: 'updated comment', - }); - - expect(!!updatedComment).toBeTruthy(); - expect(updatedComment.id).toBe(comment.id); - - await client.issues.deleteIssue({ - issueIdOrKey: issue.key, - }); -}); diff --git a/tests/integration/version2/issueSearch.test.mts b/tests/integration/version2/issueSearch.test.mts new file mode 100644 index 000000000..d9d17e46c --- /dev/null +++ b/tests/integration/version2/issueSearch.test.mts @@ -0,0 +1,22 @@ +import { afterAll, beforeAll, test } from 'vitest'; +import { cleanupEnvironment, getVersion2Client, prepareEnvironment } from '@tests/integration/utils'; + +beforeAll(async () => { + await prepareEnvironment(); +}); + +afterAll(async () => { + await cleanupEnvironment(); +}); + +test.sequential('searchForIssuesUsingJql should correctly calls', async ({ expect }) => { + const client = getVersion2Client({ noCheckAtlassianToken: true }); + + const issues = await client.issueSearch.searchForIssuesUsingJql({ + jql: 'assignee=currentuser()', + }); + + expect(issues.startAt).toBe(0); + expect(issues.maxResults).toBe(50); + expect(issues.issues).toStrictEqual([]); +}); diff --git a/tests/integration/version2/issueSearch.test.ts b/tests/integration/version2/issueSearch.test.ts deleted file mode 100644 index 814f1ecf7..000000000 --- a/tests/integration/version2/issueSearch.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { afterAll, beforeAll, test } from 'vitest'; -import { cleanupEnvironment, getVersion2Client, prepareEnvironment } from '../utils/index.js'; - -beforeAll(async () => { - await prepareEnvironment(); -}); - -afterAll(async () => { - await cleanupEnvironment(); -}); - -test.sequential('searchForIssuesUsingJql should correctly calls', async ({ expect }) => { - const client = getVersion2Client({ noCheckAtlassianToken: true }); - - const issues = await client.issueSearch.searchForIssuesUsingJql({ - jql: 'assignee=currentuser()', - }); - - expect(issues.startAt).toBe(0); - expect(issues.maxResults).toBe(50); - expect(issues.issues).toStrictEqual([]); -}); diff --git a/tests/integration/version2/issueVotes.test.mts b/tests/integration/version2/issueVotes.test.mts new file mode 100644 index 000000000..d9a3f2135 --- /dev/null +++ b/tests/integration/version2/issueVotes.test.mts @@ -0,0 +1,42 @@ +import { afterAll, beforeAll, test } from 'vitest'; +import type { CreatedIssue } from '@jirajs/version2/models'; +import { + cleanupEnvironment, createIssue, getVersion2Client, prepareEnvironment, +} from '@tests/integration/utils'; + +const client = getVersion2Client(); +let createdIssue: CreatedIssue; + +beforeAll(async () => { + await prepareEnvironment(); + createdIssue = await createIssue(); +}); + +afterAll(async () => { + await cleanupEnvironment(); +}); + +test.sequential('should get zero votes on the issue', async ({ expect }) => { + const { votes, hasVoted } = await client.issueVotes.getVotes({ issueIdOrKey: createdIssue.id }); + + expect(votes).toBe(0); + expect(hasVoted).toBeFalsy(); +}); + +test.sequential('should add vote to issue', async ({ expect }) => { + await client.issueVotes.addVote({ issueIdOrKey: createdIssue.key }); + + const { votes, hasVoted } = await client.issueVotes.getVotes({ issueIdOrKey: createdIssue.id }); + + expect(votes).toBe(1); + expect(hasVoted).toBeTruthy(); +}); + +test.sequential('should remove vote from issue', async ({ expect }) => { + await client.issueVotes.removeVote({ issueIdOrKey: createdIssue.key }); + + const { votes, hasVoted } = await client.issueVotes.getVotes({ issueIdOrKey: createdIssue.id }); + + expect(votes).toBe(0); + expect(hasVoted).toBeFalsy(); +}); diff --git a/tests/integration/version2/issueVotes.test.ts b/tests/integration/version2/issueVotes.test.ts deleted file mode 100644 index b79b2c2cc..000000000 --- a/tests/integration/version2/issueVotes.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { afterAll, beforeAll, test } from 'vitest'; -import type { CreatedIssue } from '../../../src/version2/models/index.js'; -import { - cleanupEnvironment, createIssue, getVersion2Client, prepareEnvironment, -} from '../utils/index.js'; - -const client = getVersion2Client(); -let createdIssue: CreatedIssue; - -beforeAll(async () => { - await prepareEnvironment(); - createdIssue = await createIssue(); -}); - -afterAll(async () => { - await cleanupEnvironment(); -}); - -test.sequential('should get zero votes on the issue', async ({ expect }) => { - const { votes, hasVoted } = await client.issueVotes.getVotes({ issueIdOrKey: createdIssue.id }); - - expect(votes).toBe(0); - expect(hasVoted).toBeFalsy(); -}); - -test.sequential('should add vote to issue', async ({ expect }) => { - await client.issueVotes.addVote({ issueIdOrKey: createdIssue.key }); - - const { votes, hasVoted } = await client.issueVotes.getVotes({ issueIdOrKey: createdIssue.id }); - - expect(votes).toBe(1); - expect(hasVoted).toBeTruthy(); -}); - -test.sequential('should remove vote from issue', async ({ expect }) => { - await client.issueVotes.removeVote({ issueIdOrKey: createdIssue.key }); - - const { votes, hasVoted } = await client.issueVotes.getVotes({ issueIdOrKey: createdIssue.id }); - - expect(votes).toBe(0); - expect(hasVoted).toBeFalsy(); -}); diff --git a/tests/integration/version2/issues.test.mts b/tests/integration/version2/issues.test.mts new file mode 100644 index 000000000..e4b89c959 --- /dev/null +++ b/tests/integration/version2/issues.test.mts @@ -0,0 +1,68 @@ +import { afterAll, beforeAll, test } from 'vitest'; +import { Version2Models } from '@jirajs'; +import { Constants } from '@tests/integration/constants'; +import { cleanupEnvironment, getVersion2Client, prepareEnvironment } from '@tests/integration/utils'; + +let createdIssue: Version2Models.CreatedIssue; +const client = getVersion2Client(); + +beforeAll(async () => { + await prepareEnvironment(); +}); + +afterAll(async () => { + await cleanupEnvironment(); +}); + +test.sequential('should create issue', async ({ expect }) => { + createdIssue = await client.issues.createIssue({ + fields: { + summary: Constants.testIssueSummary, + issuetype: { + name: 'Task', + }, + project: { + key: Constants.testProjectKey, + }, + description: Constants.testIssueDescription, + }, + }); + + expect(!!createdIssue).toBeTruthy(); + expect(!!createdIssue.id).toBeTruthy(); + expect(createdIssue.self).toBeTruthy(); + expect(createdIssue.key).toBe(`${Constants.testProjectKey}-1`); +}); + +test.sequential('should get issue', async ({ expect }) => { + const issue = await client.issues.getIssue({ issueIdOrKey: createdIssue.id }); + + expect(!!issue).toBeTruthy(); + + // Fields section + expect(issue.fields.summary).toBe(Constants.testIssueSummary); + expect(issue.fields.description).toBe(Constants.testIssueDescription); + expect(issue.fields.status.name).toBe('To Do'); + expect(!!issue.fields.priority).toBeTruthy(); + expect(!!issue.fields.assignee).toBeTruthy(); + expect(!!issue.fields.timetracking).toBeTruthy(); + expect(!!issue.fields.issuetype).toBeTruthy(); + expect(!!issue.fields.watches).toBeTruthy(); + expect(!!issue.fields.created).toBeTruthy(); + expect(!!issue.fields.labels).toBeTruthy(); + expect(!!issue.fields.updated).toBeTruthy(); + expect(!!issue.fields.components).toBeTruthy(); + expect(!!issue.fields.attachment).toBeTruthy(); + expect(!!issue.fields.creator).toBeTruthy(); + expect(!!issue.fields.subtasks).toBeTruthy(); + expect(!!issue.fields.reporter).toBeTruthy(); + expect(!!issue.fields.comment).toBeTruthy(); + expect(!!issue.fields.votes).toBeTruthy(); + expect(!!issue.fields.worklog).toBeTruthy(); +}); + +test.sequential('should remove issue', async ({ expect }) => { + const removedIssue = await client.issues.deleteIssue({ issueIdOrKey: createdIssue.id }); + + expect(removedIssue).toBe(''); +}); diff --git a/tests/integration/version2/issues.test.ts b/tests/integration/version2/issues.test.ts deleted file mode 100644 index 5ab98fe9f..000000000 --- a/tests/integration/version2/issues.test.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { afterAll, beforeAll, test } from 'vitest'; -import { Version2Models } from '../../../src/index.js'; -import { Constants } from '../constants.js'; -import { cleanupEnvironment, getVersion2Client, prepareEnvironment } from '../utils/index.js'; - -let createdIssue: Version2Models.CreatedIssue; -const client = getVersion2Client(); - -beforeAll(async () => { - await prepareEnvironment(); -}); - -afterAll(async () => { - await cleanupEnvironment(); -}); - -test.sequential('should create issue', async ({ expect }) => { - createdIssue = await client.issues.createIssue({ - fields: { - summary: Constants.testIssueSummary, - issuetype: { - name: 'Task', - }, - project: { - key: Constants.testProjectKey, - }, - description: Constants.testIssueDescription, - }, - }); - - expect(!!createdIssue).toBeTruthy(); - expect(!!createdIssue.id).toBeTruthy(); - expect(createdIssue.self).toBeTruthy(); - expect(createdIssue.key).toBe(`${Constants.testProjectKey}-1`); -}); - -test.sequential('should get issue', async ({ expect }) => { - const issue = await client.issues.getIssue({ issueIdOrKey: createdIssue.id }); - - expect(!!issue).toBeTruthy(); - - // Fields section - expect(issue.fields.summary).toBe(Constants.testIssueSummary); - expect(issue.fields.description).toBe(Constants.testIssueDescription); - expect(issue.fields.status.name).toBe('To Do'); - expect(!!issue.fields.priority).toBeTruthy(); - expect(!!issue.fields.assignee).toBeTruthy(); - expect(!!issue.fields.timetracking).toBeTruthy(); - expect(!!issue.fields.issuetype).toBeTruthy(); - expect(!!issue.fields.watches).toBeTruthy(); - expect(!!issue.fields.created).toBeTruthy(); - expect(!!issue.fields.labels).toBeTruthy(); - expect(!!issue.fields.updated).toBeTruthy(); - expect(!!issue.fields.components).toBeTruthy(); - expect(!!issue.fields.attachment).toBeTruthy(); - expect(!!issue.fields.creator).toBeTruthy(); - expect(!!issue.fields.subtasks).toBeTruthy(); - expect(!!issue.fields.reporter).toBeTruthy(); - expect(!!issue.fields.comment).toBeTruthy(); - expect(!!issue.fields.votes).toBeTruthy(); - expect(!!issue.fields.worklog).toBeTruthy(); -}); - -test.sequential('should remove issue', async ({ expect }) => { - const removedIssue = await client.issues.deleteIssue({ issueIdOrKey: createdIssue.id }); - - expect(removedIssue).toBe(''); -}); diff --git a/tests/integration/version2/projectRoles.test.mts b/tests/integration/version2/projectRoles.test.mts new file mode 100644 index 000000000..0245c8857 --- /dev/null +++ b/tests/integration/version2/projectRoles.test.mts @@ -0,0 +1,22 @@ +import { afterAll, beforeAll, test } from 'vitest'; +import { Constants } from '@tests/integration/constants'; +import { cleanupEnvironment, getVersion2Client, prepareEnvironment } from '@tests/integration/utils'; + +const client = getVersion2Client(); + +beforeAll(async () => { + await prepareEnvironment(); +}); + +afterAll(async () => { + await cleanupEnvironment(); +}); + +test.sequential('should get project roles', async ({ expect }) => { + const projectRoles = await client.projectRoles.getProjectRoles({ + projectIdOrKey: Constants.testProjectKey, + }); + + expect(!!projectRoles.Administrators).toBeTruthy(); + expect(typeof projectRoles.Administrators).toBe('string'); +}); diff --git a/tests/integration/version2/projectRoles.test.ts b/tests/integration/version2/projectRoles.test.ts deleted file mode 100644 index a275ef46a..000000000 --- a/tests/integration/version2/projectRoles.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { afterAll, beforeAll, test } from 'vitest'; -import { Constants } from '../constants.js'; -import { cleanupEnvironment, getVersion2Client, prepareEnvironment } from '../utils/index.js'; - -const client = getVersion2Client(); - -beforeAll(async () => { - await prepareEnvironment(); -}); - -afterAll(async () => { - await cleanupEnvironment(); -}); - -test.sequential('should get project roles', async ({ expect }) => { - const projectRoles = await client.projectRoles.getProjectRoles({ - projectIdOrKey: Constants.testProjectKey, - }); - - expect(!!projectRoles.Administrators).toBeTruthy(); - expect(typeof projectRoles.Administrators).toBe('string'); -}); diff --git a/tests/integration/version2/projects.test.mts b/tests/integration/version2/projects.test.mts new file mode 100644 index 000000000..53c6cceec --- /dev/null +++ b/tests/integration/version2/projects.test.mts @@ -0,0 +1,34 @@ +import { afterAll, beforeAll, test } from 'vitest'; +import { Constants } from '@tests/integration/constants'; +import { cleanupEnvironment, getVersion2Client, prepareEnvironment } from '@tests/integration/utils'; + +beforeAll(async () => { + await prepareEnvironment(); +}); + +afterAll(async () => { + await cleanupEnvironment(); +}); + +test.sequential('should search all projects', async ({ expect }) => { + const client = getVersion2Client(); + const projects = await client.projects.searchProjects(); + + expect(projects.total).toBe(1); +}); + +test.sequential(`should search ${Constants.testProjectKey} project`, async ({ expect }) => { + const client = getVersion2Client(); + + const projects = await client.projects.searchProjects({ + query: Constants.testProjectKey, + }); + + expect(projects.total).toBe(1); + expect(projects.isLast).toBeTruthy(); + + const project = projects.values[0]; + + expect(project.key).toBe(Constants.testProjectKey); + expect(project.name).toBe(Constants.testProjectName); +}); diff --git a/tests/integration/version2/projects.test.ts b/tests/integration/version2/projects.test.ts deleted file mode 100644 index ebe83b64d..000000000 --- a/tests/integration/version2/projects.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { afterAll, beforeAll, test } from 'vitest'; -import { Constants } from '../constants.js'; -import { cleanupEnvironment, getVersion2Client, prepareEnvironment } from '../utils/index.js'; - -beforeAll(async () => { - await prepareEnvironment(); -}); - -afterAll(async () => { - await cleanupEnvironment(); -}); - -test.sequential('should search all projects', async ({ expect }) => { - const client = getVersion2Client(); - const projects = await client.projects.searchProjects(); - - expect(projects.total).toBe(1); -}); - -test.sequential(`should search ${Constants.testProjectKey} project`, async ({ expect }) => { - const client = getVersion2Client(); - - const projects = await client.projects.searchProjects({ - query: Constants.testProjectKey, - }); - - expect(projects.total).toBe(1); - expect(projects.isLast).toBeTruthy(); - - const project = projects.values[0]; - - expect(project.key).toBe(Constants.testProjectKey); - expect(project.name).toBe(Constants.testProjectName); -}); diff --git a/tests/integration/version3/avatars.test.mts b/tests/integration/version3/avatars.test.mts new file mode 100644 index 000000000..91ec9d1f6 --- /dev/null +++ b/tests/integration/version3/avatars.test.mts @@ -0,0 +1,22 @@ +import { test } from 'vitest'; +import type { Avatar } from '@jirajs/version3/models'; +import { getVersion3Client } from '@tests/integration/utils'; + +const client = getVersion3Client(); + +let avatar: Avatar | undefined; + +test.sequential('should get all system avatars', async ({ expect }) => { + const systemAvatars = await client.avatars.getAllSystemAvatars({ type: 'project' }); + + avatar = systemAvatars.system?.[0]; + + expect(!!avatar).toBeTruthy(); +}); + +test.sequential('should return avatar image with contentType', async ({ expect }) => { + const avatarWithDetails = await client.avatars.getAvatarImageByID({ id: avatar!.id, type: 'project' }); + + expect(avatarWithDetails.contentType).toBe('image/svg+xml'); + expect(avatarWithDetails.avatar instanceof Uint8Array).toBeTruthy(); +}); diff --git a/tests/integration/version3/avatars.test.ts b/tests/integration/version3/avatars.test.ts deleted file mode 100644 index 017c50fcb..000000000 --- a/tests/integration/version3/avatars.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { test } from 'vitest'; -import type { Avatar } from '../../../src/version3/models/index.js'; -import { getVersion3Client } from '../utils/index.js'; - -const client = getVersion3Client(); - -let avatar: Avatar | undefined; - -test.sequential('should get all system avatars', async ({ expect }) => { - const systemAvatars = await client.avatars.getAllSystemAvatars({ type: 'project' }); - - avatar = systemAvatars.system?.[0]; - - expect(!!avatar).toBeTruthy(); -}); - -test.sequential('should return avatar image with contentType', async ({ expect }) => { - const avatarWithDetails = await client.avatars.getAvatarImageByID({ id: avatar!.id, type: 'project' }); - - expect(avatarWithDetails.contentType).toBe('image/svg+xml'); - expect(avatarWithDetails.avatar instanceof Uint8Array).toBeTruthy(); -}); diff --git a/tests/integration/version3/dashboards.test.mts b/tests/integration/version3/dashboards.test.mts new file mode 100644 index 000000000..28740036f --- /dev/null +++ b/tests/integration/version3/dashboards.test.mts @@ -0,0 +1,27 @@ +import { test } from 'vitest'; +import { Version3Models } from '@jirajs'; +import { Constants } from '@tests/integration/constants'; +import { getVersion3Client } from '@tests/integration/utils'; + +let dashboard: Version3Models.Dashboard; +const client = getVersion3Client(); + +test.sequential('should create dashboard', async ({ expect }) => { + dashboard = await client.dashboards.createDashboard({ + name: Constants.testDashboardName, + sharePermissions: [], + }); + + expect(!!dashboard).toBeTruthy(); + expect(dashboard.name).toBe(Constants.testDashboardName); + expect(dashboard.sharePermissions).toStrictEqual([]); +}); + +test.sequential('should remove dashboard', async ({ expect }) => { + const response = await client.dashboards.deleteDashboard({ + id: dashboard.id, + }); + + expect(typeof response).toBe('string'); + expect(response).toBe(''); +}); diff --git a/tests/integration/version3/dashboards.test.ts b/tests/integration/version3/dashboards.test.ts deleted file mode 100644 index a8d80c80a..000000000 --- a/tests/integration/version3/dashboards.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { test } from 'vitest'; -import { Version3Models } from '../../../src/index.js'; -import { Constants } from '../constants.js'; -import { getVersion3Client } from '../utils/index.js'; - -let dashboard: Version3Models.Dashboard; -const client = getVersion3Client(); - -test.sequential('should create dashboard', async ({ expect }) => { - dashboard = await client.dashboards.createDashboard({ - name: Constants.testDashboardName, - sharePermissions: [], - }); - - expect(!!dashboard).toBeTruthy(); - expect(dashboard.name).toBe(Constants.testDashboardName); - expect(dashboard.sharePermissions).toStrictEqual([]); -}); - -test.sequential('should remove dashboard', async ({ expect }) => { - const response = await client.dashboards.deleteDashboard({ - id: dashboard.id, - }); - - expect(typeof response).toBe('string'); - expect(response).toBe(''); -}); diff --git a/tests/integration/version3/groups.test.mts b/tests/integration/version3/groups.test.mts new file mode 100644 index 000000000..c47d7a1b1 --- /dev/null +++ b/tests/integration/version3/groups.test.mts @@ -0,0 +1,23 @@ +import { test } from 'vitest'; +import { Constants } from '@tests/integration/constants'; +import { getVersion3Client } from '@tests/integration/utils'; + +const client = getVersion3Client(); + +test.sequential('should create a group', async ({ expect }) => { + const group = await client.groups.createGroup({ + name: Constants.testGroupName, + }); + + expect(group).toBeTruthy(); + expect(group.name).toBe(Constants.testGroupName); +}); + +test.sequential('should remove a group', async ({ expect }) => { + const response = await client.groups.removeGroup({ + groupname: Constants.testGroupName, + }); + + expect(typeof response).toBe('string'); + expect(response.trim()).toBe(''); +}); diff --git a/tests/integration/version3/groups.test.ts b/tests/integration/version3/groups.test.ts deleted file mode 100644 index 68a500941..000000000 --- a/tests/integration/version3/groups.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { test } from 'vitest'; -import { Constants } from '../constants.js'; -import { getVersion3Client } from '../utils/index.js'; - -const client = getVersion3Client(); - -test.sequential('should create a group', async ({ expect }) => { - const group = await client.groups.createGroup({ - name: Constants.testGroupName, - }); - - expect(group).toBeTruthy(); - expect(group.name).toBe(Constants.testGroupName); -}); - -test.sequential('should remove a group', async ({ expect }) => { - const response = await client.groups.removeGroup({ - groupname: Constants.testGroupName, - }); - - expect(typeof response).toBe('string'); - expect(response.trim()).toBe(''); -}); diff --git a/tests/integration/version3/issueAttachments.test.mts b/tests/integration/version3/issueAttachments.test.mts new file mode 100644 index 000000000..a1eed763a --- /dev/null +++ b/tests/integration/version3/issueAttachments.test.mts @@ -0,0 +1,56 @@ +import * as fs from 'fs'; +import { afterAll, beforeAll, test } from 'vitest'; +import type { Attachment, Issue } from '@jirajs/version3/models'; +import { Constants } from '@tests/integration/constants'; +import { cleanupEnvironment, getVersion3Client, prepareEnvironment } from '@tests/integration/utils'; + +const client = getVersion3Client({ noCheckAtlassianToken: true }); + +let issue: Issue; +let attachments: Attachment[]; + +beforeAll(async () => { + await prepareEnvironment(); +}); + +afterAll(async () => { + await cleanupEnvironment(); +}); + +test.sequential('should add attachment', async ({ expect }) => { + issue = await client.issues.createIssue({ + fields: { + summary: 'Issue with attachment', + project: { + key: Constants.testProjectKey, + }, + issuetype: { + name: 'Task', + }, + }, + }); + + expect(!!issue).toBeTruthy(); + + attachments = await client.issueAttachments.addAttachment({ + issueIdOrKey: issue.key, + attachment: { + filename: 'issueAttachments.test.ts', + file: fs.readFileSync('./tests/integration/version3/issueAttachments.test.ts'), + }, + }); + + expect(!!attachments).toBeTruthy(); + expect(attachments[0].filename).toBe('issueAttachments.test.ts'); + expect(attachments[0].mimeType).toBe('video/mp2t'); +}); + +test.sequential('should getAttachmentContent', async ({ expect }) => { + const content = await client.issueAttachments.getAttachmentContent({ id: attachments[0].id }); + + expect(Buffer.isBuffer(content)).toBeTruthy(); +}); + +test.sequential('should remove attachment', async ({ expect }) => { + await client.issues.deleteIssue({ issueIdOrKey: issue.key }); +}); diff --git a/tests/integration/version3/issueAttachments.test.ts b/tests/integration/version3/issueAttachments.test.ts deleted file mode 100644 index 61e1c653f..000000000 --- a/tests/integration/version3/issueAttachments.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import * as fs from 'fs'; -import { afterAll, beforeAll, test } from 'vitest'; -import type { Attachment, Issue } from '../../../src/version3/models/index.js'; -import { Constants } from '../constants.js'; -import { cleanupEnvironment, getVersion3Client, prepareEnvironment } from '../utils/index.js'; - -const client = getVersion3Client({ noCheckAtlassianToken: true }); - -let issue: Issue; -let attachments: Attachment[]; - -beforeAll(async () => { - await prepareEnvironment(); -}); - -afterAll(async () => { - await cleanupEnvironment(); -}); - -test.sequential('should add attachment', async ({ expect }) => { - issue = await client.issues.createIssue({ - fields: { - summary: 'Issue with attachment', - project: { - key: Constants.testProjectKey, - }, - issuetype: { - name: 'Task', - }, - }, - }); - - expect(!!issue).toBeTruthy(); - - attachments = await client.issueAttachments.addAttachment({ - issueIdOrKey: issue.key, - attachment: { - filename: 'issueAttachments.test.ts', - file: fs.readFileSync('./tests/integration/version3/issueAttachments.test.ts'), - }, - }); - - expect(!!attachments).toBeTruthy(); - expect(attachments[0].filename).toBe('issueAttachments.test.ts'); - expect(attachments[0].mimeType).toBe('video/mp2t'); -}); - -test.sequential('should getAttachmentContent', async ({ expect }) => { - const content = await client.issueAttachments.getAttachmentContent({ id: attachments[0].id }); - - expect(Buffer.isBuffer(content)).toBeTruthy(); -}); - -test.sequential('should remove attachment', async ({ expect }) => { - await client.issues.deleteIssue({ issueIdOrKey: issue.key }); -}); diff --git a/tests/integration/version3/issueComments.test.mts b/tests/integration/version3/issueComments.test.mts new file mode 100644 index 000000000..806bff7ac --- /dev/null +++ b/tests/integration/version3/issueComments.test.mts @@ -0,0 +1,78 @@ +import { afterAll, beforeAll, test } from 'vitest'; +import { Constants } from '@tests/integration/constants'; +import { cleanupEnvironment, getVersion3Client, prepareEnvironment } from '@tests/integration/utils'; + +beforeAll(async () => { + await prepareEnvironment(); +}); + +afterAll(async () => { + await cleanupEnvironment(); +}); + +test.sequential('should update comment', async ({ expect }) => { + const client = getVersion3Client({ noCheckAtlassianToken: true }); + + const issue = await client.issues.createIssue({ + fields: { + summary: 'Issue with comments', + project: { + key: Constants.testProjectKey, + }, + issuetype: { + name: 'Task', + }, + }, + }); + + expect(!!issue).toBeTruthy(); + + const comment = await client.issueComments.addComment({ + issueIdOrKey: issue.key, + comment: { + type: 'doc', + version: 1, + content: [ + { + type: 'paragraph', + content: [ + { + text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semper quam laoreet nisi egestas at posuere augue semper.', + type: 'text', + }, + ], + }, + ], + }, + }); + + expect(!!comment).toBeTruthy(); + if (!comment.id) throw new Error('Comment ID is not defined'); + + const updatedComment = await client.issueComments.updateComment({ + issueIdOrKey: issue.key, + id: comment.id, + body: { + type: 'doc', + version: 1, + content: [ + { + type: 'paragraph', + content: [ + { + text: 'Lorem ipsum dolor sit', + type: 'text', + }, + ], + }, + ], + }, + }); + + expect(!!updatedComment).toBeTruthy(); + expect(updatedComment.id).toBe(comment.id); + + await client.issues.deleteIssue({ + issueIdOrKey: issue.key, + }); +}); diff --git a/tests/integration/version3/issueComments.test.ts b/tests/integration/version3/issueComments.test.ts deleted file mode 100644 index daa448b3b..000000000 --- a/tests/integration/version3/issueComments.test.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { afterAll, beforeAll, test } from 'vitest'; -import { Constants } from '../constants.js'; -import { cleanupEnvironment, getVersion3Client, prepareEnvironment } from '../utils/index.js'; - -beforeAll(async () => { - await prepareEnvironment(); -}); - -afterAll(async () => { - await cleanupEnvironment(); -}); - -test.sequential('should update comment', async ({ expect }) => { - const client = getVersion3Client({ noCheckAtlassianToken: true }); - - const issue = await client.issues.createIssue({ - fields: { - summary: 'Issue with comments', - project: { - key: Constants.testProjectKey, - }, - issuetype: { - name: 'Task', - }, - }, - }); - - expect(!!issue).toBeTruthy(); - - const comment = await client.issueComments.addComment({ - issueIdOrKey: issue.key, - comment: { - type: 'doc', - version: 1, - content: [ - { - type: 'paragraph', - content: [ - { - text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semper quam laoreet nisi egestas at posuere augue semper.', - type: 'text', - }, - ], - }, - ], - }, - }); - - expect(!!comment).toBeTruthy(); - if (!comment.id) throw new Error('Comment ID is not defined'); - - const updatedComment = await client.issueComments.updateComment({ - issueIdOrKey: issue.key, - id: comment.id, - body: { - type: 'doc', - version: 1, - content: [ - { - type: 'paragraph', - content: [ - { - text: 'Lorem ipsum dolor sit', - type: 'text', - }, - ], - }, - ], - }, - }); - - expect(!!updatedComment).toBeTruthy(); - expect(updatedComment.id).toBe(comment.id); - - await client.issues.deleteIssue({ - issueIdOrKey: issue.key, - }); -}); diff --git a/tests/integration/version3/issueSearch.test.mts b/tests/integration/version3/issueSearch.test.mts new file mode 100644 index 000000000..3f8c41451 --- /dev/null +++ b/tests/integration/version3/issueSearch.test.mts @@ -0,0 +1,22 @@ +import { afterAll, beforeAll, test } from 'vitest'; +import { cleanupEnvironment, getVersion3Client, prepareEnvironment } from '@tests/integration/utils'; + +beforeAll(async () => { + await prepareEnvironment(); +}); + +afterAll(async () => { + await cleanupEnvironment(); +}); + +test.sequential('searchForIssuesUsingJql should correctly calls', async ({ expect }) => { + const client = getVersion3Client({ noCheckAtlassianToken: true }); + + const issues = await client.issueSearch.searchForIssuesUsingJql({ + jql: 'assignee=currentuser()', + }); + + expect(issues.startAt).toBe(0); + expect(issues.maxResults).toBe(50); + expect(issues.issues).toStrictEqual([]); +}); diff --git a/tests/integration/version3/issueSearch.test.ts b/tests/integration/version3/issueSearch.test.ts deleted file mode 100644 index a524fc905..000000000 --- a/tests/integration/version3/issueSearch.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { afterAll, beforeAll, test } from 'vitest'; -import { cleanupEnvironment, getVersion3Client, prepareEnvironment } from '../utils/index.js'; - -beforeAll(async () => { - await prepareEnvironment(); -}); - -afterAll(async () => { - await cleanupEnvironment(); -}); - -test.sequential('searchForIssuesUsingJql should correctly calls', async ({ expect }) => { - const client = getVersion3Client({ noCheckAtlassianToken: true }); - - const issues = await client.issueSearch.searchForIssuesUsingJql({ - jql: 'assignee=currentuser()', - }); - - expect(issues.startAt).toBe(0); - expect(issues.maxResults).toBe(50); - expect(issues.issues).toStrictEqual([]); -}); diff --git a/tests/integration/version3/issueVotes.test.mts b/tests/integration/version3/issueVotes.test.mts new file mode 100644 index 000000000..fca6ce556 --- /dev/null +++ b/tests/integration/version3/issueVotes.test.mts @@ -0,0 +1,45 @@ +import { afterAll, beforeAll, test } from 'vitest'; +import type { CreatedIssue } from '@jirajs/version3/models'; +import { + cleanupEnvironment, + createIssue, + getVersion3Client, + prepareEnvironment, +} from '@tests/integration/utils'; + +const client = getVersion3Client(); +let createdIssue: CreatedIssue; + +beforeAll(async () => { + await prepareEnvironment(); + createdIssue = await createIssue(); +}); + +afterAll(async () => { + await cleanupEnvironment(); +}); + +test.sequential('should get zero votes on the issue', async ({ expect }) => { + const { votes, hasVoted } = await client.issueVotes.getVotes({ issueIdOrKey: createdIssue.id }); + + expect(votes).toBe(0); + expect(hasVoted).toBeFalsy(); +}); + +test.sequential('should add vote to issue', async ({ expect }) => { + await client.issueVotes.addVote({ issueIdOrKey: createdIssue.key }); + + const { votes, hasVoted } = await client.issueVotes.getVotes({ issueIdOrKey: createdIssue.id }); + + expect(votes).toBe(1); + expect(hasVoted).toBeTruthy(); +}); + +test.sequential('should remove vote from issue', async ({ expect }) => { + await client.issueVotes.removeVote({ issueIdOrKey: createdIssue.key }); + + const { votes, hasVoted } = await client.issueVotes.getVotes({ issueIdOrKey: createdIssue.id }); + + expect(votes).toBe(0); + expect(hasVoted).toBeFalsy(); +}); diff --git a/tests/integration/version3/issueVotes.test.ts b/tests/integration/version3/issueVotes.test.ts deleted file mode 100644 index b1c3557b8..000000000 --- a/tests/integration/version3/issueVotes.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { afterAll, beforeAll, test } from 'vitest'; -import type { CreatedIssue } from '../../../src/version3/models/index.js'; -import { - cleanupEnvironment, createIssue, getVersion3Client, prepareEnvironment, -} from '../utils/index.js'; - -const client = getVersion3Client(); -let createdIssue: CreatedIssue; - -beforeAll(async () => { - await prepareEnvironment(); - createdIssue = await createIssue(); -}); - -afterAll(async () => { - await cleanupEnvironment(); -}); - -test.sequential('should get zero votes on the issue', async ({ expect }) => { - const { votes, hasVoted } = await client.issueVotes.getVotes({ issueIdOrKey: createdIssue.id }); - - expect(votes).toBe(0); - expect(hasVoted).toBeFalsy(); -}); - -test.sequential('should add vote to issue', async ({ expect }) => { - await client.issueVotes.addVote({ issueIdOrKey: createdIssue.key }); - - const { votes, hasVoted } = await client.issueVotes.getVotes({ issueIdOrKey: createdIssue.id }); - - expect(votes).toBe(1); - expect(hasVoted).toBeTruthy(); -}); - -test.sequential('should remove vote from issue', async ({ expect }) => { - await client.issueVotes.removeVote({ issueIdOrKey: createdIssue.key }); - - const { votes, hasVoted } = await client.issueVotes.getVotes({ issueIdOrKey: createdIssue.id }); - - expect(votes).toBe(0); - expect(hasVoted).toBeFalsy(); -}); diff --git a/tests/integration/version3/issues.test.mts b/tests/integration/version3/issues.test.mts new file mode 100644 index 000000000..309579cde --- /dev/null +++ b/tests/integration/version3/issues.test.mts @@ -0,0 +1,123 @@ +import { afterAll, beforeAll, test } from 'vitest'; +import { Version3Models } from '@jirajs'; +import { Constants } from '@tests/integration/constants'; +import { cleanupEnvironment, getVersion3Client, prepareEnvironment } from '@tests/integration/utils'; + +let createdIssue: Version3Models.CreatedIssue; +const client = getVersion3Client(); + +beforeAll(async () => { + await prepareEnvironment(); +}); + +afterAll(async () => { + await cleanupEnvironment(); +}); + +test.sequential('should create issue', async ({ expect }) => { + createdIssue = await client.issues.createIssue({ + fields: { + summary: Constants.testIssueSummary, + issuetype: { + name: 'Task', + }, + project: { + key: Constants.testProjectKey, + }, + description: { + type: 'doc', + version: 1, + content: [ + { + type: 'paragraph', + content: [ + { + text: Constants.testIssueDescription, + type: 'text', + }, + ], + }, + ], + }, + }, + }); + + expect(!!createdIssue).toBeTruthy(); + expect(!!createdIssue.id).toBeTruthy(); + expect(!!createdIssue.self).toBeTruthy(); + expect(createdIssue.key).toBe(`${Constants.testProjectKey}-1`); +}); + +test.sequential('should get issue', async ({ expect }) => { + const issue = await client.issues.getIssue({ issueIdOrKey: createdIssue.id }); + + expect(!!issue).toBeTruthy(); + + // Fields section + expect(issue.fields.summary).toBe(Constants.testIssueSummary); + expect(issue.fields.description).toStrictEqual({ + content: [ + { + content: [ + { + text: Constants.testIssueDescription, + type: 'text', + }, + ], + type: 'paragraph', + }, + ], + type: 'doc', + version: 1, + }); + expect(issue.fields.status.name).toBe('To Do'); + expect(!!issue.fields.priority).toBeTruthy(); + expect(!!issue.fields.assignee).toBeTruthy(); + expect(!!issue.fields.timetracking).toBeTruthy(); + expect(!!issue.fields.issuetype).toBeTruthy(); + expect(!!issue.fields.watches).toBeTruthy(); + expect(!!issue.fields.created).toBeTruthy(); + expect(!!issue.fields.labels).toBeTruthy(); + expect(!!issue.fields.updated).toBeTruthy(); + expect(!!issue.fields.components).toBeTruthy(); + expect(!!issue.fields.attachment).toBeTruthy(); + expect(!!issue.fields.creator).toBeTruthy(); + expect(!!issue.fields.subtasks).toBeTruthy(); + expect(!!issue.fields.reporter).toBeTruthy(); + expect(!!issue.fields.comment).toBeTruthy(); + expect(!!issue.fields.votes).toBeTruthy(); + expect(!!issue.fields.worklog).toBeTruthy(); +}); + +test.sequential('should update issue description', async ({ expect }) => { + await client.issues.editIssue({ + issueIdOrKey: createdIssue.id, + fields: { + description: 'this is a new description', + }, + }); + + const issue = await client.issues.getIssue({ issueIdOrKey: createdIssue.id }); + + expect(issue.fields.description).toStrictEqual({ + content: [ + { + content: [ + { + text: 'this is a new description', + type: 'text', + }, + ], + type: 'paragraph', + }, + ], + type: 'doc', + version: 1, + }); +}); + +test.sequential('should remove issue', async ({ expect }) => { + const removedIssue = await client.issues.deleteIssue({ issueIdOrKey: createdIssue.id }); + + expect(removedIssue).toBe(''); +}); diff --git a/tests/integration/version3/issues.test.ts b/tests/integration/version3/issues.test.ts deleted file mode 100644 index b2304bd4c..000000000 --- a/tests/integration/version3/issues.test.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { afterAll, beforeAll, test } from 'vitest'; -import { Version3Models } from '../../../src/index.js'; -import { Constants } from '../constants.js'; -import { cleanupEnvironment, getVersion3Client, prepareEnvironment } from '../utils/index.js'; - -let createdIssue: Version3Models.CreatedIssue; -const client = getVersion3Client(); - -beforeAll(async () => { - await prepareEnvironment(); -}); - -afterAll(async () => { - await cleanupEnvironment(); -}); - -test.sequential('should create issue', async ({ expect }) => { - createdIssue = await client.issues.createIssue({ - fields: { - summary: Constants.testIssueSummary, - issuetype: { - name: 'Task', - }, - project: { - key: Constants.testProjectKey, - }, - description: { - type: 'doc', - version: 1, - content: [ - { - type: 'paragraph', - content: [ - { - text: Constants.testIssueDescription, - type: 'text', - }, - ], - }, - ], - }, - }, - }); - - expect(!!createdIssue).toBeTruthy(); - expect(!!createdIssue.id).toBeTruthy(); - expect(!!createdIssue.self).toBeTruthy(); - expect(createdIssue.key).toBe(`${Constants.testProjectKey}-1`); -}); - -test.sequential('should get issue', async ({ expect }) => { - const issue = await client.issues.getIssue({ issueIdOrKey: createdIssue.id }); - - expect(!!issue).toBeTruthy(); - - // Fields section - expect(issue.fields.summary).toBe(Constants.testIssueSummary); - expect(issue.fields.description).toStrictEqual({ - content: [ - { - content: [ - { - text: Constants.testIssueDescription, - type: 'text', - }, - ], - type: 'paragraph', - }, - ], - type: 'doc', - version: 1, - }); - expect(issue.fields.status.name).toBe('To Do'); - expect(!!issue.fields.priority).toBeTruthy(); - expect(!!issue.fields.assignee).toBeTruthy(); - expect(!!issue.fields.timetracking).toBeTruthy(); - expect(!!issue.fields.issuetype).toBeTruthy(); - expect(!!issue.fields.watches).toBeTruthy(); - expect(!!issue.fields.created).toBeTruthy(); - expect(!!issue.fields.labels).toBeTruthy(); - expect(!!issue.fields.updated).toBeTruthy(); - expect(!!issue.fields.components).toBeTruthy(); - expect(!!issue.fields.attachment).toBeTruthy(); - expect(!!issue.fields.creator).toBeTruthy(); - expect(!!issue.fields.subtasks).toBeTruthy(); - expect(!!issue.fields.reporter).toBeTruthy(); - expect(!!issue.fields.comment).toBeTruthy(); - expect(!!issue.fields.votes).toBeTruthy(); - expect(!!issue.fields.worklog).toBeTruthy(); -}); - -test.sequential('should update issue description', async ({ expect }) => { - await client.issues.editIssue({ - issueIdOrKey: createdIssue.id, - fields: { - description: 'this is a new description', - }, - }); - - const issue = await client.issues.getIssue({ issueIdOrKey: createdIssue.id }); - - expect(issue.fields.description).toStrictEqual({ - content: [ - { - content: [ - { - text: 'this is a new description', - type: 'text', - }, - ], - type: 'paragraph', - }, - ], - type: 'doc', - version: 1, - }); -}); - -test.sequential('should remove issue', async ({ expect }) => { - const removedIssue = await client.issues.deleteIssue({ issueIdOrKey: createdIssue.id }); - - expect(removedIssue).toBe(''); -}); diff --git a/tests/integration/version3/projectRoles.test.mts b/tests/integration/version3/projectRoles.test.mts new file mode 100644 index 000000000..bc79c002b --- /dev/null +++ b/tests/integration/version3/projectRoles.test.mts @@ -0,0 +1,22 @@ +import { afterAll, beforeAll, test } from 'vitest'; +import { Constants } from '@tests/integration/constants'; +import { cleanupEnvironment, getVersion3Client, prepareEnvironment } from '@tests/integration/utils'; + +const client = getVersion3Client(); + +beforeAll(async () => { + await prepareEnvironment(); +}); + +afterAll(async () => { + await cleanupEnvironment(); +}); + +test.sequential('should get project roles', async ({ expect }) => { + const projectRoles = await client.projectRoles.getProjectRoles({ + projectIdOrKey: Constants.testProjectKey, + }); + + expect(!!projectRoles.Administrators).toBeTruthy(); + expect(typeof projectRoles.Administrators).toBe('string'); +}); diff --git a/tests/integration/version3/projectRoles.test.ts b/tests/integration/version3/projectRoles.test.ts deleted file mode 100644 index 7bf054187..000000000 --- a/tests/integration/version3/projectRoles.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { afterAll, beforeAll, test } from 'vitest'; -import { Constants } from '../constants.js'; -import { cleanupEnvironment, getVersion3Client, prepareEnvironment } from '../utils/index.js'; - -const client = getVersion3Client(); - -beforeAll(async () => { - await prepareEnvironment(); -}); - -afterAll(async () => { - await cleanupEnvironment(); -}); - -test.sequential('should get project roles', async ({ expect }) => { - const projectRoles = await client.projectRoles.getProjectRoles({ - projectIdOrKey: Constants.testProjectKey, - }); - - expect(!!projectRoles.Administrators).toBeTruthy(); - expect(typeof projectRoles.Administrators).toBe('string'); -}); diff --git a/tests/integration/version3/projects.test.mts b/tests/integration/version3/projects.test.mts new file mode 100644 index 000000000..9f4ff2e22 --- /dev/null +++ b/tests/integration/version3/projects.test.mts @@ -0,0 +1,39 @@ +import { afterAll, beforeAll, test } from 'vitest'; +import { Constants } from '@tests/integration/constants'; +import { + cleanupEnvironment, + getVersion2Client, + getVersion3Client, + prepareEnvironment, +} from '@tests/integration/utils'; + +beforeAll(async () => { + await prepareEnvironment(); +}); + +afterAll(async () => { + await cleanupEnvironment(); +}); + +test.sequential('should search all projects', async ({ expect }) => { + const client = getVersion2Client(); + const projects = await client.projects.searchProjects(); + + expect(projects.total).toBe(1); +}); + +test.sequential(`should search ${Constants.testProjectKey} project`, async ({ expect }) => { + const client = getVersion3Client(); + + const projects = await client.projects.searchProjects({ + query: Constants.testProjectKey, + }); + + expect(projects.total).toBe(1); + expect(projects.isLast).toBeTruthy(); + + const project = projects.values[0]; + + expect(project.key).toBe(Constants.testProjectKey); + expect(project.name).toBe(Constants.testProjectName); +}); diff --git a/tests/integration/version3/projects.test.ts b/tests/integration/version3/projects.test.ts deleted file mode 100644 index 5cb9aea78..000000000 --- a/tests/integration/version3/projects.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { afterAll, beforeAll, test } from 'vitest'; -import { Constants } from '../constants.js'; -import { cleanupEnvironment, getVersion2Client, getVersion3Client, prepareEnvironment } from '../utils/index.js'; - -beforeAll(async () => { - await prepareEnvironment(); -}); - -afterAll(async () => { - await cleanupEnvironment(); -}); - -test.sequential('should search all projects', async ({ expect }) => { - const client = getVersion2Client(); - const projects = await client.projects.searchProjects(); - - expect(projects.total).toBe(1); -}); - -test.sequential(`should search ${Constants.testProjectKey} project`, async ({ expect }) => { - const client = getVersion3Client(); - - const projects = await client.projects.searchProjects({ - query: Constants.testProjectKey, - }); - - expect(projects.total).toBe(1); - expect(projects.isLast).toBeTruthy(); - - const project = projects.values[0]; - - expect(project.key).toBe(Constants.testProjectKey); - expect(project.name).toBe(Constants.testProjectName); -}); diff --git a/tests/unit/agile/board.test.mts b/tests/unit/agile/board.test.mts new file mode 100644 index 000000000..e41fc890e --- /dev/null +++ b/tests/unit/agile/board.test.mts @@ -0,0 +1,41 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { AgileClient } from '@jirajs'; + +const config = { host: 'http://localhost' }; + +test('getBoard should accept following parameters', ({ expect }) => { + const client = new AgileClient(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.board.getBoard({ boardId: 10100 }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/agile/1.0/board/10100'); +}); + +test('getAllSprints should accept following parameters', ({ expect }) => { + const client = new AgileClient(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.board.getAllSprints({ + boardId: 10111, + startAt: 0, + maxResults: 100, + state: 'testState', + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/agile/1.0/board/10111/sprint'); + expect(callArgument.params).toMatchObject({ + startAt: 0, + maxResults: 100, + state: 'testState', + }); +}); diff --git a/tests/unit/agile/board.test.ts b/tests/unit/agile/board.test.ts deleted file mode 100644 index d868403a9..000000000 --- a/tests/unit/agile/board.test.ts +++ /dev/null @@ -1,41 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { AgileClient } from '../../../src/index.js'; - -const config = { host: 'http://localhost' }; - -test('getBoard should accept following parameters', ({ expect }) => { - const client = new AgileClient(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.board.getBoard({ boardId: 10100 }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/agile/1.0/board/10100'); -}); - -test('getAllSprints should accept following parameters', ({ expect }) => { - const client = new AgileClient(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.board.getAllSprints({ - boardId: 10111, - startAt: 0, - maxResults: 100, - state: 'testState', - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/agile/1.0/board/10111/sprint'); - expect(callArgument.params).toMatchObject({ - startAt: 0, - maxResults: 100, - state: 'testState', - }); -}); diff --git a/tests/unit/agile/client/agileClient.test.mts b/tests/unit/agile/client/agileClient.test.mts new file mode 100644 index 000000000..36268eb38 --- /dev/null +++ b/tests/unit/agile/client/agileClient.test.mts @@ -0,0 +1,36 @@ +import { describe, it, expect } from 'vitest'; +import { AgileClient } from '@/agile/index.mjs'; +import { Backlog } from '@/agile/backlog.mjs'; +import { Board } from '@/agile/board.mjs'; +import { Builds } from '@/agile/builds.mjs'; +import { Deployments } from '@/agile/deployments.mjs'; +import { DevelopmentInformation } from '@/agile/developmentInformation.mjs'; +import { DevopsComponents } from '@/agile/devopsComponents.mjs'; +import { Epic } from '@/agile/epic.mjs'; +import { FeatureFlags } from '@/agile/featureFlags.mjs'; +import { Issue } from '@/agile/issue.mjs'; +import { Operations } from '@/agile/operations.mjs'; +import { RemoteLinks } from '@/agile/remoteLinks.mjs'; +import { SecurityInformation } from '@/agile/securityInformation.mjs'; +import { Sprint } from '@/agile/sprint.mjs'; + +describe('AgileClient', () => { + it('should have all required properties instantiated', () => { + const client = new AgileClient({ host: 'http://localhost:3000' }); + + // Verify each property exists and is an instance of the correct class + expect(client.backlog).toBeInstanceOf(Backlog); + expect(client.board).toBeInstanceOf(Board); + expect(client.builds).toBeInstanceOf(Builds); + expect(client.deployments).toBeInstanceOf(Deployments); + expect(client.developmentInformation).toBeInstanceOf(DevelopmentInformation); + expect(client.devopsComponents).toBeInstanceOf(DevopsComponents); + expect(client.epic).toBeInstanceOf(Epic); + expect(client.featureFlags).toBeInstanceOf(FeatureFlags); + expect(client.issue).toBeInstanceOf(Issue); + expect(client.operations).toBeInstanceOf(Operations); + expect(client.remoteLinks).toBeInstanceOf(RemoteLinks); + expect(client.securityInformation).toBeInstanceOf(SecurityInformation); + expect(client.sprint).toBeInstanceOf(Sprint); + }); +}); diff --git a/tests/unit/agile/issue.test.mts b/tests/unit/agile/issue.test.mts new file mode 100644 index 000000000..f641d6f59 --- /dev/null +++ b/tests/unit/agile/issue.test.mts @@ -0,0 +1,16 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { AgileClient } from '@jirajs'; + +test('getIssue should accept follow parameters', ({ expect }) => { + const client = new AgileClient({ host: 'http://localhost' }); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issue.getIssue({ issueIdOrKey: 'key' }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/agile/1.0/issue/key'); +}); diff --git a/tests/unit/agile/issue.test.ts b/tests/unit/agile/issue.test.ts deleted file mode 100644 index 737500633..000000000 --- a/tests/unit/agile/issue.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { AgileClient } from '../../../src/index.js'; - -test('getIssue should accept follow parameters', ({ expect }) => { - const client = new AgileClient({ host: 'http://localhost' }); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issue.getIssue({ issueIdOrKey: 'key' }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/agile/1.0/issue/key'); -}); diff --git a/tests/unit/agile/sprint.test.mts b/tests/unit/agile/sprint.test.mts new file mode 100644 index 000000000..f76dc51af --- /dev/null +++ b/tests/unit/agile/sprint.test.mts @@ -0,0 +1,22 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { AgileClient } from '@jirajs'; + +test('moveIssuesToSprintAndRank should accept follow parameters', ({ expect }) => { + const client = new AgileClient({ host: 'http://localhost' }); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.sprint.moveIssuesToSprintAndRank({ + sprintId: 10100, + issues: ['first_issue', 'second_issue'], + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/agile/1.0/sprint/10100/issue'); + expect(callArgument.data).toMatchObject({ + issues: ['first_issue', 'second_issue'], + }); +}); diff --git a/tests/unit/agile/sprint.test.ts b/tests/unit/agile/sprint.test.ts deleted file mode 100644 index 932a08143..000000000 --- a/tests/unit/agile/sprint.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { AgileClient } from '../../../src/index.js'; - -test('moveIssuesToSprintAndRank should accept follow parameters', ({ expect }) => { - const client = new AgileClient({ host: 'http://localhost' }); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.sprint.moveIssuesToSprintAndRank({ - sprintId: 10100, - issues: ['first_issue', 'second_issue'], - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/agile/1.0/sprint/10100/issue'); - expect(callArgument.data).toMatchObject({ - issues: ['first_issue', 'second_issue'], - }); -}); diff --git a/tests/unit/clients/baseClient.test.mts b/tests/unit/clients/baseClient.test.mts new file mode 100644 index 000000000..27e97e048 --- /dev/null +++ b/tests/unit/clients/baseClient.test.mts @@ -0,0 +1,89 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { BaseClient } from '@jirajs'; + +const XAtlassianToken = 'X-Atlassian-Token'; + +test('should create X-Atlassian-Token: no-check header in requests', ({ expect }) => { + const client = new BaseClient({ + host: 'http://localhost', + noCheckAtlassianToken: true, + }); + + // @ts-ignore + const defaultHeaders: Record = client.instance.defaults.headers || {}; + + expect(defaultHeaders[XAtlassianToken]).toBe('no-check'); + + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + // @ts-ignore + client.sendRequest({}, undefined); // TODO problem with never type + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.headers?.[XAtlassianToken]).toBe(undefined); +}); + +test('should not create X-Atlassian-Token: no-check header in requests case 1', ({ expect }) => { + const client = new BaseClient({ + host: 'http://localhost', + noCheckAtlassianToken: false, + }); + // @ts-ignore + const defaultHeaders: Record = client.instance.defaults.headers || {}; + + expect(defaultHeaders[XAtlassianToken]).toBe(undefined); + + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + // @ts-ignore + client.sendRequest({}, undefined); // TODO problem with never type + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.headers?.[XAtlassianToken]).toBe(undefined); +}); + +test('should create X-Atlassian-Token: no-check header in requests case 2', ({ expect }) => { + const client = new BaseClient({ + host: 'http://localhost', + }); + + // @ts-ignore + const defaultHeaders: Record = client.instance.defaults.headers || {}; + + expect(defaultHeaders[XAtlassianToken]).toBe(undefined); + + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + // @ts-ignore + client.sendRequest({}, undefined); // TODO problem with never type + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.headers?.[XAtlassianToken]).toBe(undefined); +}); + +test("shouldn't display error message for correct host urls", ({ expect }) => { + // eslint-disable-next-line no-new + new BaseClient({ + host: 'http://localhost', + }); + + // eslint-disable-next-line no-new + new BaseClient({ host: 'https://localhost/' }); +}); + +test('should display error message for incorrect host url', ({ expect }) => { + const errorMessage = "Couldn't parse the host URL. Perhaps you forgot to add 'http://' or 'https://' at the beginning of the URL?"; + + expect(() => new BaseClient({ host: '' })).toThrowError(errorMessage); + expect(() => new BaseClient({ host: 'localhost' })).toThrowError(errorMessage); + expect(() => new BaseClient({ host: 'example.com' })).toThrowError(errorMessage); +}); diff --git a/tests/unit/clients/baseClient.test.ts b/tests/unit/clients/baseClient.test.ts deleted file mode 100644 index f2acd3465..000000000 --- a/tests/unit/clients/baseClient.test.ts +++ /dev/null @@ -1,89 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { BaseClient } from '../../../src/index.js'; - -const XAtlassianToken = 'X-Atlassian-Token'; - -test('should create X-Atlassian-Token: no-check header in requests', ({ expect }) => { - const client = new BaseClient({ - host: 'http://localhost', - noCheckAtlassianToken: true, - }); - - // @ts-ignore - const defaultHeaders: Record = client.instance.defaults.headers || {}; - - expect(defaultHeaders[XAtlassianToken]).toBe('no-check'); - - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - // @ts-ignore - client.sendRequest({}, undefined); // TODO problem with never type - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.headers?.[XAtlassianToken]).toBe(undefined); -}); - -test('should not create X-Atlassian-Token: no-check header in requests case 1', ({ expect }) => { - const client = new BaseClient({ - host: 'http://localhost', - noCheckAtlassianToken: false, - }); - // @ts-ignore - const defaultHeaders: Record = client.instance.defaults.headers || {}; - - expect(defaultHeaders[XAtlassianToken]).toBe(undefined); - - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - // @ts-ignore - client.sendRequest({}, undefined); // TODO problem with never type - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.headers?.[XAtlassianToken]).toBe(undefined); -}); - -test('should create X-Atlassian-Token: no-check header in requests case 2', ({ expect }) => { - const client = new BaseClient({ - host: 'http://localhost', - }); - - // @ts-ignore - const defaultHeaders: Record = client.instance.defaults.headers || {}; - - expect(defaultHeaders[XAtlassianToken]).toBe(undefined); - - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - // @ts-ignore - client.sendRequest({}, undefined); // TODO problem with never type - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.headers?.[XAtlassianToken]).toBe(undefined); -}); - -test("shouldn't display error message for correct host urls", ({ expect }) => { - // eslint-disable-next-line no-new - new BaseClient({ - host: 'http://localhost', - }); - - // eslint-disable-next-line no-new - new BaseClient({ host: 'https://localhost/' }); -}); - -test('should display error message for incorrect host url', ({ expect }) => { - const errorMessage = "Couldn't parse the host URL. Perhaps you forgot to add 'http://' or 'https://' at the beginning of the URL?"; - - expect(() => new BaseClient({ host: '' })).toThrowError(errorMessage); - expect(() => new BaseClient({ host: 'localhost' })).toThrowError(errorMessage); - expect(() => new BaseClient({ host: 'example.com' })).toThrowError(errorMessage); -}); diff --git a/tests/unit/createClient.test.ts b/tests/unit/createClient.test.ts deleted file mode 100644 index c7dc9e6a2..000000000 --- a/tests/unit/createClient.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { test } from 'vitest'; -import { AgileClient, BaseClient, ClientType, createClient, Version2Client, Version3Client } from '../../src/index.js'; - -const defaultConfig = { host: 'http://localhost' }; - -test('should create Agile client', ({ expect }) => { - const client = createClient(ClientType.Agile, defaultConfig); - - expect(!!client).toBeTruthy(); - expect(client instanceof AgileClient).toBeTruthy(); -}); - -test('should create Version 2 client', ({ expect }) => { - const client = createClient(ClientType.Version2, defaultConfig); - - expect(!!client).toBeTruthy(); - expect(client instanceof Version2Client).toBeTruthy(); -}); - -test('should create Version 3 client', ({ expect }) => { - const client = createClient(ClientType.Version3, defaultConfig); - - expect(!!client).toBeTruthy(); - expect(client instanceof Version3Client).toBeTruthy(); -}); - -test('should create ServiceDesk client', ({ expect }) => { - const client = createClient(ClientType.Version2, defaultConfig); - - expect(!!client).toBeTruthy(); - expect(client instanceof Version2Client).toBeTruthy(); -}); - -test('should create Base client', ({ expect }) => { - // @ts-ignore - const client = createClient('baseClient', defaultConfig); - - expect(!!client).toBeTruthy(); - expect(client instanceof BaseClient).toBeTruthy(); -}); diff --git a/tests/unit/index.test.mts b/tests/unit/index.test.mts new file mode 100644 index 000000000..f1050df9c --- /dev/null +++ b/tests/unit/index.test.mts @@ -0,0 +1,41 @@ +import { test } from 'vitest'; +import { + AgileClient, + ServiceDeskClient, + Version2Client, + Version3Client, + type Callback, + type Config, +} from '@/index.mjs'; + +test('Callback should be defined', ({ expect }) => { + const callback: Callback = () => {}; + + expect(!!callback).toBeTruthy(); +}); + +test('Config should be defined', ({ expect }) => { + const config: Config = { + host: 'http://localhost', + }; + + expect(!!config).toBeTruthy(); + expect(!!config.host).toBeTruthy(); + expect(typeof config.host).toBe('string'); +}); + +test('Agile client should be defined', ({ expect }) => { + expect(!!AgileClient).toBeTruthy(); +}); + +test('Version2 client should be defined', ({ expect }) => { + expect(!!Version2Client).toBeTruthy(); +}); + +test('Version3 client should be defined', ({ expect }) => { + expect(!!Version3Client).toBeTruthy(); +}); + +test('ServiceDesk client should be defined', ({ expect }) => { + expect(!!ServiceDeskClient).toBeTruthy(); +}); diff --git a/tests/unit/index.test.ts b/tests/unit/index.test.ts deleted file mode 100644 index 719acafde..000000000 --- a/tests/unit/index.test.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { test } from 'vitest'; -import type { Callback, Config } from '../../src/index.js'; -import { - AgileClient, - AgileModels, - AgileParameters, - ServiceDeskClient, - ServiceDeskModels, - ServiceDeskParameters, - Version2Client, - Version2Models, - Version2Parameters, - Version3Client, - Version3Models, - Version3Parameters, -} from '../../src/index.js'; - -test('Callback should be defined', ({ expect }) => { - const callback: Callback = () => {}; - - expect(!!callback).toBeTruthy(); -}); - -test('Config should be defined', ({ expect }) => { - const config: Config = { - host: 'http://localhost', - }; - - expect(!!config).toBeTruthy(); - expect(!!config.host).toBeTruthy(); - expect(typeof config.host).toBe('string'); -}); - -test('Agile client should be defined', ({ expect }) => { - expect(!!AgileClient).toBeTruthy(); -}); - -test('Agile models should be defined', ({ expect }) => { - expect(!!AgileModels).toBeTruthy(); -}); - -test('Agile parameters should be defined', ({ expect }) => { - expect(!!AgileParameters).toBeTruthy(); -}); - -test('Version2 client should be defined', ({ expect }) => { - expect(!!Version2Client).toBeTruthy(); -}); - -test('Version2 models should be defined', ({ expect }) => { - expect(!!Version2Models).toBeTruthy(); -}); - -test('Version2 parameters should be defined', ({ expect }) => { - expect(!!Version2Parameters).toBeTruthy(); -}); - -test('Version3 client should be defined', ({ expect }) => { - expect(!!Version3Client).toBeTruthy(); -}); - -test('Version3 models should be defined', ({ expect }) => { - expect(!!Version3Models).toBeTruthy(); -}); - -test('Version3 parameters should be defined', ({ expect }) => { - expect(!!Version3Parameters).toBeTruthy(); -}); - -test('ServiceDesk client should be defined', ({ expect }) => { - expect(!!ServiceDeskClient).toBeTruthy(); -}); - -test('ServiceDesk models should be defined', ({ expect }) => { - expect(!!ServiceDeskModels).toBeTruthy(); -}); - -test('ServiceDesk parameters should be defined', ({ expect }) => { - expect(!!ServiceDeskParameters).toBeTruthy(); -}); diff --git a/tests/unit/serviceDesk/client/serviceDeskClient.test.mts b/tests/unit/serviceDesk/client/serviceDeskClient.test.mts new file mode 100644 index 000000000..35391e81a --- /dev/null +++ b/tests/unit/serviceDesk/client/serviceDeskClient.test.mts @@ -0,0 +1,26 @@ +import { describe, it, expect } from 'vitest'; +import { ServiceDeskClient } from '@/serviceDesk/index.mjs'; +import { Customer } from '@/serviceDesk/customer.mjs'; +import { Info } from '@/serviceDesk/info.mjs'; +import { Insight } from '@/serviceDesk/insight.mjs'; +import { KnowledgeBase } from '@/serviceDesk/knowledgeBase.mjs'; +import { Organization } from '@/serviceDesk/organization.mjs'; +import { Request } from '@/serviceDesk/request.mjs'; +import { RequestType } from '@/serviceDesk/requestType.mjs'; +import { ServiceDesk } from '@/serviceDesk/serviceDesk.mjs'; + +describe('ServiceDeskClient', () => { + it('should have all required properties instantiated', () => { + const client = new ServiceDeskClient({ host: 'http://localhost:3000' }); + + // Verify each property exists and is an instance of the correct class + expect(client.customer).toBeInstanceOf(Customer); + expect(client.info).toBeInstanceOf(Info); + expect(client.insights).toBeInstanceOf(Insight); + expect(client.knowledgeBase).toBeInstanceOf(KnowledgeBase); + expect(client.organization).toBeInstanceOf(Organization); + expect(client.request).toBeInstanceOf(Request); + expect(client.requestType).toBeInstanceOf(RequestType); + expect(client.serviceDesk).toBeInstanceOf(ServiceDesk); + }); +}); diff --git a/tests/unit/services/authenticationService.test.mts b/tests/unit/services/authenticationService.test.mts new file mode 100644 index 000000000..769b704dc --- /dev/null +++ b/tests/unit/services/authenticationService.test.mts @@ -0,0 +1,47 @@ +import { test } from 'vitest'; +import type { Config } from '@jirajs'; +import { getAuthenticationToken } from '@jirajs/services/authenticationService'; + +test('should return undefined when authentication does not used', async ({ expect }) => { + const authentication = undefined; + + const token = await getAuthenticationToken(authentication); + + expect(token).toBe(undefined); +}); + +test('should return Basic authentication token for password case', async ({ expect }) => { + const authentication: Config.Authentication = { + basic: { + username: 'test_username', + password: 'test_password', + }, + }; + + const token = await getAuthenticationToken(authentication); + + expect(token).toBe('Basic dGVzdF91c2VybmFtZTp0ZXN0X3Bhc3N3b3Jk'); +}); + +test('should return Basic authentication token for apiToken case', async ({ expect }) => { + const authentication: Config.Authentication = { + basic: { + email: 'test_email@test.qwe', + apiToken: 'test_apiToken', + }, + }; + + const token = await getAuthenticationToken(authentication); + + expect(token).toBe('Basic dGVzdF9lbWFpbEB0ZXN0LnF3ZTp0ZXN0X2FwaVRva2Vu'); +}); + +test('should generate Bearer Header correctly for Personal Access Token', async ({ expect }) => { + const authentication: Config.Authentication = { + personalAccessToken: 'secretPAT', + }; + + const token = await getAuthenticationToken(authentication); + + expect(token).toBe('Bearer secretPAT'); +}); diff --git a/tests/unit/services/authenticationService.test.ts b/tests/unit/services/authenticationService.test.ts deleted file mode 100644 index 09a7ccf36..000000000 --- a/tests/unit/services/authenticationService.test.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { test } from 'vitest'; -import type { Config } from '../../../src/index.js'; -import { getAuthenticationToken } from '../../../src/services/authenticationService/index.js'; - -test('should return undefined when authentication does not used', async ({ expect }) => { - const authentication = undefined; - - const token = await getAuthenticationToken(authentication); - - expect(token).toBe(undefined); -}); - -test('should return Basic authentication token for password case', async ({ expect }) => { - const authentication: Config.Authentication = { - basic: { - username: 'test_username', - password: 'test_password', - }, - }; - - const token = await getAuthenticationToken(authentication); - - expect(token).toBe('Basic dGVzdF91c2VybmFtZTp0ZXN0X3Bhc3N3b3Jk'); -}); - -test('should return Basic authentication token for apiToken case', async ({ expect }) => { - const authentication: Config.Authentication = { - basic: { - email: 'test_email@test.qwe', - apiToken: 'test_apiToken', - }, - }; - - const token = await getAuthenticationToken(authentication); - - expect(token).toBe('Basic dGVzdF9lbWFpbEB0ZXN0LnF3ZTp0ZXN0X2FwaVRva2Vu'); -}); - -test('should generate Bearer Header correctly for Personal Access Token', async ({ expect }) => { - const authentication: Config.Authentication = { - personalAccessToken: 'secretPAT', - }; - - const token = await getAuthenticationToken(authentication); - - expect(token).toBe('Bearer secretPAT'); -}); diff --git a/tests/unit/version2/appMigration.test.mts b/tests/unit/version2/appMigration.test.mts new file mode 100644 index 000000000..6933af1c3 --- /dev/null +++ b/tests/unit/version2/appMigration.test.mts @@ -0,0 +1,32 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { Version2Client } from '@jirajs'; + +const entity = { + entityId: 1, + key: 'k', + value: 'v', +}; + +const config = { host: 'http://localhost' }; + +test('updateEntityPropertiesValue should accept actual parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.appMigration.updateEntityPropertiesValue({ + entityType: '1', + transferId: '2', + accountId: '3', + entities: [entity], + }); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(sendRequestStub.calledOnce).toBeTruthy(); + expect(callArgument.url!.endsWith('1')).toBeTruthy(); + expect(callArgument.headers!['Atlassian-Transfer-Id']).toBe('2'); + expect(callArgument.headers!['Atlassian-Account-Id']).toBe('3'); + expect(callArgument.headers!['Content-Type']).toBe('application/json'); + expect(callArgument.data).toStrictEqual([entity]); +}); diff --git a/tests/unit/version2/appMigration.test.ts b/tests/unit/version2/appMigration.test.ts deleted file mode 100644 index 984ba891b..000000000 --- a/tests/unit/version2/appMigration.test.ts +++ /dev/null @@ -1,32 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { Version2Client } from '../../../src/index.js'; - -const entity = { - entityId: 1, - key: 'k', - value: 'v', -}; - -const config = { host: 'http://localhost' }; - -test('updateEntityPropertiesValue should accept actual parameters', ({ expect }) => { - const client = new Version2Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.appMigration.updateEntityPropertiesValue({ - entityType: '1', - transferId: '2', - accountId: '3', - entities: [entity], - }); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(sendRequestStub.calledOnce).toBeTruthy(); - expect(callArgument.url!.endsWith('1')).toBeTruthy(); - expect(callArgument.headers!['Atlassian-Transfer-Id']).toBe('2'); - expect(callArgument.headers!['Atlassian-Account-Id']).toBe('3'); - expect(callArgument.headers!['Content-Type']).toBe('application/json'); - expect(callArgument.data).toStrictEqual([entity]); -}); diff --git a/tests/unit/version2/client/version2Client.test.mts b/tests/unit/version2/client/version2Client.test.mts new file mode 100644 index 000000000..20a066369 --- /dev/null +++ b/tests/unit/version2/client/version2Client.test.mts @@ -0,0 +1,179 @@ +import { describe, it, expect } from 'vitest'; +import { Version2Client } from '@/version2/index.mjs'; +import { AnnouncementBanner } from '@/version2/announcementBanner.mjs'; +import { ApplicationRoles } from '@/version2/applicationRoles.mjs'; +import { AppMigration } from '@/version2/appMigration.mjs'; +import { AppProperties } from '@/version2/appProperties.mjs'; +import { AuditRecords } from '@/version2/auditRecords.mjs'; +import { Avatars } from '@/version2/avatars.mjs'; +import { Dashboards } from '@/version2/dashboards.mjs'; +import { DynamicModules } from '@/version2/dynamicModules.mjs'; +import { Filters } from '@/version2/filters.mjs'; +import { FilterSharing } from '@/version2/filterSharing.mjs'; +import { GroupAndUserPicker } from '@/version2/groupAndUserPicker.mjs'; +import { Groups } from '@/version2/groups.mjs'; +import { IssueAttachments } from '@/version2/issueAttachments.mjs'; +import { IssueCommentProperties } from '@/version2/issueCommentProperties.mjs'; +import { IssueComments } from '@/version2/issueComments.mjs'; +import { IssueCustomFieldConfigurationApps } from '@/version2/issueCustomFieldConfigurationApps.mjs'; +import { IssueCustomFieldContexts } from '@/version2/issueCustomFieldContexts.mjs'; +import { IssueCustomFieldOptions } from '@/version2/issueCustomFieldOptions.mjs'; +import { IssueCustomFieldOptionsApps } from '@/version2/issueCustomFieldOptionsApps.mjs'; +import { IssueCustomFieldValuesApps } from '@/version2/issueCustomFieldValuesApps.mjs'; +import { IssueFieldConfigurations } from '@/version2/issueFieldConfigurations.mjs'; +import { IssueFields } from '@/version2/issueFields.mjs'; +import { IssueLinks } from '@/version2/issueLinks.mjs'; +import { IssueLinkTypes } from '@/version2/issueLinkTypes.mjs'; +import { IssueNavigatorSettings } from '@/version2/issueNavigatorSettings.mjs'; +import { IssueNotificationSchemes } from '@/version2/issueNotificationSchemes.mjs'; +import { IssuePriorities } from '@/version2/issuePriorities.mjs'; +import { IssueProperties } from '@/version2/issueProperties.mjs'; +import { IssueRemoteLinks } from '@/version2/issueRemoteLinks.mjs'; +import { IssueResolutions } from '@/version2/issueResolutions.mjs'; +import { Issues } from '@/version2/issues.mjs'; +import { IssueSearch } from '@/version2/issueSearch.mjs'; +import { IssueSecurityLevel } from '@/version2/issueSecurityLevel.mjs'; +import { IssueSecuritySchemes } from '@/version2/issueSecuritySchemes.mjs'; +import { IssueTypeProperties } from '@/version2/issueTypeProperties.mjs'; +import { IssueTypes } from '@/version2/issueTypes.mjs'; +import { IssueTypeSchemes } from '@/version2/issueTypeSchemes.mjs'; +import { IssueTypeScreenSchemes } from '@/version2/issueTypeScreenSchemes.mjs'; +import { IssueVotes } from '@/version2/issueVotes.mjs'; +import { IssueWatchers } from '@/version2/issueWatchers.mjs'; +import { IssueWorklogProperties } from '@/version2/issueWorklogProperties.mjs'; +import { IssueWorklogs } from '@/version2/issueWorklogs.mjs'; +import { JiraExpressions } from '@/version2/jiraExpressions.mjs'; +import { JiraSettings } from '@/version2/jiraSettings.mjs'; +import { JQL } from '@/version2/jql.mjs'; +import { JqlFunctionsApps } from '@/version2/jqlFunctionsApps.mjs'; +import { Labels } from '@/version2/labels.mjs'; +import { LicenseMetrics } from '@/version2/licenseMetrics.mjs'; +import { Myself } from '@/version2/myself.mjs'; +import { Permissions } from '@/version2/permissions.mjs'; +import { PermissionSchemes } from '@/version2/permissionSchemes.mjs'; +import { ProjectAvatars } from '@/version2/projectAvatars.mjs'; +import { ProjectCategories } from '@/version2/projectCategories.mjs'; +import { ProjectComponents } from '@/version2/projectComponents.mjs'; +import { ProjectEmail } from '@/version2/projectEmail.mjs'; +import { ProjectFeatures } from '@/version2/projectFeatures.mjs'; +import { ProjectKeyAndNameValidation } from '@/version2/projectKeyAndNameValidation.mjs'; +import { ProjectPermissionSchemes } from '@/version2/projectPermissionSchemes.mjs'; +import { ProjectProperties } from '@/version2/projectProperties.mjs'; +import { ProjectRoleActors } from '@/version2/projectRoleActors.mjs'; +import { ProjectRoles } from '@/version2/projectRoles.mjs'; +import { Projects } from '@/version2/projects.mjs'; +import { ProjectTypes } from '@/version2/projectTypes.mjs'; +import { ProjectVersions } from '@/version2/projectVersions.mjs'; +import { Screens } from '@/version2/screens.mjs'; +import { ScreenSchemes } from '@/version2/screenSchemes.mjs'; +import { ScreenTabFields } from '@/version2/screenTabFields.mjs'; +import { ScreenTabs } from '@/version2/screenTabs.mjs'; +import { ServerInfo } from '@/version2/serverInfo.mjs'; +import { Status } from '@/version2/status.mjs'; +import { Tasks } from '@/version2/tasks.mjs'; +import { TimeTracking } from '@/version2/timeTracking.mjs'; +import { UiModificationsApps } from '@/version2/uiModificationsApps.mjs'; +import { UserProperties } from '@/version2/userProperties.mjs'; +import { Users } from '@/version2/users.mjs'; +import { UserSearch } from '@/version2/userSearch.mjs'; +import { Webhooks } from '@/version2/webhooks.mjs'; +import { Workflows } from '@/version2/workflows.mjs'; +import { WorkflowSchemeDrafts } from '@/version2/workflowSchemeDrafts.mjs'; +import { WorkflowSchemeProjectAssociations } from '@/version2/workflowSchemeProjectAssociations.mjs'; +import { WorkflowSchemes } from '@/version2/workflowSchemes.mjs'; +import { WorkflowStatusCategories } from '@/version2/workflowStatusCategories.mjs'; +import { WorkflowStatuses } from '@/version2/workflowStatuses.mjs'; +import { WorkflowTransitionProperties } from '@/version2/workflowTransitionProperties.mjs'; +import { WorkflowTransitionRules } from '@/version2/workflowTransitionRules.mjs'; + +describe('Version2Client', () => { + it('should have all required properties instantiated', () => { + const client = new Version2Client({ host: 'http://localhost:3000' }); + + expect(client.announcementBanner).toBeInstanceOf(AnnouncementBanner); + expect(client.applicationRoles).toBeInstanceOf(ApplicationRoles); + expect(client.appMigration).toBeInstanceOf(AppMigration); + expect(client.appProperties).toBeInstanceOf(AppProperties); + expect(client.auditRecords).toBeInstanceOf(AuditRecords); + expect(client.avatars).toBeInstanceOf(Avatars); + expect(client.dashboards).toBeInstanceOf(Dashboards); + expect(client.dynamicModules).toBeInstanceOf(DynamicModules); + expect(client.filters).toBeInstanceOf(Filters); + expect(client.filterSharing).toBeInstanceOf(FilterSharing); + expect(client.groupAndUserPicker).toBeInstanceOf(GroupAndUserPicker); + expect(client.groups).toBeInstanceOf(Groups); + expect(client.issueAttachments).toBeInstanceOf(IssueAttachments); + expect(client.issueCommentProperties).toBeInstanceOf(IssueCommentProperties); + expect(client.issueComments).toBeInstanceOf(IssueComments); + expect(client.issueCustomFieldConfigurationApps).toBeInstanceOf(IssueCustomFieldConfigurationApps); + expect(client.issueCustomFieldContexts).toBeInstanceOf(IssueCustomFieldContexts); + expect(client.issueCustomFieldOptions).toBeInstanceOf(IssueCustomFieldOptions); + expect(client.issueCustomFieldOptionsApps).toBeInstanceOf(IssueCustomFieldOptionsApps); + expect(client.issueCustomFieldValuesApps).toBeInstanceOf(IssueCustomFieldValuesApps); + expect(client.issueFieldConfigurations).toBeInstanceOf(IssueFieldConfigurations); + expect(client.issueFields).toBeInstanceOf(IssueFields); + expect(client.issueLinks).toBeInstanceOf(IssueLinks); + expect(client.issueLinkTypes).toBeInstanceOf(IssueLinkTypes); + expect(client.issueNavigatorSettings).toBeInstanceOf(IssueNavigatorSettings); + expect(client.issueNotificationSchemes).toBeInstanceOf(IssueNotificationSchemes); + expect(client.issuePriorities).toBeInstanceOf(IssuePriorities); + expect(client.issueProperties).toBeInstanceOf(IssueProperties); + expect(client.issueRemoteLinks).toBeInstanceOf(IssueRemoteLinks); + expect(client.issueResolutions).toBeInstanceOf(IssueResolutions); + expect(client.issues).toBeInstanceOf(Issues); + expect(client.issueSearch).toBeInstanceOf(IssueSearch); + expect(client.issueSecurityLevel).toBeInstanceOf(IssueSecurityLevel); + expect(client.issueSecuritySchemes).toBeInstanceOf(IssueSecuritySchemes); + expect(client.issueTypeProperties).toBeInstanceOf(IssueTypeProperties); + expect(client.issueTypes).toBeInstanceOf(IssueTypes); + expect(client.issueTypeSchemes).toBeInstanceOf(IssueTypeSchemes); + expect(client.issueTypeScreenSchemes).toBeInstanceOf(IssueTypeScreenSchemes); + expect(client.issueVotes).toBeInstanceOf(IssueVotes); + expect(client.issueWatchers).toBeInstanceOf(IssueWatchers); + expect(client.issueWorklogProperties).toBeInstanceOf(IssueWorklogProperties); + expect(client.issueWorklogs).toBeInstanceOf(IssueWorklogs); + expect(client.jiraExpressions).toBeInstanceOf(JiraExpressions); + expect(client.jiraSettings).toBeInstanceOf(JiraSettings); + expect(client.jql).toBeInstanceOf(JQL); + expect(client.jqlFunctionsApps).toBeInstanceOf(JqlFunctionsApps); + expect(client.labels).toBeInstanceOf(Labels); + expect(client.licenseMetrics).toBeInstanceOf(LicenseMetrics); + expect(client.myself).toBeInstanceOf(Myself); + expect(client.permissions).toBeInstanceOf(Permissions); + expect(client.permissionSchemes).toBeInstanceOf(PermissionSchemes); + expect(client.projectAvatars).toBeInstanceOf(ProjectAvatars); + expect(client.projectCategories).toBeInstanceOf(ProjectCategories); + expect(client.projectComponents).toBeInstanceOf(ProjectComponents); + expect(client.projectEmail).toBeInstanceOf(ProjectEmail); + expect(client.projectFeatures).toBeInstanceOf(ProjectFeatures); + expect(client.projectKeyAndNameValidation).toBeInstanceOf(ProjectKeyAndNameValidation); + expect(client.projectPermissionSchemes).toBeInstanceOf(ProjectPermissionSchemes); + expect(client.projectProperties).toBeInstanceOf(ProjectProperties); + expect(client.projectRoleActors).toBeInstanceOf(ProjectRoleActors); + expect(client.projectRoles).toBeInstanceOf(ProjectRoles); + expect(client.projects).toBeInstanceOf(Projects); + expect(client.projectTypes).toBeInstanceOf(ProjectTypes); + expect(client.projectVersions).toBeInstanceOf(ProjectVersions); + expect(client.screens).toBeInstanceOf(Screens); + expect(client.screenSchemes).toBeInstanceOf(ScreenSchemes); + expect(client.screenTabFields).toBeInstanceOf(ScreenTabFields); + expect(client.screenTabs).toBeInstanceOf(ScreenTabs); + expect(client.serverInfo).toBeInstanceOf(ServerInfo); + expect(client.status).toBeInstanceOf(Status); + expect(client.tasks).toBeInstanceOf(Tasks); + expect(client.timeTracking).toBeInstanceOf(TimeTracking); + expect(client.uiModificationsApps).toBeInstanceOf(UiModificationsApps); + expect(client.userProperties).toBeInstanceOf(UserProperties); + expect(client.users).toBeInstanceOf(Users); + expect(client.userSearch).toBeInstanceOf(UserSearch); + expect(client.webhooks).toBeInstanceOf(Webhooks); + expect(client.workflows).toBeInstanceOf(Workflows); + expect(client.workflowSchemeDrafts).toBeInstanceOf(WorkflowSchemeDrafts); + expect(client.workflowSchemeProjectAssociations).toBeInstanceOf(WorkflowSchemeProjectAssociations); + expect(client.workflowSchemes).toBeInstanceOf(WorkflowSchemes); + expect(client.workflowStatusCategories).toBeInstanceOf(WorkflowStatusCategories); + expect(client.workflowStatuses).toBeInstanceOf(WorkflowStatuses); + expect(client.workflowTransitionProperties).toBeInstanceOf(WorkflowTransitionProperties); + expect(client.workflowTransitionRules).toBeInstanceOf(WorkflowTransitionRules); + }); +}); diff --git a/tests/unit/version2/issueComments.test.mts b/tests/unit/version2/issueComments.test.mts new file mode 100644 index 000000000..9b6e25c70 --- /dev/null +++ b/tests/unit/version2/issueComments.test.mts @@ -0,0 +1,34 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { IssueComments, Version2Client } from '@jirajs/version2'; + +const client = new Version2Client({ host: 'http://localhost' }); +const sendRequestStub = sinon.stub(client, 'sendRequest'); +const issueComments = new IssueComments(client); + +test('addComment should accept follow parameters', ({ expect }) => { + issueComments.addComment({ + issueIdOrKey: 'key', + comment: 'test comment', + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/2/issue/key/comment'); + expect(callArgument.data).toStrictEqual({ + body: 'test comment', + author: undefined, + created: undefined, + id: undefined, + jsdAuthorCanSeeRequest: undefined, + jsdPublic: undefined, + properties: undefined, + renderedBody: undefined, + self: undefined, + updateAuthor: undefined, + updated: undefined, + visibility: undefined, + }); +}); diff --git a/tests/unit/version2/issueComments.test.ts b/tests/unit/version2/issueComments.test.ts deleted file mode 100644 index dbe71c55c..000000000 --- a/tests/unit/version2/issueComments.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { IssueComments, Version2Client } from '../../../src/version2/index.js'; - -const client = new Version2Client({ host: 'http://localhost' }); -const sendRequestStub = sinon.stub(client, 'sendRequest'); -const issueComments = new IssueComments(client); - -test('addComment should accept follow parameters', ({ expect }) => { - issueComments.addComment({ - issueIdOrKey: 'key', - comment: 'test comment', - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/2/issue/key/comment'); - expect(callArgument.data).toStrictEqual({ - body: 'test comment', - author: undefined, - created: undefined, - id: undefined, - jsdAuthorCanSeeRequest: undefined, - jsdPublic: undefined, - properties: undefined, - renderedBody: undefined, - self: undefined, - updateAuthor: undefined, - updated: undefined, - visibility: undefined, - }); -}); diff --git a/tests/unit/version2/issueFields.test.mts b/tests/unit/version2/issueFields.test.mts new file mode 100644 index 000000000..c09b6cacc --- /dev/null +++ b/tests/unit/version2/issueFields.test.mts @@ -0,0 +1,12 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { Version2Client } from '@jirajs'; + +test('getFields should calls without parameters', ({ expect }) => { + const client = new Version2Client({ host: 'http://localhost' }); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueFields.getFields(); + + expect(sendRequestStub.calledOnce).toBeTruthy(); +}); diff --git a/tests/unit/version2/issueFields.test.ts b/tests/unit/version2/issueFields.test.ts deleted file mode 100644 index 92877c7ff..000000000 --- a/tests/unit/version2/issueFields.test.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { Version2Client } from '../../../src/index.js'; - -test('getFields should calls without parameters', ({ expect }) => { - const client = new Version2Client({ host: 'http://localhost' }); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueFields.getFields(); - - expect(sendRequestStub.calledOnce).toBeTruthy(); -}); diff --git a/tests/unit/version2/issueLinks.test.mts b/tests/unit/version2/issueLinks.test.mts new file mode 100644 index 000000000..5a901638f --- /dev/null +++ b/tests/unit/version2/issueLinks.test.mts @@ -0,0 +1,26 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { IssueLinks, Version2Client } from '@jirajs/version2'; + +const client = new Version2Client({ host: 'http://localhost' }); +const sendRequestStub = sinon.stub(client, 'sendRequest'); +const issueLinks = new IssueLinks(client); + +test('linkIssues should calls without parameters', ({ expect }) => { + issueLinks.linkIssues({ + type: {}, + inwardIssue: {}, + outwardIssue: {}, + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.data).toStrictEqual({ + comment: undefined, + inwardIssue: {}, + outwardIssue: {}, + type: {}, + }); +}); diff --git a/tests/unit/version2/issueLinks.test.ts b/tests/unit/version2/issueLinks.test.ts deleted file mode 100644 index ecd5fcc9d..000000000 --- a/tests/unit/version2/issueLinks.test.ts +++ /dev/null @@ -1,26 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { IssueLinks, Version2Client } from '../../../src/version2/index.js'; - -const client = new Version2Client({ host: 'http://localhost' }); -const sendRequestStub = sinon.stub(client, 'sendRequest'); -const issueLinks = new IssueLinks(client); - -test('linkIssues should calls without parameters', ({ expect }) => { - issueLinks.linkIssues({ - type: {}, - inwardIssue: {}, - outwardIssue: {}, - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.data).toStrictEqual({ - comment: undefined, - inwardIssue: {}, - outwardIssue: {}, - type: {}, - }); -}); diff --git a/tests/unit/version2/issuePriorities.test.mts b/tests/unit/version2/issuePriorities.test.mts new file mode 100644 index 000000000..bcfec41cb --- /dev/null +++ b/tests/unit/version2/issuePriorities.test.mts @@ -0,0 +1,13 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { IssuePriorities, Version2Client } from '@jirajs/version2'; + +const client = new Version2Client({ host: 'http://localhost' }); +const sendRequestStub = sinon.stub(client, 'sendRequest'); +const issuePriorities = new IssuePriorities(client); + +test('getPriorities should calls without parameters', ({ expect }) => { + issuePriorities.getPriorities(); + + expect(sendRequestStub.calledOnce).toBeTruthy(); +}); diff --git a/tests/unit/version2/issuePriorities.test.ts b/tests/unit/version2/issuePriorities.test.ts deleted file mode 100644 index b27046c78..000000000 --- a/tests/unit/version2/issuePriorities.test.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { IssuePriorities, Version2Client } from '../../../src/version2/index.js'; - -const client = new Version2Client({ host: 'http://localhost' }); -const sendRequestStub = sinon.stub(client, 'sendRequest'); -const issuePriorities = new IssuePriorities(client); - -test('getPriorities should calls without parameters', ({ expect }) => { - issuePriorities.getPriorities(); - - expect(sendRequestStub.calledOnce).toBeTruthy(); -}); diff --git a/tests/unit/version2/issueRemoteLinks.test.mts b/tests/unit/version2/issueRemoteLinks.test.mts new file mode 100644 index 000000000..16d01f9ae --- /dev/null +++ b/tests/unit/version2/issueRemoteLinks.test.mts @@ -0,0 +1,34 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { IssueRemoteLinks, Version2Client } from '@jirajs/version2'; + +const client = new Version2Client({ host: 'http://localhost' }); +const sendRequestStub = sinon.stub(client, 'sendRequest'); +const issueRemoteLinks = new IssueRemoteLinks(client); + +test('createOrUpdateRemoteIssueLink should accept follow parameters', ({ expect }) => { + issueRemoteLinks.createOrUpdateRemoteIssueLink({ + issueIdOrKey: 'issue.key', + object: { + url: 'http://localhost/', + title: 'Title', + icon: {}, + }, + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/2/issue/issue.key/remotelink'); + expect(callArgument.data).toStrictEqual({ + application: undefined, + globalId: undefined, + relationship: undefined, + object: { + url: 'http://localhost/', + title: 'Title', + icon: {}, + }, + }); +}); diff --git a/tests/unit/version2/issueRemoteLinks.test.ts b/tests/unit/version2/issueRemoteLinks.test.ts deleted file mode 100644 index 25d57983d..000000000 --- a/tests/unit/version2/issueRemoteLinks.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { IssueRemoteLinks, Version2Client } from '../../../src/version2/index.js'; - -const client = new Version2Client({ host: 'http://localhost' }); -const sendRequestStub = sinon.stub(client, 'sendRequest'); -const issueRemoteLinks = new IssueRemoteLinks(client); - -test('createOrUpdateRemoteIssueLink should accept follow parameters', ({ expect }) => { - issueRemoteLinks.createOrUpdateRemoteIssueLink({ - issueIdOrKey: 'issue.key', - object: { - url: 'http://localhost/', - title: 'Title', - icon: {}, - }, - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/2/issue/issue.key/remotelink'); - expect(callArgument.data).toStrictEqual({ - application: undefined, - globalId: undefined, - relationship: undefined, - object: { - url: 'http://localhost/', - title: 'Title', - icon: {}, - }, - }); -}); diff --git a/tests/unit/version2/issueSearch.test.mts b/tests/unit/version2/issueSearch.test.mts new file mode 100644 index 000000000..484ffd892 --- /dev/null +++ b/tests/unit/version2/issueSearch.test.mts @@ -0,0 +1,69 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { IssueSearch, Version2Client } from '@jirajs/version2'; + +const config = { host: 'http://localhost' }; + +test('should be defined', ({ expect }) => { + expect(!!IssueSearch).toBeTruthy(); +}); + +test('searchForIssuesUsingJql should calls without parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJql(); + + expect(sendRequestStub.calledOnce).toBeTruthy(); +}); + +test('searchForIssuesUsingJql should accept follow parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJql({ + jql: 'id IN (TICKET_ID) ORDER BY key ASC', + maxResults: 10, + fields: ['key', 'summary'], + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.params).toStrictEqual({ + expand: undefined, + fields: ['key', 'summary'], + fieldsByKeys: undefined, + jql: 'id IN (TICKET_ID) ORDER BY key ASC', + maxResults: 10, + properties: undefined, + startAt: undefined, + validateQuery: undefined, + }); +}); + +test('searchForIssuesUsingJqlPost should accept follow parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJqlPost({ + jql: 'test Jql', + expand: ['changelog'], + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.data).toStrictEqual({ + expand: ['changelog'], + fields: undefined, + fieldsByKeys: undefined, + jql: 'test Jql', + maxResults: undefined, + properties: undefined, + startAt: undefined, + validateQuery: undefined, + }); +}); diff --git a/tests/unit/version2/issueSearch.test.ts b/tests/unit/version2/issueSearch.test.ts deleted file mode 100644 index fde828cd9..000000000 --- a/tests/unit/version2/issueSearch.test.ts +++ /dev/null @@ -1,69 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { IssueSearch, Version2Client } from '../../../src/version2/index.js'; - -const config = { host: 'http://localhost' }; - -test('should be defined', ({ expect }) => { - expect(!!IssueSearch).toBeTruthy(); -}); - -test('searchForIssuesUsingJql should calls without parameters', ({ expect }) => { - const client = new Version2Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueSearch.searchForIssuesUsingJql(); - - expect(sendRequestStub.calledOnce).toBeTruthy(); -}); - -test('searchForIssuesUsingJql should accept follow parameters', ({ expect }) => { - const client = new Version2Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueSearch.searchForIssuesUsingJql({ - jql: 'id IN (TICKET_ID) ORDER BY key ASC', - maxResults: 10, - fields: ['key', 'summary'], - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.params).toStrictEqual({ - expand: undefined, - fields: ['key', 'summary'], - fieldsByKeys: undefined, - jql: 'id IN (TICKET_ID) ORDER BY key ASC', - maxResults: 10, - properties: undefined, - startAt: undefined, - validateQuery: undefined, - }); -}); - -test('searchForIssuesUsingJqlPost should accept follow parameters', ({ expect }) => { - const client = new Version2Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueSearch.searchForIssuesUsingJqlPost({ - jql: 'test JQL', - expand: ['changelog'], - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.data).toStrictEqual({ - expand: ['changelog'], - fields: undefined, - fieldsByKeys: undefined, - jql: 'test JQL', - maxResults: undefined, - properties: undefined, - startAt: undefined, - validateQuery: undefined, - }); -}); diff --git a/tests/unit/version2/issueVotes.test.mts b/tests/unit/version2/issueVotes.test.mts new file mode 100644 index 000000000..1c885b509 --- /dev/null +++ b/tests/unit/version2/issueVotes.test.mts @@ -0,0 +1,23 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { Version2Client } from '@jirajs'; +import { IssueVotes } from '@jirajs/version2'; + +const client = new Version2Client({ host: 'http://localhost' }); +const sendRequestStub = sinon.stub(client, 'sendRequest'); +const issueVote = new IssueVotes(client); + +test("should contains 'Content-Type'", ({ expect }) => { + issueVote.addVote({ issueIdOrKey: 'TEST-2' }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + expect( + sendRequestStub.lastCall.calledWith({ + url: '/rest/api/2/issue/TEST-2/votes', + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }), + ).toBeTruthy(); +}); diff --git a/tests/unit/version2/issueVotes.test.ts b/tests/unit/version2/issueVotes.test.ts deleted file mode 100644 index 1248dbad8..000000000 --- a/tests/unit/version2/issueVotes.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { Version2Client } from '../../../src/index.js'; -import { IssueVotes } from '../../../src/version2/index.js'; - -const client = new Version2Client({ host: 'http://localhost' }); -const sendRequestStub = sinon.stub(client, 'sendRequest'); -const issueVote = new IssueVotes(client); - -test("should contains 'Content-Type'", ({ expect }) => { - issueVote.addVote({ issueIdOrKey: 'TEST-2' }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - expect( - sendRequestStub.lastCall.calledWith({ - url: '/rest/api/2/issue/TEST-2/votes', - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - }), - ).toBeTruthy(); -}); diff --git a/tests/unit/version2/issueWatcher.test.mts b/tests/unit/version2/issueWatcher.test.mts new file mode 100644 index 000000000..c90bb5a0d --- /dev/null +++ b/tests/unit/version2/issueWatcher.test.mts @@ -0,0 +1,15 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { Version2Client } from '@jirajs'; + +test('addWatcher should accept accountId', ({ expect }) => { + const client = new Version2Client({ host: 'http://localhost' }); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueWatchers.addWatcher({ issueIdOrKey: '', accountId: '101010' }); + + const callArgument = sendRequestStub.lastCall.args[0]; + + expect(sendRequestStub.calledOnce).toBeTruthy(); + expect(callArgument.data).toBe('101010'); +}); diff --git a/tests/unit/version2/issueWatcher.test.ts b/tests/unit/version2/issueWatcher.test.ts deleted file mode 100644 index 8be4ea6b8..000000000 --- a/tests/unit/version2/issueWatcher.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { Version2Client } from '../../../src/index.js'; - -test('addWatcher should accept accountId', ({ expect }) => { - const client = new Version2Client({ host: 'http://localhost' }); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueWatchers.addWatcher({ issueIdOrKey: '', accountId: '101010' }); - - const callArgument = sendRequestStub.lastCall.args[0]; - - expect(sendRequestStub.calledOnce).toBeTruthy(); - expect(callArgument.data).toBe('101010'); -}); diff --git a/tests/unit/version2/issues.test.mts b/tests/unit/version2/issues.test.mts new file mode 100644 index 000000000..e9973a776 --- /dev/null +++ b/tests/unit/version2/issues.test.mts @@ -0,0 +1,128 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { Version2Client } from '@jirajs'; + +const config = { host: 'http://localhost' }; + +test('createIssue should accept follow parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issues.createIssue({ + fields: { + summary: 'My issue name', + project: { + key: 'TEST', + }, + issuetype: { + name: '10004', + }, + labels: ['test label'], + }, + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.data).toStrictEqual({ + fields: { + summary: 'My issue name', + project: { + key: 'TEST', + }, + issuetype: { + name: '10004', + }, + labels: ['test label'], + }, + historyMetadata: undefined, + properties: undefined, + transition: undefined, + update: undefined, + }); +}); + +test('editIssue should accept follow parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issues.editIssue({ + issueIdOrKey: 'issueId', + notifyUsers: false, + fields: { + description: 'desc', + }, + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/2/issue/issueId'); + expect(callArgument.params).toStrictEqual({ + expand: undefined, + notifyUsers: false, + overrideEditableFlag: undefined, + overrideScreenSecurity: undefined, + returnIssue: undefined, + }); + expect(callArgument.data).toStrictEqual({ + fields: { description: 'desc' }, + historyMetadata: undefined, + properties: undefined, + transition: undefined, + update: undefined, + }); +}); + +test('doTransition should accept follow parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issues.doTransition({ + issueIdOrKey: 'idOrKey', + transition: { + name: 'transition', + id: '31', + to: { + id: '41', + name: 'new transition', + }, + }, + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/2/issue/idOrKey/transitions'); + expect(callArgument.data).toStrictEqual({ + fields: undefined, + historyMetadata: undefined, + properties: undefined, + transition: { + name: 'transition', + id: '31', + to: { + id: '41', + name: 'new transition', + }, + }, + update: undefined, + }); +}); + +test('deleteIssue should accept follow parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issues.deleteIssue({ issueIdOrKey: 'issueKey', deleteSubtasks: true }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/2/issue/issueKey'); + expect(callArgument.params).toStrictEqual({ deleteSubtasks: true }); +}); diff --git a/tests/unit/version2/issues.test.ts b/tests/unit/version2/issues.test.ts deleted file mode 100644 index 39a800a67..000000000 --- a/tests/unit/version2/issues.test.ts +++ /dev/null @@ -1,128 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { Version2Client } from '../../../src/index.js'; - -const config = { host: 'http://localhost' }; - -test('createIssue should accept follow parameters', ({ expect }) => { - const client = new Version2Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issues.createIssue({ - fields: { - summary: 'My issue name', - project: { - key: 'TEST', - }, - issuetype: { - name: '10004', - }, - labels: ['test label'], - }, - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.data).toStrictEqual({ - fields: { - summary: 'My issue name', - project: { - key: 'TEST', - }, - issuetype: { - name: '10004', - }, - labels: ['test label'], - }, - historyMetadata: undefined, - properties: undefined, - transition: undefined, - update: undefined, - }); -}); - -test('editIssue should accept follow parameters', ({ expect }) => { - const client = new Version2Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issues.editIssue({ - issueIdOrKey: 'issueId', - notifyUsers: false, - fields: { - description: 'desc', - }, - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/2/issue/issueId'); - expect(callArgument.params).toStrictEqual({ - expand: undefined, - notifyUsers: false, - overrideEditableFlag: undefined, - overrideScreenSecurity: undefined, - returnIssue: undefined, - }); - expect(callArgument.data).toStrictEqual({ - fields: { description: 'desc' }, - historyMetadata: undefined, - properties: undefined, - transition: undefined, - update: undefined, - }); -}); - -test('doTransition should accept follow parameters', ({ expect }) => { - const client = new Version2Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issues.doTransition({ - issueIdOrKey: 'idOrKey', - transition: { - name: 'transition', - id: '31', - to: { - id: '41', - name: 'new transition', - }, - }, - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/2/issue/idOrKey/transitions'); - expect(callArgument.data).toStrictEqual({ - fields: undefined, - historyMetadata: undefined, - properties: undefined, - transition: { - name: 'transition', - id: '31', - to: { - id: '41', - name: 'new transition', - }, - }, - update: undefined, - }); -}); - -test('deleteIssue should accept follow parameters', ({ expect }) => { - const client = new Version2Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issues.deleteIssue({ issueIdOrKey: 'issueKey', deleteSubtasks: true }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/2/issue/issueKey'); - expect(callArgument.params).toStrictEqual({ deleteSubtasks: true }); -}); diff --git a/tests/unit/version2/myself.test.mts b/tests/unit/version2/myself.test.mts new file mode 100644 index 000000000..5afa2b877 --- /dev/null +++ b/tests/unit/version2/myself.test.mts @@ -0,0 +1,13 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { Myself, Version2Client } from '@jirajs/version2'; + +const client = new Version2Client({ host: 'http://localhost' }); +const sendRequestStub = sinon.stub(client, 'sendRequest'); +const myself = new Myself(client); + +test('getCurrentUser should calls without parameters', ({ expect }) => { + myself.getCurrentUser(); + + expect(sendRequestStub.calledOnce).toBeTruthy(); +}); diff --git a/tests/unit/version2/myself.test.ts b/tests/unit/version2/myself.test.ts deleted file mode 100644 index 1f35a9b6f..000000000 --- a/tests/unit/version2/myself.test.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { Myself, Version2Client } from '../../../src/version2/index.js'; - -const client = new Version2Client({ host: 'http://localhost' }); -const sendRequestStub = sinon.stub(client, 'sendRequest'); -const myself = new Myself(client); - -test('getCurrentUser should calls without parameters', ({ expect }) => { - myself.getCurrentUser(); - - expect(sendRequestStub.calledOnce).toBeTruthy(); -}); diff --git a/tests/unit/version2/projectVersions.test.mts b/tests/unit/version2/projectVersions.test.mts new file mode 100644 index 000000000..b60f9201e --- /dev/null +++ b/tests/unit/version2/projectVersions.test.mts @@ -0,0 +1,93 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { ProjectVersions, Version2Client } from '@jirajs/version2'; + +const config = { host: 'http://localhost' }; + +test('should be defined', ({ expect }) => { + expect(!!ProjectVersions).toBeTruthy(); +}); + +test('getProjectVersionsPaginated should accept follow parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.projectVersions.getProjectVersionsPaginated({ + projectIdOrKey: 'StubProjectId', + maxResults: 50, + orderBy: '-sequence', + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/2/project/StubProjectId/version'); + expect(callArgument.params).toStrictEqual({ + maxResults: 50, + orderBy: '-sequence', + expand: undefined, + query: undefined, + startAt: undefined, + status: undefined, + }); +}); + +test('getVersionRelatedIssues should accept follow parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.projectVersions.getVersionRelatedIssues({ id: 'RelatedIssueId' }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/2/version/RelatedIssueId/relatedIssueCounts'); +}); + +test('getProjectVersions should accept follow parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.projectVersions.getProjectVersions({ projectIdOrKey: 'TEST' }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/2/project/TEST/versions'); +}); + +test('createVersion should accept follow parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.projectVersions.createVersion({ + projectId: 1455, + name: 'testName', + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.data).toStrictEqual({ + archived: undefined, + description: undefined, + expand: undefined, + id: undefined, + issuesStatusForFixVersion: undefined, + moveUnfixedIssuesTo: undefined, + name: 'testName', + operations: undefined, + overdue: undefined, + projectId: 1455, + releaseDate: undefined, + released: undefined, + self: undefined, + startDate: undefined, + userReleaseDate: undefined, + userStartDate: undefined, + }); +}); diff --git a/tests/unit/version2/projectVersions.test.ts b/tests/unit/version2/projectVersions.test.ts deleted file mode 100644 index fb0a636bc..000000000 --- a/tests/unit/version2/projectVersions.test.ts +++ /dev/null @@ -1,93 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { ProjectVersions, Version2Client } from '../../../src/version2/index.js'; - -const config = { host: 'http://localhost' }; - -test('should be defined', ({ expect }) => { - expect(!!ProjectVersions).toBeTruthy(); -}); - -test('getProjectVersionsPaginated should accept follow parameters', ({ expect }) => { - const client = new Version2Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.projectVersions.getProjectVersionsPaginated({ - projectIdOrKey: 'StubProjectId', - maxResults: 50, - orderBy: '-sequence', - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/2/project/StubProjectId/version'); - expect(callArgument.params).toStrictEqual({ - maxResults: 50, - orderBy: '-sequence', - expand: undefined, - query: undefined, - startAt: undefined, - status: undefined, - }); -}); - -test('getVersionRelatedIssues should accept follow parameters', ({ expect }) => { - const client = new Version2Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.projectVersions.getVersionRelatedIssues({ id: 'RelatedIssueId' }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/2/version/RelatedIssueId/relatedIssueCounts'); -}); - -test('getProjectVersions should accept follow parameters', ({ expect }) => { - const client = new Version2Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.projectVersions.getProjectVersions({ projectIdOrKey: 'TEST' }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/2/project/TEST/versions'); -}); - -test('createVersion should accept follow parameters', ({ expect }) => { - const client = new Version2Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.projectVersions.createVersion({ - projectId: 1455, - name: 'testName', - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.data).toStrictEqual({ - archived: undefined, - description: undefined, - expand: undefined, - id: undefined, - issuesStatusForFixVersion: undefined, - moveUnfixedIssuesTo: undefined, - name: 'testName', - operations: undefined, - overdue: undefined, - projectId: 1455, - releaseDate: undefined, - released: undefined, - self: undefined, - startDate: undefined, - userReleaseDate: undefined, - userStartDate: undefined, - }); -}); diff --git a/tests/unit/version2/workflowStatuses.test.mts b/tests/unit/version2/workflowStatuses.test.mts new file mode 100644 index 000000000..cb25037ae --- /dev/null +++ b/tests/unit/version2/workflowStatuses.test.mts @@ -0,0 +1,13 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { Version2Client, WorkflowStatuses } from '@jirajs/version2'; + +const client = new Version2Client({ host: 'http://localhost' }); +const sendRequestStub = sinon.stub(client, 'sendRequest'); +const workflowStatuses = new WorkflowStatuses(client); + +test('getStatuses should calls without parameters', ({ expect }) => { + workflowStatuses.getStatuses(); + + expect(sendRequestStub.calledOnce).toBeTruthy(); +}); diff --git a/tests/unit/version2/workflowStatuses.test.ts b/tests/unit/version2/workflowStatuses.test.ts deleted file mode 100644 index 04e3774f0..000000000 --- a/tests/unit/version2/workflowStatuses.test.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { Version2Client, WorkflowStatuses } from '../../../src/version2/index.js'; - -const client = new Version2Client({ host: 'http://localhost' }); -const sendRequestStub = sinon.stub(client, 'sendRequest'); -const workflowStatuses = new WorkflowStatuses(client); - -test('getStatuses should calls without parameters', ({ expect }) => { - workflowStatuses.getStatuses(); - - expect(sendRequestStub.calledOnce).toBeTruthy(); -}); diff --git a/tests/unit/version3/appMigration.test.mts b/tests/unit/version3/appMigration.test.mts new file mode 100644 index 000000000..404e82a35 --- /dev/null +++ b/tests/unit/version3/appMigration.test.mts @@ -0,0 +1,34 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { Version3Client } from '@jirajs'; + +const entity = { + entityId: 1, + key: 'k', + value: 'v', +}; + +const config = { + host: 'http://localhost', +}; + +test('updateEntityPropertiesValue should accept actual parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.appMigration.updateEntityPropertiesValue({ + entityType: '1', + transferId: '2', + accountId: '3', + entities: [entity], + }); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(sendRequestStub.calledOnce).toBeTruthy(); + expect(callArgument.url!.endsWith('1')).toBeTruthy(); + expect(callArgument.headers!['Atlassian-Transfer-Id']).toBe('2'); + expect(callArgument.headers!['Atlassian-Account-Id']).toBe('3'); + expect(callArgument.headers!['Content-Type']).toBe('application/json'); + expect(callArgument.data).toStrictEqual([entity]); +}); diff --git a/tests/unit/version3/appMigration.test.ts b/tests/unit/version3/appMigration.test.ts deleted file mode 100644 index faf7b5028..000000000 --- a/tests/unit/version3/appMigration.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { Version3Client } from '../../../src/index.js'; - -const entity = { - entityId: 1, - key: 'k', - value: 'v', -}; - -const config = { - host: 'http://localhost', -}; - -test('updateEntityPropertiesValue should accept actual parameters', ({ expect }) => { - const client = new Version3Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.appMigration.updateEntityPropertiesValue({ - entityType: '1', - transferId: '2', - accountId: '3', - entities: [entity], - }); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(sendRequestStub.calledOnce).toBeTruthy(); - expect(callArgument.url!.endsWith('1')).toBeTruthy(); - expect(callArgument.headers!['Atlassian-Transfer-Id']).toBe('2'); - expect(callArgument.headers!['Atlassian-Account-Id']).toBe('3'); - expect(callArgument.headers!['Content-Type']).toBe('application/json'); - expect(callArgument.data).toStrictEqual([entity]); -}); diff --git a/tests/unit/version3/client/version3Client.test.mts b/tests/unit/version3/client/version3Client.test.mts new file mode 100644 index 000000000..8df5feb53 --- /dev/null +++ b/tests/unit/version3/client/version3Client.test.mts @@ -0,0 +1,181 @@ +import { describe, it, expect } from 'vitest'; +import { Version3Client } from '@/version3/index.mjs'; +import { AnnouncementBanner } from '@/version3/announcementBanner.mjs'; +import { AppMigration } from '@/version3/appMigration.mjs'; +import { AppProperties } from '@/version3/appProperties.mjs'; +import { ApplicationRoles } from '@/version3/applicationRoles.mjs'; +import { AuditRecords } from '@/version3/auditRecords.mjs'; +import { Avatars } from '@/version3/avatars.mjs'; +import { Dashboards } from '@/version3/dashboards.mjs'; +import { DynamicModules } from '@/version3/dynamicModules.mjs'; +import { FilterSharing } from '@/version3/filterSharing.mjs'; +import { Filters } from '@/version3/filters.mjs'; +import { GroupAndUserPicker } from '@/version3/groupAndUserPicker.mjs'; +import { Groups } from '@/version3/groups.mjs'; +import { InstanceInformation } from '@/version3/instanceInformation.mjs'; +import { IssueAttachments } from '@/version3/issueAttachments.mjs'; +import { IssueCommentProperties } from '@/version3/issueCommentProperties.mjs'; +import { IssueComments } from '@/version3/issueComments.mjs'; +import { IssueCustomFieldConfigurationApps } from '@/version3/issueCustomFieldConfigurationApps.mjs'; +import { IssueCustomFieldContexts } from '@/version3/issueCustomFieldContexts.mjs'; +import { IssueCustomFieldOptions } from '@/version3/issueCustomFieldOptions.mjs'; +import { IssueCustomFieldOptionsApps } from '@/version3/issueCustomFieldOptionsApps.mjs'; +import { IssueCustomFieldValuesApps } from '@/version3/issueCustomFieldValuesApps.mjs'; +import { IssueFieldConfigurations } from '@/version3/issueFieldConfigurations.mjs'; +import { IssueFields } from '@/version3/issueFields.mjs'; +import { IssueLinks } from '@/version3/issueLinks.mjs'; +import { IssueLinkTypes } from '@/version3/issueLinkTypes.mjs'; +import { IssueNavigatorSettings } from '@/version3/issueNavigatorSettings.mjs'; +import { IssueNotificationSchemes } from '@/version3/issueNotificationSchemes.mjs'; +import { IssuePriorities } from '@/version3/issuePriorities.mjs'; +import { IssueProperties } from '@/version3/issueProperties.mjs'; +import { IssueRemoteLinks } from '@/version3/issueRemoteLinks.mjs'; +import { IssueResolutions } from '@/version3/issueResolutions.mjs'; +import { Issues } from '@/version3/issues.mjs'; +import { IssueSearch } from '@/version3/issueSearch.mjs'; +import { IssueSecurityLevel } from '@/version3/issueSecurityLevel.mjs'; +import { IssueSecuritySchemes } from '@/version3/issueSecuritySchemes.mjs'; +import { IssueTypeProperties } from '@/version3/issueTypeProperties.mjs'; +import { IssueTypes } from '@/version3/issueTypes.mjs'; +import { IssueTypeSchemes } from '@/version3/issueTypeSchemes.mjs'; +import { IssueTypeScreenSchemes } from '@/version3/issueTypeScreenSchemes.mjs'; +import { IssueVotes } from '@/version3/issueVotes.mjs'; +import { IssueWatchers } from '@/version3/issueWatchers.mjs'; +import { IssueWorklogProperties } from '@/version3/issueWorklogProperties.mjs'; +import { IssueWorklogs } from '@/version3/issueWorklogs.mjs'; +import { JiraExpressions } from '@/version3/jiraExpressions.mjs'; +import { JiraSettings } from '@/version3/jiraSettings.mjs'; +import { JQL } from '@/version3/jql.mjs'; +import { JqlFunctionsApps } from '@/version3/jqlFunctionsApps.mjs'; +import { Labels } from '@/version3/labels.mjs'; +import { LicenseMetrics } from '@/version3/licenseMetrics.mjs'; +import { Myself } from '@/version3/myself.mjs'; +import { Permissions } from '@/version3/permissions.mjs'; +import { PermissionSchemes } from '@/version3/permissionSchemes.mjs'; +import { ProjectAvatars } from '@/version3/projectAvatars.mjs'; +import { ProjectCategories } from '@/version3/projectCategories.mjs'; +import { ProjectComponents } from '@/version3/projectComponents.mjs'; +import { ProjectEmail } from '@/version3/projectEmail.mjs'; +import { ProjectFeatures } from '@/version3/projectFeatures.mjs'; +import { ProjectKeyAndNameValidation } from '@/version3/projectKeyAndNameValidation.mjs'; +import { ProjectPermissionSchemes } from '@/version3/projectPermissionSchemes.mjs'; +import { ProjectProperties } from '@/version3/projectProperties.mjs'; +import { ProjectRoleActors } from '@/version3/projectRoleActors.mjs'; +import { ProjectRoles } from '@/version3/projectRoles.mjs'; +import { Projects } from '@/version3/projects.mjs'; +import { ProjectTypes } from '@/version3/projectTypes.mjs'; +import { ProjectVersions } from '@/version3/projectVersions.mjs'; +import { Screens } from '@/version3/screens.mjs'; +import { ScreenSchemes } from '@/version3/screenSchemes.mjs'; +import { ScreenTabFields } from '@/version3/screenTabFields.mjs'; +import { ScreenTabs } from '@/version3/screenTabs.mjs'; +import { ServerInfo } from '@/version3/serverInfo.mjs'; +import { Status } from '@/version3/status.mjs'; +import { Tasks } from '@/version3/tasks.mjs'; +import { TimeTracking } from '@/version3/timeTracking.mjs'; +import { UiModificationsApps } from '@/version3/uiModificationsApps.mjs'; +import { UserProperties } from '@/version3/userProperties.mjs'; +import { UserSearch } from '@/version3/userSearch.mjs'; +import { Users } from '@/version3/users.mjs'; +import { Webhooks } from '@/version3/webhooks.mjs'; +import { Workflows } from '@/version3/workflows.mjs'; +import { WorkflowSchemeDrafts } from '@/version3/workflowSchemeDrafts.mjs'; +import { WorkflowSchemeProjectAssociations } from '@/version3/workflowSchemeProjectAssociations.mjs'; +import { WorkflowSchemes } from '@/version3/workflowSchemes.mjs'; +import { WorkflowStatusCategories } from '@/version3/workflowStatusCategories.mjs'; +import { WorkflowStatuses } from '@/version3/workflowStatuses.mjs'; +import { WorkflowTransitionProperties } from '@/version3/workflowTransitionProperties.mjs'; +import { WorkflowTransitionRules } from '@/version3/workflowTransitionRules.mjs'; + +describe('Version3Client', () => { + it('should have all required properties instantiated', () => { + const client = new Version3Client({ host: 'http://localhost:3000' }); + + expect(client.announcementBanner).toBeInstanceOf(AnnouncementBanner); + expect(client.applicationRoles).toBeInstanceOf(ApplicationRoles); + expect(client.appMigration).toBeInstanceOf(AppMigration); + expect(client.appProperties).toBeInstanceOf(AppProperties); + expect(client.auditRecords).toBeInstanceOf(AuditRecords); + expect(client.avatars).toBeInstanceOf(Avatars); + expect(client.dashboards).toBeInstanceOf(Dashboards); + expect(client.dynamicModules).toBeInstanceOf(DynamicModules); + expect(client.filters).toBeInstanceOf(Filters); + expect(client.filterSharing).toBeInstanceOf(FilterSharing); + expect(client.groupAndUserPicker).toBeInstanceOf(GroupAndUserPicker); + expect(client.groups).toBeInstanceOf(Groups); + expect(client.instanceInformation).toBeInstanceOf(InstanceInformation); + expect(client.issueAttachments).toBeInstanceOf(IssueAttachments); + expect(client.issueCommentProperties).toBeInstanceOf(IssueCommentProperties); + expect(client.issueComments).toBeInstanceOf(IssueComments); + expect(client.issueCustomFieldConfigurationApps).toBeInstanceOf(IssueCustomFieldConfigurationApps); + expect(client.issueCustomFieldContexts).toBeInstanceOf(IssueCustomFieldContexts); + expect(client.issueCustomFieldOptions).toBeInstanceOf(IssueCustomFieldOptions); + expect(client.issueCustomFieldOptionsApps).toBeInstanceOf(IssueCustomFieldOptionsApps); + expect(client.issueCustomFieldValuesApps).toBeInstanceOf(IssueCustomFieldValuesApps); + expect(client.issueFieldConfigurations).toBeInstanceOf(IssueFieldConfigurations); + expect(client.issueFields).toBeInstanceOf(IssueFields); + expect(client.issueLinks).toBeInstanceOf(IssueLinks); + expect(client.issueLinkTypes).toBeInstanceOf(IssueLinkTypes); + expect(client.issueNavigatorSettings).toBeInstanceOf(IssueNavigatorSettings); + expect(client.issueNotificationSchemes).toBeInstanceOf(IssueNotificationSchemes); + expect(client.issuePriorities).toBeInstanceOf(IssuePriorities); + expect(client.issueProperties).toBeInstanceOf(IssueProperties); + expect(client.issueRemoteLinks).toBeInstanceOf(IssueRemoteLinks); + expect(client.issueResolutions).toBeInstanceOf(IssueResolutions); + expect(client.issues).toBeInstanceOf(Issues); + expect(client.issueSearch).toBeInstanceOf(IssueSearch); + expect(client.issueSecurityLevel).toBeInstanceOf(IssueSecurityLevel); + expect(client.issueSecuritySchemes).toBeInstanceOf(IssueSecuritySchemes); + expect(client.issueTypeProperties).toBeInstanceOf(IssueTypeProperties); + expect(client.issueTypes).toBeInstanceOf(IssueTypes); + expect(client.issueTypeSchemes).toBeInstanceOf(IssueTypeSchemes); + expect(client.issueTypeScreenSchemes).toBeInstanceOf(IssueTypeScreenSchemes); + expect(client.issueVotes).toBeInstanceOf(IssueVotes); + expect(client.issueWatchers).toBeInstanceOf(IssueWatchers); + expect(client.issueWorklogProperties).toBeInstanceOf(IssueWorklogProperties); + expect(client.issueWorklogs).toBeInstanceOf(IssueWorklogs); + expect(client.jiraExpressions).toBeInstanceOf(JiraExpressions); + expect(client.jiraSettings).toBeInstanceOf(JiraSettings); + expect(client.jql).toBeInstanceOf(JQL); + expect(client.jqlFunctionsApps).toBeInstanceOf(JqlFunctionsApps); + expect(client.labels).toBeInstanceOf(Labels); + expect(client.licenseMetrics).toBeInstanceOf(LicenseMetrics); + expect(client.myself).toBeInstanceOf(Myself); + expect(client.permissions).toBeInstanceOf(Permissions); + expect(client.permissionSchemes).toBeInstanceOf(PermissionSchemes); + expect(client.projectAvatars).toBeInstanceOf(ProjectAvatars); + expect(client.projectCategories).toBeInstanceOf(ProjectCategories); + expect(client.projectComponents).toBeInstanceOf(ProjectComponents); + expect(client.projectEmail).toBeInstanceOf(ProjectEmail); + expect(client.projectFeatures).toBeInstanceOf(ProjectFeatures); + expect(client.projectKeyAndNameValidation).toBeInstanceOf(ProjectKeyAndNameValidation); + expect(client.projectPermissionSchemes).toBeInstanceOf(ProjectPermissionSchemes); + expect(client.projectProperties).toBeInstanceOf(ProjectProperties); + expect(client.projectRoleActors).toBeInstanceOf(ProjectRoleActors); + expect(client.projectRoles).toBeInstanceOf(ProjectRoles); + expect(client.projects).toBeInstanceOf(Projects); + expect(client.projectTypes).toBeInstanceOf(ProjectTypes); + expect(client.projectVersions).toBeInstanceOf(ProjectVersions); + expect(client.screens).toBeInstanceOf(Screens); + expect(client.screenSchemes).toBeInstanceOf(ScreenSchemes); + expect(client.screenTabFields).toBeInstanceOf(ScreenTabFields); + expect(client.screenTabs).toBeInstanceOf(ScreenTabs); + expect(client.serverInfo).toBeInstanceOf(ServerInfo); + expect(client.status).toBeInstanceOf(Status); + expect(client.tasks).toBeInstanceOf(Tasks); + expect(client.timeTracking).toBeInstanceOf(TimeTracking); + expect(client.uiModificationsApps).toBeInstanceOf(UiModificationsApps); + expect(client.userProperties).toBeInstanceOf(UserProperties); + expect(client.users).toBeInstanceOf(Users); + expect(client.userSearch).toBeInstanceOf(UserSearch); + expect(client.webhooks).toBeInstanceOf(Webhooks); + expect(client.workflows).toBeInstanceOf(Workflows); + expect(client.workflowSchemeDrafts).toBeInstanceOf(WorkflowSchemeDrafts); + expect(client.workflowSchemeProjectAssociations).toBeInstanceOf(WorkflowSchemeProjectAssociations); + expect(client.workflowSchemes).toBeInstanceOf(WorkflowSchemes); + expect(client.workflowStatusCategories).toBeInstanceOf(WorkflowStatusCategories); + expect(client.workflowStatuses).toBeInstanceOf(WorkflowStatuses); + expect(client.workflowTransitionProperties).toBeInstanceOf(WorkflowTransitionProperties); + expect(client.workflowTransitionRules).toBeInstanceOf(WorkflowTransitionRules); + }); +}); diff --git a/tests/unit/version3/issueComments.test.mts b/tests/unit/version3/issueComments.test.mts new file mode 100644 index 000000000..ba517f367 --- /dev/null +++ b/tests/unit/version3/issueComments.test.mts @@ -0,0 +1,77 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { Version3Client } from '@jirajs'; + +test('addComment should accept follow parameters', ({ expect }) => { + const client = new Version3Client({ host: 'http://localhost' }); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueComments.addComment({ + issueIdOrKey: 'key', + comment: { + type: 'doc', + version: 1, + text: 'Comment', + }, + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/3/issue/key/comment'); + expect(callArgument.data).toStrictEqual({ + author: undefined, + body: { + type: 'doc', + version: 1, + text: 'Comment', + }, + created: undefined, + id: undefined, + jsdAuthorCanSeeRequest: undefined, + jsdPublic: undefined, + properties: undefined, + renderedBody: undefined, + self: undefined, + updateAuthor: undefined, + updated: undefined, + visibility: undefined, + }); +}); + +test('addComment should accept body string and convert to simple Document', ({ expect }) => { + const client = new Version3Client({ + host: 'http://localhost', + }); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueComments.addComment({ + issueIdOrKey: 'key', + comment: 'Comment', + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/3/issue/key/comment'); + expect(callArgument.data).toStrictEqual({ + author: undefined, + body: { + type: 'doc', + version: 1, + content: [{ type: 'paragraph', content: [{ type: 'text', text: 'Comment' }] }], + }, + created: undefined, + id: undefined, + jsdAuthorCanSeeRequest: undefined, + jsdPublic: undefined, + properties: undefined, + renderedBody: undefined, + self: undefined, + updateAuthor: undefined, + updated: undefined, + visibility: undefined, + }); +}); diff --git a/tests/unit/version3/issueComments.test.ts b/tests/unit/version3/issueComments.test.ts deleted file mode 100644 index 8cf51e694..000000000 --- a/tests/unit/version3/issueComments.test.ts +++ /dev/null @@ -1,77 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { Version3Client } from '../../../src/index.js'; - -test('addComment should accept follow parameters', ({ expect }) => { - const client = new Version3Client({ host: 'http://localhost' }); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueComments.addComment({ - issueIdOrKey: 'key', - comment: { - type: 'doc', - version: 1, - text: 'Comment', - }, - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/3/issue/key/comment'); - expect(callArgument.data).toStrictEqual({ - author: undefined, - body: { - type: 'doc', - version: 1, - text: 'Comment', - }, - created: undefined, - id: undefined, - jsdAuthorCanSeeRequest: undefined, - jsdPublic: undefined, - properties: undefined, - renderedBody: undefined, - self: undefined, - updateAuthor: undefined, - updated: undefined, - visibility: undefined, - }); -}); - -test('addComment should accept body string and convert to simple Document', ({ expect }) => { - const client = new Version3Client({ - host: 'http://localhost', - }); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueComments.addComment({ - issueIdOrKey: 'key', - comment: 'Comment', - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/3/issue/key/comment'); - expect(callArgument.data).toStrictEqual({ - author: undefined, - body: { - type: 'doc', - version: 1, - content: [{ type: 'paragraph', content: [{ type: 'text', text: 'Comment' }] }], - }, - created: undefined, - id: undefined, - jsdAuthorCanSeeRequest: undefined, - jsdPublic: undefined, - properties: undefined, - renderedBody: undefined, - self: undefined, - updateAuthor: undefined, - updated: undefined, - visibility: undefined, - }); -}); diff --git a/tests/unit/version3/issueFields.test.mts b/tests/unit/version3/issueFields.test.mts new file mode 100644 index 000000000..10027e4b7 --- /dev/null +++ b/tests/unit/version3/issueFields.test.mts @@ -0,0 +1,12 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { Version3Client } from '@jirajs'; + +test('getFields should calls without parameters', ({ expect }) => { + const client = new Version3Client({ host: 'http://localhost' }); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueFields.getFields(); + + expect(sendRequestStub.calledOnce).toBeTruthy(); +}); diff --git a/tests/unit/version3/issueFields.test.ts b/tests/unit/version3/issueFields.test.ts deleted file mode 100644 index 66daad2b8..000000000 --- a/tests/unit/version3/issueFields.test.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { Version3Client } from '../../../src/index.js'; - -test('getFields should calls without parameters', ({ expect }) => { - const client = new Version3Client({ host: 'http://localhost' }); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueFields.getFields(); - - expect(sendRequestStub.calledOnce).toBeTruthy(); -}); diff --git a/tests/unit/version3/issueLinks.test.mts b/tests/unit/version3/issueLinks.test.mts new file mode 100644 index 000000000..1ed238d21 --- /dev/null +++ b/tests/unit/version3/issueLinks.test.mts @@ -0,0 +1,21 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { Version3Client } from '@jirajs'; + +test('linkIssues should calls without parameters', ({ expect }) => { + const client = new Version3Client({ host: 'http://localhost' }); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueLinks.linkIssues(); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.data).toStrictEqual({ + comment: undefined, + inwardIssue: undefined, + outwardIssue: undefined, + type: undefined, + }); +}); diff --git a/tests/unit/version3/issueLinks.test.ts b/tests/unit/version3/issueLinks.test.ts deleted file mode 100644 index 58ec63868..000000000 --- a/tests/unit/version3/issueLinks.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { Version3Client } from '../../../src/index.js'; - -test('linkIssues should calls without parameters', ({ expect }) => { - const client = new Version3Client({ host: 'http://localhost' }); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueLinks.linkIssues(); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.data).toStrictEqual({ - comment: undefined, - inwardIssue: undefined, - outwardIssue: undefined, - type: undefined, - }); -}); diff --git a/tests/unit/version3/issuePriorities.test.mts b/tests/unit/version3/issuePriorities.test.mts new file mode 100644 index 000000000..cb10216b4 --- /dev/null +++ b/tests/unit/version3/issuePriorities.test.mts @@ -0,0 +1,13 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { IssuePriorities, Version3Client } from '@jirajs/version3'; + +const client = new Version3Client({ host: 'http://localhost' }); +const sendRequestStub = sinon.stub(client, 'sendRequest'); +const issuePriorities = new IssuePriorities(client); + +test('getPriorities should calls without parameters', ({ expect }) => { + issuePriorities.getPriorities(); + + expect(sendRequestStub.calledOnce).toBeTruthy(); +}); diff --git a/tests/unit/version3/issuePriorities.test.ts b/tests/unit/version3/issuePriorities.test.ts deleted file mode 100644 index cdcd52c56..000000000 --- a/tests/unit/version3/issuePriorities.test.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { IssuePriorities, Version3Client } from '../../../src/version3/index.js'; - -const client = new Version3Client({ host: 'http://localhost' }); -const sendRequestStub = sinon.stub(client, 'sendRequest'); -const issuePriorities = new IssuePriorities(client); - -test('getPriorities should calls without parameters', ({ expect }) => { - issuePriorities.getPriorities(); - - expect(sendRequestStub.calledOnce).toBeTruthy(); -}); diff --git a/tests/unit/version3/issueRemoteLinks.test.mts b/tests/unit/version3/issueRemoteLinks.test.mts new file mode 100644 index 000000000..986449e0b --- /dev/null +++ b/tests/unit/version3/issueRemoteLinks.test.mts @@ -0,0 +1,34 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { IssueRemoteLinks, Version3Client } from '@jirajs/version3'; + +const client = new Version3Client({ host: 'http://localhost' }); +const sendRequestStub = sinon.stub(client, 'sendRequest'); +const issueRemoteLinks = new IssueRemoteLinks(client); + +test('createOrUpdateRemoteIssueLink should accept following parameters', ({ expect }) => { + issueRemoteLinks.createOrUpdateRemoteIssueLink({ + issueIdOrKey: 'issue.key', + object: { + url: 'http://localhost/', + title: 'Title', + icon: {}, + }, + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/3/issue/issue.key/remotelink'); + expect(callArgument.data).toStrictEqual({ + object: { + url: 'http://localhost/', + title: 'Title', + icon: {}, + }, + application: undefined, + globalId: undefined, + relationship: undefined, + }); +}); diff --git a/tests/unit/version3/issueRemoteLinks.test.ts b/tests/unit/version3/issueRemoteLinks.test.ts deleted file mode 100644 index b3397fd59..000000000 --- a/tests/unit/version3/issueRemoteLinks.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { IssueRemoteLinks, Version3Client } from '../../../src/version3/index.js'; - -const client = new Version3Client({ host: 'http://localhost' }); -const sendRequestStub = sinon.stub(client, 'sendRequest'); -const issueRemoteLinks = new IssueRemoteLinks(client); - -test('createOrUpdateRemoteIssueLink should accept following parameters', ({ expect }) => { - issueRemoteLinks.createOrUpdateRemoteIssueLink({ - issueIdOrKey: 'issue.key', - object: { - url: 'http://localhost/', - title: 'Title', - icon: {}, - }, - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/3/issue/issue.key/remotelink'); - expect(callArgument.data).toStrictEqual({ - object: { - url: 'http://localhost/', - title: 'Title', - icon: {}, - }, - application: undefined, - globalId: undefined, - relationship: undefined, - }); -}); diff --git a/tests/unit/version3/issueSearch.test.mts b/tests/unit/version3/issueSearch.test.mts new file mode 100644 index 000000000..6f6d2b771 --- /dev/null +++ b/tests/unit/version3/issueSearch.test.mts @@ -0,0 +1,69 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { IssueSearch, Version3Client } from '@jirajs/version3'; + +const config = { host: 'http://localhost' }; + +test('should be defined', ({ expect }) => { + expect(!!IssueSearch).toBeTruthy(); +}); + +test('searchForIssuesUsingJql should calls without parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJql(); + + expect(sendRequestStub.calledOnce).toBeTruthy(); +}); + +test('searchForIssuesUsingJql should accept follow parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJql({ + jql: 'id IN (TICKET_ID) ORDER BY key ASC', + maxResults: 10, + fields: ['key', 'summary'], + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.params).toStrictEqual({ + expand: undefined, + fields: ['key', 'summary'], + fieldsByKeys: undefined, + jql: 'id IN (TICKET_ID) ORDER BY key ASC', + maxResults: 10, + properties: undefined, + startAt: undefined, + validateQuery: undefined, + }); +}); + +test('searchForIssuesUsingJqlPost should accept follow parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJqlPost({ + jql: 'test Jql', + expand: ['changelog'], + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.data).toStrictEqual({ + expand: ['changelog'], + fields: undefined, + fieldsByKeys: undefined, + jql: 'test Jql', + maxResults: undefined, + properties: undefined, + startAt: undefined, + validateQuery: undefined, + }); +}); diff --git a/tests/unit/version3/issueSearch.test.ts b/tests/unit/version3/issueSearch.test.ts deleted file mode 100644 index 504495030..000000000 --- a/tests/unit/version3/issueSearch.test.ts +++ /dev/null @@ -1,69 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { IssueSearch, Version3Client } from '../../../src/version3/index.js'; - -const config = { host: 'http://localhost' }; - -test('should be defined', ({ expect }) => { - expect(!!IssueSearch).toBeTruthy(); -}); - -test('searchForIssuesUsingJql should calls without parameters', ({ expect }) => { - const client = new Version3Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueSearch.searchForIssuesUsingJql(); - - expect(sendRequestStub.calledOnce).toBeTruthy(); -}); - -test('searchForIssuesUsingJql should accept follow parameters', ({ expect }) => { - const client = new Version3Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueSearch.searchForIssuesUsingJql({ - jql: 'id IN (TICKET_ID) ORDER BY key ASC', - maxResults: 10, - fields: ['key', 'summary'], - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.params).toStrictEqual({ - expand: undefined, - fields: ['key', 'summary'], - fieldsByKeys: undefined, - jql: 'id IN (TICKET_ID) ORDER BY key ASC', - maxResults: 10, - properties: undefined, - startAt: undefined, - validateQuery: undefined, - }); -}); - -test('searchForIssuesUsingJqlPost should accept follow parameters', ({ expect }) => { - const client = new Version3Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueSearch.searchForIssuesUsingJqlPost({ - jql: 'test JQL', - expand: ['changelog'], - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.data).toStrictEqual({ - expand: ['changelog'], - fields: undefined, - fieldsByKeys: undefined, - jql: 'test JQL', - maxResults: undefined, - properties: undefined, - startAt: undefined, - validateQuery: undefined, - }); -}); diff --git a/tests/unit/version3/issueVotes.test.mts b/tests/unit/version3/issueVotes.test.mts new file mode 100644 index 000000000..1bd43b64e --- /dev/null +++ b/tests/unit/version3/issueVotes.test.mts @@ -0,0 +1,23 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { Version3Client } from '@jirajs'; +import { IssueVotes } from '@jirajs/version3'; + +const client = new Version3Client({ host: 'http://localhost' }); +const sendRequestStub = sinon.stub(client, 'sendRequest'); +const issueVote = new IssueVotes(client); + +test("should contains 'Content-Type'", ({ expect }) => { + issueVote.addVote({ issueIdOrKey: 'TEST-2' }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + expect( + sendRequestStub.lastCall.calledWith({ + url: '/rest/api/3/issue/TEST-2/votes', + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }), + ).toBeTruthy(); +}); diff --git a/tests/unit/version3/issueVotes.test.ts b/tests/unit/version3/issueVotes.test.ts deleted file mode 100644 index 454c555a3..000000000 --- a/tests/unit/version3/issueVotes.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { Version3Client } from '../../../src/index.js'; -import { IssueVotes } from '../../../src/version3/index.js'; - -const client = new Version3Client({ host: 'http://localhost' }); -const sendRequestStub = sinon.stub(client, 'sendRequest'); -const issueVote = new IssueVotes(client); - -test("should contains 'Content-Type'", ({ expect }) => { - issueVote.addVote({ issueIdOrKey: 'TEST-2' }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - expect( - sendRequestStub.lastCall.calledWith({ - url: '/rest/api/3/issue/TEST-2/votes', - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - }), - ).toBeTruthy(); -}); diff --git a/tests/unit/version3/issueWatcher.test.mts b/tests/unit/version3/issueWatcher.test.mts new file mode 100644 index 000000000..bff7a143a --- /dev/null +++ b/tests/unit/version3/issueWatcher.test.mts @@ -0,0 +1,15 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { Version3Client } from '@jirajs'; + +test('addWatcher should accept accountId', ({ expect }) => { + const client = new Version3Client({ host: 'http://localhost' }); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueWatchers.addWatcher({ issueIdOrKey: '', accountId: '101010' }); + + const callArgument = sendRequestStub.lastCall.args[0]; + + expect(sendRequestStub.calledOnce).toBeTruthy(); + expect(callArgument.data).toBe('101010'); +}); diff --git a/tests/unit/version3/issueWatcher.test.ts b/tests/unit/version3/issueWatcher.test.ts deleted file mode 100644 index 74d4b1f8a..000000000 --- a/tests/unit/version3/issueWatcher.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { Version3Client } from '../../../src/index.js'; - -test('addWatcher should accept accountId', ({ expect }) => { - const client = new Version3Client({ host: 'http://localhost' }); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueWatchers.addWatcher({ issueIdOrKey: '', accountId: '101010' }); - - const callArgument = sendRequestStub.lastCall.args[0]; - - expect(sendRequestStub.calledOnce).toBeTruthy(); - expect(callArgument.data).toBe('101010'); -}); diff --git a/tests/unit/version3/issues.test.mts b/tests/unit/version3/issues.test.mts new file mode 100644 index 000000000..f8f462644 --- /dev/null +++ b/tests/unit/version3/issues.test.mts @@ -0,0 +1,174 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { Version3Client } from '@jirajs'; + +const config = { host: 'http://localhost' }; + +test('createIssue should accept follow parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issues.createIssue({ + fields: { + summary: 'gg', + project: { + key: 'testProject', + }, + description: 'hello', + issuetype: { + id: 10004, + }, + labels: ['test label'], + }, + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.data).toStrictEqual({ + fields: { + summary: 'gg', + project: { + key: 'testProject', + }, + description: { + content: [ + { + type: 'paragraph', + content: [ + { + text: 'hello', + type: 'text', + }, + ], + }, + ], + type: 'doc', + version: 1, + }, + issuetype: { + id: 10004, + }, + labels: ['test label'], + }, + historyMetadata: undefined, + properties: undefined, + transition: undefined, + update: undefined, + }); +}); + +test('editIssue should accept follow parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issues.editIssue({ + issueIdOrKey: 'issueId', + notifyUsers: false, + fields: { + description: { + version: 1, + type: 'doc', + content: [ + { + type: 'paragraph', + content: [ + { + text: 'desc', + type: 'text', + }, + ], + }, + ], + }, + }, + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/3/issue/issueId'); + expect(callArgument.params).toStrictEqual({ + expand: undefined, + notifyUsers: false, + overrideEditableFlag: undefined, + overrideScreenSecurity: undefined, + returnIssue: undefined, + }); + expect(callArgument.data).toStrictEqual({ + fields: { + description: { + content: [ + { + type: 'paragraph', + content: [ + { + text: 'desc', + type: 'text', + }, + ], + }, + ], + type: 'doc', + version: 1, + }, + }, + historyMetadata: undefined, + properties: undefined, + transition: undefined, + update: undefined, + }); +}); + +test('doTransition should accept follow parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issues.doTransition({ + issueIdOrKey: 'idOrKey', + transition: { + name: 'transition', + id: '31', + to: { + id: '41', + name: 'new transition', + }, + }, + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/3/issue/idOrKey/transitions'); + expect(callArgument.data).toStrictEqual({ + fields: undefined, + historyMetadata: undefined, + properties: undefined, + transition: { + id: '31', + name: 'transition', + to: { + id: '41', + name: 'new transition', + }, + }, + update: undefined, + }); +}); + +test('deleteIssue should accept follow parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issues.deleteIssue({ issueIdOrKey: 'issueKey', deleteSubtasks: true }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/3/issue/issueKey'); + expect(callArgument.params).toStrictEqual({ deleteSubtasks: true }); +}); diff --git a/tests/unit/version3/issues.test.ts b/tests/unit/version3/issues.test.ts deleted file mode 100644 index 043b89d0e..000000000 --- a/tests/unit/version3/issues.test.ts +++ /dev/null @@ -1,174 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { Version3Client } from '../../../src/index.js'; - -const config = { host: 'http://localhost' }; - -test('createIssue should accept follow parameters', ({ expect }) => { - const client = new Version3Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issues.createIssue({ - fields: { - summary: 'gg', - project: { - key: 'testProject', - }, - description: 'hello', - issuetype: { - id: 10004, - }, - labels: ['test label'], - }, - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.data).toStrictEqual({ - fields: { - summary: 'gg', - project: { - key: 'testProject', - }, - description: { - content: [ - { - type: 'paragraph', - content: [ - { - text: 'hello', - type: 'text', - }, - ], - }, - ], - type: 'doc', - version: 1, - }, - issuetype: { - id: 10004, - }, - labels: ['test label'], - }, - historyMetadata: undefined, - properties: undefined, - transition: undefined, - update: undefined, - }); -}); - -test('editIssue should accept follow parameters', ({ expect }) => { - const client = new Version3Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issues.editIssue({ - issueIdOrKey: 'issueId', - notifyUsers: false, - fields: { - description: { - version: 1, - type: 'doc', - content: [ - { - type: 'paragraph', - content: [ - { - text: 'desc', - type: 'text', - }, - ], - }, - ], - }, - }, - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/3/issue/issueId'); - expect(callArgument.params).toStrictEqual({ - expand: undefined, - notifyUsers: false, - overrideEditableFlag: undefined, - overrideScreenSecurity: undefined, - returnIssue: undefined, - }); - expect(callArgument.data).toStrictEqual({ - fields: { - description: { - content: [ - { - type: 'paragraph', - content: [ - { - text: 'desc', - type: 'text', - }, - ], - }, - ], - type: 'doc', - version: 1, - }, - }, - historyMetadata: undefined, - properties: undefined, - transition: undefined, - update: undefined, - }); -}); - -test('doTransition should accept follow parameters', ({ expect }) => { - const client = new Version3Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issues.doTransition({ - issueIdOrKey: 'idOrKey', - transition: { - name: 'transition', - id: '31', - to: { - id: '41', - name: 'new transition', - }, - }, - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/3/issue/idOrKey/transitions'); - expect(callArgument.data).toStrictEqual({ - fields: undefined, - historyMetadata: undefined, - properties: undefined, - transition: { - id: '31', - name: 'transition', - to: { - id: '41', - name: 'new transition', - }, - }, - update: undefined, - }); -}); - -test('deleteIssue should accept follow parameters', ({ expect }) => { - const client = new Version3Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issues.deleteIssue({ issueIdOrKey: 'issueKey', deleteSubtasks: true }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/3/issue/issueKey'); - expect(callArgument.params).toStrictEqual({ deleteSubtasks: true }); -}); diff --git a/tests/unit/version3/myself.test.mts b/tests/unit/version3/myself.test.mts new file mode 100644 index 000000000..215f68f78 --- /dev/null +++ b/tests/unit/version3/myself.test.mts @@ -0,0 +1,13 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { Myself, Version3Client } from '@jirajs/version3'; + +const client = new Version3Client({ host: 'http://localhost' }); +const sendRequestStub = sinon.stub(client, 'sendRequest'); +const myself = new Myself(client); + +test('getCurrentUser should calls without parameters', ({ expect }) => { + myself.getCurrentUser(); + + expect(sendRequestStub.calledOnce).toBeTruthy(); +}); diff --git a/tests/unit/version3/myself.test.ts b/tests/unit/version3/myself.test.ts deleted file mode 100644 index 0527ced8d..000000000 --- a/tests/unit/version3/myself.test.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { Myself, Version3Client } from '../../../src/version3/index.js'; - -const client = new Version3Client({ host: 'http://localhost' }); -const sendRequestStub = sinon.stub(client, 'sendRequest'); -const myself = new Myself(client); - -test('getCurrentUser should calls without parameters', ({ expect }) => { - myself.getCurrentUser(); - - expect(sendRequestStub.calledOnce).toBeTruthy(); -}); diff --git a/tests/unit/version3/projectVersions.test.mts b/tests/unit/version3/projectVersions.test.mts new file mode 100644 index 000000000..ca33b80ca --- /dev/null +++ b/tests/unit/version3/projectVersions.test.mts @@ -0,0 +1,95 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { ProjectVersions, Version3Client } from '@jirajs/version3'; + +const config = { host: 'http://localhost' }; + +test('should be defined', ({ expect }) => { + expect(!!ProjectVersions).toBeTruthy(); +}); + +test('getProjectVersionsPaginated should accept follow parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.projectVersions.getProjectVersionsPaginated({ + projectIdOrKey: 'StubProjectId', + maxResults: 50, + orderBy: '-sequence', + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/3/project/StubProjectId/version'); + expect(callArgument.params).toStrictEqual({ + maxResults: 50, + orderBy: '-sequence', + expand: undefined, + query: undefined, + startAt: undefined, + status: undefined, + }); +}); + +test('getVersionRelatedIssues should accept follow parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.projectVersions.getVersionRelatedIssues({ + id: 'RelatedIssueId', + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/3/version/RelatedIssueId/relatedIssueCounts'); +}); + +test('getProjectVersions should accept follow parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.projectVersions.getProjectVersions({ projectIdOrKey: 'TEST' }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.url).toBe('/rest/api/3/project/TEST/versions'); +}); + +test('createVersion should accept follow parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.projectVersions.createVersion({ + projectId: 1455, + name: 'testName', + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.data).toStrictEqual({ + archived: undefined, + description: undefined, + expand: undefined, + id: undefined, + issuesStatusForFixVersion: undefined, + moveUnfixedIssuesTo: undefined, + name: 'testName', + operations: undefined, + overdue: undefined, + projectId: 1455, + releaseDate: undefined, + released: undefined, + self: undefined, + startDate: undefined, + userReleaseDate: undefined, + userStartDate: undefined, + }); +}); diff --git a/tests/unit/version3/projectVersions.test.ts b/tests/unit/version3/projectVersions.test.ts deleted file mode 100644 index 8e8ea0b02..000000000 --- a/tests/unit/version3/projectVersions.test.ts +++ /dev/null @@ -1,95 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { ProjectVersions, Version3Client } from '../../../src/version3/index.js'; - -const config = { host: 'http://localhost' }; - -test('should be defined', ({ expect }) => { - expect(!!ProjectVersions).toBeTruthy(); -}); - -test('getProjectVersionsPaginated should accept follow parameters', ({ expect }) => { - const client = new Version3Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.projectVersions.getProjectVersionsPaginated({ - projectIdOrKey: 'StubProjectId', - maxResults: 50, - orderBy: '-sequence', - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/3/project/StubProjectId/version'); - expect(callArgument.params).toStrictEqual({ - maxResults: 50, - orderBy: '-sequence', - expand: undefined, - query: undefined, - startAt: undefined, - status: undefined, - }); -}); - -test('getVersionRelatedIssues should accept follow parameters', ({ expect }) => { - const client = new Version3Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.projectVersions.getVersionRelatedIssues({ - id: 'RelatedIssueId', - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/3/version/RelatedIssueId/relatedIssueCounts'); -}); - -test('getProjectVersions should accept follow parameters', ({ expect }) => { - const client = new Version3Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.projectVersions.getProjectVersions({ projectIdOrKey: 'TEST' }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.url).toBe('/rest/api/3/project/TEST/versions'); -}); - -test('createVersion should accept follow parameters', ({ expect }) => { - const client = new Version3Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.projectVersions.createVersion({ - projectId: 1455, - name: 'testName', - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.data).toStrictEqual({ - archived: undefined, - description: undefined, - expand: undefined, - id: undefined, - issuesStatusForFixVersion: undefined, - moveUnfixedIssuesTo: undefined, - name: 'testName', - operations: undefined, - overdue: undefined, - projectId: 1455, - releaseDate: undefined, - released: undefined, - self: undefined, - startDate: undefined, - userReleaseDate: undefined, - userStartDate: undefined, - }); -}); diff --git a/tests/unit/version3/workflowStatuses.test.mts b/tests/unit/version3/workflowStatuses.test.mts new file mode 100644 index 000000000..e4d2e9252 --- /dev/null +++ b/tests/unit/version3/workflowStatuses.test.mts @@ -0,0 +1,13 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { Version3Client, WorkflowStatuses } from '@jirajs/version3'; + +const client = new Version3Client({ host: 'http://localhost' }); +const sendRequestStub = sinon.stub(client, 'sendRequest'); +const workflowStatuses = new WorkflowStatuses(client); + +test('getStatuses should calls without parameters', ({ expect }) => { + workflowStatuses.getStatuses(); + + expect(sendRequestStub.calledOnce).toBeTruthy(); +}); diff --git a/tests/unit/version3/workflowStatuses.test.ts b/tests/unit/version3/workflowStatuses.test.ts deleted file mode 100644 index 0753a09ea..000000000 --- a/tests/unit/version3/workflowStatuses.test.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { Version3Client, WorkflowStatuses } from '../../../src/version3/index.js'; - -const client = new Version3Client({ host: 'http://localhost' }); -const sendRequestStub = sinon.stub(client, 'sendRequest'); -const workflowStatuses = new WorkflowStatuses(client); - -test('getStatuses should calls without parameters', ({ expect }) => { - workflowStatuses.getStatuses(); - - expect(sendRequestStub.calledOnce).toBeTruthy(); -}); diff --git a/tsconfig.json b/tsconfig.json index 5a4b2800b..85275fa00 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,33 @@ { "compilerOptions": { - "target": "ES6", - "outDir": "out", + "target": "ES2022", + "outDir": "dist", "module": "NodeNext", "moduleResolution": "NodeNext", - "lib": ["ES2018", "DOM"], + "lib": ["ES2022", "DOM"], "baseUrl": ".", + "paths": { + "@": ["src"], + "@/*": ["src/*"], + "@jirajs": ["src"], // todo remove + "@jirajs/*": ["src/*"], // todo remove + "@tests": ["tests"], + "@tests/*": ["tests/*"] + }, "declaration": true, - "declarationMap": true, "importHelpers": true, "strict": true, - "verbatimModuleSyntax": true, + "skipLibCheck": true, "forceConsistentCasingInFileNames": true }, - "include": ["src"], - "exclude": ["node_modules", "coverage", "docs", "out", "example"] + "include": [ + "src" + ], + "exclude": [ + "node_modules", + "coverage", + "docs", + "dist", + "example" + ] } diff --git a/tsconfig.lint.json b/tsconfig.lint.json index 9653cc7ce..cdb624b7d 100644 --- a/tsconfig.lint.json +++ b/tsconfig.lint.json @@ -1,4 +1,10 @@ { "extends": "./tsconfig.json", - "include": ["examples", "rollup.config.ts", "src", "tests", "vitest.config.mts"] + "include": [ + "examples", + "rollup.config.ts", + "src", + "tests", + "vitest.config.mts" + ] } diff --git a/vitest.config.mts b/vitest.config.mts index 3d8f3167d..f3d4513f8 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -9,6 +9,14 @@ export default defineConfig({ tsconfig: 'tsconfig.lint.json', }, setupFiles: ['dotenv/config'], + coverage: { + provider: 'v8', + reporter: ['text', 'json', 'html'], + reportsDirectory: './coverage', + all: true, + include: ['src/**/*.mts'], + exclude: ['node_modules', 'test/**/*.mts'], + }, }, resolve: { alias: {