diff --git a/package-lock.json b/package-lock.json index d001898..df9af81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "msw-sp", - "version": "1.5.0", + "version": "1.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "msw-sp", - "version": "1.5.0", + "version": "1.6.0", "license": "ISC", "dependencies": { "eh-odata-parser": "^1.4.3", @@ -219,9 +219,10 @@ } }, "node_modules/@inquirer/core/node_modules/@types/node": { - "version": "20.12.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.13.tgz", - "integrity": "sha512-gBGeanV41c1L171rR7wjbMiEpEI/l5XFQdLLfhr/REwpgDy/4U8y89+i8kRiLzDyZdOkXh+cRaTetUnCYutoXA==", + "version": "20.14.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz", + "integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==", + "license": "MIT", "dependencies": { "undici-types": "~5.26.4" } @@ -411,12 +412,13 @@ } }, "node_modules/@pnp/core": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@pnp/core/-/core-4.1.0.tgz", - "integrity": "sha512-YWBe5mEZ4jcNxpagz79gkHG2kODVM9x2buuwiDkl25Hwn32iUz8FU44HQz/EOEf5b2+RrMOxreF6GiuOH2URGQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@pnp/core/-/core-4.2.0.tgz", + "integrity": "sha512-6dewgrUxl2wavAWZAWDQzmEmvztI6dXoMJOfcgdxX+MUhF83YYtjLCJaRfxMJsrnHmMJbTiIhnIAsZbaO5IczQ==", "dev": true, + "license": "MIT", "dependencies": { - "tslib": "2.6.2" + "tslib": "2.6.3" }, "engines": { "node": ">=18.12.0" @@ -427,13 +429,14 @@ } }, "node_modules/@pnp/queryable": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@pnp/queryable/-/queryable-4.1.0.tgz", - "integrity": "sha512-7wPyFbaO2mtkBeQUZxfBsxK3a73jT8zLHCk061eCxE2P36iLA/b2OMrQKmJKmDpgGlZza2ljQ5S3159mkXrOuw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@pnp/queryable/-/queryable-4.2.0.tgz", + "integrity": "sha512-DtRlsY++rQCzAyYQIF0fm+lhLOkx2fo0NSb++k/CCTPb8eLiR39PicOq7h7Zy1zWKG5D2+g90mDNa5THEmxd3Q==", "dev": true, + "license": "MIT", "dependencies": { - "@pnp/core": "4.1.0", - "tslib": "2.6.2" + "@pnp/core": "4.2.0", + "tslib": "2.6.3" }, "engines": { "node": ">=18.12.0" @@ -444,14 +447,15 @@ } }, "node_modules/@pnp/sp": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@pnp/sp/-/sp-4.1.0.tgz", - "integrity": "sha512-l3kVsGweO8iXXpCP5WN2nqq+HRCFhlOXrknTGeQRJPriHkRKiZ1cBY5SqEZ+mkBUbf+caljik6+Ex6bQlDKX5g==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@pnp/sp/-/sp-4.2.0.tgz", + "integrity": "sha512-jZ1fQC97oVRDo1DO+n2V8AlNPNwCSKTf5NFNaNJ1fZ5grBd6MzfFUm4lC7H6gk7YXaD0Y/PKge1vlGVjuL8GQw==", "dev": true, + "license": "MIT", "dependencies": { - "@pnp/core": "4.1.0", - "@pnp/queryable": "4.1.0", - "tslib": "2.6.2" + "@pnp/core": "4.2.0", + "@pnp/queryable": "4.2.0", + "tslib": "2.6.3" }, "engines": { "node": ">=18.12.0" @@ -475,9 +479,10 @@ } }, "node_modules/@types/node": { - "version": "18.19.33", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.33.tgz", - "integrity": "sha512-NR9+KrpSajr2qBVp/Yt5TU/rp+b5Mayi3+OlMlcg2cVCfRmcG5PWZ7S4+MG9PZ5gWBoc9Pd0BKSRViuBCRPu0A==", + "version": "18.19.39", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.39.tgz", + "integrity": "sha512-nPwTRDKUctxw3di5b4TfT3I0sWDiWoPQCZjXhvdkINntwr8lcoVCKsTgnXeRubKIlfnV+eN/HYk6Jb40tbcEAQ==", + "license": "MIT", "dependencies": { "undici-types": "~5.26.4" } @@ -493,16 +498,17 @@ "integrity": "sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.11.0.tgz", - "integrity": "sha512-P+qEahbgeHW4JQ/87FuItjBj8O3MYv5gELDzr8QaQ7fsll1gSMTYb6j87MYyxwf3DtD7uGFB9ShwgmCJB5KmaQ==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.14.1.tgz", + "integrity": "sha512-aAJd6bIf2vvQRjUG3ZkNXkmBpN+J7Wd0mfQiiVCJMu9Z5GcZZdcc0j8XwN/BM97Fl7e3SkTXODSk4VehUv7CGw==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.11.0", - "@typescript-eslint/type-utils": "7.11.0", - "@typescript-eslint/utils": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0", + "@typescript-eslint/scope-manager": "7.14.1", + "@typescript-eslint/type-utils": "7.14.1", + "@typescript-eslint/utils": "7.14.1", + "@typescript-eslint/visitor-keys": "7.14.1", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -526,15 +532,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.11.0.tgz", - "integrity": "sha512-yimw99teuaXVWsBcPO1Ais02kwJ1jmNA1KxE7ng0aT7ndr1pT1wqj0OJnsYVGKKlc4QJai86l/025L6z8CljOg==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-8lKUOebNLcR0D7RvlcloOacTOWzOqemWEWkKSVpMZVF/XVcwjPR+3MD08QzbW9TCGJ+DwIc6zUSGZ9vd8cO1IA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "7.11.0", - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/typescript-estree": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0", + "@typescript-eslint/scope-manager": "7.14.1", + "@typescript-eslint/types": "7.14.1", + "@typescript-eslint/typescript-estree": "7.14.1", + "@typescript-eslint/visitor-keys": "7.14.1", "debug": "^4.3.4" }, "engines": { @@ -554,13 +561,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.11.0.tgz", - "integrity": "sha512-27tGdVEiutD4POirLZX4YzT180vevUURJl4wJGmm6TrQoiYwuxTIY98PBp6L2oN+JQxzE0URvYlzJaBHIekXAw==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.14.1.tgz", + "integrity": "sha512-gPrFSsoYcsffYXTOZ+hT7fyJr95rdVe4kGVX1ps/dJ+DfmlnjFN/GcMxXcVkeHDKqsq6uAcVaQaIi3cFffmAbA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0" + "@typescript-eslint/types": "7.14.1", + "@typescript-eslint/visitor-keys": "7.14.1" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -571,13 +579,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.11.0.tgz", - "integrity": "sha512-WmppUEgYy+y1NTseNMJ6mCFxt03/7jTOy08bcg7bxJJdsM4nuhnchyBbE8vryveaJUf62noH7LodPSo5Z0WUCg==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.14.1.tgz", + "integrity": "sha512-/MzmgNd3nnbDbOi3LfasXWWe292+iuo+umJ0bCCMCPc1jLO/z2BQmWUUUXvXLbrQey/JgzdF/OV+I5bzEGwJkQ==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "7.11.0", - "@typescript-eslint/utils": "7.11.0", + "@typescript-eslint/typescript-estree": "7.14.1", + "@typescript-eslint/utils": "7.14.1", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -598,10 +607,11 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.11.0.tgz", - "integrity": "sha512-MPEsDRZTyCiXkD4vd3zywDCifi7tatc4K37KqTprCvaXptP7Xlpdw0NR2hRJTetG5TxbWDB79Ys4kLmHliEo/w==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.14.1.tgz", + "integrity": "sha512-mL7zNEOQybo5R3AavY+Am7KLv8BorIv7HCYS5rKoNZKQD9tsfGUpO4KdAn3sSUvTiS4PQkr2+K0KJbxj8H9NDg==", "dev": true, + "license": "MIT", "engines": { "node": "^18.18.0 || >=20.0.0" }, @@ -611,13 +621,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.11.0.tgz", - "integrity": "sha512-cxkhZ2C/iyi3/6U9EPc5y+a6csqHItndvN/CzbNXTNrsC3/ASoYQZEt9uMaEp+xFNjasqQyszp5TumAVKKvJeQ==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.14.1.tgz", + "integrity": "sha512-k5d0VuxViE2ulIO6FbxxSZaxqDVUyMbXcidC8rHvii0I56XZPv8cq+EhMns+d/EVIL41sMXqRbK3D10Oza1bbA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0", + "@typescript-eslint/types": "7.14.1", + "@typescript-eslint/visitor-keys": "7.14.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -639,15 +650,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.11.0.tgz", - "integrity": "sha512-xlAWwPleNRHwF37AhrZurOxA1wyXowW4PqVXZVUNCLjB48CqdPJoJWkrpH2nij9Q3Lb7rtWindtoXwxjxlKKCA==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.14.1.tgz", + "integrity": "sha512-CMmVVELns3nak3cpJhZosDkm63n+DwBlDX8g0k4QUa9BMnF+lH2lr3d130M1Zt1xxmB3LLk3NV7KQCq86ZBBhQ==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.11.0", - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/typescript-estree": "7.11.0" + "@typescript-eslint/scope-manager": "7.14.1", + "@typescript-eslint/types": "7.14.1", + "@typescript-eslint/typescript-estree": "7.14.1" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -661,12 +673,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.11.0.tgz", - "integrity": "sha512-7syYk4MzjxTEk0g/w3iqtgxnFQspDJfn6QKD36xMuuhTzjcxY7F8EmBLnALjVyaOF1/bVocu3bS/2/F7rXrveQ==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.14.1.tgz", + "integrity": "sha512-Crb+F75U1JAEtBeQGxSKwI60hZmmzaqA3z9sYsVm8X7W5cwLEm5bRe0/uXS6+MR/y8CVpKSR/ontIAIEPFcEkA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.11.0", + "@typescript-eslint/types": "7.14.1", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -778,6 +791,7 @@ "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -800,6 +814,7 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { "fill-range": "^7.1.1" }, @@ -950,6 +965,7 @@ "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, + "license": "MIT", "dependencies": { "path-type": "^4.0.0" }, @@ -1214,6 +1230,7 @@ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -1277,6 +1294,7 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1432,6 +1450,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -1459,6 +1478,7 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, + "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -1590,6 +1610,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -1711,6 +1732,7 @@ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -1720,6 +1742,7 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", "dev": true, + "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -1757,10 +1780,11 @@ "dev": true }, "node_modules/msw": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/msw/-/msw-2.3.0.tgz", - "integrity": "sha512-cDr1q/QTMzaWhY8n9lpGhceY209k29UZtdTgJ3P8Bzne3TSMchX2EM/ldvn4ATLOktpCefCU2gcEgzHc31GTPw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/msw/-/msw-2.3.1.tgz", + "integrity": "sha512-ocgvBCLn/5l3jpl1lssIb3cniuACJLoOfZu01e3n5dbJrpA5PeeWn28jCLgQDNt6d7QT8tF2fYRzm9JoEHtiig==", "hasInstallScript": true, + "license": "MIT", "dependencies": { "@bundled-es-modules/cookie": "^2.0.0", "@bundled-es-modules/statuses": "^1.0.1", @@ -1947,6 +1971,7 @@ "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -1956,6 +1981,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -2073,6 +2099,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -2115,6 +2142,7 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -2216,6 +2244,7 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -2236,10 +2265,11 @@ } }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", + "dev": true, + "license": "0BSD" }, "node_modules/type-check": { "version": "0.4.0", @@ -2266,10 +2296,11 @@ } }, "node_modules/typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", + "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", "devOptional": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index cd2d474..cb925d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "msw-sp", - "version": "1.6.0", + "version": "1.7.0", "description": "MSW handlers for mocking SharePoint REST api.", "main": "lib/index.js", "engines": { @@ -9,7 +9,7 @@ "type": "module", "scripts": { "build": "npx tsc", - "test": "node --test lib/tests/", + "test": "node --test", "lint": "npx eslint .", "watch": "npx tsc --watch" }, diff --git a/src/handlers.ts b/src/handlers.ts index b738319..e33811d 100644 --- a/src/handlers.ts +++ b/src/handlers.ts @@ -239,6 +239,11 @@ export const handlers = (options: Tenant | { tenant: Tenant, delay?: DelayMode | const listRelativeUrl = info.params.listRelativeUrl.toString(); return response(await tenantMock.sites.getSite(site).rootWeb.getList(listRelativeUrl).get(), info); }), + ...get("/_api/web/getList\\(':listRelativeUrl'\\)/forms", async (info) => { + const site = info.params.site?.toString() || "/"; + const listRelativeUrl = info.params.listRelativeUrl.toString(); + return response(await tenantMock.sites.getSite(site).rootWeb.getList(listRelativeUrl).forms.get(), info); + }), ...get("/_api/web/getList\\(':listRelativeUrl'\\)/fields", async (info) => { const site = info.params.site?.toString() || "/"; const listRelativeUrl = info.params.listRelativeUrl.toString(); @@ -264,6 +269,11 @@ export const handlers = (options: Tenant | { tenant: Tenant, delay?: DelayMode | const listId = info.params.listId.toString(); return response(await tenantMock.sites.getSite(site).rootWeb.lists.getById(listId).items.get(), info); }), + ...get("/_api/web/lists\\(':listId'\\)/forms", async (info) => { + const site = info.params.site?.toString() || "/"; + const listId = info.params.listId.toString(); + return response(await tenantMock.sites.getSite(site).rootWeb.lists.getById(listId).forms.get(), info); + }), ...get("/_api/web/lists/getByTitle\\(':title'\\)/forms", async (info) => { const site = info.params.site?.toString() || "/"; const title = info.params.title.toString(); diff --git a/src/mocks/ListMock.ts b/src/mocks/ListMock.ts index a6e6c91..415200a 100644 --- a/src/mocks/ListMock.ts +++ b/src/mocks/ListMock.ts @@ -36,13 +36,31 @@ export class ListMock { public get forms() { return { get: async () => { + if (!this.list) { + return new Response( + undefined, + { status: 404 }, + ); + } + if (!this.list.forms) { + return new Response( + JSON.stringify([ + { + "ServerRelativeUrl": `/${this.list.url || this.list.title}/DispForm.aspx`, + "FormType": 4 + }, + { + "ServerRelativeUrl": `/${this.list.url || this.list.title}/EditForm.aspx`, + "FormType": 6 + } + ]), + { status: 200 }, + ); + } + return new Response( - JSON.stringify([ - { - "ServerRelativeUrl": `/${this.list?.title}/EditForm.aspx`, - "FormType": 6 - } - ]), + JSON.stringify(this.list.forms.map(Utils.upperCaseKeys) + ), { status: 200 }, ); } diff --git a/src/tests/forms.test.ts b/src/tests/forms.test.ts new file mode 100644 index 0000000..0a71de8 --- /dev/null +++ b/src/tests/forms.test.ts @@ -0,0 +1,103 @@ +import { SPFx, spfi } from "@pnp/sp"; +import "@pnp/sp/fields/index.js"; +import "@pnp/sp/forms/index.js"; +import "@pnp/sp/items/index.js"; +import "@pnp/sp/lists/index.js"; +import "@pnp/sp/site-users/index.js"; +import "@pnp/sp/sites/index.js"; +import "@pnp/sp/webs/index.js"; +import { setupServer } from 'msw/node'; +import * as assert from "node:assert"; +import { describe, test } from "node:test"; +import { handlers } from '../handlers.js'; +import { PageType } from "../types/List.js"; + +void describe("forms", async () => { + const url = "https://tenant.sharepoint.com"; + const server = setupServer(...handlers({ + title: "tenant", + url, + sites: { + "forms": { + rootWeb: { + title: "Forms Site", + serverRelativeUrl: "/sites/forms", + lists: [ + { + title: "Forms", + baseTemplate: 100, + url: "Lists/Forms", + items: [ + ], + forms: [ + { + formType: PageType.DisplayForm, + serverRelativeUrl: "/sites/forms/Lists/forms/DispForm.aspx", + }, + ] + }, + { + id: "4e319fc6-3da4-4bcb-87fc-67446cf10aa7", + title: "Default", + baseTemplate: 100, + items: [], + url: "lists/default", + } + ], + }, + }, + }, + })); + server.listen(); + + const getContext = (serverRelativeUrl: string) => { + return { + pageContext: { + web: { + absoluteUrl: `${url}${serverRelativeUrl}`, + }, + legacyPageContext: { + formDigestTimeoutSeconds: 60, + formDigestValue: "digest", + }, + }, + }; + }; + + await test("forms", async () => { + const sp = spfi().using(SPFx(getContext("/sites/forms"))); + + const list = sp.web.getList("/sites/forms/lists/forms"); + const forms = await list.forms(); + + assert.equal(forms.length, 1); + const form = forms[0]; + + assert.equal(form.FormType, PageType.DisplayForm); + assert.equal(form.ServerRelativeUrl, "/sites/forms/Lists/forms/DispForm.aspx"); + }); + + await test("default", async () => { + const sp = spfi().using(SPFx(getContext("/sites/forms"))); + + const list = sp.web.lists.getByTitle("Default"); + const forms = await list.forms(); + + assert.ok(forms.length > 0); + const displayForm = forms.find(form => form.FormType === PageType.DisplayForm); + + assert.ok(displayForm); + }); + + await test("default getById", async () => { + const sp = spfi().using(SPFx(getContext("/sites/forms"))); + + const list = sp.web.lists.getById("4e319fc6-3da4-4bcb-87fc-67446cf10aa7"); + const forms = await list.forms(); + + assert.ok(forms.length > 0); + const displayForm = forms.find(form => form.FormType === PageType.DisplayForm); + + assert.ok(displayForm); + }); +}); \ No newline at end of file diff --git a/src/tests/lists.test.ts b/src/tests/lists.test.ts index e205a7c..5fc158f 100644 --- a/src/tests/lists.test.ts +++ b/src/tests/lists.test.ts @@ -1,4 +1,5 @@ import { SPFx, spfi } from "@pnp/sp"; +import "@pnp/sp/fields/index.js"; import "@pnp/sp/items/index.js"; import "@pnp/sp/lists/index.js"; import "@pnp/sp/site-users/index.js"; @@ -79,7 +80,14 @@ void describe("lists", async () => { "AuthorId": 1073741822, "EditorId": 1073741822, }, - ] + ], + fields: [ + { + title: "Id", + internalName: "ID", + typeAsString: "Counter", + }, + ], }, ], }, @@ -163,4 +171,14 @@ void describe("lists", async () => { assert.equal(list.ContentTypesEnabled, true); assert.equal(list.NoCrawl, true); }); + + await test("fields", async () => { + const sp = spfi().using(SPFx(getContext("/sites/events"))); + + const eventList = sp.web.lists.getByTitle("Events"); + const fields = await eventList.fields.select("InternalName")(); + assert.equal(fields.length, 1); + const field = fields[0]; + assert.equal(field.InternalName, "ID"); + }); }); \ No newline at end of file diff --git a/src/types/Field.ts b/src/types/Field.ts index 612ebea..d1eb533 100644 --- a/src/types/Field.ts +++ b/src/types/Field.ts @@ -14,6 +14,10 @@ type DateTimeField = { typeAsString: "DateTime"; } +type CounterField = { + typeAsString: "Counter"; +} + type LookupField = { typeAsString: "Lookup"; lookupField: string; @@ -24,5 +28,10 @@ export type Field = { title: string; description?: string; internalName: string; -} & (TextField | LookupField | ComputedField | NumberField | DateTimeField); +} & (TextField | + LookupField | + ComputedField | + NumberField | + DateTimeField | + CounterField); diff --git a/src/types/List.ts b/src/types/List.ts index 5f3821d..17aa918 100644 --- a/src/types/List.ts +++ b/src/types/List.ts @@ -11,8 +11,32 @@ export type List = { contentTypes?: Array; hidden?: boolean; created?: string; + forms?: Array
; } & (GenericList | SitePagesList); +export enum PageType { + Invalid = -1, + DefaultView = 0, + NormalView = 1, + DialogView = 2, + View = 3, + DisplayForm = 4, + DisplayFormDialog = 5, + EditForm = 6, + EditFormDialog = 7, + NewForm = 8, + NewFormDialog = 9, + SolutionForm = 10, + PAGE_MAXITEMS = 11 +} + +export type Form = { + id?: string, + formType?: PageType, + serverRelativeUrl?: string, + decodedUrl?: string, +} + // https://learn.microsoft.com/en-us/openspecs/sharepoint_protocols/ms-wssts/8bf797af-288c-4a1d-a14b-cf5394e636cf export type GenericList = { /**