From 82c2c115482b0ee5ab74e3a94d9e8ebb55112532 Mon Sep 17 00:00:00 2001 From: Richard Sustek Date: Mon, 9 Sep 2024 10:58:57 +0200 Subject: [PATCH 01/13] feat: updates deps --- package-lock.json | 1245 +++++++++++++++++++++------------------------ package.json | 18 +- 2 files changed, 585 insertions(+), 678 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0d25879a..374396d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,14 +15,14 @@ }, "devDependencies": { "@types/jasmine": "5.1.4", - "@types/node": "22.3.0", + "@types/node": "22.5.4", "@types/url-parse": "1.4.11", "@types/uuid": "10.0.0", - "@typescript-eslint/eslint-plugin": "8.1.0", - "@typescript-eslint/parser": "8.1.0", + "@typescript-eslint/eslint-plugin": "8.4.0", + "@typescript-eslint/parser": "8.4.0", "colors": "1.4.0", - "eslint": "9.9.0", - "jasmine-core": "5.2.0", + "eslint": "9.10.0", + "jasmine-core": "5.3.0", "jasmine-spec-reporter": "7.0.0", "karma": "6.4.4", "karma-chrome-launcher": "3.2.0", @@ -37,15 +37,15 @@ "mocha": "10.7.3", "standard-version": "9.5.0", "ts-loader": "9.5.1", - "tsx": "4.17.0", + "tsx": "4.19.0", "typescript": "5.2.2", - "typescript-eslint": "8.1.0", - "webpack": "5.93.0", + "typescript-eslint": "8.4.0", + "webpack": "5.94.0", "webpack-bundle-analyzer": "4.10.2", "webpack-cli": "5.1.4" }, "engines": { - "node": ">= 18" + "node": ">= 20" } }, "node_modules/@ampproject/remapping": { @@ -75,30 +75,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.7.tgz", - "integrity": "sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.4.tgz", + "integrity": "sha512-+LGRog6RAsCJrrrg/IO6LGmpphNe5DiK30dGjCoxxeGv49B10/3XYGxPsAwrDlMFcFEvdAUavDT8r9k/hSyQqQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.7.tgz", - "integrity": "sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.2.tgz", + "integrity": "sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.24.7", - "@babel/helper-compilation-targets": "^7.24.7", - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helpers": "^7.24.7", - "@babel/parser": "^7.24.7", - "@babel/template": "^7.24.7", - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7", + "@babel/generator": "^7.25.0", + "@babel/helper-compilation-targets": "^7.25.2", + "@babel/helper-module-transforms": "^7.25.2", + "@babel/helpers": "^7.25.0", + "@babel/parser": "^7.25.0", + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.2", + "@babel/types": "^7.25.2", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -129,12 +129,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", - "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.6.tgz", + "integrity": "sha512-VPC82gr1seXOpkjAAKoLhP50vx4vGNlF4msF64dSFq1P8RfB+QAuJWGHPXXPc8QyfVWwwB/TNNU4+ayZmHNbZw==", "dev": true, "dependencies": { - "@babel/types": "^7.24.7", + "@babel/types": "^7.25.6", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" @@ -169,14 +169,14 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.7.tgz", - "integrity": "sha512-ctSdRHBi20qWOfy27RUb4Fhp07KSJ3sXcuSvTrXrc4aG8NSYDo1ici3Vhg9bg69y5bj0Mr1lh0aeEgTvc12rMg==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz", + "integrity": "sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.24.7", - "@babel/helper-validator-option": "^7.24.7", - "browserslist": "^4.22.2", + "@babel/compat-data": "^7.25.2", + "@babel/helper-validator-option": "^7.24.8", + "browserslist": "^4.23.1", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, @@ -194,19 +194,17 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.7.tgz", - "integrity": "sha512-kTkaDl7c9vO80zeX1rJxnuRpEsD5tA81yh11X1gQo+PhSti3JS+7qeZo9U4RHobKRiFPKaGK3svUAeb8D0Q7eg==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.4.tgz", + "integrity": "sha512-ro/bFs3/84MDgDmMwbcHgDa8/E6J3QKNTk4xJJnVeFtGE+tL0K26E3pNxhYz2b67fJpt7Aphw5XcploKXuCvCQ==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-function-name": "^7.24.7", - "@babel/helper-member-expression-to-functions": "^7.24.7", + "@babel/helper-member-expression-to-functions": "^7.24.8", "@babel/helper-optimise-call-expression": "^7.24.7", - "@babel/helper-replace-supers": "^7.24.7", + "@babel/helper-replace-supers": "^7.25.0", "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", - "@babel/helper-split-export-declaration": "^7.24.7", + "@babel/traverse": "^7.25.4", "semver": "^6.3.1" }, "engines": { @@ -226,9 +224,9 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.24.7.tgz", - "integrity": "sha512-03TCmXy2FtXJEZfbXDTSqq1fRJArk7lX9DOFC/47VthYcxyIOx+eXQmdo6DOQvrbpIix+KfXwvuXdFDZHxt+rA==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.2.tgz", + "integrity": "sha512-+wqVGP+DFmqwFD3EH6TMTfUNeqDehV3E/dl+Sd54eaXqm17tEUNbEIn4sVivVowbvUpOtIGxdo3GoXyDH9N/9g==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.24.7", @@ -267,51 +265,14 @@ "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, - "node_modules/@babel/helper-environment-visitor": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", - "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-function-name": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz", - "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==", - "dev": true, - "dependencies": { - "@babel/template": "^7.24.7", - "@babel/types": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz", - "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.7.tgz", - "integrity": "sha512-LGeMaf5JN4hAT471eJdBs/GK1DoYIJ5GCtZN/EsL6KUiiDZOvO/eKE11AMZJa2zP4zk4qe9V2O/hxAmkRc8p6w==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.8.tgz", + "integrity": "sha512-LABppdt+Lp/RlBxqrh4qgf1oEH/WxdzQNDJIu5gC/W1GyvPVrOBiItmmM8wan2fm4oYqFuFfkXmlGpLQhPY8CA==", "dev": true, "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/traverse": "^7.24.8", + "@babel/types": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -331,16 +292,15 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.24.7.tgz", - "integrity": "sha512-1fuJEwIrp+97rM4RWdO+qrRsZlAeL1lQJoPqtCYWv0NL115XM93hIH4CSRln2w52SqvmY5hqdtauB6QFCDiZNQ==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz", + "integrity": "sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.24.7", "@babel/helper-module-imports": "^7.24.7", "@babel/helper-simple-access": "^7.24.7", - "@babel/helper-split-export-declaration": "^7.24.7", - "@babel/helper-validator-identifier": "^7.24.7" + "@babel/helper-validator-identifier": "^7.24.7", + "@babel/traverse": "^7.25.2" }, "engines": { "node": ">=6.9.0" @@ -362,23 +322,23 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.7.tgz", - "integrity": "sha512-Rq76wjt7yz9AAc1KnlRKNAi/dMSVWgDRx43FHoJEbcYU6xOWaE2dVPwcdTukJrjxS65GITyfbvEYHvkirZ6uEg==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz", + "integrity": "sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.24.7.tgz", - "integrity": "sha512-9pKLcTlZ92hNZMQfGCHImUpDOlAgkkpqalWEeftW5FBya75k8Li2ilerxkM/uBEj01iBZXcCIB/bwvDYgWyibA==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.0.tgz", + "integrity": "sha512-NhavI2eWEIz/H9dbrG0TuOicDhNexze43i5z7lEqwYm0WEZVTwnPpA0EafUTP7+6/W79HWIP2cTe3Z5NiSTVpw==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-wrap-function": "^7.24.7" + "@babel/helper-wrap-function": "^7.25.0", + "@babel/traverse": "^7.25.0" }, "engines": { "node": ">=6.9.0" @@ -388,14 +348,14 @@ } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.24.7.tgz", - "integrity": "sha512-qTAxxBM81VEyoAY0TtLrx1oAEJc09ZK67Q9ljQToqCnA+55eNwCORaxlKyu+rNfX86o8OXRUSNUnrtsAZXM9sg==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.0.tgz", + "integrity": "sha512-q688zIvQVYtZu+i2PsdIu/uWGRpfxzr5WESsfpShfZECkO+d2o+WROWezCi/Q6kJ0tfPa5+pUGUlfx2HhrA3Bg==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-member-expression-to-functions": "^7.24.7", - "@babel/helper-optimise-call-expression": "^7.24.7" + "@babel/helper-member-expression-to-functions": "^7.24.8", + "@babel/helper-optimise-call-expression": "^7.24.7", + "@babel/traverse": "^7.25.0" }, "engines": { "node": ">=6.9.0" @@ -430,22 +390,10 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz", - "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-string-parser": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", - "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", + "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", "dev": true, "engines": { "node": ">=6.9.0" @@ -461,37 +409,36 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.7.tgz", - "integrity": "sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz", + "integrity": "sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-wrap-function": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.24.7.tgz", - "integrity": "sha512-N9JIYk3TD+1vq/wn77YnJOqMtfWhNewNE+DJV4puD2X7Ew9J4JvrzrFDfTfyv5EgEXVy9/Wt8QiOErzEmv5Ifw==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.0.tgz", + "integrity": "sha512-s6Q1ebqutSiZnEjaofc/UKDyC4SbzV5n5SrA2Gq8UawLycr3i04f1dX4OzoQVnexm6aOCh37SQNYlJ/8Ku+PMQ==", "dev": true, "dependencies": { - "@babel/helper-function-name": "^7.24.7", - "@babel/template": "^7.24.7", - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.0", + "@babel/types": "^7.25.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.7.tgz", - "integrity": "sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.6.tgz", + "integrity": "sha512-Xg0tn4HcfTijTwfDwYlvVCl43V6h4KyVVX2aEm4qdO/PC6L2YvzLHFdmxhoeSA3eslcE6+ZVXHgWwopXYLNq4Q==", "dev": true, "dependencies": { - "@babel/template": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.6" }, "engines": { "node": ">=6.9.0" @@ -584,10 +531,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", - "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz", + "integrity": "sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==", "dev": true, + "dependencies": { + "@babel/types": "^7.25.6" + }, "bin": { "parser": "bin/babel-parser.js" }, @@ -596,13 +546,28 @@ } }, "node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.24.7.tgz", - "integrity": "sha512-TiT1ss81W80eQsN+722OaeQMY/G4yTb4G9JrqeiDADs3N8lbPMGldWi9x8tyqCW5NLx1Jh2AvkE6r6QvEltMMQ==", + "version": "7.25.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.3.tgz", + "integrity": "sha512-wUrcsxZg6rqBXG05HG1FPYgsP6EvwF4WpBbxIpWIIYnH8wG0gzx3yZY3dtEHas4sTAOGkbTsc9EGPxwff8lRoA==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/traverse": "^7.25.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-class-field-initializer-scope": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.0.tgz", + "integrity": "sha512-Bm4bH2qsX880b/3ziJ8KD711LT7z4u8CFudmjqle65AZj/HNUFhEf90dqYv6O86buWvSBmeQDjv0Tn2aF/bIBA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -612,12 +577,12 @@ } }, "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.24.7.tgz", - "integrity": "sha512-unaQgZ/iRu/By6tsjMZzpeBZjChYfLYry6HrEXPoz3KmfF0sVBQ1l8zKMQ4xRGLWVsjuvB8nQfjNP/DcfEOCsg==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.0.tgz", + "integrity": "sha512-lXwdNZtTmeVOOFtwM/WDe7yg1PL8sYhRk/XH0FzbR2HDQ0xC+EnQ/JHeoMYSavtU115tnUk0q9CDyq8si+LMAA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -644,13 +609,13 @@ } }, "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.24.7.tgz", - "integrity": "sha512-utA4HuR6F4Vvcr+o4DnjL8fCOlgRFGbeeBEGNg3ZTrLFw6VWG5XmUrvcQ0FjIYMU2ST4XcR2Wsp7t9qOAPnxMg==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.0.tgz", + "integrity": "sha512-tggFrk1AIShG/RUQbEwt2Tr/E+ObkfwrPjR6BjbRvsx24+PSjK8zrq0GWPNCjo8qpRx4DuJzlcvWJqlm+0h3kw==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/traverse": "^7.25.0" }, "engines": { "node": ">=6.9.0" @@ -735,12 +700,12 @@ } }, "node_modules/@babel/plugin-syntax-import-assertions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.24.7.tgz", - "integrity": "sha512-Ec3NRUMoi8gskrkBe3fNmEQfxDvY8bgfQpz6jlk/41kX9eUjvpyqWU7PBP/pLAvMaSQjbMNKJmvX57jP+M6bPg==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.25.6.tgz", + "integrity": "sha512-aABl0jHw9bZ2karQ/uUD6XP4u0SG22SJrOHFoL6XB1R7dTovOP4TzTlsxOYC5yQ1pdscVK2JTUnF6QL3ARoAiQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -750,12 +715,12 @@ } }, "node_modules/@babel/plugin-syntax-import-attributes": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.24.7.tgz", - "integrity": "sha512-hbX+lKKeUMGihnK8nvKqmXBInriT3GVjzXKFriV3YC6APGxMbP8RZNFwy91+hocLXq90Mta+HshoB31802bb8A==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.25.6.tgz", + "integrity": "sha512-sXaDXaJN9SNLymBdlWFA+bjzBhFD617ZaFiY13dGt7TVslVvVgA6fkZOP7Ki3IGElC45lwHdOTrCtKZGVAWeLQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -922,15 +887,15 @@ } }, "node_modules/@babel/plugin-transform-async-generator-functions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.24.7.tgz", - "integrity": "sha512-o+iF77e3u7ZS4AoAuJvapz9Fm001PuD2V3Lp6OSE4FYQke+cSewYtnek+THqGRWyQloRCyvWL1OkyfNEl9vr/g==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.4.tgz", + "integrity": "sha512-jz8cV2XDDTqjKPwVPJBIjORVEmSGYhdRa8e5k5+vN+uwcjSrSxUaebBRa4ko1jqNF2uxyg8G6XYk30Jv285xzg==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-remap-async-to-generator": "^7.24.7", - "@babel/plugin-syntax-async-generators": "^7.8.4" + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-remap-async-to-generator": "^7.25.0", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/traverse": "^7.25.4" }, "engines": { "node": ">=6.9.0" @@ -972,12 +937,12 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.24.7.tgz", - "integrity": "sha512-Nd5CvgMbWc+oWzBsuaMcbwjJWAcp5qzrbg69SZdHSP7AMY0AbWFqFO0WTFCA1jxhMCwodRwvRec8k0QUbZk7RQ==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.0.tgz", + "integrity": "sha512-yBQjYoOjXlFv9nlXb3f1casSHOZkWr29NX+zChVanLg5Nc157CrbEX9D7hxxtTpuFy7Q0YzmmWfJxzvps4kXrQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -987,13 +952,13 @@ } }, "node_modules/@babel/plugin-transform-class-properties": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.24.7.tgz", - "integrity": "sha512-vKbfawVYayKcSeSR5YYzzyXvsDFWU2mD8U5TFeXtbCPLFUqe7GyCgvO6XDHzje862ODrOwy6WCPmKeWHbCFJ4w==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.4.tgz", + "integrity": "sha512-nZeZHyCWPfjkdU5pA/uHiTaDAFUEqkpzf1YoQT2NeSynCGYq9rxfyI3XpQbfx/a0hSnFH6TGlEXvae5Vi7GD8g==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-class-features-plugin": "^7.25.4", + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -1020,18 +985,16 @@ } }, "node_modules/@babel/plugin-transform-classes": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.24.7.tgz", - "integrity": "sha512-CFbbBigp8ln4FU6Bpy6g7sE8B/WmCmzvivzUC6xDAdWVsjYTXijpuuGJmYkAaoWAzcItGKT3IOAbxRItZ5HTjw==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.4.tgz", + "integrity": "sha512-oexUfaQle2pF/b6E0dwsxQtAol9TLSO88kQvym6HHBWFliV2lGdrPieX+WgMRLSJDVzdYywk7jXbLPuO2KLTLg==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-compilation-targets": "^7.24.7", - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-function-name": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-replace-supers": "^7.24.7", - "@babel/helper-split-export-declaration": "^7.24.7", + "@babel/helper-compilation-targets": "^7.25.2", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-replace-supers": "^7.25.0", + "@babel/traverse": "^7.25.4", "globals": "^11.1.0" }, "engines": { @@ -1067,12 +1030,12 @@ } }, "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.7.tgz", - "integrity": "sha512-19eJO/8kdCQ9zISOf+SEUJM/bAUIsvY3YDnXZTupUCQ8LgrWnsG/gFB9dvXqdXnRXMAM8fvt7b0CBKQHNGy1mw==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.8.tgz", + "integrity": "sha512-36e87mfY8TnRxc7yc6M9g9gOB7rKgSahqkIKwLpz4Ppk2+zC2Cy1is0uwtuSG6AE4zlTOUa+7JGz9jCJGLqQFQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -1112,6 +1075,22 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.0.tgz", + "integrity": "sha512-YLpb4LlYSc3sCUa35un84poXoraOiQucUTTu8X1j18JV+gNa8E0nyUf/CjZ171IRGr4jEguF+vzJU66QZhn29g==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.25.0", + "@babel/helper-plugin-utils": "^7.24.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, "node_modules/@babel/plugin-transform-dynamic-import": { "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.24.7.tgz", @@ -1177,14 +1156,14 @@ } }, "node_modules/@babel/plugin-transform-function-name": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.24.7.tgz", - "integrity": "sha512-U9FcnA821YoILngSmYkW6FjyQe2TyZD5pHt4EVIhmcTkrJw/3KqcrRSxuOo5tFZJi7TE19iDyI1u+weTI7bn2w==", + "version": "7.25.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.1.tgz", + "integrity": "sha512-TVVJVdW9RKMNgJJlLtHsKDTydjZAbwIsn6ySBPQaEAUU5+gVvlJt/9nRmqVbsV/IBanRjzWoaAQKLoamWVOUuA==", "dev": true, "dependencies": { - "@babel/helper-compilation-targets": "^7.24.7", - "@babel/helper-function-name": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-compilation-targets": "^7.24.8", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/traverse": "^7.25.1" }, "engines": { "node": ">=6.9.0" @@ -1210,12 +1189,12 @@ } }, "node_modules/@babel/plugin-transform-literals": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.24.7.tgz", - "integrity": "sha512-vcwCbb4HDH+hWi8Pqenwnjy+UiklO4Kt1vfspcQYFhJdpthSnW8XvWGyDZWKNVrVbVViI/S7K9PDJZiUmP2fYQ==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.2.tgz", + "integrity": "sha512-HQI+HcTbm9ur3Z2DkO+jgESMAMcYLuN/A7NRw9juzxAezN9AvqvUTnpKP/9kkYANz6u7dFlAyOu44ejuGySlfw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -1272,13 +1251,13 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.7.tgz", - "integrity": "sha512-iFI8GDxtevHJ/Z22J5xQpVqFLlMNstcLXh994xifFwxxGslr2ZXXLWgtBeLctOD63UFDArdvN6Tg8RFw+aEmjQ==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.8.tgz", + "integrity": "sha512-WHsk9H8XxRs3JXKWFiqtQebdh9b/pTk4EgueygFzYlTKAg0Ud985mSevdNjdXdFBATSKVJGQXP1tv6aGbssLKA==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-module-transforms": "^7.24.8", + "@babel/helper-plugin-utils": "^7.24.8", "@babel/helper-simple-access": "^7.24.7" }, "engines": { @@ -1289,15 +1268,15 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.24.7.tgz", - "integrity": "sha512-GYQE0tW7YoaN13qFh3O1NCY4MPkUiAH3fiF7UcV/I3ajmDKEdG3l+UOcbAm4zUE3gnvUU+Eni7XrVKo9eO9auw==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.0.tgz", + "integrity": "sha512-YPJfjQPDXxyQWg/0+jHKj1llnY5f/R6a0p/vP4lPymxLu7Lvl4k2WMitqi08yxwQcCVUUdG9LCUj4TNEgAp3Jw==", "dev": true, "dependencies": { - "@babel/helper-hoist-variables": "^7.24.7", - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-validator-identifier": "^7.24.7" + "@babel/helper-module-transforms": "^7.25.0", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "@babel/traverse": "^7.25.0" }, "engines": { "node": ">=6.9.0" @@ -1436,12 +1415,12 @@ } }, "node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.7.tgz", - "integrity": "sha512-tK+0N9yd4j+x/4hxF3F0e0fu/VdcxU18y5SevtyM/PCFlQvXbR0Zmlo2eBrKtVipGNFzpq56o8WsIIKcJFUCRQ==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.8.tgz", + "integrity": "sha512-5cTOLSMs9eypEy8JUVvIKOu6NgvbJMnpG62VpIHrTmROdQ+L5mDAaI40g25k5vXti55JWNX5jCkq3HZxXBQANw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.8", "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", "@babel/plugin-syntax-optional-chaining": "^7.8.3" }, @@ -1468,13 +1447,13 @@ } }, "node_modules/@babel/plugin-transform-private-methods": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.24.7.tgz", - "integrity": "sha512-COTCOkG2hn4JKGEKBADkA8WNb35TGkkRbI5iT845dB+NyqgO8Hn+ajPbSnIQznneJTa3d30scb6iz/DhH8GsJQ==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.4.tgz", + "integrity": "sha512-ao8BG7E2b/URaUQGqN3Tlsg+M3KlHY6rJ1O1gXAEUnZoyNQnvKyH87Kfg+FoxSeyWUB8ISZZsC91C44ZuBFytw==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-class-features-plugin": "^7.25.4", + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -1609,12 +1588,12 @@ } }, "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.7.tgz", - "integrity": "sha512-VtR8hDy7YLB7+Pet9IarXjg/zgCMSF+1mNS/EQEiEaUPoFXCVsHG64SIxcaaI2zJgRiv+YmgaQESUfWAdbjzgg==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.8.tgz", + "integrity": "sha512-adNTUpDCVnmAE58VEqKlAA6ZBlNkMnWD0ZcW76lyNFN3MJniyGFZfNwERVk8Ap56MCnXztmDr19T4mPTztcuaw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -1671,13 +1650,13 @@ } }, "node_modules/@babel/plugin-transform-unicode-sets-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.24.7.tgz", - "integrity": "sha512-2G8aAvF4wy1w/AGZkemprdGMRg5o6zPNhbHVImRz3lss55TYCBd6xStN19rt8XJHq20sqV0JbyWjOWwQRwV/wg==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.4.tgz", + "integrity": "sha512-qesBxiWkgN1Q+31xUE9RcMk79eOXXDCv6tfyGMRSs4RGlioSg2WVyQAm07k726cSE56pa+Kb0y9epX2qaXzTvA==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-regexp-features-plugin": "^7.25.2", + "@babel/helper-plugin-utils": "^7.24.8" }, "engines": { "node": ">=6.9.0" @@ -1687,19 +1666,20 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.24.7.tgz", - "integrity": "sha512-1YZNsc+y6cTvWlDHidMBsQZrZfEFjRIo/BZCT906PMdzOyXtSLTgqGdrpcuTDCXyd11Am5uQULtDIcCfnTc8fQ==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.24.7", - "@babel/helper-compilation-targets": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-validator-option": "^7.24.7", - "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.24.7", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.24.7", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.25.4.tgz", + "integrity": "sha512-W9Gyo+KmcxjGahtt3t9fb14vFRWvPpu5pT6GBlovAK6BTBcxgjfVMSQCfJl4oi35ODrxP6xx2Wr8LNST57Mraw==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.25.4", + "@babel/helper-compilation-targets": "^7.25.2", + "@babel/helper-plugin-utils": "^7.24.8", + "@babel/helper-validator-option": "^7.24.8", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.25.3", + "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.25.0", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.25.0", "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.24.7", - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.24.7", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.25.0", "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-class-properties": "^7.12.13", @@ -1720,29 +1700,30 @@ "@babel/plugin-syntax-top-level-await": "^7.14.5", "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", "@babel/plugin-transform-arrow-functions": "^7.24.7", - "@babel/plugin-transform-async-generator-functions": "^7.24.7", + "@babel/plugin-transform-async-generator-functions": "^7.25.4", "@babel/plugin-transform-async-to-generator": "^7.24.7", "@babel/plugin-transform-block-scoped-functions": "^7.24.7", - "@babel/plugin-transform-block-scoping": "^7.24.7", - "@babel/plugin-transform-class-properties": "^7.24.7", + "@babel/plugin-transform-block-scoping": "^7.25.0", + "@babel/plugin-transform-class-properties": "^7.25.4", "@babel/plugin-transform-class-static-block": "^7.24.7", - "@babel/plugin-transform-classes": "^7.24.7", + "@babel/plugin-transform-classes": "^7.25.4", "@babel/plugin-transform-computed-properties": "^7.24.7", - "@babel/plugin-transform-destructuring": "^7.24.7", + "@babel/plugin-transform-destructuring": "^7.24.8", "@babel/plugin-transform-dotall-regex": "^7.24.7", "@babel/plugin-transform-duplicate-keys": "^7.24.7", + "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.25.0", "@babel/plugin-transform-dynamic-import": "^7.24.7", "@babel/plugin-transform-exponentiation-operator": "^7.24.7", "@babel/plugin-transform-export-namespace-from": "^7.24.7", "@babel/plugin-transform-for-of": "^7.24.7", - "@babel/plugin-transform-function-name": "^7.24.7", + "@babel/plugin-transform-function-name": "^7.25.1", "@babel/plugin-transform-json-strings": "^7.24.7", - "@babel/plugin-transform-literals": "^7.24.7", + "@babel/plugin-transform-literals": "^7.25.2", "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", "@babel/plugin-transform-member-expression-literals": "^7.24.7", "@babel/plugin-transform-modules-amd": "^7.24.7", - "@babel/plugin-transform-modules-commonjs": "^7.24.7", - "@babel/plugin-transform-modules-systemjs": "^7.24.7", + "@babel/plugin-transform-modules-commonjs": "^7.24.8", + "@babel/plugin-transform-modules-systemjs": "^7.25.0", "@babel/plugin-transform-modules-umd": "^7.24.7", "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", "@babel/plugin-transform-new-target": "^7.24.7", @@ -1751,9 +1732,9 @@ "@babel/plugin-transform-object-rest-spread": "^7.24.7", "@babel/plugin-transform-object-super": "^7.24.7", "@babel/plugin-transform-optional-catch-binding": "^7.24.7", - "@babel/plugin-transform-optional-chaining": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.8", "@babel/plugin-transform-parameters": "^7.24.7", - "@babel/plugin-transform-private-methods": "^7.24.7", + "@babel/plugin-transform-private-methods": "^7.25.4", "@babel/plugin-transform-private-property-in-object": "^7.24.7", "@babel/plugin-transform-property-literals": "^7.24.7", "@babel/plugin-transform-regenerator": "^7.24.7", @@ -1762,16 +1743,16 @@ "@babel/plugin-transform-spread": "^7.24.7", "@babel/plugin-transform-sticky-regex": "^7.24.7", "@babel/plugin-transform-template-literals": "^7.24.7", - "@babel/plugin-transform-typeof-symbol": "^7.24.7", + "@babel/plugin-transform-typeof-symbol": "^7.24.8", "@babel/plugin-transform-unicode-escapes": "^7.24.7", "@babel/plugin-transform-unicode-property-regex": "^7.24.7", "@babel/plugin-transform-unicode-regex": "^7.24.7", - "@babel/plugin-transform-unicode-sets-regex": "^7.24.7", + "@babel/plugin-transform-unicode-sets-regex": "^7.25.4", "@babel/preset-modules": "0.1.6-no-external-plugins", "babel-plugin-polyfill-corejs2": "^0.4.10", - "babel-plugin-polyfill-corejs3": "^0.10.4", + "babel-plugin-polyfill-corejs3": "^0.10.6", "babel-plugin-polyfill-regenerator": "^0.6.1", - "core-js-compat": "^3.31.0", + "core-js-compat": "^3.37.1", "semver": "^6.3.1" }, "engines": { @@ -1811,9 +1792,9 @@ "dev": true }, "node_modules/@babel/runtime": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", - "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.6.tgz", + "integrity": "sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ==", "dev": true, "dependencies": { "regenerator-runtime": "^0.14.0" @@ -1823,33 +1804,30 @@ } }, "node_modules/@babel/template": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", - "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", + "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", "dev": true, "dependencies": { "@babel/code-frame": "^7.24.7", - "@babel/parser": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.7.tgz", - "integrity": "sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.6.tgz", + "integrity": "sha512-9Vrcx5ZW6UwK5tvqsj0nGpp/XzqthkT0dqIc9g1AdtygFToNtTF67XzYS//dm+SAK9cp3B9R4ZO/46p63SCjlQ==", "dev": true, "dependencies": { "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.24.7", - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-function-name": "^7.24.7", - "@babel/helper-hoist-variables": "^7.24.7", - "@babel/helper-split-export-declaration": "^7.24.7", - "@babel/parser": "^7.24.7", - "@babel/types": "^7.24.7", + "@babel/generator": "^7.25.6", + "@babel/parser": "^7.25.6", + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.6", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -1867,12 +1845,12 @@ } }, "node_modules/@babel/types": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", - "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-string-parser": "^7.24.8", "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, @@ -1899,9 +1877,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.0.tgz", - "integrity": "sha512-3sG8Zwa5fMcA9bgqB8AfWPQ+HFke6uD3h1s3RIwUNK8EG7a4buxvuFTs3j1IMs2NXAk9F30C/FF4vxRgQCcmoQ==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", + "integrity": "sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==", "cpu": [ "ppc64" ], @@ -1915,9 +1893,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.0.tgz", - "integrity": "sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.1.tgz", + "integrity": "sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==", "cpu": [ "arm" ], @@ -1931,9 +1909,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.0.tgz", - "integrity": "sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.1.tgz", + "integrity": "sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==", "cpu": [ "arm64" ], @@ -1947,9 +1925,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.0.tgz", - "integrity": "sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.1.tgz", + "integrity": "sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==", "cpu": [ "x64" ], @@ -1963,9 +1941,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.0.tgz", - "integrity": "sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.1.tgz", + "integrity": "sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==", "cpu": [ "arm64" ], @@ -1979,9 +1957,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.0.tgz", - "integrity": "sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.1.tgz", + "integrity": "sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==", "cpu": [ "x64" ], @@ -1995,9 +1973,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.0.tgz", - "integrity": "sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.1.tgz", + "integrity": "sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==", "cpu": [ "arm64" ], @@ -2011,9 +1989,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.0.tgz", - "integrity": "sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.1.tgz", + "integrity": "sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==", "cpu": [ "x64" ], @@ -2027,9 +2005,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.0.tgz", - "integrity": "sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.1.tgz", + "integrity": "sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==", "cpu": [ "arm" ], @@ -2043,9 +2021,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.0.tgz", - "integrity": "sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.1.tgz", + "integrity": "sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==", "cpu": [ "arm64" ], @@ -2059,9 +2037,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.0.tgz", - "integrity": "sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.1.tgz", + "integrity": "sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==", "cpu": [ "ia32" ], @@ -2075,9 +2053,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.0.tgz", - "integrity": "sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.1.tgz", + "integrity": "sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==", "cpu": [ "loong64" ], @@ -2091,9 +2069,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.0.tgz", - "integrity": "sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.1.tgz", + "integrity": "sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==", "cpu": [ "mips64el" ], @@ -2107,9 +2085,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.0.tgz", - "integrity": "sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.1.tgz", + "integrity": "sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==", "cpu": [ "ppc64" ], @@ -2123,9 +2101,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.0.tgz", - "integrity": "sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.1.tgz", + "integrity": "sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==", "cpu": [ "riscv64" ], @@ -2139,9 +2117,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.0.tgz", - "integrity": "sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.1.tgz", + "integrity": "sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==", "cpu": [ "s390x" ], @@ -2155,9 +2133,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.0.tgz", - "integrity": "sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.1.tgz", + "integrity": "sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==", "cpu": [ "x64" ], @@ -2171,9 +2149,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.0.tgz", - "integrity": "sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.1.tgz", + "integrity": "sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==", "cpu": [ "x64" ], @@ -2187,9 +2165,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.0.tgz", - "integrity": "sha512-suXjq53gERueVWu0OKxzWqk7NxiUWSUlrxoZK7usiF50C6ipColGR5qie2496iKGYNLhDZkPxBI3erbnYkU0rQ==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.1.tgz", + "integrity": "sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==", "cpu": [ "arm64" ], @@ -2203,9 +2181,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.0.tgz", - "integrity": "sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.1.tgz", + "integrity": "sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==", "cpu": [ "x64" ], @@ -2219,9 +2197,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.0.tgz", - "integrity": "sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.1.tgz", + "integrity": "sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==", "cpu": [ "x64" ], @@ -2235,9 +2213,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.0.tgz", - "integrity": "sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.1.tgz", + "integrity": "sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==", "cpu": [ "arm64" ], @@ -2251,9 +2229,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.0.tgz", - "integrity": "sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.1.tgz", + "integrity": "sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==", "cpu": [ "ia32" ], @@ -2267,9 +2245,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.0.tgz", - "integrity": "sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz", + "integrity": "sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==", "cpu": [ "x64" ], @@ -2307,9 +2285,9 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.17.1.tgz", - "integrity": "sha512-BlYOpej8AQ8Ev9xVqroV7a02JK3SkBAaN9GfMMH9W6Ch8FlQlkjGw4Ir7+FgYwfirivAf4t+GtzuAxqfukmISA==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", + "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", "dev": true, "dependencies": { "@eslint/object-schema": "^2.1.4", @@ -2388,9 +2366,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.9.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.9.0.tgz", - "integrity": "sha512-hhetes6ZHP3BlXLxmd8K2SNgkhNSi+UcecbnwWKwpP7kyi/uC75DJ1lOOBO3xrC4jyojtGE3YxKZPHfk4yrgug==", + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.10.0.tgz", + "integrity": "sha512-fuXtbiP5GWIn8Fz+LWoOMVf/Jxm+aajZYkhi6CuEm4SxymFM+eUWzbO9qXT+L0iCkL5+KGYMCSGxo686H19S1g==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2405,6 +2383,18 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@eslint/plugin-kit": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.1.0.tgz", + "integrity": "sha512-autAXT203ixhqei9xt+qkYOvY8l6LAFIdT2UXc/RPNeUVfqRF1BV94GTJyVPFKT8nFM6MyVJhjLj9E8JWvf5zQ==", + "dev": true, + "dependencies": { + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -2492,9 +2482,9 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { @@ -2580,26 +2570,6 @@ "@types/node": "*" } }, - "node_modules/@types/eslint": { - "version": "8.56.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", - "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", - "dev": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", - "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", - "dev": true, - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", @@ -2625,12 +2595,12 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.3.0.tgz", - "integrity": "sha512-nrWpWVaDZuaVc5X84xJ0vNrLvomM205oQyLsRt7OHNZbSHslcWsvgFR7O7hire2ZonjLrWBbedmotmIlJDVd6g==", + "version": "22.5.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz", + "integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==", "dev": true, "dependencies": { - "undici-types": "~6.18.2" + "undici-types": "~6.19.2" } }, "node_modules/@types/normalize-package-data": { @@ -2652,16 +2622,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.1.0.tgz", - "integrity": "sha512-LlNBaHFCEBPHyD4pZXb35mzjGkuGKXU5eeCA1SxvHfiRES0E82dOounfVpL4DCqYvJEKab0bZIA0gCRpdLKkCw==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.4.0.tgz", + "integrity": "sha512-rg8LGdv7ri3oAlenMACk9e+AR4wUV0yrrG+XKsGKOK0EVgeEDqurkXMPILG2836fW4ibokTB5v4b6Z9+GYQDEw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.1.0", - "@typescript-eslint/type-utils": "8.1.0", - "@typescript-eslint/utils": "8.1.0", - "@typescript-eslint/visitor-keys": "8.1.0", + "@typescript-eslint/scope-manager": "8.4.0", + "@typescript-eslint/type-utils": "8.4.0", + "@typescript-eslint/utils": "8.4.0", + "@typescript-eslint/visitor-keys": "8.4.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -2685,15 +2655,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.1.0.tgz", - "integrity": "sha512-U7iTAtGgJk6DPX9wIWPPOlt1gO57097G06gIcl0N0EEnNw8RGD62c+2/DiP/zL7KrkqnnqF7gtFGR7YgzPllTA==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.4.0.tgz", + "integrity": "sha512-NHgWmKSgJk5K9N16GIhQ4jSobBoJwrmURaLErad0qlLjrpP5bECYg+wxVTGlGZmJbU03jj/dfnb6V9bw+5icsA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.1.0", - "@typescript-eslint/types": "8.1.0", - "@typescript-eslint/typescript-estree": "8.1.0", - "@typescript-eslint/visitor-keys": "8.1.0", + "@typescript-eslint/scope-manager": "8.4.0", + "@typescript-eslint/types": "8.4.0", + "@typescript-eslint/typescript-estree": "8.4.0", + "@typescript-eslint/visitor-keys": "8.4.0", "debug": "^4.3.4" }, "engines": { @@ -2713,13 +2683,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.1.0.tgz", - "integrity": "sha512-DsuOZQji687sQUjm4N6c9xABJa7fjvfIdjqpSIIVOgaENf2jFXiM9hIBZOL3hb6DHK9Nvd2d7zZnoMLf9e0OtQ==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.4.0.tgz", + "integrity": "sha512-n2jFxLeY0JmKfUqy3P70rs6vdoPjHK8P/w+zJcV3fk0b0BwRXC/zxRTEnAsgYT7MwdQDt/ZEbtdzdVC+hcpF0A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.1.0", - "@typescript-eslint/visitor-keys": "8.1.0" + "@typescript-eslint/types": "8.4.0", + "@typescript-eslint/visitor-keys": "8.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2730,13 +2700,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.1.0.tgz", - "integrity": "sha512-oLYvTxljVvsMnldfl6jIKxTaU7ok7km0KDrwOt1RHYu6nxlhN3TIx8k5Q52L6wR33nOwDgM7VwW1fT1qMNfFIA==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.4.0.tgz", + "integrity": "sha512-pu2PAmNrl9KX6TtirVOrbLPLwDmASpZhK/XU7WvoKoCUkdtq9zF7qQ7gna0GBZFN0hci0vHaSusiL2WpsQk37A==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.1.0", - "@typescript-eslint/utils": "8.1.0", + "@typescript-eslint/typescript-estree": "8.4.0", + "@typescript-eslint/utils": "8.4.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -2754,9 +2724,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.1.0.tgz", - "integrity": "sha512-q2/Bxa0gMOu/2/AKALI0tCKbG2zppccnRIRCW6BaaTlRVaPKft4oVYPp7WOPpcnsgbr0qROAVCVKCvIQ0tbWog==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.4.0.tgz", + "integrity": "sha512-T1RB3KQdskh9t3v/qv7niK6P8yvn7ja1mS7QK7XfRVL6wtZ8/mFs/FHf4fKvTA0rKnqnYxl/uHFNbnEt0phgbw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2767,15 +2737,15 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.1.0.tgz", - "integrity": "sha512-NTHhmufocEkMiAord/g++gWKb0Fr34e9AExBRdqgWdVBaKoei2dIyYKD9Q0jBnvfbEA5zaf8plUFMUH6kQ0vGg==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.4.0.tgz", + "integrity": "sha512-kJ2OIP4dQw5gdI4uXsaxUZHRwWAGpREJ9Zq6D5L0BweyOrWsL6Sz0YcAZGWhvKnH7fm1J5YFE1JrQL0c9dd53A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.1.0", - "@typescript-eslint/visitor-keys": "8.1.0", + "@typescript-eslint/types": "8.4.0", + "@typescript-eslint/visitor-keys": "8.4.0", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", @@ -2795,15 +2765,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.1.0.tgz", - "integrity": "sha512-ypRueFNKTIFwqPeJBfeIpxZ895PQhNyH4YID6js0UoBImWYoSjBsahUn9KMiJXh94uOjVBgHD9AmkyPsPnFwJA==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.4.0.tgz", + "integrity": "sha512-swULW8n1IKLjRAgciCkTCafyTHHfwVQFt8DovmaF69sKbOxTSFMmIZaSHjqO9i/RV0wIblaawhzvtva8Nmm7lQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.1.0", - "@typescript-eslint/types": "8.1.0", - "@typescript-eslint/typescript-estree": "8.1.0" + "@typescript-eslint/scope-manager": "8.4.0", + "@typescript-eslint/types": "8.4.0", + "@typescript-eslint/typescript-estree": "8.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2817,12 +2787,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.1.0.tgz", - "integrity": "sha512-ba0lNI19awqZ5ZNKh6wCModMwoZs457StTebQ0q1NP58zSi2F6MOZRXwfKZy+jB78JNJ/WH8GSh2IQNzXX8Nag==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.4.0.tgz", + "integrity": "sha512-zTQD6WLNTre1hj5wp09nBIDiOc2U5r/qmzo7wxPn4ZgAjHql09EofqhF9WF+fZHzL5aCyaIpPcT2hyxl73kr9A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.1.0", + "@typescript-eslint/types": "8.4.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -3049,9 +3019,9 @@ } }, "node_modules/acorn": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.0.tgz", - "integrity": "sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -3079,9 +3049,9 @@ } }, "node_modules/acorn-walk": { - "version": "8.3.3", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz", - "integrity": "sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==", + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", "dev": true, "dependencies": { "acorn": "^8.11.0" @@ -3179,15 +3149,6 @@ "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", "dev": true }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -3228,9 +3189,9 @@ } }, "node_modules/async": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", - "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", "dev": true }, "node_modules/asynckit": { @@ -3287,13 +3248,13 @@ } }, "node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.4.tgz", - "integrity": "sha512-25J6I8NGfa5YkCDogHRID3fVCadIR8/pGl1/spvCkzb6lVn6SR3ojpx9nOn9iEBcUsjY24AmdKm5khcfKdylcg==", + "version": "0.10.6", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.10.6.tgz", + "integrity": "sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.6.1", - "core-js-compat": "^3.36.1" + "@babel/helper-define-polyfill-provider": "^0.6.2", + "core-js-compat": "^3.38.0" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" @@ -3559,9 +3520,9 @@ } }, "node_modules/browserslist": { - "version": "4.23.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz", - "integrity": "sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==", + "version": "4.23.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", + "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", "dev": true, "funding": [ { @@ -3578,10 +3539,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001629", - "electron-to-chromium": "^1.4.796", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.16" + "caniuse-lite": "^1.0.30001646", + "electron-to-chromium": "^1.5.4", + "node-releases": "^2.0.18", + "update-browserslist-db": "^1.1.0" }, "bin": { "browserslist": "cli.js" @@ -3696,9 +3657,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001638", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001638.tgz", - "integrity": "sha512-5SuJUJ7cZnhPpeLHaH0c/HPAnAHZvS6ElWyHK9GSIbVOQABLzowiI2pjmpvZ1WEbkyz46iFd4UXlOHR5SqgfMQ==", + "version": "1.0.30001659", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001659.tgz", + "integrity": "sha512-Qxxyfv3RdHAfJcXelgf0hU4DFUVXBGTjqrBUZLUh8AtlGnsDo+CnncYtTd95+ZKfnANUOzxyIQCuU/UeBZBYoA==", "dev": true, "funding": [ { @@ -4256,12 +4217,12 @@ } }, "node_modules/core-js-compat": { - "version": "3.37.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.1.tgz", - "integrity": "sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==", + "version": "3.38.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.1.tgz", + "integrity": "sha512-JRH6gfXxGmrzF3tZ57lFx97YARxCXPaMzPo6jELZhv88pBH5VXpQ+y0znKGlFnzuaihqhLbefxSJxWJMPtfDzw==", "dev": true, "dependencies": { - "browserslist": "^4.23.0" + "browserslist": "^4.23.3" }, "funding": { "type": "opencollective", @@ -4406,12 +4367,12 @@ "dev": true }, "node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -4595,18 +4556,6 @@ "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", "dev": true }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/dom-serialize": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", @@ -4752,15 +4701,15 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.814", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.814.tgz", - "integrity": "sha512-GVulpHjFu1Y9ZvikvbArHmAhZXtm3wHlpjTMcXNGKl4IQ4jMQjlnz8yMQYYqdLHKi/jEL2+CBC2akWVCoIGUdw==", + "version": "1.5.18", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.18.tgz", + "integrity": "sha512-1OfuVACu+zKlmjsNdcJuVQuVE61sZOLbNM4JAQ1Rvh6EOj0/EUKhMJjRH73InPlXSh8HIJk1cVZ8pyOV/FMdUQ==", "dev": true }, "node_modules/elliptic": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.5.tgz", - "integrity": "sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==", + "version": "6.5.7", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz", + "integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==", "dev": true, "dependencies": { "bn.js": "^4.11.9", @@ -4815,18 +4764,18 @@ } }, "node_modules/engine.io-parser": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.2.tgz", - "integrity": "sha512-RcyUFKA93/CXH20l4SoVvzZfrSDMOTUS3bWVpTt2FuFP+XYrL8i8oonHP7WInRyVHXh0n/ORtoeiE1os+8qkSw==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", + "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==", "dev": true, "engines": { "node": ">=10.0.0" } }, "node_modules/enhanced-resolve": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz", - "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -4897,9 +4846,9 @@ "dev": true }, "node_modules/esbuild": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.0.tgz", - "integrity": "sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==", + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.1.tgz", + "integrity": "sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==", "dev": true, "hasInstallScript": true, "bin": { @@ -4909,36 +4858,36 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.23.0", - "@esbuild/android-arm": "0.23.0", - "@esbuild/android-arm64": "0.23.0", - "@esbuild/android-x64": "0.23.0", - "@esbuild/darwin-arm64": "0.23.0", - "@esbuild/darwin-x64": "0.23.0", - "@esbuild/freebsd-arm64": "0.23.0", - "@esbuild/freebsd-x64": "0.23.0", - "@esbuild/linux-arm": "0.23.0", - "@esbuild/linux-arm64": "0.23.0", - "@esbuild/linux-ia32": "0.23.0", - "@esbuild/linux-loong64": "0.23.0", - "@esbuild/linux-mips64el": "0.23.0", - "@esbuild/linux-ppc64": "0.23.0", - "@esbuild/linux-riscv64": "0.23.0", - "@esbuild/linux-s390x": "0.23.0", - "@esbuild/linux-x64": "0.23.0", - "@esbuild/netbsd-x64": "0.23.0", - "@esbuild/openbsd-arm64": "0.23.0", - "@esbuild/openbsd-x64": "0.23.0", - "@esbuild/sunos-x64": "0.23.0", - "@esbuild/win32-arm64": "0.23.0", - "@esbuild/win32-ia32": "0.23.0", - "@esbuild/win32-x64": "0.23.0" + "@esbuild/aix-ppc64": "0.23.1", + "@esbuild/android-arm": "0.23.1", + "@esbuild/android-arm64": "0.23.1", + "@esbuild/android-x64": "0.23.1", + "@esbuild/darwin-arm64": "0.23.1", + "@esbuild/darwin-x64": "0.23.1", + "@esbuild/freebsd-arm64": "0.23.1", + "@esbuild/freebsd-x64": "0.23.1", + "@esbuild/linux-arm": "0.23.1", + "@esbuild/linux-arm64": "0.23.1", + "@esbuild/linux-ia32": "0.23.1", + "@esbuild/linux-loong64": "0.23.1", + "@esbuild/linux-mips64el": "0.23.1", + "@esbuild/linux-ppc64": "0.23.1", + "@esbuild/linux-riscv64": "0.23.1", + "@esbuild/linux-s390x": "0.23.1", + "@esbuild/linux-x64": "0.23.1", + "@esbuild/netbsd-x64": "0.23.1", + "@esbuild/openbsd-arm64": "0.23.1", + "@esbuild/openbsd-x64": "0.23.1", + "@esbuild/sunos-x64": "0.23.1", + "@esbuild/win32-arm64": "0.23.1", + "@esbuild/win32-ia32": "0.23.1", + "@esbuild/win32-x64": "0.23.1" } }, "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, "engines": { "node": ">=6" @@ -4963,16 +4912,17 @@ } }, "node_modules/eslint": { - "version": "9.9.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.9.0.tgz", - "integrity": "sha512-JfiKJrbx0506OEerjK2Y1QlldtBxkAlLxT5OEcRF8uaQ86noDe2k31Vw9rnSWv+MXZHj7OOUV/dA0AhdLFcyvA==", + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.10.0.tgz", + "integrity": "sha512-Y4D0IgtBZfOcOUAIQTSXBKoNGfY0REGqHJG6+Q81vNippW5YlKjHFj4soMxamKK1NXHUWuBZTLdU3Km+L/pcHw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.11.0", - "@eslint/config-array": "^0.17.1", + "@eslint/config-array": "^0.18.0", "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.9.0", + "@eslint/js": "9.10.0", + "@eslint/plugin-kit": "^0.1.0", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.3.0", "@nodelib/fs.walk": "^1.2.8", @@ -4995,7 +4945,6 @@ "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", @@ -5387,9 +5336,9 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", - "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", "funding": [ { "type": "individual", @@ -5566,9 +5515,9 @@ } }, "node_modules/get-tsconfig": { - "version": "4.7.5", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", - "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.0.tgz", + "integrity": "sha512-Pgba6TExTZ0FJAn1qkJAjIeKoDJ3CsI2ChuLohJnZl/tTU8MVrq3b+2t5UOPfRa4RMsorClBjJALkJUMjG1PAw==", "dev": true, "dependencies": { "resolve-pkg-maps": "^1.0.0" @@ -5716,26 +5665,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -6059,9 +5988,9 @@ } }, "node_modules/import-local": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", "dev": true, "dependencies": { "pkg-dir": "^4.2.0", @@ -6192,9 +6121,9 @@ } }, "node_modules/is-core-module": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", - "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", "dev": true, "dependencies": { "hasown": "^2.0.2" @@ -6517,9 +6446,9 @@ } }, "node_modules/jasmine-core": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-5.2.0.tgz", - "integrity": "sha512-tSAtdrvWybZkQmmaIoDgnvHG8ORUNw5kEVlO5CvrXj02Jjr9TZrmjFq7FUiOUzJiOP2wLGYT6PgrQgQF4R1xiw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-5.3.0.tgz", + "integrity": "sha512-zsOmeBKESky4toybvWEikRiZ0jHoBEu79wNArLfMdSnlLMZx3Xcp6CSm2sUcYyoJC+Uyj8LBJap/MUbVSfJ27g==", "dev": true }, "node_modules/jasmine-spec-reporter": { @@ -7372,18 +7301,6 @@ "semver": "bin/semver" } }, - "node_modules/meow/node_modules/type-fest": { - "version": "0.18.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", - "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -7400,9 +7317,9 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { "braces": "^3.0.3", @@ -7609,12 +7526,6 @@ "node": ">=10" } }, - "node_modules/mocha/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "node_modules/mocha/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -7649,9 +7560,9 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node_modules/natural-compare": { @@ -7676,9 +7587,9 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", - "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", "dev": true }, "node_modules/normalize-package-data": { @@ -7970,12 +7881,24 @@ "dev": true }, "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", "dev": true, + "dependencies": { + "pify": "^3.0.0" + }, "engines": { - "node": ">=8" + "node": ">=4" + } + }, + "node_modules/path-type/node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "engines": { + "node": ">=4" } }, "node_modules/pbkdf2": { @@ -7995,9 +7918,9 @@ } }, "node_modules/picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", + "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", "dev": true }, "node_modules/picomatch": { @@ -8382,27 +8305,6 @@ "validate-npm-package-license": "^3.0.1" } }, - "node_modules/read-pkg/node_modules/path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "dependencies": { - "pify": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/read-pkg/node_modules/pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/read-pkg/node_modules/semver": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", @@ -8714,9 +8616,9 @@ } }, "node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -8841,15 +8743,6 @@ "node": ">= 10" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/socket.io": { "version": "4.7.5", "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.7.5.tgz", @@ -8944,9 +8837,9 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.18", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz", - "integrity": "sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==", + "version": "3.0.20", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.20.tgz", + "integrity": "sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==", "dev": true }, "node_modules/split": { @@ -9223,9 +9116,9 @@ } }, "node_modules/terser": { - "version": "5.31.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.1.tgz", - "integrity": "sha512-37upzU1+viGvuFtBo9NPufCb9dwM0+l9hMxYyWfBA+fbwrPqNJAhbZ6W47bBFnZHKHTUBnMvi87434qq+qnxOg==", + "version": "5.31.6", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz", + "integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -9415,9 +9308,9 @@ } }, "node_modules/tsx": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.17.0.tgz", - "integrity": "sha512-eN4mnDA5UMKDt4YZixo9tBioibaMBpoxBkD+rIPAjVmYERSG0/dWEY1CEFuV89CgASlKL499q8AhmkMnnjtOJg==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.0.tgz", + "integrity": "sha512-bV30kM7bsLZKZIOCHeMNVMJ32/LuJzLVajkQI/qf92J2Qr08ueLQvW00PUZGiuLPP760UINwupgUj8qrSCPUKg==", "dev": true, "dependencies": { "esbuild": "~0.23.0", @@ -9451,6 +9344,18 @@ "node": ">= 0.8.0" } }, + "node_modules/type-fest": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", + "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -9484,14 +9389,14 @@ } }, "node_modules/typescript-eslint": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.1.0.tgz", - "integrity": "sha512-prB2U3jXPJLpo1iVLN338Lvolh6OrcCZO+9Yv6AR+tvegPPptYCDBIHiEEUdqRi8gAv2bXNKfMUrgAd2ejn/ow==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.4.0.tgz", + "integrity": "sha512-67qoc3zQZe3CAkO0ua17+7aCLI0dU+sSQd1eKPGq06QE4rfQjstVXR6woHO5qQvGUa550NfGckT4tzh3b3c8Pw==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.1.0", - "@typescript-eslint/parser": "8.1.0", - "@typescript-eslint/utils": "8.1.0" + "@typescript-eslint/eslint-plugin": "8.4.0", + "@typescript-eslint/parser": "8.4.0", + "@typescript-eslint/utils": "8.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -9530,9 +9435,9 @@ } }, "node_modules/uglify-js": { - "version": "3.18.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.18.0.tgz", - "integrity": "sha512-SyVVbcNBCk0dzr9XL/R/ySrmYf0s372K6/hFklzgcp2lBFyXtw4I7BOdDjlLhE1aVqaI/SHWXWmYdlZxuyF38A==", + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", "dev": true, "optional": true, "bin": { @@ -9543,9 +9448,9 @@ } }, "node_modules/undici-types": { - "version": "6.18.2", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.18.2.tgz", - "integrity": "sha512-5ruQbENj95yDYJNS3TvcaxPMshV7aizdv/hWYjGIKoANWKjhWNBsr2YEuYZKodQulB1b8l7ILOuDQep3afowQQ==", + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", "dev": true }, "node_modules/unicode-canonical-property-names-ecmascript": { @@ -9607,9 +9512,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz", - "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", "dev": true, "funding": [ { @@ -9655,13 +9560,16 @@ } }, "node_modules/url": { - "version": "0.11.3", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.3.tgz", - "integrity": "sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==", + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.4.tgz", + "integrity": "sha512-oCwdVC7mTuWiPyjLUz/COz5TLk6wgp0RCsN+wHZ2Ekneac9w8uuV0njcbbie2ME+Vs+d6duwmYuR3HgQXs1fOg==", "dev": true, "dependencies": { "punycode": "^1.4.1", - "qs": "^6.11.2" + "qs": "^6.12.3" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/url-parse": { @@ -9674,9 +9582,9 @@ } }, "node_modules/url/node_modules/qs": { - "version": "6.12.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.1.tgz", - "integrity": "sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dev": true, "dependencies": { "side-channel": "^1.0.6" @@ -9763,9 +9671,9 @@ } }, "node_modules/watchpack": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.1.tgz", - "integrity": "sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", + "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", "dev": true, "dependencies": { "glob-to-regexp": "^0.4.1", @@ -9785,12 +9693,11 @@ } }, "node_modules/webpack": { - "version": "5.93.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.93.0.tgz", - "integrity": "sha512-Y0m5oEY1LRuwly578VqluorkXbvXKh7U3rLoQCEO04M97ScRr44afGVkI0FQFsXzysk5OgFAxjZAb9rsGQVihA==", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "dev": true, "dependencies": { - "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.5", "@webassemblyjs/ast": "^1.12.1", "@webassemblyjs/wasm-edit": "^1.12.1", @@ -9799,7 +9706,7 @@ "acorn-import-attributes": "^1.9.5", "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.17.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", diff --git a/package.json b/package.json index 70dff136..fcccf520 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "Kontent Typescript" ], "engines": { - "node": ">= 18" + "node": ">= 20" }, "main": "./dist/cjs/index.js", "module": "./dist/es6/index.js", @@ -68,10 +68,10 @@ "devDependencies": { "@types/url-parse": "1.4.11", "@types/jasmine": "5.1.4", - "@types/node": "22.3.0", + "@types/node": "22.5.4", "@types/uuid": "10.0.0", "colors": "1.4.0", - "jasmine-core": "5.2.0", + "jasmine-core": "5.3.0", "jasmine-spec-reporter": "7.0.0", "karma": "6.4.4", "karma-chrome-launcher": "3.2.0", @@ -86,14 +86,14 @@ "mocha": "10.7.3", "standard-version": "9.5.0", "ts-loader": "9.5.1", - "tsx": "4.17.0", - "@typescript-eslint/eslint-plugin": "8.1.0", - "@typescript-eslint/parser": "8.1.0", - "eslint": "9.9.0", + "tsx": "4.19.0", + "@typescript-eslint/eslint-plugin": "8.4.0", + "@typescript-eslint/parser": "8.4.0", + "eslint": "9.10.0", "typescript": "5.2.2", - "webpack": "5.93.0", + "webpack": "5.94.0", "webpack-bundle-analyzer": "4.10.2", "webpack-cli": "5.1.4", - "typescript-eslint": "8.1.0" + "typescript-eslint": "8.4.0" } } From 7ef5951c505b1acf2424c99255f435aa1a26a53e Mon Sep 17 00:00:00 2001 From: Richard Sustek Date: Mon, 9 Sep 2024 11:22:49 +0200 Subject: [PATCH 02/13] feat!: Removes `propertyName` resolver configuration. All elements are now referenced only by their codenames present in Kontent.ai --- lib/config/delivery-configs.ts | 7 +- lib/mappers/element.mapper.ts | 59 +-- lib/models/item-models.ts | 4 +- lib/resolvers/index.ts | 9 +- ...camel-case-property-name-resolver.class.ts | 11 - ...ascal-case-property-name-resolver.class.ts | 11 - ...snake-case-property-name-resolver.class.ts | 29 - lib/utilities/index.ts | 7 +- lib/utilities/text.helper.ts | 25 - readme.md | 157 +++--- .../core/property-name-resolvers.spec.ts | 182 ------- .../items-feed/items-feed-all.spec.json | 471 ++++++++--------- .../endpoints/items-feed/items-feed.spec.json | 471 ++++++++--------- .../fake-data/fake-warrior-response.json | 495 +++++++++--------- ...warrior-without-modular-data-response.json | 244 +++++---- .../base-case-property-resolver.spec.json | 45 -- .../camel-case-property-resolver.spec.ts | 46 -- .../pascal-case-property-resolver.spec.ts | 46 -- .../property-name/property-resolver.spec.ts | 50 -- .../snake-case-property-resolver.spec.ts | 46 -- .../rich-resolver-html-priority-async.spec.ts | 8 +- .../rich-resolver-html-priority.spec.ts | 8 +- ...rich-resolver-preserve-object-tags.spec.ts | 8 +- .../rich-resolver-url-priority-async.spec.ts | 8 +- .../rich-resolver-url-priority.spec.ts | 8 +- .../expected-result.json | 12 +- .../rich-text-json-resolver.spec.ts | 7 +- .../expected-result.json | 12 +- .../isolated-tests/response/item.spec.ts | 10 +- .../browser/live-tests/item/live-item.spec.ts | 4 +- .../live-tests/types/live-type.spec.ts | 10 +- test/browser/setup/context.ts | 98 ++-- test/browser/setup/delivery-test-client.ts | 4 - test/browser/setup/models.ts | 10 +- test/browser/setup/setup.ts | 36 +- 35 files changed, 1015 insertions(+), 1643 deletions(-) delete mode 100644 lib/resolvers/property-name/camel-case-property-name-resolver.class.ts delete mode 100644 lib/resolvers/property-name/pascal-case-property-name-resolver.class.ts delete mode 100644 lib/resolvers/property-name/snake-case-property-name-resolver.class.ts delete mode 100644 lib/utilities/text.helper.ts delete mode 100644 test/browser/isolated-tests/core/property-name-resolvers.spec.ts delete mode 100644 test/browser/isolated-tests/resolvers/property-name/base-case-property-resolver.spec.json delete mode 100644 test/browser/isolated-tests/resolvers/property-name/camel-case-property-resolver.spec.ts delete mode 100644 test/browser/isolated-tests/resolvers/property-name/pascal-case-property-resolver.spec.ts delete mode 100644 test/browser/isolated-tests/resolvers/property-name/property-resolver.spec.ts delete mode 100644 test/browser/isolated-tests/resolvers/property-name/snake-case-property-resolver.spec.ts diff --git a/lib/config/delivery-configs.ts b/lib/config/delivery-configs.ts index 0645e43f..77a531fc 100644 --- a/lib/config/delivery-configs.ts +++ b/lib/config/delivery-configs.ts @@ -1,7 +1,7 @@ import { IHeader, IHttpService, IRetryStrategyOptions } from '@kontent-ai/core-sdk'; import { ElementResolver } from '../elements'; -import { LinkedItemsReferenceHandler, IProxyUrlData, IQueryConfig, PropertyNameResolver } from '../models'; +import { IProxyUrlData, IQueryConfig, LinkedItemsReferenceHandler } from '../models'; export interface IDeliveryClientProxyConfig { /** @@ -28,11 +28,6 @@ export interface IDeliveryClientConfig { */ environmentId: string; - /** - * Resolver used to rename content item elements. Can be used to e.g. transform underscored element codenames to camelCase format - */ - propertyNameResolver?: PropertyNameResolver; - /** * Preview API key */ diff --git a/lib/mappers/element.mapper.ts b/lib/mappers/element.mapper.ts index bb9c9a65..7351ebe8 100644 --- a/lib/mappers/element.mapper.ts +++ b/lib/mappers/element.mapper.ts @@ -6,11 +6,11 @@ import { ElementModels, Elements, ElementType } from '../elements'; import { IContentItem, IContentItemsContainer, - IMapElementsResult, - ILink, - IRichTextImage, IContentItemWithRawDataContainer, - IContentItemWithRawElements + IContentItemWithRawElements, + ILink, + IMapElementsResult, + IRichTextImage } from '../models'; interface IRichTextImageUrlRecord { @@ -41,7 +41,8 @@ export class ElementMapper { }; } - const preparedItem = data.preparedItems[codenameHelper.escapeCodenameInCodenameIndexer(data.dataToMap.item.system.codename)]; + const preparedItem = + data.preparedItems[codenameHelper.escapeCodenameInCodenameIndexer(data.dataToMap.item.system.codename)]; const itemInstance = preparedItem?.item as TContentItem; if (!itemInstance) { @@ -53,24 +54,22 @@ export class ElementMapper { const elementCodenames = Object.getOwnPropertyNames(data.dataToMap.rawItem.elements); for (const elementCodename of elementCodenames) { - const elementMap = this.resolveElementMap(itemInstance, elementCodename); const elementWrapper: ElementModels.IElementWrapper = { system: data.dataToMap.item.system, rawElement: data.dataToMap.rawItem.elements[elementCodename], - element: elementMap.resolvedName + element: elementCodename }; - if (elementMap.shouldMapElement) { - const mappedElement = this.mapElement({ - elementWrapper: elementWrapper, - item: itemInstance, - preparedItems: data.preparedItems, - processingStartedForCodenames: data.processingStartedForCodenames, - processedItems: data.processedItems - }); - // set mapped elements - itemInstance.elements[elementMap.resolvedName] = mappedElement; - } + const mappedElement = this.mapElement({ + elementWrapper: elementWrapper, + item: itemInstance, + preparedItems: data.preparedItems, + processingStartedForCodenames: data.processingStartedForCodenames, + processedItems: data.processedItems + }); + + // set mapped elements + itemInstance.elements[elementCodename] = mappedElement; } return { @@ -484,30 +483,6 @@ export class ElementMapper { }; } - private resolveElementMap( - item: IContentItem, - originalElementCodename: string - ): { - shouldMapElement: boolean; - resolvedName: string; - } { - let resolvedElementPropertyName: string | undefined = undefined; - - if (this.config.propertyNameResolver) { - resolvedElementPropertyName = this.config.propertyNameResolver(item.system.type, originalElementCodename); - } - - if (!resolvedElementPropertyName) { - // use original element codename - resolvedElementPropertyName = originalElementCodename; - } - - return { - resolvedName: resolvedElementPropertyName, - shouldMapElement: true - }; - } - private buildElement( elementWrapper: ElementModels.IElementWrapper, type: ElementType, diff --git a/lib/models/item-models.ts b/lib/models/item-models.ts index a9f7fe1b..778f155f 100644 --- a/lib/models/item-models.ts +++ b/lib/models/item-models.ts @@ -1,6 +1,6 @@ import { Contracts } from '../contracts'; -import { IQueryConfig } from './common/common-models'; import { ElementModels } from '../elements/element-models'; +import { IQueryConfig } from './common/common-models'; export interface IMapElementsResult { item: TContentItem; @@ -135,5 +135,3 @@ export interface IItemQueryConfig extends IQueryConfig {} export interface IItemFeedQueryConfig extends IQueryConfig { disableItemLinking?: boolean; } - -export type PropertyNameResolver = (contentTypeCodename: string, elementCodename: string) => string; diff --git a/lib/resolvers/index.ts b/lib/resolvers/index.ts index c2d507c9..4fcc2c97 100644 --- a/lib/resolvers/index.ts +++ b/lib/resolvers/index.ts @@ -1,10 +1,5 @@ +export * from './rich-text/async/async-rich-text-html-resolver'; export * from './rich-text/rich-text-resolver.models'; -export * from './property-name/camel-case-property-name-resolver.class'; -export * from './property-name/pascal-case-property-name-resolver.class'; -export * from './property-name/snake-case-property-name-resolver.class'; export * from './rich-text/sync/rich-text-html-resolver'; -export * from './rich-text/sync/rich-text-object-resolver'; export * from './rich-text/sync/rich-text-json-resolver'; -export * from './rich-text/async/async-rich-text-html-resolver'; - - +export * from './rich-text/sync/rich-text-object-resolver'; diff --git a/lib/resolvers/property-name/camel-case-property-name-resolver.class.ts b/lib/resolvers/property-name/camel-case-property-name-resolver.class.ts deleted file mode 100644 index e3e532ef..00000000 --- a/lib/resolvers/property-name/camel-case-property-name-resolver.class.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { textHelper } from '../../utilities'; -import { PropertyNameResolver } from '../../models'; - -export const camelCasePropertyNameResolver: PropertyNameResolver = (contentType, element) => { - return textHelper.addUnderscoreWhenStarsWithNumber(textHelper.removeZeroWidthCharacters(toCamelCase(element))); -}; - -function toCamelCase(str: string): string { - str = str.replace(textHelper.getPropertyNameRegex(), (_, c: string) => (c ? c.toUpperCase() : '')); - return str.substring(0, 1).toLowerCase() + str.substring(1); -} diff --git a/lib/resolvers/property-name/pascal-case-property-name-resolver.class.ts b/lib/resolvers/property-name/pascal-case-property-name-resolver.class.ts deleted file mode 100644 index 743969f3..00000000 --- a/lib/resolvers/property-name/pascal-case-property-name-resolver.class.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { textHelper } from '../../utilities'; -import { PropertyNameResolver } from '../../models'; - -export const pascalCasePropertyNameResolver: PropertyNameResolver = (contentType, element) => { - return textHelper.addUnderscoreWhenStarsWithNumber(textHelper.removeZeroWidthCharacters(toPascalCase(element))); -}; - -function toPascalCase(str: string): string { - str = str.replace(textHelper.getPropertyNameRegex(), (_, c: string) => (c ? c.toUpperCase() : '')); - return str.substring(0, 1).toUpperCase() + str.substring(1); -} diff --git a/lib/resolvers/property-name/snake-case-property-name-resolver.class.ts b/lib/resolvers/property-name/snake-case-property-name-resolver.class.ts deleted file mode 100644 index 1dd1a5f9..00000000 --- a/lib/resolvers/property-name/snake-case-property-name-resolver.class.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { textHelper } from '../../utilities'; -import { PropertyNameResolver } from '../../models'; - -export const snakeCasePropertyNameResolver: PropertyNameResolver = (contentType, element) => { - return textHelper - .addUnderscoreWhenStarsWithNumber(textHelper.removeZeroWidthCharacters(toSnakeCase(element))) - .toLowerCase(); -}; - -function toSnakeCase(str: string): string { - str = str.replace(textHelper.getPropertyNameRegex(), (_, c: string) => '_' + (c ? c.toLowerCase() : '')); - return removeEndUnderscore(removeStartUnderscore(str)); -} - -function removeStartUnderscore(str: string): string { - if (!str.startsWith('_')) { - return str; - } - - return str.substring(1); -} - -function removeEndUnderscore(str: string): string { - if (!str.endsWith('_')) { - return str; - } - - return str.slice(0, -1); -} diff --git a/lib/utilities/index.ts b/lib/utilities/index.ts index a08b1a55..49d8179d 100644 --- a/lib/utilities/index.ts +++ b/lib/utilities/index.ts @@ -1,6 +1,5 @@ -export * from './linked-items.helper'; -export * from './guid.helper'; +export * from './codename.helper'; export * from './delivery-url.helper'; -export * from './text.helper'; export * from './enum.helper'; -export * from './codename.helper'; +export * from './guid.helper'; +export * from './linked-items.helper'; diff --git a/lib/utilities/text.helper.ts b/lib/utilities/text.helper.ts deleted file mode 100644 index 7f14f8d9..00000000 --- a/lib/utilities/text.helper.ts +++ /dev/null @@ -1,25 +0,0 @@ -export class TextHelper { - getPropertyNameRegex(): RegExp { - return /[+;,/&()?\-='"\\\xa7!%:_\s.]+(.)?/g; - } - - removeZeroWidthCharacters(str: string): string { - return str.replace(/[\u200B-\u200D\uFEFF]/g, ''); - } - - addUnderscoreWhenStarsWithNumber(str: string): string { - if (this.startsWithNumber(str)) { - return `_${str}`; - } - return str; - } - - startsWithNumber(str: string): boolean { - if (str.match(/^\d/)) { - return true; - } - return false; - } -} - -export const textHelper = new TextHelper(); diff --git a/readme.md b/readme.md index cdce9f3e..99a51eb9 100644 --- a/readme.md +++ b/readme.md @@ -8,8 +8,8 @@ # JavaScript Delivery SDK Documentation -JavaScript Delivery SDK is a client library for retrieving data from [Kontent.ai](https://kontent.ai/). Works -both in browser & node.js environments. +JavaScript Delivery SDK is a client library for retrieving data from [Kontent.ai](https://kontent.ai/). Works both in +browser & node.js environments. # Kontent.ai Delivery SDK @@ -69,7 +69,7 @@ export type Movie = IContentItem<{ category: Elements.MultipleChoiceElement; stars: Elements.LinkedItemsElement; seoname: Elements.UrlSlugElement; - releaseCategory: Elements.TaxonomyElement; + releasecategory: Elements.TaxonomyElement; }>; // initialize delivery client @@ -91,13 +91,11 @@ const KontentDelivery = require('@kontent-ai/delivery-sdk'); // initialize delivery client const deliveryClient = KontentDelivery.createDeliveryClient({ - environmentId: '', + environmentId: '' }); // fetch items -const response = await deliveryClient.items() - .type('') - .toPromise(); +const response = await deliveryClient.items().type('').toPromise(); // read data of first item const movieText = response.data.items[0].elements.title.value; @@ -140,23 +138,22 @@ const movieText = response.data.items[0].elements.title.value; Following is a list of configuration options for DeliveryClient (`IDeliveryClientConfig`): -| Property | type | description | -| ------------------- | :--------------------------------------: |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| environmentId | string | environmentId of your Kontent.ai project | -| elementResolver? | ElementResolver | Element resolver used to map custom elements | -| previewApiKey? | string | Preview API key used to get unpublished content items | -| defaultLanguage? | string | Sets default language that will be used for all queries unless overridden with query parameters | -| proxy? | IDeliveryClientProxyConfig | Can be used to configure custom URLs. Useful when you use reverse proxy or have a need to transform URL - e.g. to remove 'environmentId' | -| secureApiKey? | string | Secured API key: Use secured API only when running on Node.JS server, otherwise you can expose your key | -| defaultQueryConfig? | IQueryConfig | Default configuration for all queries. Can be overridden by individual queries | -| httpService ? | IHttpService | Can be used to inject custom http service for performing requests | -| globalHeaders? | (queryConfig: IQueryConfig) => IHeader[] | Adds ability to add extra headers to each http request | -| retryStrategy? | IRetryStrategyOptions | Retry strategy configuration | -| linkedItemsReferenceHandler? | LinkedItemsReferenceHandler | Indicates if content items are automatically mapped. Available values: 'map' or 'ignore' | -| propertyNameResolver? | PropertyNameResolver | Used to map properties. Choose one of the following default resolvers: `snakeCasePropertyNameResolver`, `pascalCasePropertyNameResolver` & `camelCasePropertyNameResolver` or create your own PropertyNameResolver function | -| assetsDomain? | string | Custom domain for assets. Changes url of assets in both asset & rich text elements | -| defaultRenditionPreset? | string | Codename of rendition preset to be applied by default to the base asset URL path when present. When set, the SDK will provide the URL of customized images by default. Right now the only supported preset codename is `default`. | -| excludeArchivedItems? | boolean | Can be used to exclude archived items from all queries by default. Only applicable when preview API is used. | +| Property | type | description | +| ---------------------------- | :--------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| environmentId | string | environmentId of your Kontent.ai project | +| elementResolver? | ElementResolver | Element resolver used to map custom elements | +| previewApiKey? | string | Preview API key used to get unpublished content items | +| defaultLanguage? | string | Sets default language that will be used for all queries unless overridden with query parameters | +| proxy? | IDeliveryClientProxyConfig | Can be used to configure custom URLs. Useful when you use reverse proxy or have a need to transform URL - e.g. to remove 'environmentId' | +| secureApiKey? | string | Secured API key: Use secured API only when running on Node.JS server, otherwise you can expose your key | +| defaultQueryConfig? | IQueryConfig | Default configuration for all queries. Can be overridden by individual queries | +| httpService ? | IHttpService | Can be used to inject custom http service for performing requests | +| globalHeaders? | (queryConfig: IQueryConfig) => IHeader[] | Adds ability to add extra headers to each http request | +| retryStrategy? | IRetryStrategyOptions | Retry strategy configuration | +| linkedItemsReferenceHandler? | LinkedItemsReferenceHandler | Indicates if content items are automatically mapped. Available values: 'map' or 'ignore' | +| assetsDomain? | string | Custom domain for assets. Changes url of assets in both asset & rich text elements | +| defaultRenditionPreset? | string | Codename of rendition preset to be applied by default to the base asset URL path when present. When set, the SDK will provide the URL of customized images by default. Right now the only supported preset codename is `default`. | +| excludeArchivedItems? | boolean | Can be used to exclude archived items from all queries by default. Only applicable when preview API is used. | ### Create typed models @@ -178,7 +175,7 @@ export type Movie = IContentItem<{ category: Elements.MultipleChoiceElement; stars: Elements.LinkedItemsElement; seoname: Elements.UrlSlugElement; - releaseCategory: Elements.TaxonomyElement; + releasecategory: Elements.TaxonomyElement; }>; ``` @@ -256,9 +253,9 @@ type Movie = IContentItem<{ ### Query parameters -The SDK supports the following query parameters: `depthParameter`, `elementsParameter`, `excludeElementsParameter`, `limitParameter`, -`orderParameter`, `skipParameter` and `languageParameter`. For more information about the parameters, see the -[SDK query methods](#filter-content) below. You can also head over to +The SDK supports the following query parameters: `depthParameter`, `elementsParameter`, `excludeElementsParameter`, +`limitParameter`, `orderParameter`, `skipParameter` and `languageParameter`. For more information about the parameters, +see the [SDK query methods](#filter-content) below. You can also head over to [Delivery API reference](https://kontent.ai/learn/reference/delivery-api#tag/Filtering-content). ```typescript @@ -361,44 +358,6 @@ deliveryClient.item('warrior').toPromise(); deliveryClient.item('warrior').languageParameter(`en`).toPromise(); ``` -### Property name resolvers - -Kontent.ai element codenames are always in **lowercase** and use **underscore** as a replacement for special characters. -Using underscores might not be what you want to use in your code. Maybe you want to use `camelCase`, which is exactly -what you can do by registering a `propertyNameResolver`. The following example converts `first_name` element name to -`firstName`. - -```typescript -import { ContentItem, Elements, createDeliveryClient } from '@kontent-ai/delivery-sdk'; - -type Actor = IContentItem<{ - firstName: Elements.TextElement; -}>; - -const deliveryClient = createDeliveryClient({ - environmentId: ''; - propertyNameResolver: (contentType, element) => { - if (element === 'first_name') { - return 'firstName'; - } - return element; - } -}); -``` - -Rather than registering all elements manually, you can also use one of the built-in property name resolvers: `snakeCasePropertyNameResolver`, `pascalCasePropertyNameResolver` & `camelCasePropertyNameResolver` - -```typescript -import { createDeliveryClient, snakeCasePropertyNameResolver, pascalCasePropertyNameResolver, camelCasePropertyNameResolver } from '@kontent-ai/delivery-sdk'; - -const deliveryClient = createDeliveryClient({ - environmentId: ''; - propertyNameResolver: camelCasePropertyNameResolver, - // propertyNameResolver: snakeCasePropertyNameResolver, - // propertyNameResolver: pascalCasePropertyNameResolver, -}); -``` - ### Preview mode You can enable the preview mode either globally (when [initializing the DeliveryClient](#how-to-use-deliveryclient)) or @@ -431,7 +390,8 @@ deliveryClient ### Secure Delivery API -Using the Delivery API with [secure access](https://kontent.ai/learn/tutorials/develop-apps/build-strong-foundation/restrict-public-access) enabled +Using the Delivery API with +[secure access](https://kontent.ai/learn/tutorials/develop-apps/build-strong-foundation/restrict-public-access) enabled is recommend only when the request is not being executed on the client (browser) because otherwise you will expose the API key publicly. @@ -500,21 +460,21 @@ const response = await deliveryClient.items().limitParameter(5).toAllPromise({ ### Resolving rich text elements -[Rich text elements](https://kontent.ai/learn/reference/delivery-api#section/Rich-text-element) in -Kontent.ai may contain linked items and components. For example, if you write a blog post, you might want to -insert a video or testimonial to a specific place in your article. +[Rich text elements](https://kontent.ai/learn/reference/delivery-api#section/Rich-text-element) in Kontent.ai may +contain linked items and components. For example, if you write a blog post, you might want to insert a video or +testimonial to a specific place in your article. You need to define how these objects resolve to the HTML that will be rendered. This SDK provides you with few resolvers -that help you to transform the input HTML to your desired HTML, JSON or object. +that help you to transform the input HTML to your desired HTML, JSON or object. Built-in resolvers provided by SDK: -Resolver | Description | Usage ---- | --- | --- | -`RichTextHtmlResolver` | Tranforms rich text HTML by replacing linked items, links or images with custom HTML | `createRichTextHtmlResolver().resolveRichText(data)` -`RichTextJsonResolver` | Tranforms rich text HTML into JSON | `createRichTextJsonResolver().resolveRichText(data)` -`RichTextObjectResolver` | Tranforms rich text HTML into javascript Object | `createRichTextObjectResolver().resolveRichText(data)` -`AsyncRichTextHtmlResolver` | Async version of `RichTextHtmlResolver` | `await createAsyncRichTextHtmlResolver().resolveRichTextAsync(data)` +| Resolver | Description | Usage | +| --------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------- | +| `RichTextHtmlResolver` | Tranforms rich text HTML by replacing linked items, links or images with custom HTML | `createRichTextHtmlResolver().resolveRichText(data)` | +| `RichTextJsonResolver` | Tranforms rich text HTML into JSON | `createRichTextJsonResolver().resolveRichText(data)` | +| `RichTextObjectResolver` | Tranforms rich text HTML into javascript Object | `createRichTextObjectResolver().resolveRichText(data)` | +| `AsyncRichTextHtmlResolver` | Async version of `RichTextHtmlResolver` | `await createAsyncRichTextHtmlResolver().resolveRichTextAsync(data)` | #### Example use of RichTextHtmlResolver @@ -526,11 +486,13 @@ export type Movie = IContentItem<{ }>; export type Actor = IContentItem<{ - firstName: Elements.RichTextElement; + first_name: Elements.RichTextElement; }>; // get content item with rich text element -const response = (await createDeliveryClient({ environmentId: '' }).item('itemCodename').toPromise()).data; +const response = ( + await createDeliveryClient({ environmentId: '' }).item('itemCodename').toPromise() +).data; // get rich text element const richTextElement = response.item.plot; @@ -557,7 +519,7 @@ const resolvedRichText = createRichTextHtmlResolver().resolveRichText({ if (contentItem && contentItem.system.type === 'actor') { const actor = contentItem as Actor; return { - contentItemHtml: `
${actor.elements.firstName.value}
` + contentItemHtml: `
${actor.elements.first_name.value}
` }; } @@ -576,7 +538,9 @@ const resolvedHtml = resolvedRichText.html; import { createRichTextHtmlResolver, createDeliveryClient, linkedItemsHelper } from '@kontent-ai/delivery-sdk'; // get content item with rich text element -const response = (await createDeliveryClient({ environmentId: '' }).item('itemCodename').toPromise()).data; +const response = ( + await createDeliveryClient({ environmentId: '' }).item('itemCodename').toPromise() +).data; // get rich text element const richTextElement = response.item.plot; @@ -584,7 +548,7 @@ const richTextElement = response.item.plot; // transform rich text html into json const json = createRichTextJsonResolver().resolveRichText({ element: response.item.elements.plot, - linkedItems: linkedItemsHelper.convertLinkedItemsToArray(response.data.linkedItems), + linkedItems: linkedItemsHelper.convertLinkedItemsToArray(response.data.linkedItems) }); ``` @@ -611,7 +575,10 @@ const html = await createAsyncRichTextHtmlResolver(asyncNodeParser).resolveRichT ### Creating custom rich text resolvers -This SDK provides you with `browserParser` which you can use to implement your own rich text resolver. A common usecase for creating custom resolvers is when you want to convert rich text element into, for example, `react components`, `angular commponents` or components in some other popular framework. The parser will take care of actually parsing html, while you can focus on creating specific logic for creating components dynamically. +This SDK provides you with `browserParser` which you can use to implement your own rich text resolver. A common usecase +for creating custom resolvers is when you want to convert rich text element into, for example, `react components`, +`angular commponents` or components in some other popular framework. The parser will take care of actually parsing html, +while you can focus on creating specific logic for creating components dynamically. ## Get content types @@ -686,7 +653,8 @@ const client = createDeliveryClient({ ## Error handling -If the error originates in Kontent.ai (see [error responses](https://kontent.ai/learn/reference/delivery-api#section/SDKs)), you will get a `DeliveryError` object +If the error originates in Kontent.ai (see +[error responses](https://kontent.ai/learn/reference/delivery-api#section/SDKs)), you will get a `DeliveryError` object instance with more specific information. Otherwise, you will get the original error. ```typescript @@ -707,7 +675,8 @@ try { ### Remapping json responses -In some scenarios, you might want to store `json` response for later use and use SDK to map the response for you. There are 2 ways you can map previously stored `json`: +In some scenarios, you might want to store `json` response for later use and use SDK to map the response for you. There +are 2 ways you can map previously stored `json`: ```typescript const result = await deliveryClient.item('codename').toPromise(); @@ -723,12 +692,16 @@ const remappedData = deliveryClient.item(movieCodename).map(json); ### Handling circular references -By default, the SDK automatically maps content items present in `linked items` & `rich text` elements. Linked items can reference other linked items in their tree (e.g. child item referencing parent) which may cause infinite nesting (circular reference). This behavior is not an issue for most scenarios, in fact it is beneficial as you can easily access all linked items. However, you cannot easily serialize such model. Using e.g. `JSON.stringify` would fail if there are circular references. +By default, the SDK automatically maps content items present in `linked items` & `rich text` elements. Linked items can +reference other linked items in their tree (e.g. child item referencing parent) which may cause infinite nesting +(circular reference). This behavior is not an issue for most scenarios, in fact it is beneficial as you can easily +access all linked items. However, you cannot easily serialize such model. Using e.g. `JSON.stringify` would fail if +there are circular references. For this reason, you may disable mapping of linked items with `linkedItemsReferenceHandler` configuration option. ```typescript - const client = getTestDeliveryClient({ +const client = getTestDeliveryClient({ environmentId: '', linkedItemsReferenceHandler: 'ignore' // or 'map' }); @@ -750,7 +723,6 @@ const deliveryClient = createDeliveryClient({ }); ``` - ## Debugging ### Accessing request data @@ -759,7 +731,9 @@ Every response from this SDK contains additional debug data you can use to inspe need to access response headers or other network related properties. ```typescript -const deliveryResponse = await createDeliveryClient({ environmentId: 'environmentId' }).item('itemCodename').toPromise(); +const deliveryResponse = await createDeliveryClient({ environmentId: 'environmentId' }) + .item('itemCodename') + .toPromise(); const rawResponseData = deliveryResponse.response; // contains raw response data, headers, status etc.. const responseHeaders = deliveryResponse.response.headers; ``` @@ -780,6 +754,7 @@ console.log(queryText); // outputs: // https://deliver.kontent.ai/b52fa0db-84ec-4310-8f7c-3b94ed06644d/items?limit=10&order=system.codename[desc]&system.type=movie ``` + ## Upgrade The major version `11.0.0` is pretty much a complete overhaul of this SDK with many breaking changes. The major benefits @@ -799,8 +774,8 @@ of `11.0.0` are: later on) - Updated all dependencies -If you are upgrading from an older version, please see this documentation first. If you are still unsure how to upgrade or -have some other questions, feel free to submit an issue on this GitHub and we'll get back to you. +If you are upgrading from an older version, please see this documentation first. If you are still unsure how to upgrade +or have some other questions, feel free to submit an issue on this GitHub and we'll get back to you. ## Testing diff --git a/test/browser/isolated-tests/core/property-name-resolvers.spec.ts b/test/browser/isolated-tests/core/property-name-resolvers.spec.ts deleted file mode 100644 index 9f6e42bc..00000000 --- a/test/browser/isolated-tests/core/property-name-resolvers.spec.ts +++ /dev/null @@ -1,182 +0,0 @@ -import { camelCasePropertyNameResolver, pascalCasePropertyNameResolver, snakeCasePropertyNameResolver } from '../../../../lib'; -import { Context, setup } from '../../setup'; - -interface INameValue { - name: string; - camelCase: string; - pascalCase: string; - snakeCase: string; -} - -describe('Property name resolvers', () => { - const nameValues: INameValue[] = [{ - name: 'test value', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: 'test+value', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: ';test;value', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: ',test,value', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: '_test value', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: 'test / value', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: ':test value', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: '%test%value', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: '?test?value', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: '-test-value', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: '!test!value', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: '§test§value', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: '\'test\'value', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: '"test"value', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: '=test=value', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: '&test&value', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: '%test%value%', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: ' test value ', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: ' test value ', - camelCase: 'testValue', - pascalCase: 'TestValue', - snakeCase: 'test_value' - }, - { - name: 'zAPI Security scheme', - camelCase: 'zAPISecurityScheme', - pascalCase: 'ZAPISecurityScheme', - snakeCase: 'zapi_security_scheme' - }, - { - name: 'zAPI ​Category', // text includes zero width character - camelCase: 'zAPICategory', - pascalCase: 'ZAPICategory', - snakeCase: 'zapi_category' - }, - { - name: '404 Not found', // text starts with number - camelCase: '_404NotFound', - pascalCase: '_404NotFound', - snakeCase: '_404_not_found' - }, - { - name: 'Home (root)', - camelCase: 'homeRoot', - pascalCase: 'HomeRoot', - snakeCase: 'home_root' - }, - ]; - - const context = new Context(); - - setup(context); - - describe('Camel case resolver', () => { - it(`Values are converted`, () => { - for (const nameValue of nameValues) { - const converted = camelCasePropertyNameResolver('', nameValue.name); - expect(converted).toEqual(nameValue.camelCase); - } - }); - }); - - describe('Pascal case resolver', () => { - it(`Values are converted`, () => { - for (const nameValue of nameValues) { - const converted = pascalCasePropertyNameResolver('', nameValue.name); - expect(converted).toEqual(nameValue.pascalCase); - } - }); - }); - - describe('Snake case resolver', () => { - it(`Values are converted`, () => { - for (const nameValue of nameValues) { - const converted = snakeCasePropertyNameResolver('', nameValue.name); - expect(converted).toEqual(nameValue.snakeCase); - } - }); - }); -}); diff --git a/test/browser/isolated-tests/endpoints/items-feed/items-feed-all.spec.json b/test/browser/isolated-tests/endpoints/items-feed/items-feed-all.spec.json index f015cb8a..a08a775a 100644 --- a/test/browser/isolated-tests/endpoints/items-feed/items-feed-all.spec.json +++ b/test/browser/isolated-tests/endpoints/items-feed/items-feed-all.spec.json @@ -1,252 +1,245 @@ { - "items": [{ - "system": { - "id": "325e2acb-1c14-47f6-af9a-27bc8b6c16fe", - "name": "Warrior", - "codename": "warrior", - "language": "en", - "type": "movie", - "sitemap_locations": [ - "main_sitemap" - ], - "collection": "default", - "last_modified": "2019-09-05T10:51:15.6555984Z" - }, - "elements": { - "title": { - "type": "text", - "name": "Title", - "value": "Warrior" - }, - "plot": { - "type": "rich_text", - "name": "Plot", - "images": { - "22504ba8-2075-48fa-9d4f-8fce3de1754a": { - "image_id": "22504ba8-2075-48fa-9d4f-8fce3de1754a", - "description": null, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", - "width": 648, - "height": 1000 + "items": [ + { + "system": { + "id": "325e2acb-1c14-47f6-af9a-27bc8b6c16fe", + "name": "Warrior", + "codename": "warrior", + "language": "en", + "type": "movie", + "sitemap_locations": ["main_sitemap"], + "collection": "default", + "last_modified": "2019-09-05T10:51:15.6555984Z" }, - "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5": { - "image_id": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5", - "description": null, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", - "width": 214, - "height": 317 + "elements": { + "title": { + "type": "text", + "name": "Title", + "value": "Warrior" + }, + "plot": { + "type": "rich_text", + "name": "Plot", + "images": { + "22504ba8-2075-48fa-9d4f-8fce3de1754a": { + "image_id": "22504ba8-2075-48fa-9d4f-8fce3de1754a", + "description": null, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", + "width": 648, + "height": 1000 + }, + "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5": { + "image_id": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5", + "description": null, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", + "width": 214, + "height": 317 + } + }, + "links": { + "3294e4b0-e58b-49d7-85fa-5bc9a86556ec": { + "codename": "joel_edgerton", + "type": "actor", + "url_slug": "joel-edgerton" + }, + "d1557cb1-d7ec-4d04-9742-f86b52bc34fc": { + "codename": "tom_hardy", + "type": "actor", + "url_slug": "tom-hardy" + } + }, + "modular_content": ["tom_hardy", "joel_edgerton", "ec9813f6_194d_018f_e20c_36855fb6e600"], + "value": "

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

\n

Stars: 

\n\n\n


\n

See more in profile of Joel Edgerton and Tom Hardy

\n

And here are some images: 

\n
\"\"
\n
\"\"
\n


\n

Also, why not include content component in the mix?

\n" + }, + "released": { + "type": "date_time", + "name": "Released", + "value": "2011-09-09T00:00:00Z" + }, + "length": { + "type": "number", + "name": "Length", + "value": 151 + }, + "poster": { + "type": "asset", + "name": "Poster", + "value": [ + { + "name": "warrior.jpg", + "description": null, + "type": "image/jpeg", + "size": 111004, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", + "width": 648, + "height": 1000 + } + ] + }, + "category": { + "type": "multiple_choice", + "name": "Category", + "value": [ + { + "name": "Action", + "codename": "action" + }, + { + "name": "Drama", + "codename": "drama" + } + ] + }, + "stars": { + "type": "modular_content", + "name": "Stars", + "value": ["tom_hardy", "joel_edgerton"] + }, + "seoname": { + "type": "url_slug", + "name": "SeoName", + "value": "warrior" + }, + "releasecategory": { + "type": "taxonomy", + "name": "releasecategory", + "taxonomy_group": "releasecategory", + "value": [ + { + "name": "Global release", + "codename": "global_release" + }, + { + "name": "US only", + "codename": "us_only" + } + ] + } } - }, - "links": { - "3294e4b0-e58b-49d7-85fa-5bc9a86556ec": { - "codename": "joel_edgerton", - "type": "actor", - "url_slug": "joel-edgerton" + } + ], + "modular_content": { + "ec9813f6_194d_018f_e20c_36855fb6e600": { + "system": { + "id": "ec9813f6-194d-018f-e20c-36855fb6e600", + "name": "ec9813f6-194d-018f-e20c-36855fb6e600", + "codename": "ec9813f6_194d_018f_e20c_36855fb6e600", + "language": "en", + "type": "actor", + "sitemap_locations": [], + "collection": "default", + "last_modified": "2019-09-05T10:51:15.6555984Z" }, - "d1557cb1-d7ec-4d04-9742-f86b52bc34fc": { - "codename": "tom_hardy", - "type": "actor", - "url_slug": "tom-hardy" - } - }, - "modular_content": [ - "tom_hardy", - "joel_edgerton", - "ec9813f6_194d_018f_e20c_36855fb6e600" - ], - "value": "

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

\n

Stars: 

\n\n\n


\n

See more in profile of Joel Edgerton and Tom Hardy

\n

And here are some images: 

\n
\"\"
\n
\"\"
\n


\n

Also, why not include content component in the mix?

\n" - }, - "released": { - "type": "date_time", - "name": "Released", - "value": "2011-09-09T00:00:00Z" - }, - "length": { - "type": "number", - "name": "Length", - "value": 151 - }, - "poster": { - "type": "asset", - "name": "Poster", - "value": [ - { - "name": "warrior.jpg", - "description": null, - "type": "image/jpeg", - "size": 111004, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", - "width": 648, - "height": 1000 + "elements": { + "first_name": { + "type": "text", + "name": "First name", + "value": "Jennifer " + }, + "last_name": { + "type": "text", + "name": "Last name", + "value": "Morrison" + }, + "url": { + "type": "url_slug", + "name": "Url", + "value": "component-actor-url" + }, + "photo": { + "type": "asset", + "name": "Photo", + "value": [] + } } - ] }, - "category": { - "type": "multiple_choice", - "name": "Category", - "value": [ - { - "name": "Action", - "codename": "action" + "joel_edgerton": { + "system": { + "id": "3294e4b0-e58b-49d7-85fa-5bc9a86556ec", + "name": "Joel Edgerton", + "codename": "joel_edgerton", + "language": "en", + "type": "actor", + "sitemap_locations": [], + "collection": "default", + "last_modified": "2017-08-03T09:21:21.3857294Z" }, - { - "name": "Drama", - "codename": "drama" + "elements": { + "url": { + "type": "url_slug", + "name": "Url", + "value": "joel-edgerton" + }, + "first_name": { + "type": "text", + "name": "First name", + "value": "Joel" + }, + "last_name": { + "type": "text", + "name": "Last name", + "value": "Edgerton" + }, + "photo": { + "type": "asset", + "name": "Photo", + "value": [ + { + "name": "joel_edgerton.jpg", + "description": null, + "type": "image/jpeg", + "size": 6460, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/2855720a-4ca4-4687-826a-29f9635088e0/joel_edgerton.jpg", + "width": 211, + "height": 317 + } + ] + } } - ] - }, - "stars": { - "type": "modular_content", - "name": "Stars", - "value": [ - "tom_hardy", - "joel_edgerton" - ] }, - "seoname": { - "type": "url_slug", - "name": "SeoName", - "value": "warrior" - }, - "releasecategory": { - "type": "taxonomy", - "name": "ReleaseCategory", - "taxonomy_group": "releasecategory", - "value": [ - { - "name": "Global release", - "codename": "global_release" + "tom_hardy": { + "system": { + "id": "d1557cb1-d7ec-4d04-9742-f86b52bc34fc", + "name": "Tom Hardy", + "codename": "tom_hardy", + "language": "en", + "type": "actor", + "sitemap_locations": [], + "collection": "default", + "last_modified": "2018-02-09T13:11:32.5769383Z" }, - { - "name": "US only", - "codename": "us_only" + "elements": { + "url": { + "type": "url_slug", + "name": "Url", + "value": "tom-hardy" + }, + "first_name": { + "type": "text", + "name": "First name", + "value": "Tom" + }, + "last_name": { + "type": "text", + "name": "Last name", + "value": "Hardy" + }, + "photo": { + "type": "asset", + "name": "Photo", + "value": [ + { + "name": "tom_hardy.jpg", + "description": null, + "type": "image/jpeg", + "size": 8091, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", + "width": 214, + "height": 317 + } + ] + } } - ] - } - } - }], - "modular_content": { - "ec9813f6_194d_018f_e20c_36855fb6e600": { - "system": { - "id": "ec9813f6-194d-018f-e20c-36855fb6e600", - "name": "ec9813f6-194d-018f-e20c-36855fb6e600", - "codename": "ec9813f6_194d_018f_e20c_36855fb6e600", - "language": "en", - "type": "actor", - "sitemap_locations": [], - "collection": "default", - "last_modified": "2019-09-05T10:51:15.6555984Z" - }, - "elements": { - "first_name": { - "type": "text", - "name": "First name", - "value": "Jennifer " - }, - "last_name": { - "type": "text", - "name": "Last name", - "value": "Morrison" - }, - "url": { - "type": "url_slug", - "name": "Url", - "value": "component-actor-url" - }, - "photo": { - "type": "asset", - "name": "Photo", - "value": [] - } - } - }, - "joel_edgerton": { - "system": { - "id": "3294e4b0-e58b-49d7-85fa-5bc9a86556ec", - "name": "Joel Edgerton", - "codename": "joel_edgerton", - "language": "en", - "type": "actor", - "sitemap_locations": [], - "collection": "default", - "last_modified": "2017-08-03T09:21:21.3857294Z" - }, - "elements": { - "url": { - "type": "url_slug", - "name": "Url", - "value": "joel-edgerton" - }, - "first_name": { - "type": "text", - "name": "First name", - "value": "Joel" - }, - "last_name": { - "type": "text", - "name": "Last name", - "value": "Edgerton" - }, - "photo": { - "type": "asset", - "name": "Photo", - "value": [ - { - "name": "joel_edgerton.jpg", - "description": null, - "type": "image/jpeg", - "size": 6460, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/2855720a-4ca4-4687-826a-29f9635088e0/joel_edgerton.jpg", - "width": 211, - "height": 317 - } - ] - } - } - }, - "tom_hardy": { - "system": { - "id": "d1557cb1-d7ec-4d04-9742-f86b52bc34fc", - "name": "Tom Hardy", - "codename": "tom_hardy", - "language": "en", - "type": "actor", - "sitemap_locations": [], - "collection": "default", - "last_modified": "2018-02-09T13:11:32.5769383Z" - }, - "elements": { - "url": { - "type": "url_slug", - "name": "Url", - "value": "tom-hardy" - }, - "first_name": { - "type": "text", - "name": "First name", - "value": "Tom" - }, - "last_name": { - "type": "text", - "name": "Last name", - "value": "Hardy" - }, - "photo": { - "type": "asset", - "name": "Photo", - "value": [ - { - "name": "tom_hardy.jpg", - "description": null, - "type": "image/jpeg", - "size": 8091, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", - "width": 214, - "height": 317 - } - ] - } } - } } - } +} diff --git a/test/browser/isolated-tests/endpoints/items-feed/items-feed.spec.json b/test/browser/isolated-tests/endpoints/items-feed/items-feed.spec.json index f015cb8a..a08a775a 100644 --- a/test/browser/isolated-tests/endpoints/items-feed/items-feed.spec.json +++ b/test/browser/isolated-tests/endpoints/items-feed/items-feed.spec.json @@ -1,252 +1,245 @@ { - "items": [{ - "system": { - "id": "325e2acb-1c14-47f6-af9a-27bc8b6c16fe", - "name": "Warrior", - "codename": "warrior", - "language": "en", - "type": "movie", - "sitemap_locations": [ - "main_sitemap" - ], - "collection": "default", - "last_modified": "2019-09-05T10:51:15.6555984Z" - }, - "elements": { - "title": { - "type": "text", - "name": "Title", - "value": "Warrior" - }, - "plot": { - "type": "rich_text", - "name": "Plot", - "images": { - "22504ba8-2075-48fa-9d4f-8fce3de1754a": { - "image_id": "22504ba8-2075-48fa-9d4f-8fce3de1754a", - "description": null, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", - "width": 648, - "height": 1000 + "items": [ + { + "system": { + "id": "325e2acb-1c14-47f6-af9a-27bc8b6c16fe", + "name": "Warrior", + "codename": "warrior", + "language": "en", + "type": "movie", + "sitemap_locations": ["main_sitemap"], + "collection": "default", + "last_modified": "2019-09-05T10:51:15.6555984Z" }, - "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5": { - "image_id": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5", - "description": null, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", - "width": 214, - "height": 317 + "elements": { + "title": { + "type": "text", + "name": "Title", + "value": "Warrior" + }, + "plot": { + "type": "rich_text", + "name": "Plot", + "images": { + "22504ba8-2075-48fa-9d4f-8fce3de1754a": { + "image_id": "22504ba8-2075-48fa-9d4f-8fce3de1754a", + "description": null, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", + "width": 648, + "height": 1000 + }, + "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5": { + "image_id": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5", + "description": null, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", + "width": 214, + "height": 317 + } + }, + "links": { + "3294e4b0-e58b-49d7-85fa-5bc9a86556ec": { + "codename": "joel_edgerton", + "type": "actor", + "url_slug": "joel-edgerton" + }, + "d1557cb1-d7ec-4d04-9742-f86b52bc34fc": { + "codename": "tom_hardy", + "type": "actor", + "url_slug": "tom-hardy" + } + }, + "modular_content": ["tom_hardy", "joel_edgerton", "ec9813f6_194d_018f_e20c_36855fb6e600"], + "value": "

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

\n

Stars: 

\n\n\n


\n

See more in profile of Joel Edgerton and Tom Hardy

\n

And here are some images: 

\n
\"\"
\n
\"\"
\n


\n

Also, why not include content component in the mix?

\n" + }, + "released": { + "type": "date_time", + "name": "Released", + "value": "2011-09-09T00:00:00Z" + }, + "length": { + "type": "number", + "name": "Length", + "value": 151 + }, + "poster": { + "type": "asset", + "name": "Poster", + "value": [ + { + "name": "warrior.jpg", + "description": null, + "type": "image/jpeg", + "size": 111004, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", + "width": 648, + "height": 1000 + } + ] + }, + "category": { + "type": "multiple_choice", + "name": "Category", + "value": [ + { + "name": "Action", + "codename": "action" + }, + { + "name": "Drama", + "codename": "drama" + } + ] + }, + "stars": { + "type": "modular_content", + "name": "Stars", + "value": ["tom_hardy", "joel_edgerton"] + }, + "seoname": { + "type": "url_slug", + "name": "SeoName", + "value": "warrior" + }, + "releasecategory": { + "type": "taxonomy", + "name": "releasecategory", + "taxonomy_group": "releasecategory", + "value": [ + { + "name": "Global release", + "codename": "global_release" + }, + { + "name": "US only", + "codename": "us_only" + } + ] + } } - }, - "links": { - "3294e4b0-e58b-49d7-85fa-5bc9a86556ec": { - "codename": "joel_edgerton", - "type": "actor", - "url_slug": "joel-edgerton" + } + ], + "modular_content": { + "ec9813f6_194d_018f_e20c_36855fb6e600": { + "system": { + "id": "ec9813f6-194d-018f-e20c-36855fb6e600", + "name": "ec9813f6-194d-018f-e20c-36855fb6e600", + "codename": "ec9813f6_194d_018f_e20c_36855fb6e600", + "language": "en", + "type": "actor", + "sitemap_locations": [], + "collection": "default", + "last_modified": "2019-09-05T10:51:15.6555984Z" }, - "d1557cb1-d7ec-4d04-9742-f86b52bc34fc": { - "codename": "tom_hardy", - "type": "actor", - "url_slug": "tom-hardy" - } - }, - "modular_content": [ - "tom_hardy", - "joel_edgerton", - "ec9813f6_194d_018f_e20c_36855fb6e600" - ], - "value": "

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

\n

Stars: 

\n\n\n


\n

See more in profile of Joel Edgerton and Tom Hardy

\n

And here are some images: 

\n
\"\"
\n
\"\"
\n


\n

Also, why not include content component in the mix?

\n" - }, - "released": { - "type": "date_time", - "name": "Released", - "value": "2011-09-09T00:00:00Z" - }, - "length": { - "type": "number", - "name": "Length", - "value": 151 - }, - "poster": { - "type": "asset", - "name": "Poster", - "value": [ - { - "name": "warrior.jpg", - "description": null, - "type": "image/jpeg", - "size": 111004, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", - "width": 648, - "height": 1000 + "elements": { + "first_name": { + "type": "text", + "name": "First name", + "value": "Jennifer " + }, + "last_name": { + "type": "text", + "name": "Last name", + "value": "Morrison" + }, + "url": { + "type": "url_slug", + "name": "Url", + "value": "component-actor-url" + }, + "photo": { + "type": "asset", + "name": "Photo", + "value": [] + } } - ] }, - "category": { - "type": "multiple_choice", - "name": "Category", - "value": [ - { - "name": "Action", - "codename": "action" + "joel_edgerton": { + "system": { + "id": "3294e4b0-e58b-49d7-85fa-5bc9a86556ec", + "name": "Joel Edgerton", + "codename": "joel_edgerton", + "language": "en", + "type": "actor", + "sitemap_locations": [], + "collection": "default", + "last_modified": "2017-08-03T09:21:21.3857294Z" }, - { - "name": "Drama", - "codename": "drama" + "elements": { + "url": { + "type": "url_slug", + "name": "Url", + "value": "joel-edgerton" + }, + "first_name": { + "type": "text", + "name": "First name", + "value": "Joel" + }, + "last_name": { + "type": "text", + "name": "Last name", + "value": "Edgerton" + }, + "photo": { + "type": "asset", + "name": "Photo", + "value": [ + { + "name": "joel_edgerton.jpg", + "description": null, + "type": "image/jpeg", + "size": 6460, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/2855720a-4ca4-4687-826a-29f9635088e0/joel_edgerton.jpg", + "width": 211, + "height": 317 + } + ] + } } - ] - }, - "stars": { - "type": "modular_content", - "name": "Stars", - "value": [ - "tom_hardy", - "joel_edgerton" - ] }, - "seoname": { - "type": "url_slug", - "name": "SeoName", - "value": "warrior" - }, - "releasecategory": { - "type": "taxonomy", - "name": "ReleaseCategory", - "taxonomy_group": "releasecategory", - "value": [ - { - "name": "Global release", - "codename": "global_release" + "tom_hardy": { + "system": { + "id": "d1557cb1-d7ec-4d04-9742-f86b52bc34fc", + "name": "Tom Hardy", + "codename": "tom_hardy", + "language": "en", + "type": "actor", + "sitemap_locations": [], + "collection": "default", + "last_modified": "2018-02-09T13:11:32.5769383Z" }, - { - "name": "US only", - "codename": "us_only" + "elements": { + "url": { + "type": "url_slug", + "name": "Url", + "value": "tom-hardy" + }, + "first_name": { + "type": "text", + "name": "First name", + "value": "Tom" + }, + "last_name": { + "type": "text", + "name": "Last name", + "value": "Hardy" + }, + "photo": { + "type": "asset", + "name": "Photo", + "value": [ + { + "name": "tom_hardy.jpg", + "description": null, + "type": "image/jpeg", + "size": 8091, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", + "width": 214, + "height": 317 + } + ] + } } - ] - } - } - }], - "modular_content": { - "ec9813f6_194d_018f_e20c_36855fb6e600": { - "system": { - "id": "ec9813f6-194d-018f-e20c-36855fb6e600", - "name": "ec9813f6-194d-018f-e20c-36855fb6e600", - "codename": "ec9813f6_194d_018f_e20c_36855fb6e600", - "language": "en", - "type": "actor", - "sitemap_locations": [], - "collection": "default", - "last_modified": "2019-09-05T10:51:15.6555984Z" - }, - "elements": { - "first_name": { - "type": "text", - "name": "First name", - "value": "Jennifer " - }, - "last_name": { - "type": "text", - "name": "Last name", - "value": "Morrison" - }, - "url": { - "type": "url_slug", - "name": "Url", - "value": "component-actor-url" - }, - "photo": { - "type": "asset", - "name": "Photo", - "value": [] - } - } - }, - "joel_edgerton": { - "system": { - "id": "3294e4b0-e58b-49d7-85fa-5bc9a86556ec", - "name": "Joel Edgerton", - "codename": "joel_edgerton", - "language": "en", - "type": "actor", - "sitemap_locations": [], - "collection": "default", - "last_modified": "2017-08-03T09:21:21.3857294Z" - }, - "elements": { - "url": { - "type": "url_slug", - "name": "Url", - "value": "joel-edgerton" - }, - "first_name": { - "type": "text", - "name": "First name", - "value": "Joel" - }, - "last_name": { - "type": "text", - "name": "Last name", - "value": "Edgerton" - }, - "photo": { - "type": "asset", - "name": "Photo", - "value": [ - { - "name": "joel_edgerton.jpg", - "description": null, - "type": "image/jpeg", - "size": 6460, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/2855720a-4ca4-4687-826a-29f9635088e0/joel_edgerton.jpg", - "width": 211, - "height": 317 - } - ] - } - } - }, - "tom_hardy": { - "system": { - "id": "d1557cb1-d7ec-4d04-9742-f86b52bc34fc", - "name": "Tom Hardy", - "codename": "tom_hardy", - "language": "en", - "type": "actor", - "sitemap_locations": [], - "collection": "default", - "last_modified": "2018-02-09T13:11:32.5769383Z" - }, - "elements": { - "url": { - "type": "url_slug", - "name": "Url", - "value": "tom-hardy" - }, - "first_name": { - "type": "text", - "name": "First name", - "value": "Tom" - }, - "last_name": { - "type": "text", - "name": "Last name", - "value": "Hardy" - }, - "photo": { - "type": "asset", - "name": "Photo", - "value": [ - { - "name": "tom_hardy.jpg", - "description": null, - "type": "image/jpeg", - "size": 8091, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", - "width": 214, - "height": 317 - } - ] - } } - } } - } +} diff --git a/test/browser/isolated-tests/fake-data/fake-warrior-response.json b/test/browser/isolated-tests/fake-data/fake-warrior-response.json index 176d71b5..eacf378d 100644 --- a/test/browser/isolated-tests/fake-data/fake-warrior-response.json +++ b/test/browser/isolated-tests/fake-data/fake-warrior-response.json @@ -1,264 +1,255 @@ { - "item": { - "system": { - "id": "325e2acb-1c14-47f6-af9a-27bc8b6c16fe", - "name": "Warrior", - "codename": "warrior", - "language": "en", - "type": "movie", - "sitemap_locations": [ - "main_sitemap" - ], - "collection": "christmas-campaign", - "last_modified": "2019-09-05T10:51:15.6555984Z", - "workflow_step": "published", - "workflow": "default" - }, - "elements": { - "title": { - "type": "text", - "name": "Title", - "value": "Warrior" - }, - "plot": { - "type": "rich_text", - "name": "Plot", - "images": { - "22504ba8-2075-48fa-9d4f-8fce3de1754a": { - "image_id": "22504ba8-2075-48fa-9d4f-8fce3de1754a", - "description": null, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", - "width": 648, - "height": 1000 - }, - "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5": { - "image_id": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5", - "description": null, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", - "width": 214, - "height": 317 - } - }, - "links": { - "3294e4b0-e58b-49d7-85fa-5bc9a86556ec": { - "codename": "joel_edgerton", - "type": "actor", - "url_slug": "joel-edgerton" - }, - "d1557cb1-d7ec-4d04-9742-f86b52bc34fc": { - "codename": "tom_hardy", - "type": "actor", - "url_slug": "tom-hardy" - } + "item": { + "system": { + "id": "325e2acb-1c14-47f6-af9a-27bc8b6c16fe", + "name": "Warrior", + "codename": "warrior", + "language": "en", + "type": "movie", + "sitemap_locations": ["main_sitemap"], + "collection": "christmas-campaign", + "last_modified": "2019-09-05T10:51:15.6555984Z", + "workflow_step": "published", + "workflow": "default" }, - "modular_content": [ - "tom_hardy", - "joel_edgerton", - "ec9813f6_194d_018f_e20c_36855fb6e600" - ], - "value": "

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

\n

Stars: 

\n\n\n


\n

See more in profile of Joel Edgerton and Tom Hardy

\n

And here are some images: 

\n
\"\"
\n
\"\"
\n


\n

Also, why not include content component in the mix?

\n" - }, - "released": { - "type": "date_time", - "name": "Released", - "value": "2011-09-09T00:00:00Z", - "display_timezone": "Europe/London" - }, - "length": { - "type": "number", - "name": "Length", - "value": 151 - }, - "poster": { - "type": "asset", - "name": "Poster", - "value": [ - { - "name": "warrior.jpg", - "description": null, - "type": "image/jpeg", - "size": 111004, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", - "width": 648, - "height": 1000, - "renditions": { - "default": { - "rendition_id": "b447ca6c-8020-4e8f-be57-1d110721e535", - "preset_id": "a6d98cd5-8b2c-4e50-99c9-15192bce2490", - "width": 1280, - "height": 1024, - "query": "w=1280&h=1024&fit=clip&rect=2396,169,1280,1024" - } + "elements": { + "title": { + "type": "text", + "name": "Title", + "value": "Warrior" + }, + "plot": { + "type": "rich_text", + "name": "Plot", + "images": { + "22504ba8-2075-48fa-9d4f-8fce3de1754a": { + "image_id": "22504ba8-2075-48fa-9d4f-8fce3de1754a", + "description": null, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", + "width": 648, + "height": 1000 + }, + "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5": { + "image_id": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5", + "description": null, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", + "width": 214, + "height": 317 + } + }, + "links": { + "3294e4b0-e58b-49d7-85fa-5bc9a86556ec": { + "codename": "joel_edgerton", + "type": "actor", + "url_slug": "joel-edgerton" + }, + "d1557cb1-d7ec-4d04-9742-f86b52bc34fc": { + "codename": "tom_hardy", + "type": "actor", + "url_slug": "tom-hardy" + } + }, + "modular_content": ["tom_hardy", "joel_edgerton", "ec9813f6_194d_018f_e20c_36855fb6e600"], + "value": "

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

\n

Stars: 

\n\n\n


\n

See more in profile of Joel Edgerton and Tom Hardy

\n

And here are some images: 

\n
\"\"
\n
\"\"
\n


\n

Also, why not include content component in the mix?

\n" + }, + "released": { + "type": "date_time", + "name": "Released", + "value": "2011-09-09T00:00:00Z", + "display_timezone": "Europe/London" + }, + "length": { + "type": "number", + "name": "Length", + "value": 151 + }, + "poster": { + "type": "asset", + "name": "Poster", + "value": [ + { + "name": "warrior.jpg", + "description": null, + "type": "image/jpeg", + "size": 111004, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", + "width": 648, + "height": 1000, + "renditions": { + "default": { + "rendition_id": "b447ca6c-8020-4e8f-be57-1d110721e535", + "preset_id": "a6d98cd5-8b2c-4e50-99c9-15192bce2490", + "width": 1280, + "height": 1024, + "query": "w=1280&h=1024&fit=clip&rect=2396,169,1280,1024" + } + } + } + ] + }, + "category": { + "type": "multiple_choice", + "name": "Category", + "value": [ + { + "name": "Action", + "codename": "action" + }, + { + "name": "Drama", + "codename": "drama" + } + ] + }, + "stars": { + "type": "modular_content", + "name": "Stars", + "value": ["tom_hardy", "joel_edgerton"] + }, + "seoname": { + "type": "url_slug", + "name": "SeoName", + "value": "warrior" + }, + "releasecategory": { + "type": "taxonomy", + "name": "releasecategory", + "taxonomy_group": "releasecategory", + "value": [ + { + "name": "Global release", + "codename": "global_release" + }, + { + "name": "US only", + "codename": "us_only" + } + ] } - } - ] - }, - "category": { - "type": "multiple_choice", - "name": "Category", - "value": [ - { - "name": "Action", - "codename": "action" - }, - { - "name": "Drama", - "codename": "drama" - } - ] - }, - "stars": { - "type": "modular_content", - "name": "Stars", - "value": [ - "tom_hardy", - "joel_edgerton" - ] - }, - "seoname": { - "type": "url_slug", - "name": "SeoName", - "value": "warrior" - }, - "releasecategory": { - "type": "taxonomy", - "name": "ReleaseCategory", - "taxonomy_group": "releasecategory", - "value": [ - { - "name": "Global release", - "codename": "global_release" - }, - { - "name": "US only", - "codename": "us_only" - } - ] - } - } - }, - "modular_content": { - "ec9813f6_194d_018f_e20c_36855fb6e600": { - "system": { - "id": "ec9813f6-194d-018f-e20c-36855fb6e600", - "name": "ec9813f6-194d-018f-e20c-36855fb6e600", - "codename": "ec9813f6_194d_018f_e20c_36855fb6e600", - "language": "en", - "type": "actor", - "sitemap_locations": [], - "collection": "default", - "last_modified": "2019-09-05T10:51:15.6555984Z" - }, - "elements": { - "first_name": { - "type": "text", - "name": "First name", - "value": "Jennifer " - }, - "last_name": { - "type": "text", - "name": "Last name", - "value": "Morrison" - }, - "url": { - "type": "url_slug", - "name": "Url", - "value": "component-actor-url" - }, - "photo": { - "type": "asset", - "name": "Photo", - "value": [] } - } }, - "joel_edgerton": { - "system": { - "id": "3294e4b0-e58b-49d7-85fa-5bc9a86556ec", - "name": "Joel Edgerton", - "codename": "joel_edgerton", - "language": "en", - "type": "actor", - "sitemap_locations": [], - "collection": "default", - "last_modified": "2017-08-03T09:21:21.3857294Z" - }, - "elements": { - "url": { - "type": "url_slug", - "name": "Url", - "value": "joel-edgerton" - }, - "first_name": { - "type": "text", - "name": "First name", - "value": "Joel" - }, - "last_name": { - "type": "text", - "name": "Last name", - "value": "Edgerton" - }, - "photo": { - "type": "asset", - "name": "Photo", - "value": [ - { - "name": "joel_edgerton.jpg", - "description": null, - "type": "image/jpeg", - "size": 6460, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/2855720a-4ca4-4687-826a-29f9635088e0/joel_edgerton.jpg", - "width": 211, - "height": 317 + "modular_content": { + "ec9813f6_194d_018f_e20c_36855fb6e600": { + "system": { + "id": "ec9813f6-194d-018f-e20c-36855fb6e600", + "name": "ec9813f6-194d-018f-e20c-36855fb6e600", + "codename": "ec9813f6_194d_018f_e20c_36855fb6e600", + "language": "en", + "type": "actor", + "sitemap_locations": [], + "collection": "default", + "last_modified": "2019-09-05T10:51:15.6555984Z" + }, + "elements": { + "first_name": { + "type": "text", + "name": "First name", + "value": "Jennifer " + }, + "last_name": { + "type": "text", + "name": "Last name", + "value": "Morrison" + }, + "url": { + "type": "url_slug", + "name": "Url", + "value": "component-actor-url" + }, + "photo": { + "type": "asset", + "name": "Photo", + "value": [] + } } - ] - } - } - }, - "tom_hardy": { - "system": { - "id": "d1557cb1-d7ec-4d04-9742-f86b52bc34fc", - "name": "Tom Hardy", - "codename": "tom_hardy", - "language": "en", - "type": "actor", - "sitemap_locations": [], - "collection": "default", - "last_modified": "2018-02-09T13:11:32.5769383Z" - }, - "elements": { - "url": { - "type": "url_slug", - "name": "Url", - "value": "tom-hardy" - }, - "first_name": { - "type": "text", - "name": "First name", - "value": "Tom" }, - "last_name": { - "type": "text", - "name": "Last name", - "value": "Hardy" + "joel_edgerton": { + "system": { + "id": "3294e4b0-e58b-49d7-85fa-5bc9a86556ec", + "name": "Joel Edgerton", + "codename": "joel_edgerton", + "language": "en", + "type": "actor", + "sitemap_locations": [], + "collection": "default", + "last_modified": "2017-08-03T09:21:21.3857294Z" + }, + "elements": { + "url": { + "type": "url_slug", + "name": "Url", + "value": "joel-edgerton" + }, + "first_name": { + "type": "text", + "name": "First name", + "value": "Joel" + }, + "last_name": { + "type": "text", + "name": "Last name", + "value": "Edgerton" + }, + "photo": { + "type": "asset", + "name": "Photo", + "value": [ + { + "name": "joel_edgerton.jpg", + "description": null, + "type": "image/jpeg", + "size": 6460, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/2855720a-4ca4-4687-826a-29f9635088e0/joel_edgerton.jpg", + "width": 211, + "height": 317 + } + ] + } + } }, - "photo": { - "type": "asset", - "name": "Photo", - "value": [ - { - "name": "tom_hardy.jpg", - "description": null, - "type": "image/jpeg", - "size": 8091, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", - "width": 214, - "height": 317 + "tom_hardy": { + "system": { + "id": "d1557cb1-d7ec-4d04-9742-f86b52bc34fc", + "name": "Tom Hardy", + "codename": "tom_hardy", + "language": "en", + "type": "actor", + "sitemap_locations": [], + "collection": "default", + "last_modified": "2018-02-09T13:11:32.5769383Z" + }, + "elements": { + "url": { + "type": "url_slug", + "name": "Url", + "value": "tom-hardy" + }, + "first_name": { + "type": "text", + "name": "First name", + "value": "Tom" + }, + "last_name": { + "type": "text", + "name": "Last name", + "value": "Hardy" + }, + "photo": { + "type": "asset", + "name": "Photo", + "value": [ + { + "name": "tom_hardy.jpg", + "description": null, + "type": "image/jpeg", + "size": 8091, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", + "width": 214, + "height": 317 + } + ] + } } - ] } - } } - } } diff --git a/test/browser/isolated-tests/fake-data/fake-warrior-without-modular-data-response.json b/test/browser/isolated-tests/fake-data/fake-warrior-without-modular-data-response.json index 9d6d21bb..68ae3c93 100644 --- a/test/browser/isolated-tests/fake-data/fake-warrior-without-modular-data-response.json +++ b/test/browser/isolated-tests/fake-data/fake-warrior-without-modular-data-response.json @@ -1,130 +1,120 @@ { - "item": { - "system": { - "id": "325e2acb-1c14-47f6-af9a-27bc8b6c16fe", - "name": "Warrior", - "codename": "warrior", - "language": "en", - "type": "movie", - "sitemap_locations": [ - "main_sitemap" - ], - "collection": "default", - "last_modified": "2019-09-05T10:51:15.6555984Z" - }, - "elements": { - "title": { - "type": "text", - "name": "Title", - "value": "Warrior" - }, - "plot": { - "type": "rich_text", - "name": "Plot", - "images": { - "22504ba8-2075-48fa-9d4f-8fce3de1754a": { - "image_id": "22504ba8-2075-48fa-9d4f-8fce3de1754a", - "description": null, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", - "width": 648, - "height": 1000 - }, - "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5": { - "image_id": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5", - "description": null, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", - "width": 214, - "height": 317 - } - }, - "links": { - "3294e4b0-e58b-49d7-85fa-5bc9a86556ec": { - "codename": "joel_edgerton", - "type": "actor", - "url_slug": "joel-edgerton" - }, - "d1557cb1-d7ec-4d04-9742-f86b52bc34fc": { - "codename": "tom_hardy", - "type": "actor", - "url_slug": "tom-hardy" - } + "item": { + "system": { + "id": "325e2acb-1c14-47f6-af9a-27bc8b6c16fe", + "name": "Warrior", + "codename": "warrior", + "language": "en", + "type": "movie", + "sitemap_locations": ["main_sitemap"], + "collection": "default", + "last_modified": "2019-09-05T10:51:15.6555984Z" }, - "modular_content": [ - "tom_hardy", - "joel_edgerton", - "ec9813f6_194d_018f_e20c_36855fb6e600" - ], - "value": "

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

\n

Stars: 

\n\n\n


\n

See more in profile of Joel Edgerton and Tom Hardy

\n

And here are some images: 

\n
\"\"
\n
\"\"
\n


\n

Also, why not include content component in the mix?

\n" - }, - "released": { - "type": "date_time", - "name": "Released", - "value": "2011-09-09T00:00:00Z" - }, - "length": { - "type": "number", - "name": "Length", - "value": 151 - }, - "poster": { - "type": "asset", - "name": "Poster", - "value": [ - { - "name": "warrior.jpg", - "description": null, - "type": "image/jpeg", - "size": 111004, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", - "width": 648, - "height": 1000 - } - ] - }, - "category": { - "type": "multiple_choice", - "name": "Category", - "value": [ - { - "name": "Action", - "codename": "action" - }, - { - "name": "Drama", - "codename": "drama" - } - ] - }, - "stars": { - "type": "modular_content", - "name": "Stars", - "value": [ - "tom_hardy", - "joel_edgerton" - ] - }, - "seoname": { - "type": "url_slug", - "name": "SeoName", - "value": "warrior" - }, - "releasecategory": { - "type": "taxonomy", - "name": "ReleaseCategory", - "taxonomy_group": "releasecategory", - "value": [ - { - "name": "Global release", - "codename": "global_release" - }, - { - "name": "US only", - "codename": "us_only" - } - ] - } - } - }, - "modular_content": { - } + "elements": { + "title": { + "type": "text", + "name": "Title", + "value": "Warrior" + }, + "plot": { + "type": "rich_text", + "name": "Plot", + "images": { + "22504ba8-2075-48fa-9d4f-8fce3de1754a": { + "image_id": "22504ba8-2075-48fa-9d4f-8fce3de1754a", + "description": null, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", + "width": 648, + "height": 1000 + }, + "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5": { + "image_id": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5", + "description": null, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", + "width": 214, + "height": 317 + } + }, + "links": { + "3294e4b0-e58b-49d7-85fa-5bc9a86556ec": { + "codename": "joel_edgerton", + "type": "actor", + "url_slug": "joel-edgerton" + }, + "d1557cb1-d7ec-4d04-9742-f86b52bc34fc": { + "codename": "tom_hardy", + "type": "actor", + "url_slug": "tom-hardy" + } + }, + "modular_content": ["tom_hardy", "joel_edgerton", "ec9813f6_194d_018f_e20c_36855fb6e600"], + "value": "

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

\n

Stars: 

\n\n\n


\n

See more in profile of Joel Edgerton and Tom Hardy

\n

And here are some images: 

\n
\"\"
\n
\"\"
\n


\n

Also, why not include content component in the mix?

\n" + }, + "released": { + "type": "date_time", + "name": "Released", + "value": "2011-09-09T00:00:00Z" + }, + "length": { + "type": "number", + "name": "Length", + "value": 151 + }, + "poster": { + "type": "asset", + "name": "Poster", + "value": [ + { + "name": "warrior.jpg", + "description": null, + "type": "image/jpeg", + "size": 111004, + "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", + "width": 648, + "height": 1000 + } + ] + }, + "category": { + "type": "multiple_choice", + "name": "Category", + "value": [ + { + "name": "Action", + "codename": "action" + }, + { + "name": "Drama", + "codename": "drama" + } + ] + }, + "stars": { + "type": "modular_content", + "name": "Stars", + "value": ["tom_hardy", "joel_edgerton"] + }, + "seoname": { + "type": "url_slug", + "name": "SeoName", + "value": "warrior" + }, + "releasecategory": { + "type": "taxonomy", + "name": "releasecategory", + "taxonomy_group": "releasecategory", + "value": [ + { + "name": "Global release", + "codename": "global_release" + }, + { + "name": "US only", + "codename": "us_only" + } + ] + } + } + }, + "modular_content": {} } diff --git a/test/browser/isolated-tests/resolvers/property-name/base-case-property-resolver.spec.json b/test/browser/isolated-tests/resolvers/property-name/base-case-property-resolver.spec.json deleted file mode 100644 index 41e12ef5..00000000 --- a/test/browser/isolated-tests/resolvers/property-name/base-case-property-resolver.spec.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "item": { - "system": { - "id": "325e2acb-1c14-47f6-af9a-27bc8b6c16fe", - "name": "Warrior", - "codename": "warrior", - "language": "en", - "type": "movie", - "sitemap_locations": [ - "main_sitemap" - ], - "collection": "christmas-campaign", - "last_modified": "2019-09-05T10:51:15.6555984Z", - "workflow_step": "published" - }, - "elements": { - "first_name": { - "type": "text", - "name": "Title", - "value": "Joe" - }, - "last__name": { - "type": "text", - "name": "Title", - "value": "Edgerton" - }, - "age_": { - "type": "text", - "name": "Title", - "value": 40 - }, - "_residence": { - "type": "text", - "name": "Title", - "value": "x" - }, - "____city___": { - "type": "text", - "name": "Title", - "value": "x" - } - } - }, - "modular_content": {} -} \ No newline at end of file diff --git a/test/browser/isolated-tests/resolvers/property-name/camel-case-property-resolver.spec.ts b/test/browser/isolated-tests/resolvers/property-name/camel-case-property-resolver.spec.ts deleted file mode 100644 index 97a21196..00000000 --- a/test/browser/isolated-tests/resolvers/property-name/camel-case-property-resolver.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { getDeliveryClientWithJson } from '../../../setup'; -import { Elements, IContentItem, Responses, camelCasePropertyNameResolver } from '../../../../../lib'; -import * as warriorJson from './base-case-property-resolver.spec.json'; - -type MockWarrior = IContentItem<{ - firstName: Elements.TextElement; - lastName: Elements.TextElement; - age: Elements.NumberElement; - residence: Elements.TextElement; - city: Elements.TextElement; -}>; - -describe('Camel case property resolver', () => { - let response: Responses.IViewContentItemResponse; - - beforeAll(async () => { - response = await ( - await getDeliveryClientWithJson(warriorJson, { - propertyNameResolver: camelCasePropertyNameResolver, - environmentId: 'X' - }) - .item('x') - .toPromise() - ).data; - }); - - it(`checks element is assigned #1`, () => { - expect(response.item.elements.firstName.value).toEqual(warriorJson.item.elements.first_name.value); - }); - - it(`checks element is assigned #2`, () => { - expect(response.item.elements.lastName.value).toEqual(warriorJson.item.elements.last__name.value); - }); - - it(`checks element is assigned #3`, () => { - expect(response.item.elements.age.value).toEqual(warriorJson.item.elements.age_.value); - }); - - it(`checks element is assigned #4`, () => { - expect(response.item.elements.residence.value).toEqual(warriorJson.item.elements._residence.value); - }); - - it(`checks element is assigned #5`, () => { - expect(response.item.elements.city.value).toEqual(warriorJson.item.elements.____city___.value); - }); -}); diff --git a/test/browser/isolated-tests/resolvers/property-name/pascal-case-property-resolver.spec.ts b/test/browser/isolated-tests/resolvers/property-name/pascal-case-property-resolver.spec.ts deleted file mode 100644 index 3e872b5b..00000000 --- a/test/browser/isolated-tests/resolvers/property-name/pascal-case-property-resolver.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { getDeliveryClientWithJson } from '../../../setup'; -import { Elements, IContentItem, Responses, pascalCasePropertyNameResolver } from '../../../../../lib'; -import * as warriorJson from './base-case-property-resolver.spec.json'; - -type MockWarrior = IContentItem<{ - FirstName: Elements.TextElement; - LastName: Elements.TextElement; - Age: Elements.NumberElement; - Residence: Elements.TextElement; - City: Elements.TextElement; -}>; - -describe('Pascal case property resolver', () => { - let response: Responses.IViewContentItemResponse; - - beforeAll(async () => { - response = await ( - await getDeliveryClientWithJson(warriorJson, { - propertyNameResolver: pascalCasePropertyNameResolver, - environmentId: 'X' - }) - .item('x') - .toPromise() - ).data; - }); - - it(`checks element is assigned #1`, () => { - expect(response.item.elements.FirstName.value).toEqual(warriorJson.item.elements.first_name.value); - }); - - it(`checks element is assigned #2`, () => { - expect(response.item.elements.LastName.value).toEqual(warriorJson.item.elements.last__name.value); - }); - - it(`checks element is assigned #3`, () => { - expect(response.item.elements.Age.value).toEqual(warriorJson.item.elements.age_.value); - }); - - it(`checks element is assigned #4`, () => { - expect(response.item.elements.Residence.value).toEqual(warriorJson.item.elements._residence.value); - }); - - it(`checks element is assigned #5`, () => { - expect(response.item.elements.City.value).toEqual(warriorJson.item.elements.____city___.value); - }); -}); diff --git a/test/browser/isolated-tests/resolvers/property-name/property-resolver.spec.ts b/test/browser/isolated-tests/resolvers/property-name/property-resolver.spec.ts deleted file mode 100644 index 8488c83f..00000000 --- a/test/browser/isolated-tests/resolvers/property-name/property-resolver.spec.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { getDeliveryClientWithJson } from '../../../setup'; -import { Elements, IContentItem, Responses, PropertyNameResolver } from '../../../../../lib'; -import * as warriorJson from '../../fake-data/fake-warrior-response.json'; - -type MockMovie = IContentItem<{ - titleTest: Elements.TextElement; - test_released: Elements.DateTimeElement; - justNumber: Elements.NumberElement; -}>; - -describe('Property resolver', () => { - const propertyResolver: PropertyNameResolver = (contentType, element) => { - if (element === 'title') { - return 'titleTest'; - } - if (element === 'released') { - return 'test_released'; - } - if (element === 'length') { - return 'justNumber'; - } - return element; - }; - - let response: Responses.IViewContentItemResponse; - - beforeAll(async () => { - response = await ( - await getDeliveryClientWithJson(warriorJson, { - propertyNameResolver: propertyResolver, - environmentId: 'X' - }) - .item('x') - .toPromise() - ).data; - }); - - it(`checks element is assigned #1`, () => { - expect(response.item.elements.titleTest.value).toEqual('Warrior'); - }); - - it(`checks element is assigned #2`, () => { - expect(response.item.elements.test_released.displayTimeZone).toEqual('Europe/London'); - expect(response.item.elements.test_released.value).toEqual('2011-09-09T00:00:00Z'); - }); - - it(`checks element is assigned #3`, () => { - expect(response.item.elements.justNumber.value).toEqual(151); - }); -}); diff --git a/test/browser/isolated-tests/resolvers/property-name/snake-case-property-resolver.spec.ts b/test/browser/isolated-tests/resolvers/property-name/snake-case-property-resolver.spec.ts deleted file mode 100644 index 799d97bc..00000000 --- a/test/browser/isolated-tests/resolvers/property-name/snake-case-property-resolver.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { getDeliveryClientWithJson } from '../../../setup'; -import { Elements, IContentItem, Responses, snakeCasePropertyNameResolver } from '../../../../../lib'; -import * as warriorJson from './base-case-property-resolver.spec.json'; - -type MockWarrior = IContentItem<{ - first_name: Elements.TextElement; - last_name: Elements.TextElement; - age: Elements.NumberElement; - residence: Elements.TextElement; - city: Elements.TextElement; -}>; - -describe('Snake case property resolver', () => { - let response: Responses.IViewContentItemResponse; - - beforeAll(async () => { - response = await ( - await getDeliveryClientWithJson(warriorJson, { - propertyNameResolver: snakeCasePropertyNameResolver, - environmentId: 'X' - }) - .item('x') - .toPromise() - ).data; - }); - - it(`checks element is assigned #1`, () => { - expect(response.item.elements.first_name.value).toEqual(warriorJson.item.elements.first_name.value); - }); - - it(`checks element is assigned #2`, () => { - expect(response.item.elements.last_name.value).toEqual(warriorJson.item.elements.last__name.value); - }); - - it(`checks element is assigned #3`, () => { - expect(response.item.elements.age.value).toEqual(warriorJson.item.elements.age_.value); - }); - - it(`checks element is assigned #4`, () => { - expect(response.item.elements.residence.value).toEqual(warriorJson.item.elements._residence.value); - }); - - it(`checks element is assigned #5`, () => { - expect(response.item.elements.city.value).toEqual(warriorJson.item.elements.____city___.value); - }); -}); diff --git a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-html-priority-async.spec.ts b/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-html-priority-async.spec.ts index 3b0c5712..88cba675 100644 --- a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-html-priority-async.spec.ts +++ b/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-html-priority-async.spec.ts @@ -1,10 +1,10 @@ -import { Actor, getDeliveryClientWithJson, Movie, toPromise } from '../../../setup'; import { createAsyncRichTextHtmlResolver, IResolvedRichTextHtmlResult, - Responses, - linkedItemsHelper + linkedItemsHelper, + Responses } from '../../../../../lib'; +import { Actor, getDeliveryClientWithJson, Movie, toPromise } from '../../../setup'; import * as warriorJson from '../../fake-data/fake-warrior-response.json'; const expectedHtml = `

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

@@ -43,7 +43,7 @@ describe('Rich text resolver (HTML priority) async', () => { if (contentItem && contentItem.system.type === 'actor') { const actor = contentItem as Actor; return await toPromise({ - contentItemHtml: `
${actor.elements.firstName.value}
` + contentItemHtml: `
${actor.elements.first_name.value}
` }); } diff --git a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-html-priority.spec.ts b/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-html-priority.spec.ts index 392e51fd..663d18ed 100644 --- a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-html-priority.spec.ts +++ b/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-html-priority.spec.ts @@ -1,10 +1,10 @@ -import { Actor, getDeliveryClientWithJson, Movie } from '../../../setup'; import { createRichTextHtmlResolver, IResolvedRichTextHtmlResult, - Responses, - linkedItemsHelper + linkedItemsHelper, + Responses } from '../../../../../lib'; +import { Actor, getDeliveryClientWithJson, Movie } from '../../../setup'; import * as warriorJson from '../../fake-data/fake-warrior-response.json'; const expectedHtml = `

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

@@ -43,7 +43,7 @@ describe('Rich text resolver (HTML priority)', () => { if (contentItem && contentItem.system.type === 'actor') { const actor = contentItem as Actor; return { - contentItemHtml: `
${actor.elements.firstName.value}
` + contentItemHtml: `
${actor.elements.first_name.value}
` }; } diff --git a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-preserve-object-tags.spec.ts b/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-preserve-object-tags.spec.ts index f0966fc8..599f5ee2 100644 --- a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-preserve-object-tags.spec.ts +++ b/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-preserve-object-tags.spec.ts @@ -1,10 +1,10 @@ -import { Actor, getDeliveryClientWithJson, Movie } from '../../../setup'; import { createRichTextHtmlResolver, IResolvedRichTextHtmlResult, - Responses, - linkedItemsHelper + linkedItemsHelper, + Responses } from '../../../../../lib'; +import { Actor, getDeliveryClientWithJson, Movie } from '../../../setup'; import * as warriorJson from '../../fake-data/fake-warrior-response.json'; const expectedHtml = `

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

@@ -44,7 +44,7 @@ describe('Rich text resolver preserve object tags', () => { if (contentItem && contentItem.system.type === 'actor') { const actor = contentItem as Actor; return { - contentItemHtml: `
${actor.elements.firstName.value}
` + contentItemHtml: `
${actor.elements.first_name.value}
` }; } diff --git a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-url-priority-async.spec.ts b/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-url-priority-async.spec.ts index 13a0e445..5202a0b3 100644 --- a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-url-priority-async.spec.ts +++ b/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-url-priority-async.spec.ts @@ -1,10 +1,10 @@ -import { Actor, getDeliveryClientWithJson, Movie, toPromise } from '../../../setup'; import { createAsyncRichTextHtmlResolver, IResolvedRichTextHtmlResult, - Responses, - linkedItemsHelper + linkedItemsHelper, + Responses } from '../../../../../lib'; +import { Actor, getDeliveryClientWithJson, Movie, toPromise } from '../../../setup'; import * as warriorJson from '../../fake-data/fake-warrior-response.json'; const expectedHtml = `

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

@@ -43,7 +43,7 @@ describe('Rich text resolver (URL priority) async', () => { if (contentItem && contentItem.system.type === 'actor') { const actor = contentItem as Actor; return { - contentItemHtml: `
${actor.elements.firstName.value}
` + contentItemHtml: `
${actor.elements.first_name.value}
` }; } diff --git a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-url-priority.spec.ts b/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-url-priority.spec.ts index 0d77fac4..5cf52a71 100644 --- a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-url-priority.spec.ts +++ b/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-url-priority.spec.ts @@ -1,10 +1,10 @@ -import { Actor, getDeliveryClientWithJson, Movie } from '../../../setup'; import { createRichTextHtmlResolver, IResolvedRichTextHtmlResult, - Responses, - linkedItemsHelper + linkedItemsHelper, + Responses } from '../../../../../lib'; +import { Actor, getDeliveryClientWithJson, Movie } from '../../../setup'; import * as warriorJson from '../../fake-data/fake-warrior-response.json'; const expectedHtml = `

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

@@ -43,7 +43,7 @@ describe('Rich text resolver (URL priority)', () => { if (contentItem && contentItem.system.type === 'actor') { const actor = contentItem as Actor; return { - contentItemHtml: `
${actor.elements.firstName.value}
` + contentItemHtml: `
${actor.elements.first_name.value}
` }; } diff --git a/test/browser/isolated-tests/resolvers/rich-text-json-resolver/expected-result.json b/test/browser/isolated-tests/resolvers/rich-text-json-resolver/expected-result.json index ac055715..295d52e0 100644 --- a/test/browser/isolated-tests/resolvers/rich-text-json-resolver/expected-result.json +++ b/test/browser/isolated-tests/resolvers/rich-text-json-resolver/expected-result.json @@ -35,8 +35,8 @@ "item": { "elements": { "url": { "name": "Url", "type": "url_slug", "value": "tom-hardy" }, - "firstName": { "name": "First name", "type": "text", "value": "Tom" }, - "lastName": { "name": "Last name", "type": "text", "value": "Hardy" }, + "first_name": { "name": "First name", "type": "text", "value": "Tom" }, + "last_name": { "name": "Last name", "type": "text", "value": "Hardy" }, "photo": { "name": "Photo", "type": "asset", @@ -85,8 +85,8 @@ "item": { "elements": { "url": { "name": "Url", "type": "url_slug", "value": "joel-edgerton" }, - "firstName": { "name": "First name", "type": "text", "value": "Joel" }, - "lastName": { "name": "Last name", "type": "text", "value": "Edgerton" }, + "first_name": { "name": "First name", "type": "text", "value": "Joel" }, + "last_name": { "name": "Last name", "type": "text", "value": "Edgerton" }, "photo": { "name": "Photo", "type": "asset", @@ -319,8 +319,8 @@ "codename": "ec9813f6_194d_018f_e20c_36855fb6e600", "item": { "elements": { - "firstName": { "name": "First name", "type": "text", "value": "Jennifer " }, - "lastName": { "name": "Last name", "type": "text", "value": "Morrison" }, + "first_name": { "name": "First name", "type": "text", "value": "Jennifer " }, + "last_name": { "name": "Last name", "type": "text", "value": "Morrison" }, "url": { "name": "Url", "type": "url_slug", "value": "component-actor-url" }, "photo": { "name": "Photo", "type": "asset", "value": [] } }, diff --git a/test/browser/isolated-tests/resolvers/rich-text-json-resolver/rich-text-json-resolver.spec.ts b/test/browser/isolated-tests/resolvers/rich-text-json-resolver/rich-text-json-resolver.spec.ts index bfd4bcc1..f6566c0d 100644 --- a/test/browser/isolated-tests/resolvers/rich-text-json-resolver/rich-text-json-resolver.spec.ts +++ b/test/browser/isolated-tests/resolvers/rich-text-json-resolver/rich-text-json-resolver.spec.ts @@ -1,10 +1,5 @@ +import { createRichTextJsonResolver, IRichTextJsonResult, linkedItemsHelper, Responses } from '../../../../../lib'; import { getDeliveryClientWithJson, Movie } from '../../../setup'; -import { - Responses, - linkedItemsHelper, - createRichTextJsonResolver, - IRichTextJsonResult -} from '../../../../../lib'; import * as warriorJson from '../../fake-data/fake-warrior-response.json'; import * as expectedJson from './expected-result.json'; diff --git a/test/browser/isolated-tests/resolvers/rich-text-object-resolver/expected-result.json b/test/browser/isolated-tests/resolvers/rich-text-object-resolver/expected-result.json index ac055715..295d52e0 100644 --- a/test/browser/isolated-tests/resolvers/rich-text-object-resolver/expected-result.json +++ b/test/browser/isolated-tests/resolvers/rich-text-object-resolver/expected-result.json @@ -35,8 +35,8 @@ "item": { "elements": { "url": { "name": "Url", "type": "url_slug", "value": "tom-hardy" }, - "firstName": { "name": "First name", "type": "text", "value": "Tom" }, - "lastName": { "name": "Last name", "type": "text", "value": "Hardy" }, + "first_name": { "name": "First name", "type": "text", "value": "Tom" }, + "last_name": { "name": "Last name", "type": "text", "value": "Hardy" }, "photo": { "name": "Photo", "type": "asset", @@ -85,8 +85,8 @@ "item": { "elements": { "url": { "name": "Url", "type": "url_slug", "value": "joel-edgerton" }, - "firstName": { "name": "First name", "type": "text", "value": "Joel" }, - "lastName": { "name": "Last name", "type": "text", "value": "Edgerton" }, + "first_name": { "name": "First name", "type": "text", "value": "Joel" }, + "last_name": { "name": "Last name", "type": "text", "value": "Edgerton" }, "photo": { "name": "Photo", "type": "asset", @@ -319,8 +319,8 @@ "codename": "ec9813f6_194d_018f_e20c_36855fb6e600", "item": { "elements": { - "firstName": { "name": "First name", "type": "text", "value": "Jennifer " }, - "lastName": { "name": "Last name", "type": "text", "value": "Morrison" }, + "first_name": { "name": "First name", "type": "text", "value": "Jennifer " }, + "last_name": { "name": "Last name", "type": "text", "value": "Morrison" }, "url": { "name": "Url", "type": "url_slug", "value": "component-actor-url" }, "photo": { "name": "Photo", "type": "asset", "value": [] } }, diff --git a/test/browser/isolated-tests/response/item.spec.ts b/test/browser/isolated-tests/response/item.spec.ts index 45a9891d..c51cd74e 100644 --- a/test/browser/isolated-tests/response/item.spec.ts +++ b/test/browser/isolated-tests/response/item.spec.ts @@ -52,7 +52,7 @@ describe('Verifies mapping of delivery content item', () => { }); it(`checks taxonomy element value`, () => { - expect(responseWithLinkedItems.item.elements.releaseCategory.value[0].codename).toEqual( + expect(responseWithLinkedItems.item.elements.releasecategory.value[0].codename).toEqual( warriorJson.item.elements.releasecategory.value[0].codename ); }); @@ -66,10 +66,10 @@ describe('Verifies mapping of delivery content item', () => { }); it(`checks strongly typed taxonomy`, () => { - const globalReleaseTaxonomy = responseWithLinkedItems.item.elements.releaseCategory.value.find( + const globalReleaseTaxonomy = responseWithLinkedItems.item.elements.releasecategory.value.find( (m) => m.codename === 'global_release' ); - const usReleaseTaxonomy = responseWithLinkedItems.item.elements.releaseCategory.value.find( + const usReleaseTaxonomy = responseWithLinkedItems.item.elements.releasecategory.value.find( (m) => m.codename === 'us_only' ); @@ -123,7 +123,7 @@ describe('Verifies mapping of delivery content item', () => { expect( responseWithLinkedItems.item.elements.stars.linkedItems.find( (m) => - m.elements.firstName.value === warriorJson.modular_content.joel_edgerton.elements.first_name.value + m.elements.first_name.value === warriorJson.modular_content.joel_edgerton.elements.first_name.value ) ).toBeDefined(); }); @@ -131,7 +131,7 @@ describe('Verifies mapping of delivery content item', () => { it(`checks that text element in second linked item is set`, () => { expect( responseWithLinkedItems.item.elements.stars.linkedItems.find( - (m) => m.elements.firstName.value === warriorJson.modular_content.tom_hardy.elements.first_name.value + (m) => m.elements.first_name.value === warriorJson.modular_content.tom_hardy.elements.first_name.value ) ).toBeDefined(); }); diff --git a/test/browser/live-tests/item/live-item.spec.ts b/test/browser/live-tests/item/live-item.spec.ts index 143f6223..0a161579 100644 --- a/test/browser/live-tests/item/live-item.spec.ts +++ b/test/browser/live-tests/item/live-item.spec.ts @@ -72,8 +72,8 @@ describe('Live item', () => { expect(response.item.elements.plot.linkedItemCodenames).toContain('joel_edgerton'); }); - it(`check that linked item (Actor) has 'firstName' text properly assigned`, () => { - expect(response.item.elements.stars.linkedItems[0].elements.firstName.value).toEqual('Tom'); + it(`check that linked item (Actor) has 'first_name' text properly assigned`, () => { + expect(response.item.elements.stars.linkedItems[0].elements.first_name.value).toEqual('Tom'); }); it(`images should be mapped in plot rich text element`, () => { diff --git a/test/browser/live-tests/types/live-type.spec.ts b/test/browser/live-tests/types/live-type.spec.ts index c758a504..027677e9 100644 --- a/test/browser/live-tests/types/live-type.spec.ts +++ b/test/browser/live-tests/types/live-type.spec.ts @@ -1,4 +1,4 @@ -import { Responses, IGenericElement } from '../../../../lib'; +import { IGenericElement, Responses } from '../../../../lib'; import { Context, setup } from '../../setup'; describe('Live type', () => { @@ -32,12 +32,12 @@ describe('Live type', () => { }); it(`Verifies taxonomy element - '${taxonomyElement}'`, () => { - const releaseCategoryElement = response.type.elements.find( + const releasecategoryElement = response.type.elements.find( (m) => m.codename === taxonomyElement ) as IGenericElement; - expect(releaseCategoryElement).toBeDefined(); - expect(releaseCategoryElement.taxonomyGroup).toBeDefined(); - expect(releaseCategoryElement.taxonomyGroup).toEqual('releasecategory'); + expect(releasecategoryElement).toBeDefined(); + expect(releasecategoryElement.taxonomyGroup).toBeDefined(); + expect(releasecategoryElement.taxonomyGroup).toEqual('releasecategory'); }); it(`Verifies multiple_choice element - '${multipleChoiceElement}'`, () => { diff --git a/test/browser/setup/context.ts b/test/browser/setup/context.ts index b01ca72c..630aafd2 100644 --- a/test/browser/setup/context.ts +++ b/test/browser/setup/context.ts @@ -1,60 +1,54 @@ -import { DeliveryClient, IDeliveryClientConfig, IQueryConfig, PropertyNameResolver } from '../../../lib'; import { IHeader, IRetryStrategyOptions } from '@kontent-ai/core-sdk'; +import { DeliveryClient, IDeliveryClientConfig, IQueryConfig } from '../../../lib'; export class Context { + public deliveryClient!: DeliveryClient; - public deliveryClient!: DeliveryClient; + public defaultQueryConfig?: IQueryConfig; + public environmentId!: string; + public previewApiKey?: string; + public securedApiKey?: string; + public usePreviewMode: boolean = false; + public useSecuredMode: boolean = false; + public defaultLanguage?: string; + public excludeArchivedItems?: boolean = false; + public baseUrl?: string; + public basePreviewUrl?: string; + public globalHeaders?: (queryConfig: IQueryConfig) => IHeader[]; + public retryStrategy?: IRetryStrategyOptions; - public defaultQueryConfig?: IQueryConfig; - public propertyNameResolver?: PropertyNameResolver; - public environmentId!: string; - public previewApiKey?: string; - public securedApiKey?: string; - public usePreviewMode: boolean = false; - public useSecuredMode: boolean = false; - public defaultLanguage?: string; - public excludeArchivedItems?: boolean = false; - public baseUrl?: string; - public basePreviewUrl?: string; - public globalHeaders?: (queryConfig: IQueryConfig) => IHeader[]; - public retryStrategy?: IRetryStrategyOptions; - - constructor( - options?: { - propertyNameResolver?: PropertyNameResolver; - defaultQueryConfig?: IQueryConfig; - environmentId?: string, - previewApiKey?: string, - deliveryClient?: DeliveryClient, - defaultLanguage?: string, - excludeArchivedItems?: boolean, - baseUrl?: string, - basePreviewUrl?: string, - securedApiKey?: string, - globalHeaders?: (queryConfig: IQueryConfig) => IHeader[], - retryStrategy?: IRetryStrategyOptions; - } - ) { - if (options) { - Object.assign(this, options); + constructor(options?: { + defaultQueryConfig?: IQueryConfig; + environmentId?: string; + previewApiKey?: string; + deliveryClient?: DeliveryClient; + defaultLanguage?: string; + excludeArchivedItems?: boolean; + baseUrl?: string; + basePreviewUrl?: string; + securedApiKey?: string; + globalHeaders?: (queryConfig: IQueryConfig) => IHeader[]; + retryStrategy?: IRetryStrategyOptions; + }) { + if (options) { + Object.assign(this, options); + } } - } - getConfig(): IDeliveryClientConfig { - return { - propertyNameResolver: this.propertyNameResolver, - environmentId: this.environmentId, - previewApiKey: this.previewApiKey, - secureApiKey: this.securedApiKey, - defaultQueryConfig: this.defaultQueryConfig, - proxy: { - baseUrl: this.baseUrl, - basePreviewUrl: this.basePreviewUrl - }, - defaultLanguage: this.defaultLanguage, - globalHeaders: this.globalHeaders, - retryStrategy: this.retryStrategy, - excludeArchivedItems: this.excludeArchivedItems - }; - } + getConfig(): IDeliveryClientConfig { + return { + environmentId: this.environmentId, + previewApiKey: this.previewApiKey, + secureApiKey: this.securedApiKey, + defaultQueryConfig: this.defaultQueryConfig, + proxy: { + baseUrl: this.baseUrl, + basePreviewUrl: this.basePreviewUrl + }, + defaultLanguage: this.defaultLanguage, + globalHeaders: this.globalHeaders, + retryStrategy: this.retryStrategy, + excludeArchivedItems: this.excludeArchivedItems + }; + } } diff --git a/test/browser/setup/delivery-test-client.ts b/test/browser/setup/delivery-test-client.ts index 5d4f2387..e95ffb12 100644 --- a/test/browser/setup/delivery-test-client.ts +++ b/test/browser/setup/delivery-test-client.ts @@ -1,5 +1,4 @@ import { IHeader, IResponse, TestHttpService } from '@kontent-ai/core-sdk'; -import { defaultPropertyNameResolver } from '.'; import { createDeliveryClient, IDeliveryClient, IDeliveryClientConfig } from '../../../lib'; @@ -16,7 +15,6 @@ export function getTestDeliveryClient(config?: IDeliveryClientConfig): IDelivery config ? config : { - propertyNameResolver: defaultPropertyNameResolver, environmentId: testenvironmentId } ); @@ -25,7 +23,6 @@ export function getTestDeliveryClient(config?: IDeliveryClientConfig): IDelivery export function getDeliveryClientWithError(errorJson: any): IDeliveryClient { return createDeliveryClient({ environmentId: testenvironmentId, - propertyNameResolver: defaultPropertyNameResolver, httpService: new TestHttpService({ response: undefined, error: errorJson @@ -49,7 +46,6 @@ export function getDeliveryClientWithJsonAndHeaders( if (!config) { return createDeliveryClient({ environmentId: testenvironmentId, - propertyNameResolver: defaultPropertyNameResolver, httpService: new TestHttpService({ response: getResponseFromJson(json, responseHeaders), error: undefined diff --git a/test/browser/setup/models.ts b/test/browser/setup/models.ts index ca22669b..f20ccc4f 100644 --- a/test/browser/setup/models.ts +++ b/test/browser/setup/models.ts @@ -1,12 +1,12 @@ -import { IContentItem, Elements } from '../../../lib'; +import { Elements, IContentItem } from '../../../lib'; export type Actor = IContentItem<{ - firstName: Elements.TextElement; - lastName: Elements.TextElement; + first_name: Elements.TextElement; + last_name: Elements.TextElement; photo: Elements.AssetsElement; }>; -export type ReleaseCategoryTaxonomy = 'global_release' | 'us_only' | 'local_release'; +export type releasecategoryTaxonomy = 'global_release' | 'us_only' | 'local_release'; export type Movie = IContentItem<{ title: Elements.TextElement; @@ -17,5 +17,5 @@ export type Movie = IContentItem<{ category: Elements.MultipleChoiceElement; stars: Elements.LinkedItemsElement; seoname: Elements.UrlSlugElement; - releaseCategory: Elements.TaxonomyElement; + releasecategory: Elements.TaxonomyElement; }>; diff --git a/test/browser/setup/setup.ts b/test/browser/setup/setup.ts index e9630845..5b3663e6 100644 --- a/test/browser/setup/setup.ts +++ b/test/browser/setup/setup.ts @@ -1,40 +1,20 @@ -import { DeliveryClient, IDeliveryClientConfig, PropertyNameResolver } from '../../../lib'; +import { DeliveryClient, IDeliveryClientConfig } from '../../../lib'; import { Context } from './context'; const defaultenvironmentId = 'da5abe9f-fdad-4168-97cd-b3464be2ccb9'; // tslint:disable-next-line:max-line-length -const defaultPreviewApiKey = 'ew0KICAiYWxnIjogIkhTMjU2IiwNCiAgInR5cCI6ICJKV1QiDQp9.ew0KICAidWlkIjogInVzcl8wdlFZQkNxQXZybm81cmlmSG5pWUVHIiwNCiAgImVtYWlsIjogInJpY2hhcmRzQGtlbnRpY28uY29tIiwNCiAgInByb2plY3RfaWQiOiAiZGE1YWJlOWYtZmRhZC00MTY4LTk3Y2QtYjM0NjRiZTJjY2I5IiwNCiAgImp0aSI6ICJpLXNFVWJlNmZPeUtBQmJOIiwNCiAgInZlciI6ICIxLjAuMCIsDQogICJnaXZlbl9uYW1lIjogIlJpY2hhcmQiLA0KICAiZmFtaWx5X25hbWUiOiAiU3VzdGVrIiwNCiAgImF1ZCI6ICJwcmV2aWV3LmRlbGl2ZXIua2VudGljb2Nsb3VkLmNvbSINCn0.jSq0owesXGAGf8l7e0Ue7wPkP28MT_--ZK5T02sO7yw'; +const defaultPreviewApiKey = + 'ew0KICAiYWxnIjogIkhTMjU2IiwNCiAgInR5cCI6ICJKV1QiDQp9.ew0KICAidWlkIjogInVzcl8wdlFZQkNxQXZybm81cmlmSG5pWUVHIiwNCiAgImVtYWlsIjogInJpY2hhcmRzQGtlbnRpY28uY29tIiwNCiAgInByb2plY3RfaWQiOiAiZGE1YWJlOWYtZmRhZC00MTY4LTk3Y2QtYjM0NjRiZTJjY2I5IiwNCiAgImp0aSI6ICJpLXNFVWJlNmZPeUtBQmJOIiwNCiAgInZlciI6ICIxLjAuMCIsDQogICJnaXZlbl9uYW1lIjogIlJpY2hhcmQiLA0KICAiZmFtaWx5X25hbWUiOiAiU3VzdGVrIiwNCiAgImF1ZCI6ICJwcmV2aWV3LmRlbGl2ZXIua2VudGljb2Nsb3VkLmNvbSINCn0.jSq0owesXGAGf8l7e0Ue7wPkP28MT_--ZK5T02sO7yw'; const defaultSecuredApiKey = 'securedApiKey'; -export const defaultPropertyNameResolver: PropertyNameResolver = (type, element) => { - if (type === 'actor') { - if (element === 'first_name') { - return 'firstName'; - } - if (element === 'last_name') { - return 'lastName'; - } - } - - if (type === 'movie') { - if (element === 'releasecategory') { - return 'releaseCategory'; - } - } - - return element; -}; - // ----------- setup function o------------ // export function setup(context: Context) { - // get delivery client with given context let environmentId: string = defaultenvironmentId; let previewApiKey: string = defaultPreviewApiKey; let securedApiKey: string = defaultSecuredApiKey; - let propertyNameResolver: PropertyNameResolver = defaultPropertyNameResolver; // context settings override default setup if (context.environmentId) { @@ -49,13 +29,8 @@ export function setup(context: Context) { securedApiKey = context.securedApiKey; } - if (context.propertyNameResolver) { - propertyNameResolver = context.propertyNameResolver; - } - const deliveryClientConfig: IDeliveryClientConfig = { environmentId: environmentId, - propertyNameResolver: propertyNameResolver, secureApiKey: securedApiKey, previewApiKey: previewApiKey, defaultQueryConfig: context.defaultQueryConfig, @@ -63,16 +38,15 @@ export function setup(context: Context) { excludeArchivedItems: context.excludeArchivedItems, proxy: { baseUrl: context.baseUrl, - basePreviewUrl: context.basePreviewUrl, + basePreviewUrl: context.basePreviewUrl }, retryStrategy: context.retryStrategy, - globalHeaders: context.globalHeaders, + globalHeaders: context.globalHeaders }; // set context context.environmentId = environmentId; context.previewApiKey = previewApiKey; - context.propertyNameResolver = propertyNameResolver; context.securedApiKey = securedApiKey; // set delivery client From 8c894afde62ee2ed40b44fbebc9dd9b8891115c5 Mon Sep 17 00:00:00 2001 From: Richard Sustek Date: Mon, 9 Sep 2024 15:48:39 +0200 Subject: [PATCH 03/13] feat: Adds optional generic types to `IContentItem` narrowing down available values of system attributes --- lib/models/item-models.ts | 35 +++++++++++++++++++------ test/browser/setup/models.ts | 51 +++++++++++++++++++++++++----------- 2 files changed, 62 insertions(+), 24 deletions(-) diff --git a/lib/models/item-models.ts b/lib/models/item-models.ts index 778f155f..8dc555aa 100644 --- a/lib/models/item-models.ts +++ b/lib/models/item-models.ts @@ -9,7 +9,13 @@ export interface IMapElementsResult { /** * Id of the item */ @@ -28,7 +34,7 @@ export interface IContentItemSystemAttributes { /** * Codename of the type this item is using */ - type: string; + type: TTypeCodename; /** * Date when the item was last modified @@ -38,7 +44,7 @@ export interface IContentItemSystemAttributes { /** * Codename of the language */ - language: string; + language: TLanguageCodenames; /** * Array of sitemap locations (obsolete) @@ -48,17 +54,17 @@ export interface IContentItemSystemAttributes { /** * Codename of the collection this item belongs to */ - collection: string; + collection: TCollectionCodenames; /** * Workflow step of the item */ - workflowStep: string | null; + workflowStep: TWorkflowStepCodenames | null; /** * Workflow of the item */ - workflow: string | null; + workflow: TWorkflowCodenames | null; } /** @@ -75,7 +81,14 @@ export interface IContentItemElements { [key: string]: ContentItemElementsIndexer; } -export interface IContentItem { +export interface IContentItem< + TElements extends IContentItemElements = IContentItemElements, + TTypeCodename extends string = string, + TLanguageCodenames extends string = string, + TCollectionCodenames extends string = string, + TWorkflowCodenames extends string = string, + TWorkflowStepCodenames extends string = string +> { /** * Elements of the content item */ @@ -84,7 +97,13 @@ export interface IContentItem; } export interface ILink { diff --git a/test/browser/setup/models.ts b/test/browser/setup/models.ts index f20ccc4f..889a8848 100644 --- a/test/browser/setup/models.ts +++ b/test/browser/setup/models.ts @@ -1,21 +1,40 @@ import { Elements, IContentItem } from '../../../lib'; -export type Actor = IContentItem<{ - first_name: Elements.TextElement; - last_name: Elements.TextElement; - photo: Elements.AssetsElement; -}>; +type LanguageCodenames = 'default' | 'en'; +type CollectionCodenames = 'default'; +type WorkflowCodenames = 'default'; +type WorkflowStepCodenames = 'draft' | 'published' | 'review'; + +export type Actor = IContentItem< + { + readonly first_name: Elements.TextElement; + readonly last_name: Elements.TextElement; + readonly photo: Elements.AssetsElement; + }, + 'actor', + LanguageCodenames, + CollectionCodenames, + WorkflowCodenames, + WorkflowStepCodenames +>; export type releasecategoryTaxonomy = 'global_release' | 'us_only' | 'local_release'; -export type Movie = IContentItem<{ - title: Elements.TextElement; - plot: Elements.RichTextElement; - released: Elements.DateTimeElement; - length: Elements.NumberElement; - poster: Elements.AssetsElement; - category: Elements.MultipleChoiceElement; - stars: Elements.LinkedItemsElement; - seoname: Elements.UrlSlugElement; - releasecategory: Elements.TaxonomyElement; -}>; +export type Movie = IContentItem< + { + readonly title: Elements.TextElement; + readonly plot: Elements.RichTextElement; + readonly released: Elements.DateTimeElement; + readonly length: Elements.NumberElement; + readonly poster: Elements.AssetsElement; + readonly category: Elements.MultipleChoiceElement; + readonly stars: Elements.LinkedItemsElement; + readonly seoname: Elements.UrlSlugElement; + readonly releasecategory: Elements.TaxonomyElement; + }, + 'movie', + LanguageCodenames, + CollectionCodenames, + WorkflowCodenames, + WorkflowStepCodenames +>; From 68b31a81431646a7ab06647652592b81d075527b Mon Sep 17 00:00:00 2001 From: Richard Sustek Date: Mon, 9 Sep 2024 15:52:36 +0200 Subject: [PATCH 04/13] feat: Makes `RichTextElement` take generic parameter narrowing down allowed types of linked items --- lib/elements/elements.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/elements/elements.ts b/lib/elements/elements.ts index 77cff611..7a426ec6 100644 --- a/lib/elements/elements.ts +++ b/lib/elements/elements.ts @@ -22,7 +22,7 @@ export namespace Elements { displayTimeZone: string | null; }; - export type RichTextElement = ElementModels.IElement & { + export type RichTextElement = ElementModels.IElement & { /** * Links */ @@ -43,7 +43,7 @@ export namespace Elements { * as it depends on the `depth` parameter of query. * The `linkedItemsReferenceHandler` configuration can be used to disable mapping of linked items */ - linkedItems: IContentItem[]; + linkedItems: TContentItem[]; }; export type NumberElement = ElementModels.IElement; From 331dff7b2d0411078df7f6b22c39c357ff10b653 Mon Sep 17 00:00:00 2001 From: Richard Sustek Date: Tue, 10 Sep 2024 10:25:00 +0200 Subject: [PATCH 05/13] docs: updates referenced jsdelivr version --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 99a51eb9..bad73875 100644 --- a/readme.md +++ b/readme.md @@ -110,7 +110,7 @@ const movieText = response.data.items[0].elements.title.value; Kontent.ai SDK - Html sample From ac3b5a297ee0989f5039476a0dea5d61b391c59a Mon Sep 17 00:00:00 2001 From: Richard Sustek Date: Tue, 10 Sep 2024 10:46:16 +0200 Subject: [PATCH 06/13] docs: remove obsolete upgrade docs --- readme.md | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/readme.md b/readme.md index bad73875..0c08010b 100644 --- a/readme.md +++ b/readme.md @@ -755,28 +755,6 @@ console.log(queryText); // https://deliver.kontent.ai/b52fa0db-84ec-4310-8f7c-3b94ed06644d/items?limit=10&order=system.codename[desc]&system.type=movie ``` -## Upgrade - -The major version `11.0.0` is pretty much a complete overhaul of this SDK with many breaking changes. The major benefits -of `11.0.0` are: - -- Greatly reduced package size (from `~318KB` to `~95KB`). When Gzipped, this library is now only `~19KB` -- Reduced complexity by removing `rxjs` as not everyone needs to use it -- Removed classes in favor of interfaces (again to reduce the size of the library) -- Automatic paging support for all listing queries -- Improved resolving of rich text elements along with the `async` support -- Simplified custom models without the need of `typeResolvers` -- Better retry strategy options -- More extension methods added for all queries that support it (feed listing, content type listing etc..) -- Removal of duplicate `raw` data to reduce the size of mapped responses while still being able to easily access debug - data with typed network response -- Simplified mapping of `json` data to SDK response (when you for example store `json` in cache and need to re-map it - later on) -- Updated all dependencies - -If you are upgrading from an older version, please see this documentation first. If you are still unsure how to upgrade -or have some other questions, feel free to submit an issue on this GitHub and we'll get back to you. - ## Testing Note: You need to have `Chrome` installed in order to run tests via Karma. From 3118752e05fe27f09b72c7bab21804b114fa057e Mon Sep 17 00:00:00 2001 From: Richard Sustek Date: Tue, 10 Sep 2024 11:41:36 +0200 Subject: [PATCH 07/13] feat: Adds narrowing types for Taxonomy & Multiple choice elements --- lib/elements/element-models.ts | 10 +++++----- lib/elements/elements.ts | 13 ++++++++----- test/browser/setup/models.ts | 7 ++++--- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lib/elements/element-models.ts b/lib/elements/element-models.ts index 9bd7d6bb..beb71ccc 100644 --- a/lib/elements/element-models.ts +++ b/lib/elements/element-models.ts @@ -1,5 +1,5 @@ -import { IContentItemSystemAttributes } from '../models/item-models'; import { Contracts } from '../contracts'; +import { IContentItemSystemAttributes } from '../models/item-models'; import { ElementType } from './element-type'; export namespace ElementModels { @@ -83,13 +83,13 @@ export namespace ElementModels { url: string; } - export interface MultipleChoiceOption { + export interface MultipleChoiceOption { name: string; - codename: string; + codename: TOptionCodename; } - export interface TaxonomyTerm { + export interface TaxonomyTerm { name: string; - codename: TaxonomyCodename; + codename: TTaxonomyCodename; } } diff --git a/lib/elements/elements.ts b/lib/elements/elements.ts index 7a426ec6..79824d11 100644 --- a/lib/elements/elements.ts +++ b/lib/elements/elements.ts @@ -13,7 +13,9 @@ export namespace Elements { linkedItems: TContentItem[]; }; - export type MultipleChoiceElement = ElementModels.IElement; + export type MultipleChoiceElement = ElementModels.IElement< + ElementModels.MultipleChoiceOption[] + >; export type DateTimeElement = ElementModels.IElement & { /** @@ -52,13 +54,14 @@ export namespace Elements { export type UrlSlugElement = ElementModels.IElement; - export type TaxonomyElement = ElementModels.IElement< - ElementModels.TaxonomyTerm[] - > & { + export type TaxonomyElement< + TaxonomyCodenames extends string = string, + TaxonomyGroupCodename extends string = string + > = ElementModels.IElement[]> & { /** * Taxonomy group */ - taxonomyGroup: string | null; + taxonomyGroup: TaxonomyGroupCodename; }; export type UnknownElement = ElementModels.IElement; diff --git a/test/browser/setup/models.ts b/test/browser/setup/models.ts index 889a8848..6ff695bf 100644 --- a/test/browser/setup/models.ts +++ b/test/browser/setup/models.ts @@ -18,7 +18,8 @@ export type Actor = IContentItem< WorkflowStepCodenames >; -export type releasecategoryTaxonomy = 'global_release' | 'us_only' | 'local_release'; +export type ReleaseCategoryTaxonomy = 'global_release' | 'us_only' | 'local_release'; +export type CategoryMultipleChoiceOptionCodenames = 'sci_fi' | 'action' | 'comedy' | 'drama' | 'romance' | 'animation'; export type Movie = IContentItem< { @@ -27,10 +28,10 @@ export type Movie = IContentItem< readonly released: Elements.DateTimeElement; readonly length: Elements.NumberElement; readonly poster: Elements.AssetsElement; - readonly category: Elements.MultipleChoiceElement; + readonly category: Elements.MultipleChoiceElement; readonly stars: Elements.LinkedItemsElement; readonly seoname: Elements.UrlSlugElement; - readonly releasecategory: Elements.TaxonomyElement; + readonly releasecategory: Elements.TaxonomyElement; }, 'movie', LanguageCodenames, From b9650a0422583b88dbdf065dfdf1b9dd9256a4dc Mon Sep 17 00:00:00 2001 From: Richard Sustek Date: Tue, 10 Sep 2024 11:57:44 +0200 Subject: [PATCH 08/13] Makes taxonomy_group contract prop required --- lib/contracts/contracts.ts | 2 +- lib/mappers/element.mapper.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/contracts/contracts.ts b/lib/contracts/contracts.ts index ce88d028..02507667 100644 --- a/lib/contracts/contracts.ts +++ b/lib/contracts/contracts.ts @@ -67,7 +67,7 @@ export namespace Contracts { name: string; type: string; value: any; - taxonomy_group?: string; + taxonomy_group: string; } export interface IDateTimeElementContract extends IElementContract { diff --git a/lib/mappers/element.mapper.ts b/lib/mappers/element.mapper.ts index 7351ebe8..d0a8700a 100644 --- a/lib/mappers/element.mapper.ts +++ b/lib/mappers/element.mapper.ts @@ -307,7 +307,7 @@ export class ElementMapper { private mapTaxonomyElement(elementWrapper: ElementModels.IElementWrapper): Elements.TaxonomyElement { return { ...this.buildElement(elementWrapper, ElementType.Taxonomy, () => elementWrapper.rawElement.value), - taxonomyGroup: elementWrapper.rawElement.taxonomy_group ?? null + taxonomyGroup: elementWrapper.rawElement.taxonomy_group }; } From a3bb05a036d8807177c7fc531aeba9f1fc23994a Mon Sep 17 00:00:00 2001 From: Richard Sustek Date: Tue, 10 Sep 2024 12:02:31 +0200 Subject: [PATCH 09/13] Fixes taxonomy_group --- lib/contracts/contracts.ts | 2 +- lib/mappers/element.mapper.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/contracts/contracts.ts b/lib/contracts/contracts.ts index 02507667..ce88d028 100644 --- a/lib/contracts/contracts.ts +++ b/lib/contracts/contracts.ts @@ -67,7 +67,7 @@ export namespace Contracts { name: string; type: string; value: any; - taxonomy_group: string; + taxonomy_group?: string; } export interface IDateTimeElementContract extends IElementContract { diff --git a/lib/mappers/element.mapper.ts b/lib/mappers/element.mapper.ts index d0a8700a..a76b1fab 100644 --- a/lib/mappers/element.mapper.ts +++ b/lib/mappers/element.mapper.ts @@ -307,7 +307,7 @@ export class ElementMapper { private mapTaxonomyElement(elementWrapper: ElementModels.IElementWrapper): Elements.TaxonomyElement { return { ...this.buildElement(elementWrapper, ElementType.Taxonomy, () => elementWrapper.rawElement.value), - taxonomyGroup: elementWrapper.rawElement.taxonomy_group + taxonomyGroup: elementWrapper.rawElement.taxonomy_group ?? '' }; } From 2bd30c3d4527b470848984d70e03136c2e01885e Mon Sep 17 00:00:00 2001 From: Richard Sustek Date: Tue, 10 Sep 2024 12:25:13 +0200 Subject: [PATCH 10/13] feat!: Removes parser & rich text resolver. To work with RTE use the newer and better `@kontent-ai/rich-text-resolver` library instead. --- lib/elements/element-models.ts | 6 - lib/index.ts | 11 +- .../async-browser-parser.class.ts | 236 ------------ .../implementation/browser-parser.class.ts | 235 ------------ lib/parser/index.ts | 5 - lib/parser/parse-models.ts | 93 ----- lib/parser/parser-configuration.ts | 23 -- lib/parser/parser.helper.ts | 103 ------ lib/resolvers/index.ts | 5 - .../async/async-rich-text-html-resolver.ts | 92 ----- .../base/base-async-rich-text-resolver.ts | 16 - .../rich-text/base/base-rich-text-resolver.ts | 16 - .../rich-text/rich-text-resolver.models.ts | 117 ------ .../rich-text/sync/rich-text-html-resolver.ts | 87 ----- .../rich-text/sync/rich-text-json-resolver.ts | 23 -- .../sync/rich-text-object-resolver.ts | 181 --------- readme.md | 117 +----- .../rich-resolver-html-priority-async.spec.ts | 83 ----- .../rich-resolver-html-priority.spec.ts | 83 ----- ...rich-resolver-preserve-object-tags.spec.ts | 61 --- .../rich-resolver-url-priority-async.spec.ts | 91 ----- .../rich-resolver-url-priority.spec.ts | 91 ----- .../expected-result.json | 348 ------------------ .../rich-text-json-resolver.spec.ts | 22 -- .../expected-result.json | 348 ------------------ .../rich-text-object-resolver.spec.ts | 27 -- 26 files changed, 6 insertions(+), 2514 deletions(-) delete mode 100644 lib/parser/implementation/async-browser-parser.class.ts delete mode 100644 lib/parser/implementation/browser-parser.class.ts delete mode 100644 lib/parser/index.ts delete mode 100644 lib/parser/parse-models.ts delete mode 100644 lib/parser/parser-configuration.ts delete mode 100644 lib/parser/parser.helper.ts delete mode 100644 lib/resolvers/index.ts delete mode 100644 lib/resolvers/rich-text/async/async-rich-text-html-resolver.ts delete mode 100644 lib/resolvers/rich-text/base/base-async-rich-text-resolver.ts delete mode 100644 lib/resolvers/rich-text/base/base-rich-text-resolver.ts delete mode 100644 lib/resolvers/rich-text/rich-text-resolver.models.ts delete mode 100644 lib/resolvers/rich-text/sync/rich-text-html-resolver.ts delete mode 100644 lib/resolvers/rich-text/sync/rich-text-json-resolver.ts delete mode 100644 lib/resolvers/rich-text/sync/rich-text-object-resolver.ts delete mode 100644 test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-html-priority-async.spec.ts delete mode 100644 test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-html-priority.spec.ts delete mode 100644 test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-preserve-object-tags.spec.ts delete mode 100644 test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-url-priority-async.spec.ts delete mode 100644 test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-url-priority.spec.ts delete mode 100644 test/browser/isolated-tests/resolvers/rich-text-json-resolver/expected-result.json delete mode 100644 test/browser/isolated-tests/resolvers/rich-text-json-resolver/rich-text-json-resolver.spec.ts delete mode 100644 test/browser/isolated-tests/resolvers/rich-text-object-resolver/expected-result.json delete mode 100644 test/browser/isolated-tests/resolvers/rich-text-object-resolver/rich-text-object-resolver.spec.ts diff --git a/lib/elements/element-models.ts b/lib/elements/element-models.ts index beb71ccc..bd40c7f0 100644 --- a/lib/elements/element-models.ts +++ b/lib/elements/element-models.ts @@ -3,12 +3,6 @@ import { IContentItemSystemAttributes } from '../models/item-models'; import { ElementType } from './element-type'; export namespace ElementModels { - export interface IRichTextResolverData { - html: string; - linkedItemCodenames: string[]; - componentCodenames: string[]; - } - export interface IElementWrapper { element: string; system: IContentItemSystemAttributes; diff --git a/lib/index.ts b/lib/index.ts index 64f3d84e..9305851b 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -1,15 +1,12 @@ // Public API export * from './client'; -export * from './sdk-info.generated'; export * from './config'; export * from './contracts'; export * from './elements'; -export * from './parser'; -export * from './resolvers'; -export * from './services'; +export * from './images'; export * from './mappers'; -export * from './query'; export * from './models'; -export * from './images'; +export * from './query'; +export * from './sdk-info.generated'; +export * from './services'; export * from './utilities'; - diff --git a/lib/parser/implementation/async-browser-parser.class.ts b/lib/parser/implementation/async-browser-parser.class.ts deleted file mode 100644 index 1b598d36..00000000 --- a/lib/parser/implementation/async-browser-parser.class.ts +++ /dev/null @@ -1,236 +0,0 @@ -import { - IParsedObjects, - IImageObject, - ILinkedItemContentObject, - ILinkObject, - ParsedItemIndexReferenceWrapper, - IParserResult, - IAsyncParser, - IAsyncParseResolvers -} from '../parse-models'; -import { parserConfiguration } from '../parser-configuration'; -import { ContentItemType, IContentItem } from '../../models'; -import { parserHelper } from '../parser.helper'; -import { Elements } from '../../elements'; - -export class AsyncBrowserParser implements IAsyncParser { - async parseAsync( - html: string, - mainRichTextElement: Elements.RichTextElement, - resolvers: IAsyncParseResolvers, - linkedItems: IContentItem[] - ): Promise> { - return await this.parseInternalAsync( - mainRichTextElement, - resolvers, - html, - linkedItems, - new ParsedItemIndexReferenceWrapper(0), - null - ); - } - - private async parseInternalAsync( - mainRichTextElement: Elements.RichTextElement, - resolvers: IAsyncParseResolvers, - html: string, - linkedItems: IContentItem[], - linkedItemIndex: ParsedItemIndexReferenceWrapper, - parentElement: Element | null - ): Promise> { - const rootElement = this.createWrapperElement(html); - - // get all linked items - const result = await this.processRichTextElementAsync( - mainRichTextElement, - resolvers, - rootElement.children, - { - links: [], - linkedItems: [], - images: [] - }, - linkedItems, - linkedItemIndex, - parentElement - ); - - return { - componentCodenames: result.linkedItems.filter((m) => m.itemType === 'component').map((m) => m.dataCodename), - linkedItemCodenames: result.linkedItems - .filter((m) => m.itemType === 'linkedItem') - .map((m) => m.dataCodename), - result: rootElement.innerHTML - }; - } - - private async processRichTextElementAsync( - mainRichTextElement: Elements.RichTextElement, - resolvers: IAsyncParseResolvers, - htmlCollection: HTMLCollection, - result: IParsedObjects, - linkedItems: IContentItem[], - linkedItemIndex: ParsedItemIndexReferenceWrapper, - parentElement: Element | null - ): Promise { - if (!htmlCollection || htmlCollection.length === 0) { - // there are no more nodes - } else { - // extract objects - for (let i = 0; i < htmlCollection.length; i++) { - const element = htmlCollection[i]; - - await resolvers.elementResolverAsync(parserHelper.convertToParserElement(element)); - - const typeAttribute = element.attributes ? element.attributes.getNamedItem('type') : undefined; - - // process linked items (modular items) - if ( - element.attributes && - typeAttribute && - typeAttribute.value && - typeAttribute.value.toLowerCase() === - parserConfiguration.modularContentElementData.type.toLowerCase() - ) { - const dataCodenameAttribute = element.attributes.getNamedItem( - parserConfiguration.modularContentElementData.dataCodename - ); - const dataTypeAttribute = element.attributes.getNamedItem( - parserConfiguration.modularContentElementData.dataType - ); - - if (!dataTypeAttribute) { - throw Error('Missing data type attribute. This is likely an error caused by invalid response.'); - } - - const relAttribute = element.attributes.getNamedItem( - parserConfiguration.modularContentElementData.relAttribute - ); - - let itemType: ContentItemType = 'linkedItem'; - - if ( - relAttribute && - relAttribute.value === parserConfiguration.modularContentElementData.componentRel - ) { - itemType = 'component'; - } - - // prepare link item object - const linkItemContentObject: ILinkedItemContentObject = { - dataCodename: dataCodenameAttribute ? dataCodenameAttribute.value : '', - dataType: dataTypeAttribute ? dataTypeAttribute.value : '', - itemType: itemType - }; - - // replace html - const elementParent = element.parentElement; - - if (!elementParent) { - console.warn( - `Could not replace linked item '${linkItemContentObject.dataCodename}' of '${linkItemContentObject.dataType}' because parent node is undefined. Please report this error if you are seeing this.` - ); - } else { - if (dataTypeAttribute.value === 'item') { - // add to result - result.linkedItems.push(linkItemContentObject); - - // resolve linked item - await resolvers.contentItemResolverAsync( - parserHelper.convertToParserElement(element), - linkItemContentObject.dataCodename, - linkedItemIndex.index, - parserHelper.getLinkedItem(linkedItems, linkItemContentObject.dataCodename) - ); - - // increment index - linkedItemIndex.increment(); - } else { - console.warn( - `Rich text element contains object with unsupported data type '${dataTypeAttribute.value}'` - ); - } - } - } - // process links - else if ( - element.nodeName.toLowerCase() === parserConfiguration.linkElementData.nodeName.toLowerCase() - ) { - const dataItemIdAttribute = element.attributes.getNamedItem( - parserConfiguration.linkElementData.dataItemId - ); - - if (dataItemIdAttribute) { - const linkObject: ILinkObject = { - dataItemId: dataItemIdAttribute ? dataItemIdAttribute.value : '' - }; - - // add to result - result.links.push(linkObject); - - // get original link text (the one inside tag) - const linkText = element.innerHTML; - - await resolvers.urlResolverAsync( - parserHelper.convertToParserElement(element), - linkObject.dataItemId, - linkText, - parserHelper.tryGetLink(mainRichTextElement, linkedItems, linkObject.dataItemId) - ); - } - } - // process images - else if ( - element.nodeName.toLowerCase() === parserConfiguration.imageElementData.nodeName.toLowerCase() - ) { - const dataImageIdAttribute = element.attributes.getNamedItem( - parserConfiguration.imageElementData.dataImageId - ); - - // continue only if data image id is present. There could be regular img tags included - if (dataImageIdAttribute) { - const imageObj: IImageObject = { - imageId: dataImageIdAttribute.value - }; - - result.images.push(imageObj); - - // resolve image - await resolvers.imageResolverAsync( - parserHelper.convertToParserElement(element), - imageObj.imageId, - parserHelper.tryGetImage(mainRichTextElement, linkedItems, imageObj.imageId) - ); - } - } else { - // process generic elements - await resolvers.genericElementResolverAsync(parserHelper.convertToParserElement(element)); - } - - // recursively process child nodes - if (element.children && element.children.length > 0) { - await this.processRichTextElementAsync( - mainRichTextElement, - resolvers, - element.children, - result, - linkedItems, - linkedItemIndex, - parentElement - ); - } - } - } - - return result; - } - - private createWrapperElement(html: string): HTMLElement { - const element = document.createElement(parserConfiguration.linkedItemWrapperElem); - element.innerHTML = html; - - return element; - } -} - -export const asyncBrowserParser = new AsyncBrowserParser(); diff --git a/lib/parser/implementation/browser-parser.class.ts b/lib/parser/implementation/browser-parser.class.ts deleted file mode 100644 index 49d4476e..00000000 --- a/lib/parser/implementation/browser-parser.class.ts +++ /dev/null @@ -1,235 +0,0 @@ -import { - IParsedObjects, - IImageObject, - ILinkedItemContentObject, - ILinkObject, - ParsedItemIndexReferenceWrapper, - IParser, - IParseResolvers, - IParserResult -} from '../parse-models'; -import { parserConfiguration } from '../parser-configuration'; -import { ContentItemType, IContentItem } from '../../models'; -import { parserHelper } from '../parser.helper'; -import { Elements } from '../../elements'; - -export class BrowserParser implements IParser { - parse( - html: string, - mainRichTextElement: Elements.RichTextElement, - resolvers: IParseResolvers, - linkedItems: IContentItem[] - ): IParserResult { - return this.parseInternal( - mainRichTextElement, - resolvers, - html, - linkedItems, - new ParsedItemIndexReferenceWrapper(0), - null - ); - } - - private parseInternal( - mainRichTextElement: Elements.RichTextElement, - resolvers: IParseResolvers, - html: string, - linkedItems: IContentItem[], - linkedItemIndex: ParsedItemIndexReferenceWrapper, - parentElement: Element | null - ): IParserResult { - const rootElement = this.createWrapperElement(html); - - // get all linked items - const result = this.processRichTextElement( - mainRichTextElement, - resolvers, - rootElement.children, - { - links: [], - linkedItems: [], - images: [] - }, - linkedItems, - linkedItemIndex, - parentElement - ); - - return { - componentCodenames: result.linkedItems.filter((m) => m.itemType === 'component').map((m) => m.dataCodename), - linkedItemCodenames: result.linkedItems - .filter((m) => m.itemType === 'linkedItem') - .map((m) => m.dataCodename), - result: rootElement.innerHTML - }; - } - - private processRichTextElement( - mainRichTextElement: Elements.RichTextElement, - resolvers: IParseResolvers, - htmlCollection: HTMLCollection, - result: IParsedObjects, - linkedItems: IContentItem[], - linkedItemIndex: ParsedItemIndexReferenceWrapper, - parentElement: Element | null - ): IParsedObjects { - if (!htmlCollection || htmlCollection.length === 0) { - // there are no more nodes - } else { - // extract objects - for (let i = 0; i < htmlCollection.length; i++) { - const element = htmlCollection[i]; - - resolvers.elementResolver(parserHelper.convertToParserElement(element)); - - const typeAttribute = element.attributes ? element.attributes.getNamedItem('type') : undefined; - - // process linked items (modular items) - if ( - element.attributes && - typeAttribute && - typeAttribute.value && - typeAttribute.value.toLowerCase() === - parserConfiguration.modularContentElementData.type.toLowerCase() - ) { - const dataCodenameAttribute = element.attributes.getNamedItem( - parserConfiguration.modularContentElementData.dataCodename - ); - const dataTypeAttribute = element.attributes.getNamedItem( - parserConfiguration.modularContentElementData.dataType - ); - - if (!dataTypeAttribute) { - throw Error('Missing data type attribute. This is likely an error caused by invalid response.'); - } - - const relAttribute = element.attributes.getNamedItem( - parserConfiguration.modularContentElementData.relAttribute - ); - - let itemType: ContentItemType = 'linkedItem'; - - if ( - relAttribute && - relAttribute.value === parserConfiguration.modularContentElementData.componentRel - ) { - itemType = 'component'; - } - - // prepare link item object - const linkItemContentObject: ILinkedItemContentObject = { - dataCodename: dataCodenameAttribute ? dataCodenameAttribute.value : '', - dataType: dataTypeAttribute ? dataTypeAttribute.value : '', - itemType: itemType - }; - - const elementParent = element.parentElement; - - if (!elementParent) { - console.warn( - `Could not replace linked item '${linkItemContentObject.dataCodename}' of '${linkItemContentObject.dataType}' because parent node is undefined. Please report this error if you are seeing this.` - ); - } else { - if (dataTypeAttribute.value === 'item') { - // add to result - result.linkedItems.push(linkItemContentObject); - - // resolve linked item - resolvers.contentItemResolver( - parserHelper.convertToParserElement(element), - linkItemContentObject.dataCodename, - linkedItemIndex.index, - parserHelper.getLinkedItem(linkedItems, linkItemContentObject.dataCodename) - ); - - // increment index - linkedItemIndex.increment(); - } else { - console.warn( - `Rich text element contains object with unsupported data type '${dataTypeAttribute.value}'` - ); - } - } - } - // process links - else if ( - element.nodeName.toLowerCase() === parserConfiguration.linkElementData.nodeName.toLowerCase() - ) { - const dataItemIdAttribute = element.attributes.getNamedItem( - parserConfiguration.linkElementData.dataItemId - ); - - if (dataItemIdAttribute) { - const linkObject: ILinkObject = { - dataItemId: dataItemIdAttribute ? dataItemIdAttribute.value : '' - }; - - // add to result - result.links.push(linkObject); - - // get original link text (the one inside tag) - const linkText = element.innerHTML; - - resolvers.urlResolver( - parserHelper.convertToParserElement(element), - linkObject.dataItemId, - linkText, - parserHelper.tryGetLink(mainRichTextElement, linkedItems, linkObject.dataItemId) - ); - } - } - // process images - else if ( - element.nodeName.toLowerCase() === parserConfiguration.imageElementData.nodeName.toLowerCase() - ) { - const dataImageIdAttribute = element.attributes.getNamedItem( - parserConfiguration.imageElementData.dataImageId - ); - - // continue only if data image id is present. There could be regular img tags included - if (dataImageIdAttribute) { - const imageObj: IImageObject = { - imageId: dataImageIdAttribute.value - }; - - result.images.push(imageObj); - - // resolve image - resolvers.imageResolver( - parserHelper.convertToParserElement(element), - imageObj.imageId, - parserHelper.tryGetImage(mainRichTextElement, linkedItems, imageObj.imageId) - ); - } - } else { - // process generic elements - resolvers.genericElementResolver(parserHelper.convertToParserElement(element)); - } - - // recursively process child nodes - if (element.children && element.children.length > 0) { - this.processRichTextElement( - mainRichTextElement, - resolvers, - element.children, - result, - linkedItems, - linkedItemIndex, - parentElement - ); - } - } - } - - return result; - } - - private createWrapperElement(html: string): HTMLElement { - const element = document.createElement(parserConfiguration.linkedItemWrapperElem); - element.innerHTML = html; - - return element; - } -} - -export const browserParser = new BrowserParser(); diff --git a/lib/parser/index.ts b/lib/parser/index.ts deleted file mode 100644 index 76a902a6..00000000 --- a/lib/parser/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './parse-models'; -export * from './parser-configuration'; -export * from './parser.helper'; -export * from './implementation/async-browser-parser.class'; -export * from './implementation/browser-parser.class'; diff --git a/lib/parser/parse-models.ts b/lib/parser/parse-models.ts deleted file mode 100644 index 0a837855..00000000 --- a/lib/parser/parse-models.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { Elements } from '../elements/elements'; -import { ContentItemType, IContentItem, ILink, IRichTextImage } from '../models'; - -/** - * This class as a wrapper is required so we can pass - * index as a reference and not a value - */ - export class ParsedItemIndexReferenceWrapper { - constructor(public index: number) {} - - increment(): void { - this.index++; - } -} - -export interface IParsedObjects { - links: ILinkObject[]; - linkedItems: ILinkedItemContentObject[]; - images: IImageObject[]; -} - - -export interface ILinkedItemContentObject { - dataType: string; - dataCodename: string; - itemType: ContentItemType; -} - -export interface ILinkObject { - dataItemId: string; -} - -export interface IImageObject { - imageId: string; -} - -export interface IParserElementAttribute { - name: string; - value: string; -} - - -export interface IParserElement { - attributes: IParserElementAttribute[]; - html?: string; - text?: string; - parentElement?: IParserElement; - tag: string; - setOuterHtml: (newHtml: string) => void; - setInnerHtml: (newHtml: string) => void; - setAttribute: (attributeName: string, attributeValue?: string) => void; - sourceElement: any; -} - -export interface IParseResolvers { - elementResolver: (element: IParserElement) => void; - genericElementResolver: (element: IParserElement) => void; - urlResolver: (element: IParserElement, linkId: string, linkText: string, link?: ILink) => void; - imageResolver: (element: IParserElement, imageId: string, image?: IRichTextImage) => void; - contentItemResolver: (element: IParserElement, linkedItemCodename: string, linkedItemIndex: number, linkedItem?: IContentItem) => void; -} - -export interface IAsyncParseResolvers { - elementResolverAsync: (element: IParserElement) => Promise; - genericElementResolverAsync: (element: IParserElement) => Promise; - urlResolverAsync: (element: IParserElement, linkId: string, linkText: string, link?: ILink) => Promise; - imageResolverAsync: (element: IParserElement, imageId: string, image?: IRichTextImage) => Promise; - contentItemResolverAsync: (element: IParserElement, linkedItemCodename: string, linkedItemIndex: number, linkedItem?: IContentItem) => Promise; -} - -export interface IParserResult { - result: TParserOutput; - linkedItemCodenames: string[]; - componentCodenames: string[]; -} - -export interface IParser { - parse( - html: string, - mainRichTextElement: Elements.RichTextElement, - resolvers: IParseResolvers, - linkedItems: IContentItem[] - ): IParserResult; -} - -export interface IAsyncParser { - parseAsync( - html: string, - mainRichTextElement: Elements.RichTextElement, - resolvers: IAsyncParseResolvers, - linkedItems: IContentItem[] - ): Promise>; -} diff --git a/lib/parser/parser-configuration.ts b/lib/parser/parser-configuration.ts deleted file mode 100644 index 72a53af6..00000000 --- a/lib/parser/parser-configuration.ts +++ /dev/null @@ -1,23 +0,0 @@ - -export const parserConfiguration = { - linkedItemWrapperElem: 'div', - modularContentElementData: { - type: 'application/kenticocloud', - dataType: 'data-type', - dataCodename: 'data-codename', - relAttribute: 'data-rel', - componentRel: 'component' - }, - linkElementData: { - nodeName: 'a', - dataItemId: 'data-item-id', - }, - imageElementData: { - nodeName: 'img', - dataImageId: 'data-image-id', - srcAttribute: 'src' - }, - resolvedLinkedItemIndexAttribute: 'data-sdk-item-index', - resolvedAttribute: 'data-sdk-resolved' - -}; diff --git a/lib/parser/parser.helper.ts b/lib/parser/parser.helper.ts deleted file mode 100644 index aa468e6c..00000000 --- a/lib/parser/parser.helper.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { Elements, ElementType } from '../elements'; -import { IContentItem, ILink, IRichTextImage } from '../models'; -import { IParserElement, IParserElementAttribute } from './parse-models'; - -export class ParserHelper { - - public readonly sdkResolvedAttributeName: string = 'data-sdk-resolved'; - - getLinkedItem(linkedItems: IContentItem[], itemCodename: string): IContentItem | undefined { - if (!linkedItems) { - return undefined; - } - return linkedItems.find((m) => m.system.codename === itemCodename); - } - - tryGetImage( - inputElement: Elements.RichTextElement, - linkedItems: IContentItem[], - imageId: string - ): IRichTextImage | undefined { - const elementImage = inputElement.images.find((m) => m.imageId === imageId); - if (elementImage) { - return elementImage; - } - - // try to find image in all linked items - if (linkedItems) { - for (const linkedItem of linkedItems) { - for (const elementKey of Object.keys(linkedItem.elements)) { - const element = linkedItem.elements[elementKey]; - if (element.type === ElementType.RichText) { - const richTextElement = element as Elements.RichTextElement; - const richTextElementImage = richTextElement.images.find((m) => m.imageId === imageId); - if (richTextElementImage) { - return richTextElementImage; - } - } - } - } - } - - return undefined; - } - - tryGetLink(inputElement: Elements.RichTextElement, linkedItems: IContentItem[], linkId: string): ILink | undefined { - const elementLink = inputElement.links.find((m) => m.linkId === linkId); - if (elementLink) { - return elementLink; - } - - // try to find link in all linked items - if (linkedItems) { - for (const linkedItem of linkedItems) { - for (const elementKey of Object.keys(linkedItem.elements)) { - const element = linkedItem.elements[elementKey]; - if (element.type === ElementType.RichText) { - const richTextElement = element as Elements.RichTextElement; - const richTextElementLink = richTextElement.links.find((m) => m.linkId === linkId); - if (richTextElementLink) { - return richTextElementLink; - } - } - } - } - } - - return undefined; - } - - convertToParserElement(element: Element): IParserElement { - const attributes: IParserElementAttribute[] = []; - - for (let i = 0; i < element.attributes.length; i++) { - const attribute = element.attributes[i]; - - attributes.push({ - name: attribute.name, - value: attribute.value - }); - } - - return { - tag: element.tagName, - setAttribute: (attributeName, attributeValue) => { - const attribute = element.attributes.getNamedItem(attributeName); - if (attribute) { - attribute.value = attributeValue ?? ''; - } else { - element.setAttribute(attributeName, attributeValue ?? ''); - } - }, - setInnerHtml: (newHtml) => (element.innerHTML = newHtml), - setOuterHtml: (newHtml) => (element.outerHTML = newHtml), - html: element.innerHTML, - text: element.textContent ? element.textContent : undefined, - attributes: attributes, - parentElement: element.parentElement ? this.convertToParserElement(element.parentElement) : undefined, - sourceElement: element - }; - } -} - -export const parserHelper = new ParserHelper(); diff --git a/lib/resolvers/index.ts b/lib/resolvers/index.ts deleted file mode 100644 index 4fcc2c97..00000000 --- a/lib/resolvers/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './rich-text/async/async-rich-text-html-resolver'; -export * from './rich-text/rich-text-resolver.models'; -export * from './rich-text/sync/rich-text-html-resolver'; -export * from './rich-text/sync/rich-text-json-resolver'; -export * from './rich-text/sync/rich-text-object-resolver'; diff --git a/lib/resolvers/rich-text/async/async-rich-text-html-resolver.ts b/lib/resolvers/rich-text/async/async-rich-text-html-resolver.ts deleted file mode 100644 index 534c4e4c..00000000 --- a/lib/resolvers/rich-text/async/async-rich-text-html-resolver.ts +++ /dev/null @@ -1,92 +0,0 @@ -import { IResolvedRichTextHtmlResult, IAsyncRichTextHtmlResolverInput } from '../rich-text-resolver.models'; -import { asyncBrowserParser, IAsyncParser, parserConfiguration, parserHelper } from '../../../parser'; -import { BaseAsyncRichTextResolver } from '../base/base-async-rich-text-resolver'; - -export class AsyncRichTextHtmlResolver extends BaseAsyncRichTextResolver< - IAsyncRichTextHtmlResolverInput, - IResolvedRichTextHtmlResult -> { - constructor(parser?: IAsyncParser) { - super(asyncBrowserParser, parser); - } - - async resolveRichTextAsync(input: IAsyncRichTextHtmlResolverInput): Promise { - return await this.resolveRichTextInternalAsync(input.element.value, input); - } - - private async resolveRichTextInternalAsync( - html: string, - input: IAsyncRichTextHtmlResolverInput - ): Promise { - const parsedResult = await super.getAsyncParser().parseAsync( - html, - input.element, - { - elementResolverAsync: async (element) => {}, - contentItemResolverAsync: async (element, itemCodename, linkedItemIndex, linkedItem) => { - const parentElement = element.parentElement; - - if (parentElement) { - const resolvedItemHtml = input.contentItemResolverAsync - ? (await input.contentItemResolverAsync(itemCodename, linkedItem)).contentItemHtml ?? '' - : ''; - - // resursively resolve HTML - const innerHtml = (await this.resolveRichTextInternalAsync(resolvedItemHtml, input)).html; - - // set resolved html - if (input.preserveResolvedObjectTags === true) { - element.setInnerHtml(innerHtml); - } else { - element.setOuterHtml(innerHtml); - } - - // set resolved attribute - element.setAttribute(parserHelper.sdkResolvedAttributeName, '1'); - } - }, - genericElementResolverAsync: async (element) => { - // do nothing to generic elements - }, - imageResolverAsync: async (element, imageId, image) => { - // get image result - const imageResult = input.imageResolverAsync - ? await input.imageResolverAsync(imageId, image) - : undefined; - - // html has priority over url resolver - if (imageResult?.imageHtml) { - // replace link html - element.setOuterHtml(imageResult.imageHtml); - } else if (imageResult?.imageUrl) { - // set link url only - element.setAttribute(parserConfiguration.imageElementData.srcAttribute, imageResult.imageUrl); - } - }, - urlResolverAsync: async (element, linkId, linkText, link) => { - if (input.urlResolverAsync) { - const urlResult = await input.urlResolverAsync(linkId, linkText, link); - - // html has priority over url resolver - if (urlResult?.linkHtml) { - // replace link html - element.setOuterHtml(urlResult.linkHtml); - } else if (urlResult?.linkUrl) { - // set link url only - element.setAttribute('href', urlResult.linkUrl); - } - } - } - }, - input.linkedItems ?? [] - ); - - return { - componentCodenames: parsedResult.componentCodenames, - linkedItemCodenames: parsedResult.linkedItemCodenames, - html: parsedResult.result - }; - } -} - -export const createAsyncRichTextHtmlResolver = (parser?: IAsyncParser) => new AsyncRichTextHtmlResolver(parser); diff --git a/lib/resolvers/rich-text/base/base-async-rich-text-resolver.ts b/lib/resolvers/rich-text/base/base-async-rich-text-resolver.ts deleted file mode 100644 index 29e3d16e..00000000 --- a/lib/resolvers/rich-text/base/base-async-rich-text-resolver.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IAsyncParser } from '../../../parser'; -import { IRichTextResolverAsync } from '../rich-text-resolver.models'; - -export abstract class BaseAsyncRichTextResolver implements IRichTextResolverAsync { - constructor(private defaultParser: IAsyncParser, private parser?: IAsyncParser) {} - - abstract resolveRichTextAsync(input: TInput): Promise; - - protected getAsyncParser(): IAsyncParser { - if (this.parser) { - return this.parser; - } - - return this.defaultParser; - } -} diff --git a/lib/resolvers/rich-text/base/base-rich-text-resolver.ts b/lib/resolvers/rich-text/base/base-rich-text-resolver.ts deleted file mode 100644 index a19880dd..00000000 --- a/lib/resolvers/rich-text/base/base-rich-text-resolver.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IParser } from '../../../parser'; -import { IRichTextResolver } from '../rich-text-resolver.models'; - -export abstract class BaseRichTextResolver implements IRichTextResolver { - constructor(private defaultParser: IParser, private parser?: IParser) {} - - abstract resolveRichText(input: TInput): TOutput; - - protected getParser(): IParser { - if (this.parser) { - return this.parser; - } - - return this.defaultParser; - } -} diff --git a/lib/resolvers/rich-text/rich-text-resolver.models.ts b/lib/resolvers/rich-text/rich-text-resolver.models.ts deleted file mode 100644 index 52bcc865..00000000 --- a/lib/resolvers/rich-text/rich-text-resolver.models.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { Elements } from '../../elements'; -import { IContentItem, ILink, IRichTextImage } from '../../models'; - -export interface IResolvedRichTextHtmlResult { - html: string; - linkedItemCodenames: string[]; - componentCodenames: string[]; -} - -export interface IRichTextUrlResult { - linkHtml?: string; - linkUrl?: string; -} - -export interface IRichTextImageResult { - imageUrl?: string; - imageHtml?: string; -} - -export interface IRichTextContentItemResult { - contentItemHtml?: string; -} - -export type IRichTextUrlResolver = (linkId: string, linkText: string, link?: ILink) => IRichTextUrlResult; -export type IRichTextImageResolver = (imageId: string, image?: IRichTextImage) => IRichTextImageResult; -export type IRichTextContentItemResolver = ( - itemCodename: string, - contentItem?: IContentItem -) => IRichTextContentItemResult; - -export type IAsyncRichTextUrlResolver = (linkId: string, linkText: string, link?: ILink) => Promise; -export type IAsyncRichTextImageResolver = (imageId: string, image?: IRichTextImage) => Promise; -export type IAsyncRichTextContentItemResolver = ( - itemCodename: string, - contentItem?: IContentItem -) => Promise; - -export interface IRichTextHtmlResolverInput { - element: Elements.RichTextElement; - urlResolver?: IRichTextUrlResolver; - imageResolver?: IRichTextImageResolver; - contentItemResolver?: IRichTextContentItemResolver; - linkedItems?: IContentItem[]; - preserveResolvedObjectTags?: boolean; -} - -export interface IAsyncRichTextHtmlResolverInput { - element: Elements.RichTextElement; - urlResolverAsync?: IAsyncRichTextUrlResolver; - imageResolverAsync?: IAsyncRichTextImageResolver; - contentItemResolverAsync?: IAsyncRichTextContentItemResolver; - linkedItems?: IContentItem[]; - preserveResolvedObjectTags?: boolean; -} - -export interface IRichTextResolver { - resolveRichText(input: TInput): TResult; -} - -export interface IRichTextResolverAsync { - resolveRichTextAsync(input: TInput): Promise; -} - -export interface IRichTextObjectResolverInput { - element: Elements.RichTextElement; - linkedItems?: IContentItem[]; - cleanSdkIds?: boolean; - - /** - * Tag that wraps content. Defaults to 'div' - */ - wrapperTag?: string; -} - -export type RichTextObjectDataType = 'linkedItem' | 'link' | 'image' | 'htmlElement' | 'root'; - -export interface IRichTextObjectContentItemData { - item?: IContentItem; - codename: string; -} - -export interface IRichTextObjectLinkData { - link?: ILink; - linkId: string; - linkText: string; -} - -export interface IRichTextObjectImageData { - image?: IRichTextImage; - imageId: string; -} - -export interface IRichTextObjectHtmlElementData { - text: string | null; - html: string | null; -} - -export interface IRichTextObjectAtribute { - name: string; - value: string | null; -} - -export interface IRichTextObjectItem { - type: RichTextObjectDataType; - tag: string; - _sdkElemId: string; - attributes: IRichTextObjectAtribute[]; - data: any; - children: IRichTextObjectItem[]; -} - -export interface IRichTextJsonResult { - json: string; -} -export interface IRichTextObjectResult { - data: IRichTextObjectItem; -} diff --git a/lib/resolvers/rich-text/sync/rich-text-html-resolver.ts b/lib/resolvers/rich-text/sync/rich-text-html-resolver.ts deleted file mode 100644 index a87759ae..00000000 --- a/lib/resolvers/rich-text/sync/rich-text-html-resolver.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { IResolvedRichTextHtmlResult, IRichTextHtmlResolverInput } from '../rich-text-resolver.models'; -import { browserParser, IParser, parserConfiguration, parserHelper } from '../../../parser'; -import { BaseRichTextResolver } from '../base/base-rich-text-resolver'; - -export class RichTextHtmlResolver extends BaseRichTextResolver< - IRichTextHtmlResolverInput, - IResolvedRichTextHtmlResult -> { - constructor(parser?: IParser) { - super(browserParser, parser); - } - - resolveRichText(input: IRichTextHtmlResolverInput): IResolvedRichTextHtmlResult { - return this.resolveRichTextInternal(input.element.value, input); - } - - private resolveRichTextInternal(html: string, input: IRichTextHtmlResolverInput): IResolvedRichTextHtmlResult { - const parsedResult = super.getParser().parse( - html, - input.element, - { - elementResolver: (element) => {}, - contentItemResolver: (element, itemCodename, linkedItemIndex, linkedItem) => { - const parentElement = element.parentElement; - - if (parentElement) { - const resolvedItemHtml = input.contentItemResolver - ? input.contentItemResolver(itemCodename, linkedItem).contentItemHtml ?? '' - : ''; - - // resursively resolve HTML - const innerHtml = this.resolveRichTextInternal(resolvedItemHtml, input).html; - - // set resolved html - if (input.preserveResolvedObjectTags === true) { - element.setInnerHtml(innerHtml); - } else { - element.setOuterHtml(innerHtml); - } - - // set resolved attribute - element.setAttribute(parserHelper.sdkResolvedAttributeName, '1'); - } - }, - genericElementResolver: (element) => { - // do nothing to generic elements - }, - imageResolver: (element, imageId, image) => { - // get image result - const imageResult = input.imageResolver ? input.imageResolver(imageId, image) : undefined; - - // html has priority over url resolver - if (imageResult?.imageHtml) { - // replace link html - element.setOuterHtml(imageResult.imageHtml); - } else if (imageResult?.imageUrl) { - // set link url only - element.setAttribute(parserConfiguration.imageElementData.srcAttribute, imageResult.imageUrl); - } - }, - urlResolver: (element, linkId, linkText, link) => { - if (input.urlResolver) { - const urlResult = input.urlResolver(linkId, linkText, link); - - // html has priority over url resolver - if (urlResult?.linkHtml) { - // replace link html - element.setOuterHtml(urlResult.linkHtml); - } else if (urlResult?.linkUrl) { - // set link url only - element.setAttribute('href', urlResult.linkUrl); - } - } - } - }, - input.linkedItems ?? [] - ); - - return { - componentCodenames: parsedResult.componentCodenames, - linkedItemCodenames: parsedResult.linkedItemCodenames, - html: parsedResult.result - }; - } -} - -export const createRichTextHtmlResolver = (parser?: IParser) => new RichTextHtmlResolver(parser); diff --git a/lib/resolvers/rich-text/sync/rich-text-json-resolver.ts b/lib/resolvers/rich-text/sync/rich-text-json-resolver.ts deleted file mode 100644 index a1e7e30d..00000000 --- a/lib/resolvers/rich-text/sync/rich-text-json-resolver.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { browserParser, IParser } from '../../../parser'; -import { BaseRichTextResolver } from '../base/base-rich-text-resolver'; -import { IRichTextObjectResolverInput, IRichTextJsonResult } from '../rich-text-resolver.models'; -import { createRichTextObjectResolver } from './rich-text-object-resolver'; - -export class RichTextJsonResolver extends BaseRichTextResolver< - IRichTextObjectResolverInput, - IRichTextJsonResult -> { - constructor(parser?: IParser) { - super(browserParser, parser); - } - - resolveRichText(input: IRichTextObjectResolverInput): IRichTextJsonResult { - const objectResult = createRichTextObjectResolver(this.getParser()).resolveRichText(input).data; - - return { - json: JSON.stringify(objectResult) - }; - } -} - -export const createRichTextJsonResolver = (parser?: IParser) => new RichTextJsonResolver(parser); diff --git a/lib/resolvers/rich-text/sync/rich-text-object-resolver.ts b/lib/resolvers/rich-text/sync/rich-text-object-resolver.ts deleted file mode 100644 index fec63eb9..00000000 --- a/lib/resolvers/rich-text/sync/rich-text-object-resolver.ts +++ /dev/null @@ -1,181 +0,0 @@ -import { - IRichTextObjectResolverInput, - IRichTextObjectContentItemData, - IRichTextObjectLinkData, - IRichTextObjectImageData, - IRichTextObjectHtmlElementData, - IRichTextObjectItem, - IRichTextObjectAtribute, - IRichTextObjectResult -} from '../rich-text-resolver.models'; -import { browserParser, IParser, IParserElement } from '../../../parser'; -import { guidHelper } from '../../../utilities'; -import { BaseRichTextResolver } from '../base/base-rich-text-resolver'; - -export class RichTextObjectResolver extends BaseRichTextResolver { - private readonly sdkIdAttributeName: string = 'sdk-elem-id'; - private readonly rootId: string = 'root'; - private readonly defaultWrapTag: string = 'div'; - - constructor(parser?: IParser) { - super(browserParser, parser); - } - - resolveRichText(input: IRichTextObjectResolverInput): IRichTextObjectResult { - const result = this.resolveRichTextInternal(input.element.value, input, { - type: 'root', - attributes: [], - children: [], - data: {}, - tag: input.wrapperTag ?? this.defaultWrapTag, - _sdkElemId: this.rootId - }); - - if (input.cleanSdkIds === true) { - this.cleanSdkIds(result); - } - - return { - data: result - }; - } - - private resolveRichTextInternal( - html: string, - input: IRichTextObjectResolverInput, - result: IRichTextObjectItem - ): IRichTextObjectItem { - super.getParser().parse( - html, - input.element, - { - elementResolver: (element) => { - // generate guid for each element - element.setAttribute(this.sdkIdAttributeName, guidHelper.genereateGuid()); - }, - contentItemResolver: (element, itemCodename, linkedItemIndex, linkedItem) => { - const data: IRichTextObjectContentItemData = { - codename: itemCodename, - item: linkedItem - }; - - const parentSdkId = this.getSdkIdFromElement(element.parentElement); - const parentItem = this.findItemWithSdkId(parentSdkId, result); - - if (parentItem) { - parentItem.children.push({ - type: 'linkedItem', - attributes: this.getAttributes(element), - tag: element.tag.toLowerCase(), - data: data, - children: [], - _sdkElemId: this.getSdkIdFromElement(element) - }); - } - }, - genericElementResolver: (element) => { - const data: IRichTextObjectHtmlElementData = { - text: element.text ?? '', - html: element.html ?? '' - }; - - const parentSdkId = this.getSdkIdFromElement(element.parentElement); - const parentItem = this.findItemWithSdkId(parentSdkId, result); - - if (parentItem) { - parentItem.children.push({ - type: 'htmlElement', - attributes: this.getAttributes(element), - tag: element.tag.toLowerCase(), - data: data, - children: [], - _sdkElemId: this.getSdkIdFromElement(element) - }); - } - }, - imageResolver: (element, imageId, image) => { - const data: IRichTextObjectImageData = { - imageId: imageId, - image: image - }; - - const parentSdkId = this.getSdkIdFromElement(element.parentElement); - const parentItem = this.findItemWithSdkId(parentSdkId, result); - - if (parentItem) { - parentItem.children.push({ - type: 'image', - attributes: this.getAttributes(element), - tag: element.tag.toLowerCase(), - data: data, - children: [], - _sdkElemId: this.getSdkIdFromElement(element) - }); - } - }, - urlResolver: (element, linkId, linkText, link) => { - const data: IRichTextObjectLinkData = { - linkId: linkId, - linkText: linkText, - link: link - }; - - const parentSdkId = this.getSdkIdFromElement(element.parentElement); - const parentItem = this.findItemWithSdkId(parentSdkId, result); - - if (parentItem) { - parentItem.children.push({ - type: 'link', - attributes: this.getAttributes(element), - tag: element.tag.toLowerCase(), - data: data, - children: [], - _sdkElemId: this.getSdkIdFromElement(element) - }); - } - } - }, - input.linkedItems ?? [] - ); - - return result; - } - - private findItemWithSdkId(sdkId: string, item: IRichTextObjectItem): IRichTextObjectItem | undefined { - if (item._sdkElemId === sdkId) { - return item; - } - - for (const child of item.children) { - const foundItem = this.findItemWithSdkId(sdkId, child); - if (foundItem) { - return foundItem; - } - } - - return undefined; - } - - private getAttributes(element: IParserElement | undefined): IRichTextObjectAtribute[] { - return element?.attributes ?? []; - } - - private getSdkIdFromElement(element: IParserElement | undefined): string { - if (!element) { - return this.rootId; - } - const value = element.attributes.find((m) => m.name === this.sdkIdAttributeName)?.value ?? this.rootId; - return value; - } - - private cleanSdkIds(item: IRichTextObjectItem): void { - item.attributes = item.attributes.filter((m) => m.name !== this.sdkIdAttributeName); - item._sdkElemId = ''; - - for (const child of item.children) { - this.cleanSdkIds(child); - } - } -} - -export const createRichTextObjectResolver = (parser?: IParser) => new RichTextObjectResolver(parser); diff --git a/readme.md b/readme.md index 0c08010b..bccbd33d 100644 --- a/readme.md +++ b/readme.md @@ -464,121 +464,8 @@ const response = await deliveryClient.items().limitParameter(5).toAllPromise({ contain linked items and components. For example, if you write a blog post, you might want to insert a video or testimonial to a specific place in your article. -You need to define how these objects resolve to the HTML that will be rendered. This SDK provides you with few resolvers -that help you to transform the input HTML to your desired HTML, JSON or object. - -Built-in resolvers provided by SDK: - -| Resolver | Description | Usage | -| --------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------- | -| `RichTextHtmlResolver` | Tranforms rich text HTML by replacing linked items, links or images with custom HTML | `createRichTextHtmlResolver().resolveRichText(data)` | -| `RichTextJsonResolver` | Tranforms rich text HTML into JSON | `createRichTextJsonResolver().resolveRichText(data)` | -| `RichTextObjectResolver` | Tranforms rich text HTML into javascript Object | `createRichTextObjectResolver().resolveRichText(data)` | -| `AsyncRichTextHtmlResolver` | Async version of `RichTextHtmlResolver` | `await createAsyncRichTextHtmlResolver().resolveRichTextAsync(data)` | - -#### Example use of RichTextHtmlResolver - -```typescript -import { createRichTextHtmlResolver, createDeliveryClient, linkedItemsHelper } from '@kontent-ai/delivery-sdk'; - -export type Movie = IContentItem<{ - plot: Elements.RichTextElement; -}>; - -export type Actor = IContentItem<{ - first_name: Elements.RichTextElement; -}>; - -// get content item with rich text element -const response = ( - await createDeliveryClient({ environmentId: '' }).item('itemCodename').toPromise() -).data; - -// get rich text element -const richTextElement = response.item.plot; - -// resolve HTML -const resolvedRichText = createRichTextHtmlResolver().resolveRichText({ - element: richTextElement, - linkedItems: linkedItemsHelper.convertLinkedItemsToArray(response.data.linkedItems), - imageResolver: (imageId, image) => { - return { - imageHtml: ``, - // alternatively you may return just url - imageUrl: 'customUrl' - }; - }, - urlResolver: (linkId, linkText, link) => { - return { - linkHtml: `${link?.link?.urlSlug}`, - // alternatively you may return just url - linkUrl: 'customUrl' - }; - }, - contentItemResolver: (itemId, contentItem) => { - if (contentItem && contentItem.system.type === 'actor') { - const actor = contentItem as Actor; - return { - contentItemHtml: `
${actor.elements.first_name.value}
` - }; - } - - return { - contentItemHtml: '' - }; - } -}); - -const resolvedHtml = resolvedRichText.html; -``` - -#### Example use of RichTextJsonResolver - -```typescript -import { createRichTextHtmlResolver, createDeliveryClient, linkedItemsHelper } from '@kontent-ai/delivery-sdk'; - -// get content item with rich text element -const response = ( - await createDeliveryClient({ environmentId: '' }).item('itemCodename').toPromise() -).data; - -// get rich text element -const richTextElement = response.item.plot; - -// transform rich text html into json -const json = createRichTextJsonResolver().resolveRichText({ - element: response.item.elements.plot, - linkedItems: linkedItemsHelper.convertLinkedItemsToArray(response.data.linkedItems) -}); -``` - -#### Resolving rich text in node.js - -If you need to resolve rich text in `node.js`, you have to install the following parser: - -``` -npm i @kontent-ai/delivery-node-parser --save -``` - -Once installed, it can be used by passing the parser to rich text resolver: - -```typescript -import { createRichTextHtmlResolver, createAsyncRichTextHtmlResolver } from '@kontent-ai/delivery-sdk'; -import { nodeParser, asyncNodeParser } from '@kontent-ai/delivery-node-parser'; - -// transform rich text html into json -const json = createRichTextHtmlResolver(nodeParser).resolveRichText(data); - -// or -const html = await createAsyncRichTextHtmlResolver(asyncNodeParser).resolveRichTextAsync(data); -``` - -### Creating custom rich text resolvers - -This SDK provides you with `browserParser` which you can use to implement your own rich text resolver. A common usecase -for creating custom resolvers is when you want to convert rich text element into, for example, `react components`, -`angular commponents` or components in some other popular framework. The parser will take care of actually parsing html, -while you can focus on creating specific logic for creating components dynamically. +To learn how to work with Rich text element have a look at +[@kontent-ai/rich-text-resolver](https://www.npmjs.com/package/@kontent-ai/rich-text-resolver) library. ## Get content types diff --git a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-html-priority-async.spec.ts b/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-html-priority-async.spec.ts deleted file mode 100644 index 88cba675..00000000 --- a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-html-priority-async.spec.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { - createAsyncRichTextHtmlResolver, - IResolvedRichTextHtmlResult, - linkedItemsHelper, - Responses -} from '../../../../../lib'; -import { Actor, getDeliveryClientWithJson, Movie, toPromise } from '../../../setup'; -import * as warriorJson from '../../fake-data/fake-warrior-response.json'; - -const expectedHtml = `

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

-

Stars: 

-
Tom
-
Joel
-


-

See more in profile of joel-edgerton and tom-hardy

-

And here are some images: 

-
-
-


-

Also, why not include content component in the mix?

-
Jennifer
`; - -describe('Rich text resolver (HTML priority) async', () => { - let response: Responses.IViewContentItemResponse; - let resolvedRichText: IResolvedRichTextHtmlResult; - - beforeAll(async () => { - response = (await getDeliveryClientWithJson(warriorJson).item('x').toPromise()).data; - resolvedRichText = await createAsyncRichTextHtmlResolver().resolveRichTextAsync({ - element: response.item.elements.plot, - linkedItems: linkedItemsHelper.convertLinkedItemsToArray(response.linkedItems), - imageResolverAsync: async (imageId, image) => { - return await toPromise({ - imageHtml: `` - }); - }, - urlResolverAsync: async (linkId, linkText, link) => { - return await toPromise({ - linkHtml: `${link?.urlSlug}` - }); - }, - contentItemResolverAsync: async (itemId, contentItem) => { - if (contentItem && contentItem.system.type === 'actor') { - const actor = contentItem as Actor; - return await toPromise({ - contentItemHtml: `
${actor.elements.first_name.value}
` - }); - } - - return await toPromise({ - contentItemHtml: '' - }); - } - }); - }); - - it(`linked items html should match expected result`, () => { - expect(resolvedRichText.html).toEqual(expectedHtml); - }); - - it(`links should be resolved`, () => { - expect(resolvedRichText.html).toContain('tom-hardy'); - expect(resolvedRichText.html).toContain('joel-edgerton'); - }); - - it(`images should be resolved`, () => { - expect(resolvedRichText.html).toContain(''); - expect(resolvedRichText.html).toContain(''); - }); - - it(`linked items should be resolved`, () => { - expect(resolvedRichText.html).toContain('
Joel
'); - expect(resolvedRichText.html).toContain('
Tom
'); - }); - - it(`component codenames should be set`, () => { - expect(resolvedRichText.componentCodenames).toEqual(['ec9813f6_194d_018f_e20c_36855fb6e600']); - }); - - it(`linked item codenames should be set`, () => { - expect(resolvedRichText.linkedItemCodenames).toEqual(['tom_hardy', 'joel_edgerton']); - }); -}); diff --git a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-html-priority.spec.ts b/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-html-priority.spec.ts deleted file mode 100644 index 663d18ed..00000000 --- a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-html-priority.spec.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { - createRichTextHtmlResolver, - IResolvedRichTextHtmlResult, - linkedItemsHelper, - Responses -} from '../../../../../lib'; -import { Actor, getDeliveryClientWithJson, Movie } from '../../../setup'; -import * as warriorJson from '../../fake-data/fake-warrior-response.json'; - -const expectedHtml = `

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

-

Stars: 

-
Tom
-
Joel
-


-

See more in profile of joel-edgerton and tom-hardy

-

And here are some images: 

-
-
-


-

Also, why not include content component in the mix?

-
Jennifer
`; - -describe('Rich text resolver (HTML priority)', () => { - let response: Responses.IViewContentItemResponse; - let resolvedRichText: IResolvedRichTextHtmlResult; - - beforeAll(async () => { - response = (await getDeliveryClientWithJson(warriorJson).item('x').toPromise()).data; - resolvedRichText = createRichTextHtmlResolver().resolveRichText({ - element: response.item.elements.plot, - linkedItems: linkedItemsHelper.convertLinkedItemsToArray(response.linkedItems), - imageResolver: (imageId, image) => { - return { - imageHtml: `` - }; - }, - urlResolver: (linkId, linkText, link) => { - return { - linkHtml: `${link?.urlSlug}` - }; - }, - contentItemResolver: (itemId, contentItem) => { - if (contentItem && contentItem.system.type === 'actor') { - const actor = contentItem as Actor; - return { - contentItemHtml: `
${actor.elements.first_name.value}
` - }; - } - - return { - contentItemHtml: '' - }; - } - }); - }); - - it(`linked items html should match expected result`, () => { - expect(resolvedRichText.html).toEqual(expectedHtml); - }); - - it(`links should be resolved`, () => { - expect(resolvedRichText.html).toContain('tom-hardy'); - expect(resolvedRichText.html).toContain('joel-edgerton'); - }); - - it(`images should be resolved`, () => { - expect(resolvedRichText.html).toContain(''); - expect(resolvedRichText.html).toContain(''); - }); - - it(`linked items should be resolved`, () => { - expect(resolvedRichText.html).toContain('
Joel
'); - expect(resolvedRichText.html).toContain('
Tom
'); - }); - - it(`component codenames should be set`, () => { - expect(resolvedRichText.componentCodenames).toEqual(['ec9813f6_194d_018f_e20c_36855fb6e600']); - }); - - it(`linked item codenames should be set`, () => { - expect(resolvedRichText.linkedItemCodenames).toEqual(['tom_hardy', 'joel_edgerton']); - }); -}); diff --git a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-preserve-object-tags.spec.ts b/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-preserve-object-tags.spec.ts deleted file mode 100644 index 599f5ee2..00000000 --- a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-preserve-object-tags.spec.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { - createRichTextHtmlResolver, - IResolvedRichTextHtmlResult, - linkedItemsHelper, - Responses -} from '../../../../../lib'; -import { Actor, getDeliveryClientWithJson, Movie } from '../../../setup'; -import * as warriorJson from '../../fake-data/fake-warrior-response.json'; - -const expectedHtml = `

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

-

Stars: 

-
Tom
-
Joel
-


-

See more in profile of joel-edgerton and tom-hardy

-

And here are some images: 

-
-
-


-

Also, why not include content component in the mix?

-
Jennifer
`; - -describe('Rich text resolver preserve object tags', () => { - let response: Responses.IViewContentItemResponse; - let resolvedRichText: IResolvedRichTextHtmlResult; - - beforeAll(async () => { - response = (await getDeliveryClientWithJson(warriorJson).item('x').toPromise()).data; - resolvedRichText = createRichTextHtmlResolver().resolveRichText({ - preserveResolvedObjectTags: true, - element: response.item.elements.plot, - linkedItems: linkedItemsHelper.convertLinkedItemsToArray(response.linkedItems), - imageResolver: (imageId, image) => { - return { - imageHtml: `` - }; - }, - urlResolver: (linkId, linkText, link) => { - return { - linkHtml: `${link?.urlSlug}` - }; - }, - contentItemResolver: (itemId, contentItem) => { - if (contentItem && contentItem.system.type === 'actor') { - const actor = contentItem as Actor; - return { - contentItemHtml: `
${actor.elements.first_name.value}
` - }; - } - - return { - contentItemHtml: '' - }; - } - }); - }); - - it(`linked items html should match expected result`, () => { - expect(resolvedRichText.html).toEqual(expectedHtml); - }); -}); diff --git a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-url-priority-async.spec.ts b/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-url-priority-async.spec.ts deleted file mode 100644 index 5202a0b3..00000000 --- a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-url-priority-async.spec.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { - createAsyncRichTextHtmlResolver, - IResolvedRichTextHtmlResult, - linkedItemsHelper, - Responses -} from '../../../../../lib'; -import { Actor, getDeliveryClientWithJson, Movie, toPromise } from '../../../setup'; -import * as warriorJson from '../../fake-data/fake-warrior-response.json'; - -const expectedHtml = `

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

-

Stars: 

-
Tom
-
Joel
-


-

See more in profile of Joel Edgerton and Tom Hardy

-

And here are some images: 

-
-
-


-

Also, why not include content component in the mix?

-
Jennifer
`; - -describe('Rich text resolver (URL priority) async', () => { - let response: Responses.IViewContentItemResponse; - let resolvedRichText: IResolvedRichTextHtmlResult; - - beforeAll(async () => { - response = (await getDeliveryClientWithJson(warriorJson).item('x').toPromise()).data; - resolvedRichText = await createAsyncRichTextHtmlResolver().resolveRichTextAsync({ - element: response.item.elements.plot, - linkedItems: linkedItemsHelper.convertLinkedItemsToArray(response.linkedItems), - imageResolverAsync: async (imageId, image) => { - return await toPromise({ - imageUrl: `xImageUrl-${image?.imageId}` - }); - }, - urlResolverAsync: async (linkId, linkText, link) => { - return await toPromise({ - linkUrl: `xLinkUrl-${link?.urlSlug}` - }); - }, - contentItemResolverAsync: async (itemId, contentItem) => { - if (contentItem && contentItem.system.type === 'actor') { - const actor = contentItem as Actor; - return { - contentItemHtml: `
${actor.elements.first_name.value}
` - }; - } - - return { - contentItemHtml: '' - }; - } - }); - }); - - it(`linked items html should match expected result`, () => { - expect(resolvedRichText.html).toEqual(expectedHtml); - }); - - it(`links should be resolved`, () => { - expect(resolvedRichText.html).toContain( - 'Joel Edgerton' - ); - expect(resolvedRichText.html).toContain( - 'Tom Hardy' - ); - }); - - it(`images should be resolved`, () => { - expect(resolvedRichText.html).toContain( - '' - ); - expect(resolvedRichText.html).toContain( - '' - ); - }); - - it(`linked items should be resolved`, () => { - expect(resolvedRichText.html).toContain('
Joel
'); - expect(resolvedRichText.html).toContain('
Tom
'); - }); - - it(`component codenames should be set`, () => { - expect(resolvedRichText.componentCodenames).toEqual(['ec9813f6_194d_018f_e20c_36855fb6e600']); - }); - - it(`linked item codenames should be set`, () => { - expect(resolvedRichText.linkedItemCodenames).toEqual(['tom_hardy', 'joel_edgerton']); - }); -}); diff --git a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-url-priority.spec.ts b/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-url-priority.spec.ts deleted file mode 100644 index 5cf52a71..00000000 --- a/test/browser/isolated-tests/resolvers/rich-text-html-resolver/rich-resolver-url-priority.spec.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { - createRichTextHtmlResolver, - IResolvedRichTextHtmlResult, - linkedItemsHelper, - Responses -} from '../../../../../lib'; -import { Actor, getDeliveryClientWithJson, Movie } from '../../../setup'; -import * as warriorJson from '../../fake-data/fake-warrior-response.json'; - -const expectedHtml = `

The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.

-

Stars: 

-
Tom
-
Joel
-


-

See more in profile of Joel Edgerton and Tom Hardy

-

And here are some images: 

-
-
-


-

Also, why not include content component in the mix?

-
Jennifer
`; - -describe('Rich text resolver (URL priority)', () => { - let response: Responses.IViewContentItemResponse; - let resolvedRichText: IResolvedRichTextHtmlResult; - - beforeAll(async () => { - response = (await getDeliveryClientWithJson(warriorJson).item('x').toPromise()).data; - resolvedRichText = createRichTextHtmlResolver().resolveRichText({ - element: response.item.elements.plot, - linkedItems: linkedItemsHelper.convertLinkedItemsToArray(response.linkedItems), - imageResolver: (imageId, image) => { - return { - imageUrl: `xImageUrl-${image?.imageId}` - }; - }, - urlResolver: (linkId, linkText, link) => { - return { - linkUrl: `xLinkUrl-${link?.urlSlug}` - }; - }, - contentItemResolver: (contentItemId, contentItem) => { - if (contentItem && contentItem.system.type === 'actor') { - const actor = contentItem as Actor; - return { - contentItemHtml: `
${actor.elements.first_name.value}
` - }; - } - - return { - contentItemHtml: '' - }; - } - }); - }); - - it(`linked items html should match expected result`, () => { - expect(resolvedRichText.html).toEqual(expectedHtml); - }); - - it(`links should be resolved`, () => { - expect(resolvedRichText.html).toContain( - 'Joel Edgerton' - ); - expect(resolvedRichText.html).toContain( - 'Tom Hardy' - ); - }); - - it(`images should be resolved`, () => { - expect(resolvedRichText.html).toContain( - '' - ); - expect(resolvedRichText.html).toContain( - '' - ); - }); - - it(`linked items should be resolved`, () => { - expect(resolvedRichText.html).toContain('
Joel
'); - expect(resolvedRichText.html).toContain('
Tom
'); - }); - - it(`component codenames should be set`, () => { - expect(resolvedRichText.componentCodenames).toEqual(['ec9813f6_194d_018f_e20c_36855fb6e600']); - }); - - it(`linked item codenames should be set`, () => { - expect(resolvedRichText.linkedItemCodenames).toEqual(['tom_hardy', 'joel_edgerton']); - }); -}); diff --git a/test/browser/isolated-tests/resolvers/rich-text-json-resolver/expected-result.json b/test/browser/isolated-tests/resolvers/rich-text-json-resolver/expected-result.json deleted file mode 100644 index 295d52e0..00000000 --- a/test/browser/isolated-tests/resolvers/rich-text-json-resolver/expected-result.json +++ /dev/null @@ -1,348 +0,0 @@ -{ - "type": "root", - "attributes": [], - "children": [ - { - "type": "htmlElement", - "attributes": [], - "tag": "p", - "data": { - "text": "The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.", - "html": "The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother." - }, - "children": [], - "_sdkElemId": "" - }, - { - "type": "htmlElement", - "attributes": [], - "tag": "p", - "data": { "text": "Stars: ", "html": "Stars: " }, - "children": [], - "_sdkElemId": "" - }, - { - "type": "linkedItem", - "attributes": [ - { "name": "type", "value": "application/kenticocloud" }, - { "name": "data-type", "value": "item" }, - { "name": "data-rel", "value": "link" }, - { "name": "data-codename", "value": "tom_hardy" } - ], - "tag": "object", - "data": { - "codename": "tom_hardy", - "item": { - "elements": { - "url": { "name": "Url", "type": "url_slug", "value": "tom-hardy" }, - "first_name": { "name": "First name", "type": "text", "value": "Tom" }, - "last_name": { "name": "Last name", "type": "text", "value": "Hardy" }, - "photo": { - "name": "Photo", - "type": "asset", - "value": [ - { - "name": "tom_hardy.jpg", - "description": null, - "type": "image/jpeg", - "size": 8091, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", - "width": 214, - "height": 317, - "renditions": null - } - ] - } - }, - "system": { - "codename": "tom_hardy", - "collection": "default", - "id": "d1557cb1-d7ec-4d04-9742-f86b52bc34fc", - "language": "en", - "lastModified": "2018-02-09T13:11:32.5769383Z", - "name": "Tom Hardy", - "sitemapLocations": [], - "type": "actor", - "workflowStep": null, - "workflow": null - } - } - }, - "children": [], - "_sdkElemId": "" - }, - { - "type": "linkedItem", - "attributes": [ - { "name": "type", "value": "application/kenticocloud" }, - { "name": "data-type", "value": "item" }, - { "name": "data-rel", "value": "link" }, - { "name": "data-codename", "value": "joel_edgerton" } - ], - "tag": "object", - "data": { - "codename": "joel_edgerton", - "item": { - "elements": { - "url": { "name": "Url", "type": "url_slug", "value": "joel-edgerton" }, - "first_name": { "name": "First name", "type": "text", "value": "Joel" }, - "last_name": { "name": "Last name", "type": "text", "value": "Edgerton" }, - "photo": { - "name": "Photo", - "type": "asset", - "value": [ - { - "name": "joel_edgerton.jpg", - "description": null, - "type": "image/jpeg", - "size": 6460, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/2855720a-4ca4-4687-826a-29f9635088e0/joel_edgerton.jpg", - "width": 211, - "height": 317, - "renditions": null - } - ] - } - }, - "system": { - "codename": "joel_edgerton", - "collection": "default", - "id": "3294e4b0-e58b-49d7-85fa-5bc9a86556ec", - "language": "en", - "lastModified": "2017-08-03T09:21:21.3857294Z", - "name": "Joel Edgerton", - "sitemapLocations": [], - "type": "actor", - "workflowStep": null, - "workflow": null - } - } - }, - "children": [], - "_sdkElemId": "" - }, - { - "type": "htmlElement", - "attributes": [], - "tag": "p", - "data": { "text": "", "html": "
" }, - "children": [ - { - "type": "htmlElement", - "attributes": [], - "tag": "br", - "data": { "text": "", "html": "" }, - "children": [], - "_sdkElemId": "" - } - ], - "_sdkElemId": "" - }, - { - "type": "htmlElement", - "attributes": [], - "tag": "p", - "data": { - "text": "See more in profile of Joel Edgerton and Tom Hardy", - "html": "See more in profile of Joel Edgerton and Tom Hardy" - }, - "children": [ - { - "type": "link", - "attributes": [ - { "name": "data-item-id", "value": "3294e4b0-e58b-49d7-85fa-5bc9a86556ec" }, - { "name": "href", "value": "" } - ], - "tag": "a", - "data": { - "linkId": "3294e4b0-e58b-49d7-85fa-5bc9a86556ec", - "linkText": "Joel Edgerton", - "link": { - "codename": "joel_edgerton", - "linkId": "3294e4b0-e58b-49d7-85fa-5bc9a86556ec", - "urlSlug": "joel-edgerton", - "type": "actor" - } - }, - "children": [], - "_sdkElemId": "" - }, - { - "type": "link", - "attributes": [ - { "name": "data-item-id", "value": "d1557cb1-d7ec-4d04-9742-f86b52bc34fc" }, - { "name": "href", "value": "" } - ], - "tag": "a", - "data": { - "linkId": "d1557cb1-d7ec-4d04-9742-f86b52bc34fc", - "linkText": "Tom Hardy", - "link": { - "codename": "tom_hardy", - "linkId": "d1557cb1-d7ec-4d04-9742-f86b52bc34fc", - "urlSlug": "tom-hardy", - "type": "actor" - } - }, - "children": [], - "_sdkElemId": "" - } - ], - "_sdkElemId": "" - }, - { - "type": "htmlElement", - "attributes": [], - "tag": "p", - "data": { "text": "And here are some images: ", "html": "And here are some images: " }, - "children": [], - "_sdkElemId": "" - }, - { - "type": "htmlElement", - "attributes": [ - { "name": "data-asset-id", "value": "22504ba8-2075-48fa-9d4f-8fce3de1754a" }, - { "name": "data-image-id", "value": "22504ba8-2075-48fa-9d4f-8fce3de1754a" } - ], - "tag": "figure", - "data": { - "text": "", - "html": "\"\"" - }, - "children": [ - { - "type": "image", - "attributes": [ - { - "name": "src", - "value": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg" - }, - { "name": "data-asset-id", "value": "22504ba8-2075-48fa-9d4f-8fce3de1754a" }, - { "name": "data-image-id", "value": "22504ba8-2075-48fa-9d4f-8fce3de1754a" }, - { "name": "alt", "value": "" } - ], - "tag": "img", - "data": { - "imageId": "22504ba8-2075-48fa-9d4f-8fce3de1754a", - "image": { - "description": null, - "imageId": "22504ba8-2075-48fa-9d4f-8fce3de1754a", - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", - "height": 1000, - "width": 648 - } - }, - "children": [], - "_sdkElemId": "" - } - ], - "_sdkElemId": "" - }, - { - "type": "htmlElement", - "attributes": [ - { "name": "data-asset-id", "value": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5" }, - { "name": "data-image-id", "value": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5" } - ], - "tag": "figure", - "data": { - "text": "", - "html": "\"\"" - }, - "children": [ - { - "type": "image", - "attributes": [ - { - "name": "src", - "value": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg" - }, - { "name": "data-asset-id", "value": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5" }, - { "name": "data-image-id", "value": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5" }, - { "name": "alt", "value": "" } - ], - "tag": "img", - "data": { - "imageId": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5", - "image": { - "description": null, - "imageId": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5", - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", - "height": 317, - "width": 214 - } - }, - "children": [], - "_sdkElemId": "" - } - ], - "_sdkElemId": "" - }, - { - "type": "htmlElement", - "attributes": [], - "tag": "p", - "data": { "text": "", "html": "
" }, - "children": [ - { - "type": "htmlElement", - "attributes": [], - "tag": "br", - "data": { "text": "", "html": "" }, - "children": [], - "_sdkElemId": "" - } - ], - "_sdkElemId": "" - }, - { - "type": "htmlElement", - "attributes": [], - "tag": "p", - "data": { - "text": "Also, why not include content component in the mix?", - "html": "Also, why not include content component in the mix?" - }, - "children": [], - "_sdkElemId": "" - }, - { - "type": "linkedItem", - "attributes": [ - { "name": "type", "value": "application/kenticocloud" }, - { "name": "data-type", "value": "item" }, - { "name": "data-rel", "value": "component" }, - { "name": "data-codename", "value": "ec9813f6_194d_018f_e20c_36855fb6e600" } - ], - "tag": "object", - "data": { - "codename": "ec9813f6_194d_018f_e20c_36855fb6e600", - "item": { - "elements": { - "first_name": { "name": "First name", "type": "text", "value": "Jennifer " }, - "last_name": { "name": "Last name", "type": "text", "value": "Morrison" }, - "url": { "name": "Url", "type": "url_slug", "value": "component-actor-url" }, - "photo": { "name": "Photo", "type": "asset", "value": [] } - }, - "system": { - "codename": "ec9813f6_194d_018f_e20c_36855fb6e600", - "collection": "default", - "id": "ec9813f6-194d-018f-e20c-36855fb6e600", - "language": "en", - "lastModified": "2019-09-05T10:51:15.6555984Z", - "name": "ec9813f6-194d-018f-e20c-36855fb6e600", - "sitemapLocations": [], - "type": "actor", - "workflowStep": null, - "workflow": null - } - } - }, - "children": [], - "_sdkElemId": "" - } - ], - "data": {}, - "tag": "div", - "_sdkElemId": "" -} diff --git a/test/browser/isolated-tests/resolvers/rich-text-json-resolver/rich-text-json-resolver.spec.ts b/test/browser/isolated-tests/resolvers/rich-text-json-resolver/rich-text-json-resolver.spec.ts deleted file mode 100644 index f6566c0d..00000000 --- a/test/browser/isolated-tests/resolvers/rich-text-json-resolver/rich-text-json-resolver.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { createRichTextJsonResolver, IRichTextJsonResult, linkedItemsHelper, Responses } from '../../../../../lib'; -import { getDeliveryClientWithJson, Movie } from '../../../setup'; -import * as warriorJson from '../../fake-data/fake-warrior-response.json'; -import * as expectedJson from './expected-result.json'; - -describe('Rich text json resolver', () => { - let response: Responses.IViewContentItemResponse; - let resolvedRichText: IRichTextJsonResult; - - beforeAll(async () => { - response = (await getDeliveryClientWithJson(warriorJson).item('x').toPromise()).data; - resolvedRichText = createRichTextJsonResolver().resolveRichText({ - element: response.item.elements.plot, - linkedItems: linkedItemsHelper.convertLinkedItemsToArray(response.linkedItems), - cleanSdkIds: true - }); - }); - - it(`verifies json structure`, () => { - expect(resolvedRichText.json).toEqual(JSON.stringify(expectedJson)); - }); -}); diff --git a/test/browser/isolated-tests/resolvers/rich-text-object-resolver/expected-result.json b/test/browser/isolated-tests/resolvers/rich-text-object-resolver/expected-result.json deleted file mode 100644 index 295d52e0..00000000 --- a/test/browser/isolated-tests/resolvers/rich-text-object-resolver/expected-result.json +++ /dev/null @@ -1,348 +0,0 @@ -{ - "type": "root", - "attributes": [], - "children": [ - { - "type": "htmlElement", - "attributes": [], - "tag": "p", - "data": { - "text": "The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother.", - "html": "The youngest son of an alcoholic former boxer returns home, where he's trained by his father for competition in a mixed martial arts tournament - a path that puts the fighter on a collision course with his estranged, older brother." - }, - "children": [], - "_sdkElemId": "" - }, - { - "type": "htmlElement", - "attributes": [], - "tag": "p", - "data": { "text": "Stars: ", "html": "Stars: " }, - "children": [], - "_sdkElemId": "" - }, - { - "type": "linkedItem", - "attributes": [ - { "name": "type", "value": "application/kenticocloud" }, - { "name": "data-type", "value": "item" }, - { "name": "data-rel", "value": "link" }, - { "name": "data-codename", "value": "tom_hardy" } - ], - "tag": "object", - "data": { - "codename": "tom_hardy", - "item": { - "elements": { - "url": { "name": "Url", "type": "url_slug", "value": "tom-hardy" }, - "first_name": { "name": "First name", "type": "text", "value": "Tom" }, - "last_name": { "name": "Last name", "type": "text", "value": "Hardy" }, - "photo": { - "name": "Photo", - "type": "asset", - "value": [ - { - "name": "tom_hardy.jpg", - "description": null, - "type": "image/jpeg", - "size": 8091, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", - "width": 214, - "height": 317, - "renditions": null - } - ] - } - }, - "system": { - "codename": "tom_hardy", - "collection": "default", - "id": "d1557cb1-d7ec-4d04-9742-f86b52bc34fc", - "language": "en", - "lastModified": "2018-02-09T13:11:32.5769383Z", - "name": "Tom Hardy", - "sitemapLocations": [], - "type": "actor", - "workflowStep": null, - "workflow": null - } - } - }, - "children": [], - "_sdkElemId": "" - }, - { - "type": "linkedItem", - "attributes": [ - { "name": "type", "value": "application/kenticocloud" }, - { "name": "data-type", "value": "item" }, - { "name": "data-rel", "value": "link" }, - { "name": "data-codename", "value": "joel_edgerton" } - ], - "tag": "object", - "data": { - "codename": "joel_edgerton", - "item": { - "elements": { - "url": { "name": "Url", "type": "url_slug", "value": "joel-edgerton" }, - "first_name": { "name": "First name", "type": "text", "value": "Joel" }, - "last_name": { "name": "Last name", "type": "text", "value": "Edgerton" }, - "photo": { - "name": "Photo", - "type": "asset", - "value": [ - { - "name": "joel_edgerton.jpg", - "description": null, - "type": "image/jpeg", - "size": 6460, - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/2855720a-4ca4-4687-826a-29f9635088e0/joel_edgerton.jpg", - "width": 211, - "height": 317, - "renditions": null - } - ] - } - }, - "system": { - "codename": "joel_edgerton", - "collection": "default", - "id": "3294e4b0-e58b-49d7-85fa-5bc9a86556ec", - "language": "en", - "lastModified": "2017-08-03T09:21:21.3857294Z", - "name": "Joel Edgerton", - "sitemapLocations": [], - "type": "actor", - "workflowStep": null, - "workflow": null - } - } - }, - "children": [], - "_sdkElemId": "" - }, - { - "type": "htmlElement", - "attributes": [], - "tag": "p", - "data": { "text": "", "html": "
" }, - "children": [ - { - "type": "htmlElement", - "attributes": [], - "tag": "br", - "data": { "text": "", "html": "" }, - "children": [], - "_sdkElemId": "" - } - ], - "_sdkElemId": "" - }, - { - "type": "htmlElement", - "attributes": [], - "tag": "p", - "data": { - "text": "See more in profile of Joel Edgerton and Tom Hardy", - "html": "See more in profile of Joel Edgerton and Tom Hardy" - }, - "children": [ - { - "type": "link", - "attributes": [ - { "name": "data-item-id", "value": "3294e4b0-e58b-49d7-85fa-5bc9a86556ec" }, - { "name": "href", "value": "" } - ], - "tag": "a", - "data": { - "linkId": "3294e4b0-e58b-49d7-85fa-5bc9a86556ec", - "linkText": "Joel Edgerton", - "link": { - "codename": "joel_edgerton", - "linkId": "3294e4b0-e58b-49d7-85fa-5bc9a86556ec", - "urlSlug": "joel-edgerton", - "type": "actor" - } - }, - "children": [], - "_sdkElemId": "" - }, - { - "type": "link", - "attributes": [ - { "name": "data-item-id", "value": "d1557cb1-d7ec-4d04-9742-f86b52bc34fc" }, - { "name": "href", "value": "" } - ], - "tag": "a", - "data": { - "linkId": "d1557cb1-d7ec-4d04-9742-f86b52bc34fc", - "linkText": "Tom Hardy", - "link": { - "codename": "tom_hardy", - "linkId": "d1557cb1-d7ec-4d04-9742-f86b52bc34fc", - "urlSlug": "tom-hardy", - "type": "actor" - } - }, - "children": [], - "_sdkElemId": "" - } - ], - "_sdkElemId": "" - }, - { - "type": "htmlElement", - "attributes": [], - "tag": "p", - "data": { "text": "And here are some images: ", "html": "And here are some images: " }, - "children": [], - "_sdkElemId": "" - }, - { - "type": "htmlElement", - "attributes": [ - { "name": "data-asset-id", "value": "22504ba8-2075-48fa-9d4f-8fce3de1754a" }, - { "name": "data-image-id", "value": "22504ba8-2075-48fa-9d4f-8fce3de1754a" } - ], - "tag": "figure", - "data": { - "text": "", - "html": "\"\"" - }, - "children": [ - { - "type": "image", - "attributes": [ - { - "name": "src", - "value": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg" - }, - { "name": "data-asset-id", "value": "22504ba8-2075-48fa-9d4f-8fce3de1754a" }, - { "name": "data-image-id", "value": "22504ba8-2075-48fa-9d4f-8fce3de1754a" }, - { "name": "alt", "value": "" } - ], - "tag": "img", - "data": { - "imageId": "22504ba8-2075-48fa-9d4f-8fce3de1754a", - "image": { - "description": null, - "imageId": "22504ba8-2075-48fa-9d4f-8fce3de1754a", - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/22504ba8-2075-48fa-9d4f-8fce3de1754a/warrior.jpg", - "height": 1000, - "width": 648 - } - }, - "children": [], - "_sdkElemId": "" - } - ], - "_sdkElemId": "" - }, - { - "type": "htmlElement", - "attributes": [ - { "name": "data-asset-id", "value": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5" }, - { "name": "data-image-id", "value": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5" } - ], - "tag": "figure", - "data": { - "text": "", - "html": "\"\"" - }, - "children": [ - { - "type": "image", - "attributes": [ - { - "name": "src", - "value": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg" - }, - { "name": "data-asset-id", "value": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5" }, - { "name": "data-image-id", "value": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5" }, - { "name": "alt", "value": "" } - ], - "tag": "img", - "data": { - "imageId": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5", - "image": { - "description": null, - "imageId": "bb0899cf-2c3a-4e3f-8962-60e5a54fcca5", - "url": "https://assets-us-01.kc-usercontent.com:443/da5abe9f-fdad-4168-97cd-b3464be2ccb9/bb0899cf-2c3a-4e3f-8962-60e5a54fcca5/tom_hardy.jpg", - "height": 317, - "width": 214 - } - }, - "children": [], - "_sdkElemId": "" - } - ], - "_sdkElemId": "" - }, - { - "type": "htmlElement", - "attributes": [], - "tag": "p", - "data": { "text": "", "html": "
" }, - "children": [ - { - "type": "htmlElement", - "attributes": [], - "tag": "br", - "data": { "text": "", "html": "" }, - "children": [], - "_sdkElemId": "" - } - ], - "_sdkElemId": "" - }, - { - "type": "htmlElement", - "attributes": [], - "tag": "p", - "data": { - "text": "Also, why not include content component in the mix?", - "html": "Also, why not include content component in the mix?" - }, - "children": [], - "_sdkElemId": "" - }, - { - "type": "linkedItem", - "attributes": [ - { "name": "type", "value": "application/kenticocloud" }, - { "name": "data-type", "value": "item" }, - { "name": "data-rel", "value": "component" }, - { "name": "data-codename", "value": "ec9813f6_194d_018f_e20c_36855fb6e600" } - ], - "tag": "object", - "data": { - "codename": "ec9813f6_194d_018f_e20c_36855fb6e600", - "item": { - "elements": { - "first_name": { "name": "First name", "type": "text", "value": "Jennifer " }, - "last_name": { "name": "Last name", "type": "text", "value": "Morrison" }, - "url": { "name": "Url", "type": "url_slug", "value": "component-actor-url" }, - "photo": { "name": "Photo", "type": "asset", "value": [] } - }, - "system": { - "codename": "ec9813f6_194d_018f_e20c_36855fb6e600", - "collection": "default", - "id": "ec9813f6-194d-018f-e20c-36855fb6e600", - "language": "en", - "lastModified": "2019-09-05T10:51:15.6555984Z", - "name": "ec9813f6-194d-018f-e20c-36855fb6e600", - "sitemapLocations": [], - "type": "actor", - "workflowStep": null, - "workflow": null - } - } - }, - "children": [], - "_sdkElemId": "" - } - ], - "data": {}, - "tag": "div", - "_sdkElemId": "" -} diff --git a/test/browser/isolated-tests/resolvers/rich-text-object-resolver/rich-text-object-resolver.spec.ts b/test/browser/isolated-tests/resolvers/rich-text-object-resolver/rich-text-object-resolver.spec.ts deleted file mode 100644 index 61e01302..00000000 --- a/test/browser/isolated-tests/resolvers/rich-text-object-resolver/rich-text-object-resolver.spec.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { getDeliveryClientWithJson, Movie } from '../../../setup'; -import { - Responses, - linkedItemsHelper, - createRichTextObjectResolver, - IRichTextObjectResult -} from '../../../../../lib'; -import * as warriorJson from '../../fake-data/fake-warrior-response.json'; -import * as expectedJson from './expected-result.json'; - -describe('Rich text object resolver', () => { - let response: Responses.IViewContentItemResponse; - let resolvedRichText: IRichTextObjectResult; - - beforeAll(async () => { - response = (await getDeliveryClientWithJson(warriorJson).item('x').toPromise()).data; - resolvedRichText = createRichTextObjectResolver().resolveRichText({ - element: response.item.elements.plot, - linkedItems: linkedItemsHelper.convertLinkedItemsToArray(response.linkedItems), - cleanSdkIds: true - }); - }); - - it(`verifies json structure`, () => { - expect(JSON.stringify(resolvedRichText.data)).toEqual(JSON.stringify(expectedJson)); - }); -}); From af056363f2c1abcba31220947017ae0d8dc60d92 Mon Sep 17 00:00:00 2001 From: Richard Sustek Date: Tue, 10 Sep 2024 12:44:52 +0200 Subject: [PATCH 11/13] Docs: updates readme --- readme.md | 245 +++++++++++++----------------------------------------- 1 file changed, 58 insertions(+), 187 deletions(-) diff --git a/readme.md b/readme.md index bccbd33d..306b61f4 100644 --- a/readme.md +++ b/readme.md @@ -8,22 +8,22 @@ # JavaScript Delivery SDK Documentation -JavaScript Delivery SDK is a client library for retrieving data from [Kontent.ai](https://kontent.ai/). Works both in -browser & node.js environments. +This library is build for fetching [Kontent.ai](https://kontent.ai/) data with `Delivery API`. Works in browser & node. + +> [!TIP] +> It's highly recommended to use this library in combination with +> [Model Generator](https://www.npmjs.com/package/@kontent-ai/model-generator). This will enable you to access your data +> in a strongly typed manner and will greatly simplify working with your data. # Kontent.ai Delivery SDK ## Installation -You can install this library using `npm` or you can use global CDNs such `jsdelivr`. - -### npm - -``` +```bash npm i @kontent-ai/delivery-sdk --save ``` -### UMD Bundles +## UMD When using UMD bundle and including this library in `script` tag on your `html` page, you can find it under the `kontentDelivery` global variable. @@ -33,43 +33,24 @@ Bundles are distributed in `dist/bundles` folder: - `dist/bundles/kontent-delivery.umd.js` - `dist/bundles/kontent-delivery.umd.min.js` -#### CDN - -##### kontent-delivery.umd.js - -![Gzip UMD bundle](https://img.badgesize.io/https:/cdn.jsdelivr.net/npm/@kontent-ai/delivery-sdk@latest/dist/bundles/kontent-delivery.umd.js?compression=gzip) - -``` -https://cdn.jsdelivr.net/npm/@kontent-ai/delivery-sdk@latest/dist/bundles/kontent-delivery.umd.js -``` - -##### kontent-delivery.umd.min.js - -![Gzip UMD Minified bundle](https://img.badgesize.io/https:/cdn.jsdelivr.net/npm/@kontent-ai/delivery-sdk@latest/dist/bundles/kontent-delivery.umd.min.js?compression=gzip) - -``` -https://cdn.jsdelivr.net/npm/@kontent-ai/delivery-sdk@latest/dist/bundles/kontent-delivery.umd.min.js -``` - -## TypeScript & ES6 +## Getting started ```typescript import { type IContentItem, type Elements, createDeliveryClient } from '@kontent-ai/delivery-sdk'; /** - * Defining models is optional, but will greatly benefit development - * experience & further maintenance of your code + * Generate models with @kontent-ai/model-generator */ export type Movie = IContentItem<{ - title: Elements.TextElement; - plot: Elements.RichTextElement; - released: Elements.DateTimeElement; - length: Elements.NumberElement; - poster: Elements.AssetsElement; - category: Elements.MultipleChoiceElement; - stars: Elements.LinkedItemsElement; - seoname: Elements.UrlSlugElement; - releasecategory: Elements.TaxonomyElement; + readonly title: Elements.TextElement; + readonly plot: Elements.RichTextElement; + readonly released: Elements.DateTimeElement; + readonly length: Elements.NumberElement; + readonly poster: Elements.AssetsElement; + readonly category: Elements.MultipleChoiceElement; + readonly stars: Elements.LinkedItemsElement; + readonly seoname: Elements.UrlSlugElement; + readonly releasecategory: Elements.TaxonomyElement; }>; // initialize delivery client @@ -84,59 +65,7 @@ const response = await deliveryClient.items().type('' -}); - -// fetch items -const response = await deliveryClient.items().type('').toPromise(); - -// read data of first item -const movieText = response.data.items[0].elements.title.value; -``` - -## HTML & UMD & CDN - -```html - - - - Kontent.ai SDK - Html sample - - - - -

See console

- - -``` - -## SDK Documentation - -## Client configuration - -Following is a list of configuration options for DeliveryClient (`IDeliveryClientConfig`): +## Configuration | Property | type | description | | ---------------------------- | :--------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -155,45 +84,7 @@ Following is a list of configuration options for DeliveryClient (`IDeliveryClien | defaultRenditionPreset? | string | Codename of rendition preset to be applied by default to the base asset URL path when present. When set, the SDK will provide the URL of customized images by default. Right now the only supported preset codename is `default`. | | excludeArchivedItems? | boolean | Can be used to exclude archived items from all queries by default. Only applicable when preview API is used. | -### Create typed models - -> Recommended: Use the [Model Generator](https://www.npmjs.com/package/@kontent-ai/model-generator) to automatically -> generate TypeScript models based on the content types in your Kontent.ai project. - -You may define optional models in Typescript representing your actual data defined in Kontent.ai projects. You can also -auto-generate these models (see below). - -```typescript -import { IContentItem, Elements } from '@kontent-ai/delivery-sdk'; - -export type Movie = IContentItem<{ - title: Elements.TextElement; - plot: Elements.RichTextElement; - released: Elements.DateTimeElement; - length: Elements.NumberElement; - poster: Elements.AssetsElement; - category: Elements.MultipleChoiceElement; - stars: Elements.LinkedItemsElement; - seoname: Elements.UrlSlugElement; - releasecategory: Elements.TaxonomyElement; -}>; -``` - -### Fetch data - -To get multiple content items, use the `items` method. You can specify the content type with the `type` method: - -```typescript -deliveryClient.items().type('typeCodename').toPromise(); - -deliveryClient.item('itemCodename').toPromise(); -``` - -Supported elements: `TextElement`, `MultipleChoiceElement`, `DateTimeElement`, `RichTextElement`, `NumberElement`, -`AssetsElement`, `UrlSlugElement`, `TaxonomyElement`, `LinkedItemsElement` and `CustomElement`. Additionally, you might -also get `UnknownElement` or a custom model if you register it for your custom elements. - -#### Use custom models for Custom elements +### Use custom models for Custom elements You can register an `ElementResolver` to map custom elements into dedicated element models and work with data more effectively. @@ -251,68 +142,65 @@ type Movie = IContentItem<{ }>; ``` -### Query parameters +### Querying The SDK supports the following query parameters: `depthParameter`, `elementsParameter`, `excludeElementsParameter`, `limitParameter`, `orderParameter`, `skipParameter` and `languageParameter`. For more information about the parameters, see the [SDK query methods](#filter-content) below. You can also head over to -[Delivery API reference](https://kontent.ai/learn/reference/delivery-api#tag/Filtering-content). +[Delivery API reference](https://kontent.ai/learn/docs/apis/openapi/delivery-api/#tag/Filtering-parameters). ```typescript // Gets 5 items based on the Movie type deliveryClient.items().type('movie').limitParameter(5).skipParameter(2).toPromise(); ``` -#### Filter content +| Filter | +| -------------------------- | +| `depthParameter` | +| `elementsParameter` | +| `excludeElementsParameter` | +| `limitParameter` | +| `orderParameter` | +| `skipParameter` | +| `languageParameter` | -This example returns all **Movie** content items whose **title** element is equal to **Warrior**. Filters are also -considered query parameters and can be combined. See -[Content filtering in API reference](https://kontent.ai/learn/reference/delivery-api#tag/Filtering-content) for more -general examples. +#### Filtering -Supported filters: `type`, `types`, `allFilter`, `anyFilter`, `containsFilter`, `equalsFilter`, `greaterThanFilter`, -`greaterThanOrEqualFilter`, `infilter`, `lessThanFilter`, `lessThanOrEqualFilter`, `rangeFilter`, `emptyFilter`, -`notEmptyFilter`, `notEqualsFilter`, `NotInFilter`. +Filters are also considered query parameters and can be combined. See +[Content filtering in API reference](https://kontent.ai/learn/docs/apis/openapi/delivery-api/#tag/Filtering-parameters) +for more examples. ```typescript // Gets items based on the Movie type with 'Warrior' in their 'Title' element deliveryClient.items().type('movie').equalsFilter('elements.title', 'Warrior').toPromise(); ``` -##### Filtering methods - -| Filter | Description | -| ------------------------ | ------------------------------------------------------------------------------------- | -| type | Retrieve only content items based on the given type. | -| types | Retrieve only content items based on the given types. | -| allFilter | Element with an array of values contains the specified list of values. | -| anyFilter | Element with an array of values contains any value from the specified list of values. | -| containsFilter | Element with an array of values contains the specified value. | -| equalsFilter | Element value is the same as the specified value | -| greaterThanFilter | Element value is greater than the specified value. | -| greaterThanOrEqualFilter | Element value is greater than or equals the specified value. | -| infilter | Element value is in the specified list of values. | -| lessThanFilter | Element value is less than the specified value. | -| lessThanOrEqualFilter | Element value is less than or equals the specified value | -| rangeFilter | Element value falls in the specified range of two values, both inclusive. | -| emptyFilter | Property value is empty. | -| NotEmptyFilter | Property value is not empty. | -| notEqualsFilter | Property value does not equal the specified value. | -| notInFilter | Property value is not in the specified list of values. | - -#### Sort content +| Filter | +| -------------------------- | +| `type` | +| `types` | +| `allFilter` | +| `anyFilter` | +| `containsFilter` | +| `equalsFilter` | +| `greaterThanFilter` | +| `greaterThanOrEqualFilter` | +| `inFilter` | +| `lessThanFilter` | +| `lessThanOrEqualFilter` | +| `rangeFilter` | +| `emptyFilter` | +| `NotEmptyFilter` | +| `notEqualsFilter` | +| `notInFilter` | + +#### Soring You can sort data by using any of the following methods: ```typescript deliveryClient.items().type('movie').orderByDescending('elements.title').toPromise(); -``` - -```typescript deliveryClient.items().type('movie').orderByAscending('elements.title').toPromise(); -``` - -```typescript deliveryClient.items().type('movie').orderParameter('elements.title', 'desc').toPromise(); ``` @@ -447,11 +335,7 @@ All listing queries support automatic paging. To use automatic paging, use `toAl ```typescript // this executed multiple HTTP requests until it gets all items const response = await deliveryClient.items().limitParameter(5).toAllPromise(); -``` - -Alternatively, you may also specify a maximum number of pages you want to get: -```typescript // only gets 3 pages at maximum const response = await deliveryClient.items().limitParameter(5).toAllPromise({ pages: 3 @@ -469,29 +353,17 @@ To learn how to work with Rich text element have a look at ## Get content types -To retrieve information about your content types, you can use the `type` and `types` methods. - ```typescript -deliveryClient - .type('movie') // codename of the type - .toPromise(); - +deliveryClient.type('movie').toPromise(); deliveryClient.types().toPromise(); - deliveryClient.types().toAllPromise(); ``` ## Get taxonomies -To retrieve information about your taxonomies, you can use the `taxonomy` and `taxonomies` methods. - ```typescript -deliveryClient - .taxonomy('taxonomyGroupName') // codename of the Taxonomy group - .toPromise(); - +deliveryClient.taxonomy('taxonomyGroupName').toPromise(); deliveryClient.taxonomies().toPromise(); - deliveryClient.taxonomies().toAllPromise(); ``` @@ -567,7 +439,6 @@ are 2 ways you can map previously stored `json`: ```typescript const result = await deliveryClient.item('codename').toPromise(); - const json = result.response.data; // approach #1 From 2369432ace66ab51d09683089c0c844904d77f17 Mon Sep 17 00:00:00 2001 From: Richard Sustek Date: Tue, 10 Sep 2024 13:41:04 +0200 Subject: [PATCH 12/13] chore(release): 15.0.0-0 --- CHANGELOG.md | 17 +++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57d22f2f..852dd04c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,23 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [15.0.0-0](https://github.com/kontent-ai/delivery-sdk-js/compare/v14.11.0...v15.0.0-0) (2024-09-10) + + +### ⚠ BREAKING CHANGES + +* Removes parser & rich text resolver. To work with RTE use the newer and better `@kontent-ai/rich-text-resolver` library instead. +* Removes `propertyName` resolver configuration. All elements are now referenced only by their codenames present in Kontent.ai + +### Features + +* Adds narrowing types for Taxonomy & Multiple choice elements ([3118752](https://github.com/kontent-ai/delivery-sdk-js/commit/3118752e05fe27f09b72c7bab21804b114fa057e)) +* Adds optional generic types to `IContentItem` narrowing down available values of system attributes ([8c894af](https://github.com/kontent-ai/delivery-sdk-js/commit/8c894afde62ee2ed40b44fbebc9dd9b8891115c5)) +* Makes `RichTextElement` take generic parameter narrowing down allowed types of linked items ([68b31a8](https://github.com/kontent-ai/delivery-sdk-js/commit/68b31a81431646a7ab06647652592b81d075527b)) +* Removes `propertyName` resolver configuration. All elements are now referenced only by their codenames present in Kontent.ai ([7ef5951](https://github.com/kontent-ai/delivery-sdk-js/commit/7ef5951c505b1acf2424c99255f435aa1a26a53e)) +* Removes parser & rich text resolver. To work with RTE use the newer and better `@kontent-ai/rich-text-resolver` library instead. ([2bd30c3](https://github.com/kontent-ai/delivery-sdk-js/commit/2bd30c3d4527b470848984d70e03136c2e01885e)) +* updates deps ([82c2c11](https://github.com/kontent-ai/delivery-sdk-js/commit/82c2c115482b0ee5ab74e3a94d9e8ebb55112532)) + ## [14.11.0](https://github.com/kontent-ai/delivery-sdk-js/compare/v14.10.0...v14.11.0) (2024-08-15) diff --git a/package-lock.json b/package-lock.json index 374396d3..a3c0d1a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@kontent-ai/delivery-sdk", - "version": "14.11.0", + "version": "15.0.0-0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@kontent-ai/delivery-sdk", - "version": "14.11.0", + "version": "15.0.0-0", "license": "MIT", "dependencies": { "@kontent-ai/core-sdk": "10.7.0", diff --git a/package.json b/package.json index fcccf520..10e431c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kontent-ai/delivery-sdk", - "version": "14.11.0", + "version": "15.0.0-0", "repository": { "type": "git", "url": "https://github.com/kontent-ai/delivery-sdk-js" From 57f47cb04dd02c14199bd05ecb255ee7f9254542 Mon Sep 17 00:00:00 2001 From: Richard Sustek Date: Tue, 10 Sep 2024 13:41:23 +0200 Subject: [PATCH 13/13] release --- lib/sdk-info.generated.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sdk-info.generated.ts b/lib/sdk-info.generated.ts index d7eff3b3..f4944eeb 100644 --- a/lib/sdk-info.generated.ts +++ b/lib/sdk-info.generated.ts @@ -2,6 +2,6 @@ import { ISDKInfo } from '@kontent-ai/core-sdk'; export const sdkInfo: ISDKInfo = { host: 'npmjs.com', - version: '14.11.0', + version: '15.0.0-0', name: '@kontent-ai/delivery-sdk' };